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
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 312 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.
379 380 381 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 379 def account_sid @properties['account_sid'] end |
#code ⇒ String
Returns Twilio error code.
355 356 357 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 355 def code @properties['code'] end |
#configuration ⇒ Hash
409 410 411 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 409 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
340 341 342 343 344 345 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 340 def context unless @instance_context @instance_context = TypeContext.new(@version , @params['type'], @params['id_or_unique_name']) end @instance_context end |
#date_created ⇒ Time
397 398 399 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 397 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
403 404 405 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 403 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the TypeInstance
416 417 418 419 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 416 def delete context.delete end |
#description ⇒ String
Returns The description.
391 392 393 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 391 def description @properties['description'] end |
#fetch ⇒ TypeInstance
Fetch the TypeInstance
424 425 426 427 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 424 def fetch context.fetch end |
#id ⇒ String
Returns Configuration Identifier.
373 374 375 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 373 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
450 451 452 453 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 450 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V2.TypeInstance #{values}>" end |
#message ⇒ String
Returns Error message.
349 350 351 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 349 def @properties['message'] end |
#more_info ⇒ String
Returns More information about the error.
367 368 369 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 367 def more_info @properties['more_info'] end |
#status ⇒ String
Returns status code.
361 362 363 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 361 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
443 444 445 446 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 443 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V2.TypeInstance #{values}>" end |
#unique_name ⇒ String
Returns The unique name.
385 386 387 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 385 def unique_name @properties['unique_name'] end |
#update(voice_v2_configuration_request: :unset) ⇒ TypeInstance
Update the TypeInstance
433 434 435 436 437 438 439 |
# File 'lib/twilio-ruby/rest/voice/v2/type.rb', line 433 def update(voice_v2_configuration_request: :unset ) context.update( voice_v2_configuration_request: voice_v2_configuration_request, ) end |