Class: Twilio::REST::Proxy::V1::ServiceContext::SessionContext::ParticipantContext::MessageInteractionInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, session_sid: nil, participant_sid: nil, sid: nil) ⇒ MessageInteractionInstance

Initialize the MessageInteractionInstance

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 MessageInteraction resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 456

def initialize(version, payload , service_sid: nil, session_sid: nil, participant_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'session_sid' => payload['session_sid'],
        'service_sid' => payload['service_sid'],
        'account_sid' => payload['account_sid'],
        'data' => payload['data'],
        'type' => payload['type'],
        'participant_sid' => payload['participant_sid'],
        'inbound_participant_sid' => payload['inbound_participant_sid'],
        'inbound_resource_sid' => payload['inbound_resource_sid'],
        'inbound_resource_status' => payload['inbound_resource_status'],
        'inbound_resource_type' => payload['inbound_resource_type'],
        'inbound_resource_url' => payload['inbound_resource_url'],
        'outbound_participant_sid' => payload['outbound_participant_sid'],
        'outbound_resource_sid' => payload['outbound_resource_sid'],
        'outbound_resource_status' => payload['outbound_resource_status'],
        'outbound_resource_type' => payload['outbound_resource_type'],
        'outbound_resource_url' => payload['outbound_resource_url'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the MessageInteraction resource.

Returns:



520
521
522
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 520

def 
    @properties['account_sid']
end

#contextMessageInteractionContext

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

Returns:



493
494
495
496
497
498
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 493

def context
    unless @instance_context
        @instance_context = MessageInteractionContext.new(@version , @params['service_sid'], @params['session_sid'], @params['participant_sid'], @params['sid'])
    end
    @instance_context
end

#dataString

Returns A JSON string that includes the message body sent to the participant. (e.g. ‘"hello"`).

Returns:

  • (String)

    A JSON string that includes the message body sent to the participant. (e.g. ‘"hello"`)



526
527
528
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 526

def data
    @properties['data']
end

#date_createdTime

Returns The [ISO 8601](en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created.

Returns:



604
605
606
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 604

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The [ISO 8601](en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated.

Returns:



610
611
612
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 610

def date_updated
    @properties['date_updated']
end

#fetchMessageInteractionInstance

Fetch the MessageInteractionInstance

Returns:



623
624
625
626
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 623

def fetch

    context.fetch
end

#inbound_participant_sidString

Returns Always empty for created Message Interactions.

Returns:

  • (String)

    Always empty for created Message Interactions.



544
545
546
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 544

def inbound_participant_sid
    @properties['inbound_participant_sid']
end

#inbound_resource_sidString

Returns Always empty for created Message Interactions.

Returns:

  • (String)

    Always empty for created Message Interactions.



550
551
552
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 550

def inbound_resource_sid
    @properties['inbound_resource_sid']
end

#inbound_resource_statusResourceStatus

Returns:

  • (ResourceStatus)


556
557
558
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 556

def inbound_resource_status
    @properties['inbound_resource_status']
end

#inbound_resource_typeString

Returns Always empty for created Message Interactions.

Returns:

  • (String)

    Always empty for created Message Interactions.



562
563
564
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 562

def inbound_resource_type
    @properties['inbound_resource_type']
end

#inbound_resource_urlString

Returns Always empty for created Message Interactions.

Returns:

  • (String)

    Always empty for created Message Interactions.



568
569
570
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 568

def inbound_resource_url
    @properties['inbound_resource_url']
end

#inspectObject

Provide a detailed, user friendly representation



637
638
639
640
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 637

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

#outbound_participant_sidString

Returns The SID of the outbound [Participant](www.twilio.com/docs/proxy/api/participant) resource.

Returns:



574
575
576
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 574

def outbound_participant_sid
    @properties['outbound_participant_sid']
end

#outbound_resource_sidString

Returns The SID of the outbound [Message](www.twilio.com/docs/sms/api/message-resource) resource.

Returns:



580
581
582
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 580

def outbound_resource_sid
    @properties['outbound_resource_sid']
end

#outbound_resource_statusResourceStatus

Returns:

  • (ResourceStatus)


586
587
588
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 586

def outbound_resource_status
    @properties['outbound_resource_status']
end

#outbound_resource_typeString

Returns The outbound resource type. This value is always Message.

Returns:

  • (String)

    The outbound resource type. This value is always Message.



592
593
594
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 592

def outbound_resource_type
    @properties['outbound_resource_type']
end

#outbound_resource_urlString

Returns The URL of the Twilio message resource.

Returns:

  • (String)

    The URL of the Twilio message resource.



598
599
600
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 598

def outbound_resource_url
    @properties['outbound_resource_url']
end

#participant_sidString

Returns The SID of the [Participant](www.twilio.com/docs/proxy/api/participant) resource.

Returns:



538
539
540
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 538

def participant_sid
    @properties['participant_sid']
end

#service_sidString

Returns The SID of the parent [Service](www.twilio.com/docs/proxy/api/service) resource.

Returns:



514
515
516
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 514

def service_sid
    @properties['service_sid']
end

#session_sidString

Returns The SID of the parent [Session](www.twilio.com/docs/proxy/api/session) resource.

Returns:



508
509
510
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 508

def session_sid
    @properties['session_sid']
end

#sidString

Returns The unique string that we created to identify the MessageInteraction resource.

Returns:

  • (String)

    The unique string that we created to identify the MessageInteraction resource.



502
503
504
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 502

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



630
631
632
633
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 630

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

#typeType

Returns:

  • (Type)


532
533
534
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 532

def type
    @properties['type']
end

#urlString

Returns The absolute URL of the MessageInteraction resource.

Returns:

  • (String)

    The absolute URL of the MessageInteraction resource.



616
617
618
# File 'lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb', line 616

def url
    @properties['url']
end