Class: Twilio::REST::Api::V2010::AccountContext::CallContext::SiprecContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, call_sid, sid) ⇒ SiprecContext

Initialize the SiprecContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The SID of the Account that created this Siprec resource.

  • call_sid (String)

    The SID of the Call the Siprec resource is associated with.

  • sid (String)

    The SID of the Siprec resource, or the `name` used when creating the resource


515
516
517
518
519
520
521
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 515

def initialize(version, , call_sid, sid)
  super(version)

  # Path Solution
  @solution = {account_sid: , call_sid: call_sid, sid: sid, }
  @uri = "/Accounts/#{@solution[:account_sid]}/Calls/#{@solution[:call_sid]}/Siprec/#{@solution[:sid]}.json"
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation


550
551
552
553
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 550

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

#to_sObject

Provide a user friendly representation


543
544
545
546
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 543

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

#update(status: nil) ⇒ SiprecInstance

Update the SiprecInstance

Parameters:

  • status (siprec.UpdateStatus) (defaults to: nil)

    The status. Must have the value `stopped`

Returns:


527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 527

def update(status: nil)
  data = Twilio::Values.of({'Status' => status, })

  payload = @version.update('POST', @uri, data: data)

  SiprecInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      call_sid: @solution[:call_sid],
      sid: @solution[:sid],
  )
end