Class: Twilio::REST::Intelligence::V3::ConversationInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/intelligence/v3/conversation.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, id: nil) ⇒ ConversationInstance

Initialize the ConversationInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



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
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 460

def initialize(version, payload , id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'id' => payload['id'],
        'account_id' => payload['account_id'],
        'name' => payload['name'],
        'status' => payload['status'],
        'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
        'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']),
        'intelligence_configuration_ids' => payload['intelligence_configuration_ids'],
        'conversation_configuration_id' => payload['conversation_configuration_id'],
        'channels' => payload['channels'],
        'channel_ids' => payload['channel_ids'],
        'participants' => payload['participants'],
        'communications' => payload['communications'],
        'operator_result_ids' => payload['operator_result_ids'],
    }

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

Instance Method Details

#account_idString

Returns The ID of the account that owns the Conversation.

Returns:

  • (String)

    The ID of the account that owns the Conversation.



506
507
508
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 506

def 
    @properties['account_id']
end

#channel_idsArray<String>

Returns The underlying channel resource ‘id`s associated with this Conversation, such as a Call ID or Message ID.

Returns:

  • (Array<String>)

    The underlying channel resource ‘id`s associated with this Conversation, such as a Call ID or Message ID.



554
555
556
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 554

def channel_ids
    @properties['channel_ids']
end

#channelsArray<Channel>

Returns The communication channel(s) included in the Conversation.

Returns:

  • (Array<Channel>)

    The communication channel(s) included in the Conversation.



548
549
550
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 548

def channels
    @properties['channels']
end

#communicationsArray<Communication>

Returns Metadata for the Communications that make up the Conversation.

Returns:

  • (Array<Communication>)

    Metadata for the Communications that make up the Conversation.



566
567
568
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 566

def communications
    @properties['communications']
end

#contextConversationContext

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

Returns:



491
492
493
494
495
496
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 491

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

#conversation_configuration_idString

Returns The ‘id` of the Configuration for a Conversation.

Returns:

  • (String)

    The ‘id` of the Configuration for a Conversation.



542
543
544
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 542

def conversation_configuration_id
    @properties['conversation_configuration_id']
end

#created_atTime

Returns Timestamp for when the Conversation was created.

Returns:

  • (Time)

    Timestamp for when the Conversation was created.



524
525
526
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 524

def created_at
    @properties['created_at']
end

#fetchConversationInstance

Fetch the ConversationInstance

Returns:



579
580
581
582
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 579

def fetch

    context.fetch
end

#idString

Returns The ‘id` of the Conversation attached to the Operator Result.

Returns:

  • (String)

    The ‘id` of the Conversation attached to the Operator Result.



500
501
502
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 500

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



593
594
595
596
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 593

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

#intelligence_configuration_idsArray<String>

Returns The Intelligence Configuration(s) associated with the Conversation.

Returns:

  • (Array<String>)

    The Intelligence Configuration(s) associated with the Conversation.



536
537
538
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 536

def intelligence_configuration_ids
    @properties['intelligence_configuration_ids']
end

#nameString

Returns Display name of the Conversation.

Returns:

  • (String)

    Display name of the Conversation.



512
513
514
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 512

def name
    @properties['name']
end

#operator_result_idsArray<String>

Returns List of Operator Result IDs generated from this Conversation.

Returns:

  • (Array<String>)

    List of Operator Result IDs generated from this Conversation.



572
573
574
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 572

def operator_result_ids
    @properties['operator_result_ids']
end

#participantsArray<Participant>

Returns Metadata for Participants of the Conversation.

Returns:

  • (Array<Participant>)

    Metadata for Participants of the Conversation.



560
561
562
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 560

def participants
    @properties['participants']
end

#statusConversationStatus

Returns:

  • (ConversationStatus)


518
519
520
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 518

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



586
587
588
589
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 586

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

#updated_atTime

Returns Timestamp for when the Conversation was last updated.

Returns:

  • (Time)

    Timestamp for when the Conversation was last updated.



530
531
532
# File 'lib/twilio-ruby/rest/intelligence/v3/conversation.rb', line 530

def updated_at
    @properties['updated_at']
end