Class: Telnyx::Resources::AvailablePhoneNumbers

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

Overview

Number search

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AvailablePhoneNumbers

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

Parameters:



39
40
41
# File 'lib/telnyx/resources/available_phone_numbers.rb', line 39

def initialize(client:)
  @client = client
end

Instance Method Details

#list(filter: nil, request_options: {}) ⇒ Telnyx::Models::AvailablePhoneNumberListResponse

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

Searches the Telnyx inventory for available phone numbers. Filters support number patterns, location, number type, features, reservability, and other inventory constraints; the response includes matching numbers and search metadata.

Parameters:

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/telnyx/resources/available_phone_numbers.rb', line 24

def list(params = {})
  parsed, options = Telnyx::AvailablePhoneNumberListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "available_phone_numbers",
    query: query,
    model: Telnyx::Models::AvailablePhoneNumberListResponse,
    options: options
  )
end