Class: Telnyx::SimCard

Inherits:
APIResource show all
Extended by:
APIOperations::List, APIOperations::NestedResource
Includes:
APIOperations::Save
Defined in:
lib/telnyx/sim_card.rb

Constant Summary collapse

ACTIONS =
%w[enable disable set_standby public_ip wireless_connectivity_logs device_details set_public_ip set_network_preferences remove_public_ip delete_network_preferences].freeze
OBJECT_NAME =
"sim_card".freeze

Instance Attribute Summary

Attributes inherited from APIResource

#save_with_parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::NestedResource

nested_resource_class_methods

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

Methods inherited from APIResource

class_name, identified_resource_url, inherited, #refresh, resource_url, #resource_url, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from TelnyxObject

#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Telnyx::TelnyxObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Telnyx::TelnyxObject

Class Method Details

.bulk_set_public_ips(params = {}, opts = {}) ⇒ Object

Additional action to bulk_set_public_ips



38
39
40
41
42
# File 'lib/telnyx/sim_card.rb', line 38

def self.bulk_set_public_ips(params = {}, opts = {})
  opts = Util.normalize_opts(opts)
  resp, opts = request(:post, "/v2/sim_cards/actions/bulk_set_public_ips", params, opts)
  Util.convert_to_telnyx_object(resp.data, opts)
end

.network_preferences(params = {}, opts = {}) ⇒ Object



44
45
46
47
# File 'lib/telnyx/sim_card.rb', line 44

def self.network_preferences(params = {}, opts = {})
  resp, opts = request(:put, "/v2/actions/network_preferences/sim_cards", params, opts)
  Util.convert_to_telnyx_object(resp.data, opts)
end

.register(params = {}, opts = {}) ⇒ Object



25
26
27
28
# File 'lib/telnyx/sim_card.rb', line 25

def self.register(params = {}, opts = {})
  resp, opts = request(:post, "/v2/actions/register/sim_cards", params, opts)
  Util.convert_to_telnyx_object(resp.data, opts)
end

.retrieve(id, params = {}, opts = {}) ⇒ Object



49
50
51
52
# File 'lib/telnyx/sim_card.rb', line 49

def self.retrieve(id, params = {}, opts = {})
  resp, opts = request(:get, "/v2/sim_cards/#{id}", params, opts)
  Util.convert_to_telnyx_object(resp.data, opts)
end

.validate_registration_codes(params = {}, opts = {}) ⇒ Object

Additional action to validate registration codes



31
32
33
34
35
# File 'lib/telnyx/sim_card.rb', line 31

def self.validate_registration_codes(params = {}, opts = {})
  opts = Util.normalize_opts(opts)
  resp, opts = request(:post, "/v2/sim_cards/actions/validate_registration_codes", params, opts)
  Util.convert_to_telnyx_object(resp.data, opts)
end

Instance Method Details

#activateObject



54
55
56
57
# File 'lib/telnyx/sim_card.rb', line 54

def activate
  warn "[DEPRECATION] SimCard#activate is deprecated, use enable instead."
  enable
end

#deactivateObject



59
60
61
62
# File 'lib/telnyx/sim_card.rb', line 59

def deactivate
  warn "[DEPRECATION] SimCard#deactivate is deprecated, use enable instead."
  disable
end