Class: Twilio::REST::Voice::V2::TypeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Voice::V2::TypeInstance
- Defined in:
- lib/twilio-ruby/rest/voice/v2/type.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Account sid.
-
#code ⇒ String
Twilio error code.
- #configuration ⇒ Hash
-
#context ⇒ TypeContext
Generate an instance context for the instance, the context is capable of performing various actions.
- #date_created ⇒ Time
- #date_updated ⇒ Time
-
#delete ⇒ Boolean
Delete the TypeInstance.
-
#description ⇒ String
The description.
-
#fetch ⇒ TypeInstance
Fetch the TypeInstance.
-
#id ⇒ String
Configuration Identifier.
-
#initialize(version, payload, type: nil, id_or_unique_name: nil) ⇒ TypeInstance
constructor
Initialize the TypeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#message ⇒ String
Error message.
-
#more_info ⇒ String
More information about the error.
-
#status ⇒ String
Status code.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
The unique name.
-
#update(voice_v2_configuration_request: :unset) ⇒ TypeInstance
Update the TypeInstance.
Constructor Details
#initialize(version, payload, type: nil, id_or_unique_name: nil) ⇒ TypeInstance
Initialize the TypeInstance
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 371 def initialize(version, payload , type: nil, id_or_unique_name: nil) super(version) # Marshaled Properties @properties = { 'message' => payload['message'], 'code' => payload['code'], 'status' => payload['status'], 'more_info' => payload['more_info'], 'id' => payload['id'], 'account_sid' => payload['account_sid'], 'unique_name' => payload['unique_name'], 'description' => payload['description'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'configuration' => payload['configuration'], } # Context @instance_context = nil @params = { 'type' => type || @properties['type'] ,'id_or_unique_name' => id_or_unique_name || @properties['id_or_unique_name'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns Account sid.
438 439 440 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 438 def account_sid @properties['account_sid'] end |
#code ⇒ String
Returns Twilio error code.
414 415 416 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 414 def code @properties['code'] end |
#configuration ⇒ Hash
468 469 470 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 468 def configuration @properties['configuration'] end |
#context ⇒ TypeContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
399 400 401 402 403 404 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 399 def context unless @instance_context @instance_context = TypeContext.new(@version , @params['type'], @params['id_or_unique_name']) end @instance_context end |
#date_created ⇒ Time
456 457 458 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 456 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
462 463 464 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 462 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the TypeInstance
475 476 477 478 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 475 def delete context.delete end |
#description ⇒ String
Returns The description.
450 451 452 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 450 def description @properties['description'] end |
#fetch ⇒ TypeInstance
Fetch the TypeInstance
483 484 485 486 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 483 def fetch context.fetch end |
#id ⇒ String
Returns Configuration Identifier.
432 433 434 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 432 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
509 510 511 512 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 509 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V2.TypeInstance #{values}>" end |
#message ⇒ String
Returns Error message.
408 409 410 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 408 def @properties['message'] end |
#more_info ⇒ String
Returns More information about the error.
426 427 428 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 426 def more_info @properties['more_info'] end |
#status ⇒ String
Returns status code.
420 421 422 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 420 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
502 503 504 505 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 502 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V2.TypeInstance #{values}>" end |
#unique_name ⇒ String
Returns The unique name.
444 445 446 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 444 def unique_name @properties['unique_name'] end |
#update(voice_v2_configuration_request: :unset) ⇒ TypeInstance
Update the TypeInstance
492 493 494 495 496 497 498 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 492 def update(voice_v2_configuration_request: :unset ) context.update( voice_v2_configuration_request: voice_v2_configuration_request, ) end |