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 SID of the [Account](www.twilio.com/docs/iam/api/account) to which the Sim resource belongs.
-
#commands_callback_method ⇒ String
The HTTP method we use to call
commands_callback_url. -
#commands_callback_url ⇒ String
The URL we call using the
commands_callback_methodwhen the SIM originates a machine-to-machine [Command](www.twilio.com/docs/iot/wireless/api/command-resource). -
#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 and time in GMT when the resource was created specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
-
#date_updated ⇒ Time
The date and time in GMT when the Sim resource was last updated specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
-
#delete ⇒ Boolean
Delete the SimInstance.
-
#e_id ⇒ String
Deprecated.
-
#fetch ⇒ SimInstance
Fetch the SimInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the Sim resource.
-
#iccid ⇒ String
The [ICCID](en.wikipedia.org/wiki/SIM_card#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
Deprecated.
-
#links ⇒ Hash
The URLs of related subresources.
-
#rate_plan_sid ⇒ String
The SID of the [RatePlan resource](www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource is assigned.
- #reset_status ⇒ ResetStatus
-
#sid ⇒ String
The unique string that we created to identify the Sim resource.
-
#sms_fallback_method ⇒ String
Deprecated.
-
#sms_fallback_url ⇒ String
Deprecated.
-
#sms_method ⇒ String
Deprecated.
-
#sms_url ⇒ String
Deprecated.
- #status ⇒ Status
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
An application-defined string that uniquely identifies the resource.
-
#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) ⇒ SimInstance
Update the SimInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#usage_records ⇒ usage_records
Access the usage_records.
-
#voice_fallback_method ⇒ String
Deprecated.
-
#voice_fallback_url ⇒ String
Deprecated.
-
#voice_method ⇒ String
Deprecated.
-
#voice_url ⇒ String
Deprecated.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ SimInstance
Initialize the SimInstance
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 631 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 SID of the [Account](www.twilio.com/docs/iam/api/account) to which the Sim resource belongs.
693 694 695 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 693 def account_sid @properties['account_sid'] end |
#commands_callback_method ⇒ String
Returns The HTTP method we use to call commands_callback_url. Can be: POST or GET. Default is POST.
741 742 743 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 741 def commands_callback_method @properties['commands_callback_method'] end |
#commands_callback_url ⇒ String
Returns The URL we call using the commands_callback_method when the SIM originates a machine-to-machine [Command](www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body will be ignored.
735 736 737 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 735 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
672 673 674 675 676 677 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 672 def context unless @instance_context @instance_context = SimContext.new(@version , @params['sid']) end @instance_context end |
#data_sessions ⇒ data_sessions
Access the data_sessions
906 907 908 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 906 def data_sessions context.data_sessions end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
795 796 797 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 795 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Sim resource was last updated specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
801 802 803 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 801 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the SimInstance
826 827 828 829 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 826 def delete context.delete end |
#e_id ⇒ String
Returns Deprecated.
717 718 719 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 717 def e_id @properties['e_id'] end |
#fetch ⇒ SimInstance
Fetch the SimInstance
834 835 836 837 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 834 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Sim resource.
705 706 707 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 705 def friendly_name @properties['friendly_name'] end |
#iccid ⇒ String
Returns The [ICCID](en.wikipedia.org/wiki/SIM_card#ICCID) associated with the SIM.
711 712 713 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 711 def iccid @properties['iccid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
926 927 928 929 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 926 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.SimInstance #{values}>" end |
#ip_address ⇒ String
Returns Deprecated.
819 820 821 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 819 def ip_address @properties['ip_address'] end |
#links ⇒ Hash
Returns The URLs of related subresources.
813 814 815 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 813 def links @properties['links'] end |
#rate_plan_sid ⇒ String
Returns The SID of the [RatePlan resource](www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource is assigned.
699 700 701 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 699 def rate_plan_sid @properties['rate_plan_sid'] end |
#reset_status ⇒ ResetStatus
729 730 731 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 729 def reset_status @properties['reset_status'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Sim resource.
681 682 683 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 681 def sid @properties['sid'] end |
#sms_fallback_method ⇒ String
Returns Deprecated.
747 748 749 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 747 def sms_fallback_method @properties['sms_fallback_method'] end |
#sms_fallback_url ⇒ String
Returns Deprecated.
753 754 755 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 753 def sms_fallback_url @properties['sms_fallback_url'] end |
#sms_method ⇒ String
Returns Deprecated.
759 760 761 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 759 def sms_method @properties['sms_method'] end |
#sms_url ⇒ String
Returns Deprecated.
765 766 767 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 765 def sms_url @properties['sms_url'] end |
#status ⇒ Status
723 724 725 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 723 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
919 920 921 922 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 919 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.SimInstance #{values}>" end |
#unique_name ⇒ String
Returns An application-defined string that uniquely identifies the resource. It can be used in place of the resource’s sid in the URL to address the resource.
687 688 689 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 687 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, account_sid: :unset) ⇒ SimInstance
Update the SimInstance
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 860 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 ) 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, account_sid: account_sid, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
807 808 809 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 807 def url @properties['url'] end |
#usage_records ⇒ usage_records
Access the usage_records
913 914 915 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 913 def usage_records context.usage_records end |
#voice_fallback_method ⇒ String
Returns Deprecated. The HTTP method we use to call voice_fallback_url. Can be: GET or POST. Default is POST.
771 772 773 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 771 def voice_fallback_method @properties['voice_fallback_method'] end |
#voice_fallback_url ⇒ String
Returns Deprecated. The URL we call using the voice_fallback_method when an error occurs while retrieving or executing the TwiML requested from voice_url.
777 778 779 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 777 def voice_fallback_url @properties['voice_fallback_url'] end |
#voice_method ⇒ String
Returns Deprecated. The HTTP method we use to call voice_url. Can be: GET or POST. Default is POST.
783 784 785 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 783 def voice_method @properties['voice_method'] end |
#voice_url ⇒ String
Returns Deprecated. The URL we call using the voice_method when the SIM-connected device makes a voice call.
789 790 791 |
# File 'lib/twilio-ruby/rest/wireless/v1/sim.rb', line 789 def voice_url @properties['voice_url'] end |