Class: Telnyx::Resources::PortingOrders::PhoneNumberConfigurations

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

Overview

Endpoints related to porting orders management.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PhoneNumberConfigurations

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

Parameters:



66
67
68
# File 'lib/telnyx/resources/porting_orders/phone_number_configurations.rb', line 66

def initialize(client:)
  @client = client
end

Instance Method Details

#create(phone_number_configurations: nil, request_options: {}) ⇒ Telnyx::Models::PortingOrders::PhoneNumberConfigurationCreateResponse

Creates a list of phone number configurations.



18
19
20
21
22
23
24
25
26
27
# File 'lib/telnyx/resources/porting_orders/phone_number_configurations.rb', line 18

def create(params = {})
  parsed, options = Telnyx::PortingOrders::PhoneNumberConfigurationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "porting_orders/phone_number_configurations",
    body: parsed,
    model: Telnyx::Models::PortingOrders::PhoneNumberConfigurationCreateResponse,
    options: options
  )
end

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

Some parameter documentations has been truncated, see Models::PortingOrders::PhoneNumberConfigurationListParams for more details.

Returns a list of phone number configurations paginated.

Parameters:

Returns:

See Also:



50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/telnyx/resources/porting_orders/phone_number_configurations.rb', line 50

def list(params = {})
  parsed, options = Telnyx::PortingOrders::PhoneNumberConfigurationListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "porting_orders/phone_number_configurations",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::PortingOrders::PhoneNumberConfigurationListResponse,
    options: options
  )
end