Class: Telnyx::Resources::SimCardDataUsageNotifications

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/sim_card_data_usage_notifications.rb

Overview

SIM Cards operations

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SimCardDataUsageNotifications

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

Parameters:



133
134
135
# File 'lib/telnyx/resources/sim_card_data_usage_notifications.rb', line 133

def initialize(client:)
  @client = client
end

Instance Method Details

#create(sim_card_id:, threshold:, request_options: {}) ⇒ Telnyx::Models::SimCardDataUsageNotificationCreateResponse

Creates a new SIM card data usage notification.

Parameters:

Returns:

See Also:



20
21
22
23
24
25
26
27
28
29
# File 'lib/telnyx/resources/sim_card_data_usage_notifications.rb', line 20

def create(params)
  parsed, options = Telnyx::SimCardDataUsageNotificationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "sim_card_data_usage_notifications",
    body: parsed,
    model: Telnyx::Models::SimCardDataUsageNotificationCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::SimCardDataUsageNotificationDeleteResponse

Delete the SIM Card Data Usage Notification.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



121
122
123
124
125
126
127
128
# File 'lib/telnyx/resources/sim_card_data_usage_notifications.rb', line 121

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["sim_card_data_usage_notifications/%1$s", id],
    model: Telnyx::Models::SimCardDataUsageNotificationDeleteResponse,
    options: params[:request_options]
  )
end

#list(filter_sim_card_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::SimCardDataUsageNotification>

Lists a paginated collection of SIM card data usage notifications. It enables exploring the collection using specific filters.

Parameters:

  • filter_sim_card_id (String)

    A valid SIM card ID.

  • page_number (Integer)

    The page number to load.

  • page_size (Integer)

    The size of the page.

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

Returns:

See Also:



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/telnyx/resources/sim_card_data_usage_notifications.rb', line 93

def list(params = {})
  parsed, options = Telnyx::SimCardDataUsageNotificationListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "sim_card_data_usage_notifications",
    query: query.transform_keys(
      filter_sim_card_id: "filter[sim_card_id]",
      page_number: "page[number]",
      page_size: "page[size]"
    ),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::SimCardDataUsageNotification,
    options: options
  )
end

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

Get a single SIM Card Data Usage Notification.

Parameters:

  • id (String)

    Identifies the resource.

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

Returns:

See Also:



42
43
44
45
46
47
48
49
# File 'lib/telnyx/resources/sim_card_data_usage_notifications.rb', line 42

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

#update(sim_card_data_usage_notification_id, sim_card_id: nil, threshold: nil, request_options: {}) ⇒ Telnyx::Models::SimCardDataUsageNotificationUpdateResponse

Updates information for a SIM Card Data Usage Notification.

Parameters:

Returns:

See Also:



66
67
68
69
70
71
72
73
74
75
# File 'lib/telnyx/resources/sim_card_data_usage_notifications.rb', line 66

def update(sim_card_data_usage_notification_id, params = {})
  parsed, options = Telnyx::SimCardDataUsageNotificationUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["sim_card_data_usage_notifications/%1$s", sim_card_data_usage_notification_id],
    body: parsed,
    model: Telnyx::Models::SimCardDataUsageNotificationUpdateResponse,
    options: options
  )
end