Class: Telnyx::Resources::SimCards
- Inherits:
-
Object
- Object
- Telnyx::Resources::SimCards
- Defined in:
- lib/telnyx/resources/sim_cards.rb,
lib/telnyx/resources/sim_cards/actions.rb
Overview
SIM Cards operations
Defined Under Namespace
Classes: Actions
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#delete(id, report_lost: nil, request_options: {}) ⇒ Telnyx::Models::SimCardDeleteResponse
Some parameter documentations has been truncated, see Models::SimCardDeleteParams for more details.
-
#get_activation_code(id, request_options: {}) ⇒ Telnyx::Models::SimCardGetActivationCodeResponse
It returns the activation code for an eSIM.<br/><br/> This API is only available for eSIMs.
-
#get_device_details(id, request_options: {}) ⇒ Telnyx::Models::SimCardGetDeviceDetailsResponse
It returns the device details where a SIM card is currently being used.
-
#get_public_ip(id, request_options: {}) ⇒ Telnyx::Models::SimCardGetPublicIPResponse
It returns the public IP requested for a SIM card.
-
#initialize(client:) ⇒ SimCards
constructor
private
A new instance of SimCards.
-
#list(filter: nil, filter_sim_card_group_id: nil, include_sim_card_group: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::SimpleSimCard>
Some parameter documentations has been truncated, see Models::SimCardListParams for more details.
-
#list_wireless_connectivity_logs(id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::SimCardListWirelessConnectivityLogsResponse>
This API allows listing a paginated collection of Wireless Connectivity Logs associated with a SIM Card, for troubleshooting purposes.
-
#retrieve(id, include_pin_puk_codes: nil, include_sim_card_group: nil, request_options: {}) ⇒ Telnyx::Models::SimCardRetrieveResponse
Some parameter documentations has been truncated, see Models::SimCardRetrieveParams for more details.
-
#update(sim_card_id, authorized_imeis: nil, data_limit: nil, sim_card_group_id: nil, status: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::SimCardUpdateResponse
Some parameter documentations has been truncated, see Models::SimCardUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ SimCards
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SimCards.
244 245 246 247 |
# File 'lib/telnyx/resources/sim_cards.rb', line 244 def initialize(client:) @client = client @actions = Telnyx::Resources::SimCards::Actions.new(client: client) end |
Instance Attribute Details
#actions ⇒ Telnyx::Resources::SimCards::Actions (readonly)
8 9 10 |
# File 'lib/telnyx/resources/sim_cards.rb', line 8 def actions @actions end |
Instance Method Details
#delete(id, report_lost: nil, request_options: {}) ⇒ Telnyx::Models::SimCardDeleteResponse
Some parameter documentations has been truncated, see Models::SimCardDeleteParams for more details.
The SIM card will be decommissioned, removed from your account and you will stop being charged.<br />The SIM card won’t be able to connect to the network after the deletion is completed, thus making it impossible to consume data.<br/> Transitioning to the disabled state may take a period of time. Until the transition is completed, the SIM card status will be disabling disabling.<br />In order to re-enable the SIM card, you will need to re-register it.
138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/telnyx/resources/sim_cards.rb', line 138 def delete(id, params = {}) parsed, = Telnyx::SimCardDeleteParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["sim_cards/%1$s", id], query: query, model: Telnyx::Models::SimCardDeleteResponse, options: ) end |
#get_activation_code(id, request_options: {}) ⇒ Telnyx::Models::SimCardGetActivationCodeResponse
It returns the activation code for an eSIM.<br/><br/> This API is only available for eSIMs. If the given SIM is a physical SIM card, or has already been installed, an error will be returned.
163 164 165 166 167 168 169 170 |
# File 'lib/telnyx/resources/sim_cards.rb', line 163 def get_activation_code(id, params = {}) @client.request( method: :get, path: ["sim_cards/%1$s/activation_code", id], model: Telnyx::Models::SimCardGetActivationCodeResponse, options: params[:request_options] ) end |
#get_device_details(id, request_options: {}) ⇒ Telnyx::Models::SimCardGetDeviceDetailsResponse
It returns the device details where a SIM card is currently being used.
183 184 185 186 187 188 189 190 |
# File 'lib/telnyx/resources/sim_cards.rb', line 183 def get_device_details(id, params = {}) @client.request( method: :get, path: ["sim_cards/%1$s/device_details", id], model: Telnyx::Models::SimCardGetDeviceDetailsResponse, options: params[:request_options] ) end |
#get_public_ip(id, request_options: {}) ⇒ Telnyx::Models::SimCardGetPublicIPResponse
It returns the public IP requested for a SIM card.
203 204 205 206 207 208 209 210 |
# File 'lib/telnyx/resources/sim_cards.rb', line 203 def get_public_ip(id, params = {}) @client.request( method: :get, path: ["sim_cards/%1$s/public_ip", id], model: Telnyx::Models::SimCardGetPublicIPResponse, options: params[:request_options] ) end |
#list(filter: nil, filter_sim_card_group_id: nil, include_sim_card_group: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::SimpleSimCard>
Some parameter documentations has been truncated, see Models::SimCardListParams for more details.
Get all SIM cards belonging to the user that match the given filters.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/telnyx/resources/sim_cards.rb', line 99 def list(params = {}) parsed, = Telnyx::SimCardListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "sim_cards", query: query.transform_keys( filter_sim_card_group_id: "filter[sim_card_group_id]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::SimpleSimCard, options: ) end |
#list_wireless_connectivity_logs(id, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::SimCardListWirelessConnectivityLogsResponse>
This API allows listing a paginated collection of Wireless Connectivity Logs associated with a SIM Card, for troubleshooting purposes.
228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/telnyx/resources/sim_cards.rb', line 228 def list_wireless_connectivity_logs(id, params = {}) parsed, = Telnyx::SimCardListWirelessConnectivityLogsParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["sim_cards/%1$s/wireless_connectivity_logs", id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::SimCardListWirelessConnectivityLogsResponse, options: ) end |
#retrieve(id, include_pin_puk_codes: nil, include_sim_card_group: nil, request_options: {}) ⇒ Telnyx::Models::SimCardRetrieveResponse
Some parameter documentations has been truncated, see Models::SimCardRetrieveParams for more details.
Returns the details regarding a specific SIM card.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/telnyx/resources/sim_cards.rb', line 28 def retrieve(id, params = {}) parsed, = Telnyx::SimCardRetrieveParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["sim_cards/%1$s", id], query: query, model: Telnyx::Models::SimCardRetrieveResponse, options: ) end |
#update(sim_card_id, authorized_imeis: nil, data_limit: nil, sim_card_group_id: nil, status: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::SimCardUpdateResponse
Some parameter documentations has been truncated, see Models::SimCardUpdateParams for more details.
Updates SIM card data
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/telnyx/resources/sim_cards.rb', line 64 def update(sim_card_id, params = {}) parsed, = Telnyx::SimCardUpdateParams.dump_request(params) @client.request( method: :patch, path: ["sim_cards/%1$s", sim_card_id], body: parsed, model: Telnyx::Models::SimCardUpdateResponse, options: ) end |