Class: Twilio::REST::Wireless::V1::SimInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Wireless::V1::SimInstance
- Defined in:
- lib/twilio-ruby/rest/wireless/v1/sim.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique id of the Account that this Sim belongs to.
-
#commands_callback_method ⇒ String
A string representing the HTTP method to use when making a request to commands_callback_url.
-
#commands_callback_url ⇒ String
The URL that will receive a webhook when this Sim originates a machine-to-machine Command.
-
#context ⇒ SimContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#data_sessions ⇒ data_sessions
Access the data_sessions.
-
#date_created ⇒ Time
The date that this resource was created, given as GMT in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this resource was last updated, given as GMT in ISO 8601 format.
-
#delete ⇒ Boolean
Deletes the SimInstance.
-
#e_id ⇒ String
The e_id.
-
#fetch ⇒ SimInstance
Fetch a SimInstance.
-
#friendly_name ⇒ String
A user-provided string that identifies this resource.
-
#iccid ⇒ String
The ICCID associated with the SIM.
-
#initialize(version, payload, sid: nil) ⇒ SimInstance
constructor
Initialize the SimInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#ip_address ⇒ String
The ip_address.
-
#links ⇒ String
Each Sim instance resource supports a few subresources, listed here for convenience.
-
#rate_plan_sid ⇒ String
The unique ID of the Rate Plan configured for this Sim.
-
#reset_status ⇒ sim.ResetStatus
A string representing the connectivity reset status of the Sim.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#sms_fallback_method ⇒ String
The HTTP method Twilio will use when requesting the sms_fallback_url.
-
#sms_fallback_url ⇒ String
The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by sms_url.
-
#sms_method ⇒ String
The HTTP method Twilio will use when requesting the above Url.
-
#sms_url ⇒ String
The URL Twilio will request when the SIM-connected device send an SMS that is not a Command.
-
#status ⇒ sim.Status
A string representing the status of the Sim.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
A user-provided string that uniquely identifies this resource as an alternative to the sid.
-
#update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, reset_status: :unset) ⇒ SimInstance
Update the SimInstance.
-
#url ⇒ String
The URL for this resource.
-
#usage_records ⇒ usage_records
Access the usage_records.
-
#voice_fallback_method ⇒ String
The HTTP method Twilio will use when requesting the voice_fallback_url.
-
#voice_fallback_url ⇒ String
The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by voice_url.
-
#voice_method ⇒ String
The HTTP method Twilio will use when requesting the above Url.
-
#voice_url ⇒ String
The URL Twilio will request when the SIM-connected device makes a call.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ SimInstance
Initialize the SimInstance
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 352 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'account_sid' => payload['account_sid'], 'rate_plan_sid' => payload['rate_plan_sid'], 'friendly_name' => payload['friendly_name'], 'iccid' => payload['iccid'], 'e_id' => payload['e_id'], 'status' => payload['status'], 'reset_status' => payload['reset_status'], 'commands_callback_url' => payload['commands_callback_url'], 'commands_callback_method' => payload['commands_callback_method'], 'sms_fallback_method' => payload['sms_fallback_method'], 'sms_fallback_url' => payload['sms_fallback_url'], 'sms_method' => payload['sms_method'], 'sms_url' => payload['sms_url'], 'voice_fallback_method' => payload['voice_fallback_method'], 'voice_fallback_url' => payload['voice_fallback_url'], 'voice_method' => payload['voice_method'], 'voice_url' => payload['voice_url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], 'ip_address' => payload['ip_address'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique id of the Account that this Sim belongs to.
413 414 415 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 413 def account_sid @properties['account_sid'] end |
#commands_callback_method ⇒ String
Returns A string representing the HTTP method to use when making a request to commands_callback_url.
461 462 463 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 461 def commands_callback_method @properties['commands_callback_method'] end |
#commands_callback_url ⇒ String
Returns The URL that will receive a webhook when this Sim originates a machine-to-machine Command.
455 456 457 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 455 def commands_callback_url @properties['commands_callback_url'] end |
#context ⇒ SimContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
392 393 394 395 396 397 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 392 def context unless @instance_context @instance_context = SimContext.new(@version, @params['sid'], ) end @instance_context end |
#data_sessions ⇒ data_sessions
Access the data_sessions
638 639 640 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 638 def data_sessions context.data_sessions end |
#date_created ⇒ Time
Returns The date that this resource was created, given as GMT in ISO 8601 format.
515 516 517 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 515 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated, given as GMT in ISO 8601 format.
521 522 523 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 521 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the SimInstance
624 625 626 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 624 def delete context.delete end |
#e_id ⇒ String
Returns The e_id.
437 438 439 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 437 def e_id @properties['e_id'] end |
#fetch ⇒ SimInstance
Fetch a SimInstance
546 547 548 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 546 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A user-provided string that identifies this resource.
425 426 427 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 425 def friendly_name @properties['friendly_name'] end |
#iccid ⇒ String
Returns The ICCID associated with the SIM.
431 432 433 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 431 def iccid @properties['iccid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
651 652 653 654 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 651 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.SimInstance #{values}>" end |
#ip_address ⇒ String
Returns The ip_address.
539 540 541 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 539 def ip_address @properties['ip_address'] end |
#links ⇒ String
Returns Each Sim instance resource supports a few subresources, listed here for convenience.
533 534 535 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 533 def links @properties['links'] end |
#rate_plan_sid ⇒ String
Returns The unique ID of the Rate Plan configured for this Sim.
419 420 421 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 419 def rate_plan_sid @properties['rate_plan_sid'] end |
#reset_status ⇒ sim.ResetStatus
Returns A string representing the connectivity reset status of the Sim.
449 450 451 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 449 def reset_status @properties['reset_status'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
401 402 403 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 401 def sid @properties['sid'] end |
#sms_fallback_method ⇒ String
Returns The HTTP method Twilio will use when requesting the sms_fallback_url.
467 468 469 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 467 def sms_fallback_method @properties['sms_fallback_method'] end |
#sms_fallback_url ⇒ String
Returns The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by sms_url.
473 474 475 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 473 def sms_fallback_url @properties['sms_fallback_url'] end |
#sms_method ⇒ String
Returns The HTTP method Twilio will use when requesting the above Url.
479 480 481 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 479 def sms_method @properties['sms_method'] end |
#sms_url ⇒ String
Returns The URL Twilio will request when the SIM-connected device send an SMS that is not a Command.
485 486 487 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 485 def sms_url @properties['sms_url'] end |
#status ⇒ sim.Status
Returns A string representing the status of the Sim.
443 444 445 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 443 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
644 645 646 647 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 644 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.SimInstance #{values}>" end |
#unique_name ⇒ String
Returns A user-provided string that uniquely identifies this resource as an alternative to the sid.
407 408 409 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 407 def unique_name @properties['unique_name'] end |
#update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, reset_status: :unset) ⇒ SimInstance
Update the SimInstance
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 599 def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, reset_status: :unset) context.update( unique_name: unique_name, callback_method: callback_method, callback_url: callback_url, friendly_name: friendly_name, rate_plan: rate_plan, status: status, commands_callback_method: commands_callback_method, commands_callback_url: commands_callback_url, sms_fallback_method: sms_fallback_method, sms_fallback_url: sms_fallback_url, sms_method: sms_method, sms_url: sms_url, voice_fallback_method: voice_fallback_method, voice_fallback_url: voice_fallback_url, voice_method: voice_method, voice_url: voice_url, reset_status: reset_status, ) end |
#url ⇒ String
Returns The URL for this resource.
527 528 529 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 527 def url @properties['url'] end |
#usage_records ⇒ usage_records
Access the usage_records
631 632 633 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 631 def usage_records context.usage_records end |
#voice_fallback_method ⇒ String
Returns The HTTP method Twilio will use when requesting the voice_fallback_url.
491 492 493 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 491 def voice_fallback_method @properties['voice_fallback_method'] end |
#voice_fallback_url ⇒ String
Returns The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by voice_url.
497 498 499 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 497 def voice_fallback_url @properties['voice_fallback_url'] end |
#voice_method ⇒ String
Returns The HTTP method Twilio will use when requesting the above Url.
503 504 505 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 503 def voice_method @properties['voice_method'] end |
#voice_url ⇒ String
Returns The URL Twilio will request when the SIM-connected device makes a call.
509 510 511 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 509 def voice_url @properties['voice_url'] end |