Class: Telnyx::Resources::SimCards::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/sim_cards/actions.rb,
sig/telnyx/resources/sim_cards/actions.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Actions

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 Actions.

Parameters:



370
371
372
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 370

def initialize(client:)
  @client = client
end

Instance Method Details

#bulk_disable_voice(sim_card_group_id:, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionBulkDisableVoiceResponse

This API triggers an asynchronous operation to disable voice on SIM cards belonging to a specified SIM Card Group.
For each SIM Card a SIM Card Action will be generated. The status of the SIM Card Actions can be followed through the List SIM Card Action API.

The overall status of the Bulk SIM Card Action can be followed through the List Bulk SIM Card Action API.

Parameters:

Returns:

See Also:



79
80
81
82
83
84
85
86
87
88
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 79

def bulk_disable_voice(params)
  parsed, options = Telnyx::SimCards::ActionBulkDisableVoiceParams.dump_request(params)
  @client.request(
    method: :post,
    path: "sim_cards/actions/bulk_disable_voice",
    body: parsed,
    model: Telnyx::Models::SimCards::ActionBulkDisableVoiceResponse,
    options: options
  )
end

#bulk_enable_voice(sim_card_group_id:, connection_id: nil, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionBulkEnableVoiceResponse

Some parameter documentations has been truncated, see Models::SimCards::ActionBulkEnableVoiceParams for more details.

This API triggers an asynchronous operation to enable voice on SIM cards belonging to a specified SIM Card Group.
For each SIM Card a SIM Card Action will be generated. The status of the SIM Card Actions can be followed through the List SIM Card Action API.

The overall status of the Bulk SIM Card Action can be followed through the List Bulk SIM Card Action API.

Parameters:

  • sim_card_group_id (String)
  • connection_id (String)

    The identifier of the Mobile Voice Connection to associate with the SIM cards. T

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



115
116
117
118
119
120
121
122
123
124
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 115

def bulk_enable_voice(params)
  parsed, options = Telnyx::SimCards::ActionBulkEnableVoiceParams.dump_request(params)
  @client.request(
    method: :post,
    path: "sim_cards/actions/bulk_enable_voice",
    body: parsed,
    model: Telnyx::Models::SimCards::ActionBulkEnableVoiceResponse,
    options: options
  )
end

#bulk_set_public_ips(sim_card_ids:, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionBulkSetPublicIPsResponse

This API triggers an asynchronous operation to set a public IP for each of the specified SIM cards.
For each SIM Card a SIM Card Action will be generated. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Parameters:

Returns:

See Also:



140
141
142
143
144
145
146
147
148
149
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 140

def bulk_set_public_ips(params)
  parsed, options = Telnyx::SimCards::ActionBulkSetPublicIPsParams.dump_request(params)
  @client.request(
    method: :post,
    path: "sim_cards/actions/bulk_set_public_ips",
    body: parsed,
    model: Telnyx::Models::SimCards::ActionBulkSetPublicIPsResponse,
    options: options
  )
end

#disable(id, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionDisableResponse

This API disables a SIM card, disconnecting it from the network and making it impossible to consume data.
The API will trigger an asynchronous operation called a SIM Card Action. Transitioning to the disabled state may take a period of time. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Parameters:

Returns:

See Also:



167
168
169
170
171
172
173
174
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 167

def disable(id, params = {})
  @client.request(
    method: :post,
    path: ["sim_cards/%1$s/actions/disable", id],
    model: Telnyx::Models::SimCards::ActionDisableResponse,
    options: params[:request_options]
  )
end

#disable_voice(id, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionDisableVoiceResponse

This API disables voice calling on a SIM card. The SIM card will no longer be able to make or receive calls.
The API will trigger an asynchronous operation called a SIM Card Action. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Parameters:

Returns:

See Also:



192
193
194
195
196
197
198
199
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 192

def disable_voice(id, params = {})
  @client.request(
    method: :post,
    path: ["sim_cards/%1$s/actions/disable_voice", id],
    model: Telnyx::Models::SimCards::ActionDisableVoiceResponse,
    options: params[:request_options]
  )
end

#enable(id, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionEnableResponse

This API enables a SIM card, connecting it to the network and making it possible to consume data.
To enable a SIM card, it must be associated with a SIM card group.
The API will trigger an asynchronous operation called a SIM Card Action. Transitioning to the enabled state may take a period of time. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Parameters:

Returns:

See Also:



218
219
220
221
222
223
224
225
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 218

def enable(id, params = {})
  @client.request(
    method: :post,
    path: ["sim_cards/%1$s/actions/enable", id],
    model: Telnyx::Models::SimCards::ActionEnableResponse,
    options: params[:request_options]
  )
