Class: Twilio::REST::Memory::V1::ConversationSummaryInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/memory/v1/conversation_summary.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, store_id: nil, profile_id: nil, summary_id: nil) ⇒ ConversationSummaryInstance

Initialize the ConversationSummaryInstance

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

  • sid (String) —

    The SID of the Call resource to fetch.



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 679

def initialize(version, payload , store_id: nil, profile_id: nil, summary_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'message' => payload['message'],
        'source' => payload['source'],
        'content' => payload['content'],
        'occurred_at' => Twilio.deserialize_iso8601_datetime(payload['occurred_at']),
        'conversation_id' => payload['conversation_id'],
        'id' => payload['id'],
        'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
        'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']),
    }

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

Instance Method Details

#content ⇒ String

Returns The main content of the summary.

Returns:

  • (String) —

    The main content of the summary.



726
727
728
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 726

def content
    @properties['content']
end

#context ⇒ ConversationSummaryContext

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

Returns:



705
706
707
708
709
710
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 705

def context
    unless @instance_context
        @instance_context = ConversationSummaryContext.new(@version , @params['store_id'], @params['profile_id'], @params['summary_id'])
    end
    @instance_context
end

#conversation_id ⇒ String

Returns A unique identifier for the conversation using Twilio Type ID (TTID) format.

Returns:

  • (String) —

    A unique identifier for the conversation using Twilio Type ID (TTID) format.



738
739
740
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 738

def conversation_id
    @properties['conversation_id']
end

#created_at ⇒ Time

Returns The timestamp when the summary was created.

Returns:

  • (Time) —

    The timestamp when the summary was created.



750
751
752
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 750

def created_at
    @properties['created_at']
end

#delete ⇒ Boolean

Delete the ConversationSummaryInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



763
764
765
766
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 763

def delete

    context.delete
end

#fetch ⇒ ConversationSummaryInstance

Fetch the ConversationSummaryInstance

Returns:



771
772
773
774
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 771

def fetch

    context.fetch
end

#id ⇒ String

Returns A unique identifier for the summary using Twilio Type ID (TTID) format.

Returns:

  • (String) —

    A unique identifier for the summary using Twilio Type ID (TTID) format.



744
745
746
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 744

def id
    @properties['id']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



797
798
799
800
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 797

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

#message ⇒ String

Returns Confirmation message for the operation.

Returns:

  • (String) —

    Confirmation message for the operation.



714
715
716
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 714

def message
    @properties['message']
end

#occurred_at ⇒ Time

Returns The timestamp when the summary was originally created.

Returns:

  • (Time) —

    The timestamp when the summary was originally created.



732
733
734
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 732

def occurred_at
    @properties['occurred_at']
end

#patch(summary_core_patch: nil) ⇒ ConversationSummaryInstance

Patch the ConversationSummaryInstance

Parameters:

  • summary_core_patch (SummaryCorePatch) (defaults to: nil)

Returns:



780
781
782
783
784
785
786
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 780

def patch(summary_core_patch: nil
)

    context.patch(
        summary_core_patch: summary_core_patch, 
    )
end

#source ⇒ String

Returns The source system that generated the summary. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters.

Returns:

  • (String) —

    The source system that generated the summary. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters.



720
721
722
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 720

def source
    @properties['source']
end

#to_s ⇒ Object

Provide a user friendly representation



790
791
792
793
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 790

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

#updated_at ⇒ Time

Returns The timestamp when the summary was last updated.

Returns:

  • (Time) —

    The timestamp when the summary was last updated.



756
757
758
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 756

def updated_at
    @properties['updated_at']
end