Class: Twilio::REST::Memory::V1::ConversationSummaryContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, store_id, profile_id, summary_id) ⇒ ConversationSummaryContext

Initialize the ConversationSummaryContext

Parameters:

  • version (Version) —

    Version that contains the resource

  • store_id (String) —

    A unique Memory Store ID using Twilio Type ID (TTID) format

  • profile_id (String) —

    The unique identifier for the profile using Twilio Type ID (TTID) format.

  • summary_id (String) —

    The summary ID.



364
365
366
367
368
369
370
371
372
373
374
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 364

def initialize(version, store_id, profile_id, summary_id)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)

    # Path Solution
    @solution = { store_id: store_id, profile_id: profile_id, summary_id: summary_id,  }
    @uri = "/Stores/#{@solution[:store_id]}/Profiles/#{@solution[:profile_id]}/ConversationSummaries/#{@solution[:summary_id]}"

    
end

Instance Method Details

#delete ⇒ Boolean

Delete the ConversationSummaryInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 378

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    response = @version.('DELETE', @uri, headers: headers)
    ConversationSummaryInstance.new(
      @version,
      response.body,
        store_id: @solution[:store_id],
        profile_id: @solution[:profile_id],
        summary_id: @solution[:summary_id],
    )
    
end

#delete_with_metadata ⇒ Boolean

Delete the ConversationSummaryInstanceMetadata

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 398

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      conversationSummary_instance = ConversationSummaryInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      ConversationSummaryInstanceMetadata.new(@version, conversationSummary_instance, response.headers, response.status_code)
end

#fetch ⇒ ConversationSummaryInstance

Fetch the ConversationSummaryInstance

Returns:



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 417

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    ConversationSummaryInstance.new(
        @version,
        payload,
        store_id: @solution[:store_id],
        profile_id: @solution[:profile_id],
        summary_id: @solution[:summary_id],
    )
end

#fetch_with_metadata ⇒ ConversationSummaryInstance

Fetch the ConversationSummaryInstanceMetadata

Returns:



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 438

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    conversation_summary_instance = ConversationSummaryInstance.new(
        @version,
        response.body,
        store_id: @solution[:store_id],
        profile_id: @solution[:profile_id],
        summary_id: @solution[:summary_id],
    )
    ConversationSummaryInstanceMetadata.new(
        @version,
        conversation_summary_instance,
        response.headers,
        response.status_code
    )
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



524
525
526
527
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 524

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Memory.V1.ConversationSummaryContext #{context}>"
end

#patch(summary_core_patch: nil) ⇒ ConversationSummaryInstance

Patch the ConversationSummaryInstance

Parameters:

  • summary_core_patch (SummaryCorePatch) (defaults to: nil)

Returns:



466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 466

def patch(summary_core_patch: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    payload = @version.patch('PATCH', @uri, headers: headers, data: summary_core_patch.to_json)
    ConversationSummaryInstance.new(
        @version,
        payload,
        store_id: @solution[:store_id],
        profile_id: @solution[:profile_id],
        summary_id: @solution[:summary_id],
    )
end

#patch_with_metadata(summary_core_patch: nil) ⇒ ConversationSummaryInstance

Patch the ConversationSummaryInstanceMetadata

Parameters:

  • summary_core_patch (SummaryCorePatch) (defaults to: nil)

Returns:



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 489

def (summary_core_patch: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    response = @version.('PATCH', @uri, headers: headers, data: summary_core_patch.to_json)
    conversation_summary_instance = ConversationSummaryInstance.new(
        @version,
        response.body,
        store_id: @solution[:store_id],
        profile_id: @solution[:profile_id],
        summary_id: @solution[:summary_id],
    )
    ConversationSummaryInstanceMetadata.new(
        @version,
        conversation_summary_instance,
        response.headers,
        response.status_code
    )
end

#to_s ⇒ Object

Provide a user friendly representation



517
518
519
520
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 517

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Memory.V1.ConversationSummaryContext #{context}>"
end