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
# 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']),
  }

  # 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



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

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



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

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:



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

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



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

def date_updated
  @properties['date_updated']
end

#inspectObject

Provide a detailed, user friendly representation



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

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



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

def name
  @properties['name']
end

#sidString

Returns The SID of the Siprec resource.

Returns:

  • (String)

    The SID of the Siprec resource.



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

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`



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

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



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

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:



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

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