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.



358
359
360
361
362
363
364
365
366
367
368
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 358

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

#deleteBoolean

Delete the ConversationSummaryInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 372

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_metadataBoolean

Delete the ConversationSummaryInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 392

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

#fetchConversationSummaryInstance

Fetch the ConversationSummaryInstance

Returns:



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 411

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_metadataConversationSummaryInstance

Fetch the ConversationSummaryInstanceMetadata

Returns:



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 432

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

#inspectObject

Provide a detailed, user friendly representation



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

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:



460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 460

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:



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 483

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_sObject

Provide a user friendly representation



511
512
513
514
# File 'lib/twilio-ruby/rest/memory/v1/conversation_summary.rb', line 511

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