class Twilio::REST::Wireless::V1::SimInstance
Public Class Methods
Initialize the SimInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The SID or the `unique_name` of the Sim resource to fetch. @return [SimInstance] SimInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 352 def initialize(version, payload, sid: nil) 353 super(version) 354 355 # Marshaled Properties 356 @properties = { 357 'sid' => payload['sid'], 358 'unique_name' => payload['unique_name'], 359 'account_sid' => payload['account_sid'], 360 'rate_plan_sid' => payload['rate_plan_sid'], 361 'friendly_name' => payload['friendly_name'], 362 'iccid' => payload['iccid'], 363 'e_id' => payload['e_id'], 364 'status' => payload['status'], 365 'reset_status' => payload['reset_status'], 366 'commands_callback_url' => payload['commands_callback_url'], 367 'commands_callback_method' => payload['commands_callback_method'], 368 'sms_fallback_method' => payload['sms_fallback_method'], 369 'sms_fallback_url' => payload['sms_fallback_url'], 370 'sms_method' => payload['sms_method'], 371 'sms_url' => payload['sms_url'], 372 'voice_fallback_method' => payload['voice_fallback_method'], 373 'voice_fallback_url' => payload['voice_fallback_url'], 374 'voice_method' => payload['voice_method'], 375 'voice_url' => payload['voice_url'], 376 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 377 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 378 'url' => payload['url'], 379 'links' => payload['links'], 380 'ip_address' => payload['ip_address'], 381 } 382 383 # Context 384 @instance_context = nil 385 @params = {'sid' => sid || @properties['sid'], } 386 end
Public Instance Methods
@return [String] The SID of the Account to which the Sim resource belongs
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 413 def account_sid 414 @properties['account_sid'] 415 end
@return [String] The HTTP
method we use to call commands_callback_url
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 461 def commands_callback_method 462 @properties['commands_callback_method'] 463 end
@return [String] The URL we call when the SIM originates a machine-to-machine Command
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 455 def commands_callback_url 456 @properties['commands_callback_url'] 457 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SimContext] SimContext
for this SimInstance
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 392 def context 393 unless @instance_context 394 @instance_context = SimContext.new(@version, @params['sid'], ) 395 end 396 @instance_context 397 end
Access the data_sessions
@return [data_sessions] data_sessions
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 646 def data_sessions 647 context.data_sessions 648 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 515 def date_created 516 @properties['date_created'] 517 end
@return [Time] The ISO 8601 date and time in GMT when the Sim resource was last updated
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 521 def date_updated 522 @properties['date_updated'] 523 end
Delete the SimInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 632 def delete 633 context.delete 634 end
@return [String] Deprecated
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 437 def e_id 438 @properties['e_id'] 439 end
Fetch the SimInstance
@return [SimInstance] Fetched SimInstance
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 546 def fetch 547 context.fetch 548 end
@return [String] The string that you assigned to describe the Sim resource
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 425 def friendly_name 426 @properties['friendly_name'] 427 end
@return [String] The ICCID associated with the SIM
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 431 def iccid 432 @properties['iccid'] 433 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 659 def inspect 660 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 661 "<Twilio.Wireless.V1.SimInstance #{values}>" 662 end
@return [String] Deprecated
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 539 def ip_address 540 @properties['ip_address'] 541 end
@return [String] The URLs of related subresources
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 533 def links 534 @properties['links'] 535 end
@return [String] The SID of the RatePlan resource to which the Sim resource is assigned.
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 419 def rate_plan_sid 420 @properties['rate_plan_sid'] 421 end
@return [sim.ResetStatus] The connectivity reset status of the SIM
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 449 def reset_status 450 @properties['reset_status'] 451 end
@return [String] The unique string that identifies the Sim resource
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 401 def sid 402 @properties['sid'] 403 end
@return [String] The HTTP
method we use to call sms_fallback_url
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 467 def sms_fallback_method 468 @properties['sms_fallback_method'] 469 end
@return [String] The URL we call when the SIM-connected device sends an SMS message that is not a Command
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 485 def sms_url 486 @properties['sms_url'] 487 end
@return [sim.Status] The status of the Sim resource
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 443 def status 444 @properties['status'] 445 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 652 def to_s 653 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 654 "<Twilio.Wireless.V1.SimInstance #{values}>" 655 end
@return [String] An application-defined string that uniquely identifies the resource
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 407 def unique_name 408 @properties['unique_name'] 409 end
Update the SimInstance
@param [String] unique_name
An application-defined string that uniquely
identifies the resource. It can be used in place of the `sid` in the URL path to address the resource.
@param [String] callback_method The HTTP
method we should use to call
`callback_url`. Can be: `POST` or `GET`. The default is `POST`.
@param [String] callback_url The URL we should call using the `callback_url`
when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`).
@param [String] friendly_name
A descriptive string that you create to describe
the Sim resource. It does not need to be unique.
@param [String] rate_plan The SID or unique name of the {RatePlan
resource}[https://www.twilio.com/docs/wireless/api/rateplan-resource] to which the Sim resource should be assigned.
@param [sim.Status] status The new status of the Sim resource. Can be: `ready`,
`active`, `suspended`, or `deactivated`.
@param [String] commands_callback_method
The HTTP
method we should use to call
`commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`.
@param [String] commands_callback_url
The URL we should call using the
`commands_callback_method` when the SIM sends a {Command}[https://www.twilio.com/docs/wireless/api/command-resource]. Your server should respond with an HTTP status code in the 200 range; any response body is ignored.
@param [String] sms_fallback_method
The HTTP
method we should use to call
`sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`.
@param [String] sms_fallback_url
The URL we should call using the
`sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`.
@param [String] sms_method
The HTTP
method we should use to call `sms_url`. Can
be: `GET` or `POST`. Default is `POST`.
@param [String] sms_url
The URL we should call using the `sms_method` when the
SIM-connected device sends an SMS message that is not a {Command}[https://www.twilio.com/docs/wireless/api/command-resource].
@param [String] voice_fallback_method
The HTTP
method we should use to call
`voice_fallback_url`. Can be: `GET` or `POST`.
@param [String] voice_fallback_url
The URL we should call using the
`voice_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `voice_url`.
@param [String] voice_method
The HTTP
method we should use when we call
`voice_url`. Can be: `GET` or `POST`.
@param [String] voice_url
The URL we should call using the `voice_method` when
the SIM-connected device makes a voice call.
@param [sim.ResetStatus] reset_status
Initiate a connectivity reset on the SIM.
Set to `resetting` to initiate a connectivity reset on the SIM. No other value is valid.
@param [String] account_sid
The SID of the
{Account}[https://www.twilio.com/docs/iam/api/account] to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a {Subaccount}[https://www.twilio.com/docs/iam/api/subaccounts] of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the {Move SIMs between Subaccounts documentation}[https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts].
@return [SimInstance] Updated SimInstance
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 606 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, account_sid: :unset) 607 context.update( 608 unique_name: unique_name, 609 callback_method: callback_method, 610 callback_url: callback_url, 611 friendly_name: friendly_name, 612 rate_plan: rate_plan, 613 status: status, 614 commands_callback_method: commands_callback_method, 615 commands_callback_url: commands_callback_url, 616 sms_fallback_method: sms_fallback_method, 617 sms_fallback_url: sms_fallback_url, 618 sms_method: sms_method, 619 sms_url: sms_url, 620 voice_fallback_method: voice_fallback_method, 621 voice_fallback_url: voice_fallback_url, 622 voice_method: voice_method, 623 voice_url: voice_url, 624 reset_status: reset_status, 625 account_sid: account_sid, 626 ) 627 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 527 def url 528 @properties['url'] 529 end
Access the usage_records
@return [usage_records] usage_records
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 639 def usage_records 640 context.usage_records 641 end
@return [String] The HTTP
method we use to call voice_fallback_url
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 491 def voice_fallback_method 492 @properties['voice_fallback_method'] 493 end
@return [String] The URL we call when the SIM-connected device makes a voice call
# File lib/twilio-ruby/rest/wireless/v1/sim.rb 509 def voice_url 510 @properties['voice_url'] 511 end