end

#enable_voice(id, connection_id: nil, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionEnableVoiceResponse

Some parameter documentations has been truncated, see Models::SimCards::ActionEnableVoiceParams for more details.

This API enables voice calling on a SIM card. When a connection_id is provided, the SIM is associated with the specified Mobile Voice Connection. The connection must be owned by the same user and of type mobile_voice.
The API will trigger an asynchronous operation called a SIM Card Action. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Parameters:

  • id (String)

    Identifies the SIM.

  • connection_id (String)

    The identifier of the Mobile Voice Connection to associate with this SIM card. T

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



250
251
252
253
254
255
256
257
258
259
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 250

def enable_voice(id, params = {})
  parsed, options = Telnyx::SimCards::ActionEnableVoiceParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["sim_cards/%1$s/actions/enable_voice", id],
    body: parsed,
    model: Telnyx::Models::SimCards::ActionEnableVoiceResponse,
    options: options
  )
end

#list(filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::SimCards::WirelessSimCardAction>

Some parameter documentations has been truncated, see Models::SimCards::ActionListParams for more details.

This API lists a paginated collection of SIM card actions. It enables exploring a collection of existing asynchronous operations using specific filters.

Parameters:

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 47

def list(params = {})
  parsed, options = Telnyx::SimCards::ActionListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "sim_card_actions",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::SimCards::WirelessSimCardAction,
    options: options
  )
end

#remove_public_ip(id, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionRemovePublicIPResponse

This API removes an existing public IP from a SIM card.

The API will trigger an asynchronous operation called a SIM Card Action. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Parameters:

Returns:

See Also:



276
277
278
279
280
281
282
283
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 276

def remove_public_ip(id, params = {})
  @client.request(
    method: :post,
    path: ["sim_cards/%1$s/actions/remove_public_ip", id],
    model: Telnyx::Models::SimCards::ActionRemovePublicIPResponse,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionRetrieveResponse

This API fetches detailed information about a SIM card action to follow-up on an existing asynchronous operation.

Parameters:

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 19

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["sim_card_actions/%1$s", id],
    model: Telnyx::Models::SimCards::ActionRetrieveResponse,
    options: params[:request_options]
  )
end

#set_public_ip(id, region_code: nil, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionSetPublicIPResponse

Some parameter documentations has been truncated, see Models::SimCards::ActionSetPublicIPParams for more details.

This API makes a SIM card reachable on the public internet by mapping a random public IP to the SIM card.

The API will trigger an asynchronous operation called a SIM Card Action. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Setting a Public IP to a SIM Card incurs a charge and will only succeed if the account has sufficient funds.

Parameters:

  • id (String)

    Identifies the SIM.

  • region_code (String)

    The code of the region where the public IP should be assigned. A list of availab

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



307
308
309
310
311
312
313
314
315
316
317
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 307

def set_public_ip(id, params = {})
  parsed, options = Telnyx::SimCards::ActionSetPublicIPParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :post,
    path: ["sim_cards/%1$s/actions/set_public_ip", id],
    query: query,
    model: Telnyx::Models::SimCards::ActionSetPublicIPResponse,
    options: options
  )
end

#set_standby(id, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionSetStandbyResponse

The SIM card will be able to connect to the network once the process to set it to standby has been completed, thus making it possible to consume data.
To set a SIM card to standby, it must be associated with SIM card group.
The API will trigger an asynchronous operation called a SIM Card Action. Transitioning to the standby state may take a period of time. The status of the SIM Card Action can be followed through the List SIM Card Action API.

Parameters:

Returns:

See Also:



337
338
339
340
341
342
343
344
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 337

def set_standby(id, params = {})
  @client.request(
    method: :post,
    path: ["sim_cards/%1$s/actions/set_standby", id],
    model: Telnyx::Models::SimCards::ActionSetStandbyResponse,
    options: params[:request_options]
  )
end

#validate_registration_codes(registration_codes: nil, request_options: {}) ⇒ Telnyx::Models::SimCards::ActionValidateRegistrationCodesResponse

It validates whether SIM card registration codes are valid or not.

Parameters:

Returns:

See Also:



356
357
358
359
360
361
362
363
364
365
# File 'lib/telnyx/resources/sim_cards/actions.rb', line 356

def validate_registration_codes(params = {})
  parsed, options = Telnyx::SimCards::ActionValidateRegistrationCodesParams.dump_request(params)
  @client.request(
    method: :post,
    path: "sim_cards/actions/validate_registration_codes",
    body: parsed,
    model: Telnyx::Models::SimCards::ActionValidateRegistrationCodesResponse,
    options: options
  )
end