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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) ⇒ SiprecInstance

Initialize the SiprecInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this Siprec resource.

  • call_sid (String) (defaults to: nil)

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

  • sid (String) (defaults to: nil)

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


570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 570

def initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'call_sid' => payload['call_sid'],
      'name' => payload['name'],
      'status' => payload['status'],
      'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
      'uri' => payload['uri'],
  }

  # Context
  @instance_context = nil
  @params = {'account_sid' => , 'call_sid' => call_sid, 'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created this resource.

Returns:

  • (String)

    The SID of the Account that created this resource


613
614
615
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 613

def 
  @properties['account_sid']
end

#call_sidString

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

Returns:

  • (String)

    The SID of the Call the resource is associated with


619
620
621
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 619

def call_sid
  @properties['call_sid']
end

#contextSiprecContext

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

Returns:


593
594
595
596
597
598
599
600
601
602
603
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 593

def context
  unless @instance_context
    @instance_context = SiprecContext.new(
        @version,
        @params['account_sid'],
        @params['call_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT that this resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that this resource was last updated


637
638
639
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 637

def date_updated
  @properties['date_updated']
end

#inspectObject

Provide a detailed, user friendly representation


664
665
666
667
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 664

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

#nameString

Returns The name of this resource.

Returns:

  • (String)

    The name of this resource


625
626
627
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 625

def name
  @properties['name']
end

#sidString

Returns The SID of the Siprec resource.

Returns:

  • (String)

    The SID of the Siprec resource.


607
608
609
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 607

def sid
  @properties['sid']
end

#statussiprec.Status

Returns The status - one of `stopped`, `in-progress`.

Returns:

  • (siprec.Status)

    The status - one of `stopped`, `in-progress`


631
632
633
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 631

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation


657
658
659
660
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 657

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

#update(status: nil) ⇒ SiprecInstance

Update the SiprecInstance

Parameters:

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

    The status. Must have the value `stopped`

Returns:


651
652
653
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 651

def update(status: nil)
  context.update(status: status, )
end

#uriString

Returns The URI of the resource, relative to `api.twilio.com`.

Returns:


643
644
645
# File 'lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb', line 643

def uri
  @properties['uri']
end