Class: Twilio::REST::Api::V2010::AccountContext::CallContext::PaymentInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::CallContext::PaymentInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/call/payment.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the Payments resource.
-
#call_sid ⇒ String
The SID of the Call the resource is associated with.
-
#context ⇒ PaymentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT that the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT that the resource was last updated.
-
#initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) ⇒ PaymentInstance
constructor
Initialize the PaymentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The SID of the Payments resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset) ⇒ PaymentInstance
Update the PaymentInstance.
-
#uri ⇒ String
The URI of the resource, relative to ‘api.twilio.com`.
Constructor Details
#initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) ⇒ PaymentInstance
Initialize the PaymentInstance
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 249 def initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'call_sid' => payload['call_sid'], 'sid' => payload['sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'uri' => payload['uri'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'call_sid' => call_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the Payments resource.
285 286 287 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 285 def account_sid @properties['account_sid'] end |
#call_sid ⇒ String
Returns The SID of the Call the resource is associated with.
291 292 293 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 291 def call_sid @properties['call_sid'] end |
#context ⇒ PaymentContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 271 def context unless @instance_context @instance_context = PaymentContext.new( @version, @params['account_sid'], @params['call_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT that the resource was created.
303 304 305 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 303 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT that the resource was last updated.
309 310 311 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 309 def date_updated @properties['date_updated'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
349 350 351 352 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 349 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.PaymentInstance #{values}>" end |
#sid ⇒ String
Returns The SID of the Payments resource.
297 298 299 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 297 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 342 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.PaymentInstance #{values}>" end |
#update(idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset) ⇒ PaymentInstance
Update the PaymentInstance
331 332 333 334 335 336 337 338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 331 def update(idempotency_key: nil, status_callback: nil, capture: :unset, status: :unset) context.update( idempotency_key: idempotency_key, status_callback: status_callback, capture: capture, status: status, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to ‘api.twilio.com`.
315 316 317 |
# File 'lib/twilio-ruby/rest/api/v2010/account/call/payment.rb', line 315 def uri @properties['uri'] end |