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.



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

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.



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

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:



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

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.



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

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.



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

def created_at
    @properties['created_at']
end

#delete ⇒ Boolean

Delete the ConversationSummaryInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



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

def delete

    context.delete
end

#fetch ⇒ ConversationSummaryInstance

Fetch the ConversationSummaryInstance

Returns:



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

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.



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

def id
    @properties['id']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



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

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.



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

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.



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

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:



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

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.



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

def source
    @properties['source']
end

#to_s ⇒ Object

Provide a user friendly representation



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

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.



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

def updated_at
    @properties['updated_at']
end