Class: Twilio::REST::Messaging::V2::ChannelsSenderInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/messaging/v2/channels_sender.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ChannelsSenderInstance

Initialize the ChannelsSenderInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this ChannelsSender resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 877

def initialize(version, payload , sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'status' => payload['status'],
        'sender_id' => payload['sender_id'],
        'configuration' => payload['configuration'],
        'webhook' => payload['webhook'],
        'profile' => payload['profile'],
        'properties' => payload['properties'],
        'offline_reasons' => payload['offline_reasons'],
        'compliance' => payload['compliance'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#complianceMessagingV2RcsComplianceResponse

Returns:

  • (MessagingV2RcsComplianceResponse)


961
962
963
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 961

def compliance
    @properties['compliance']
end

#configurationMessagingV2ChannelsSenderConfiguration

Returns:

  • (MessagingV2ChannelsSenderConfiguration)


931
932
933
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 931

def configuration
    @properties['configuration']
end

#contextChannelsSenderContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



904
905
906
907
908
909
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 904

def context
    unless @instance_context
        @instance_context = ChannelsSenderContext.new(@version , @params['sid'])
    end
    @instance_context
end

#deleteBoolean

Delete the ChannelsSenderInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



974
975
976
977
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 974

def delete

    context.delete
end

#fetchChannelsSenderInstance

Fetch the ChannelsSenderInstance

Returns:



982
983
984
985
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 982

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



1008
1009
1010
1011
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 1008

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Messaging.V2.ChannelsSenderInstance #{values}>"
end

#offline_reasonsArray<MessagingV2ChannelsSenderOfflineReasonsItems>

Returns The reasons why the sender is offline.

Returns:

  • (Array<MessagingV2ChannelsSenderOfflineReasonsItems>)

    The reasons why the sender is offline.



955
956
957
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 955

def offline_reasons
    @properties['offline_reasons']
end

#profileMessagingV2ChannelsSenderProfileGenericResponse

Returns:

  • (MessagingV2ChannelsSenderProfileGenericResponse)


943
944
945
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 943

def profile
    @properties['profile']
end

#propertiesMessagingV2ChannelsSenderProperties

Returns:

  • (MessagingV2ChannelsSenderProperties)


949
950
951
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 949

def properties
    @properties['properties']
end

#sender_idString

Returns The ID of the sender in ‘whatsapp:<E.164_PHONE_NUMBER>` format.

Returns:

  • (String)

    The ID of the sender in ‘whatsapp:<E.164_PHONE_NUMBER>` format.



925
926
927
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 925

def sender_id
    @properties['sender_id']
end

#sidString

Returns The SID of the sender.

Returns:

  • (String)

    The SID of the sender.



913
914
915
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 913

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


919
920
921
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 919

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



1001
1002
1003
1004
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 1001

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Messaging.V2.ChannelsSenderInstance #{values}>"
end

#update(messaging_v2_channels_sender_requests_update: :unset) ⇒ ChannelsSenderInstance

Update the ChannelsSenderInstance

Parameters:

  • messaging_v2_channels_sender_requests_update (MessagingV2ChannelsSenderRequestsUpdate) (defaults to: :unset)

Returns:



991
992
993
994
995
996
997
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 991

def update(messaging_v2_channels_sender_requests_update: :unset
)

    context.update(
        messaging_v2_channels_sender_requests_update: messaging_v2_channels_sender_requests_update, 
    )
end

#urlString

Returns The URL of the resource.

Returns:

  • (String)

    The URL of the resource.



967
968
969
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 967

def url
    @properties['url']
end

#webhookMessagingV2ChannelsSenderWebhook

Returns:

  • (MessagingV2ChannelsSenderWebhook)


937
938
939
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 937

def webhook
    @properties['webhook']
end