Class: Telnyx::Resources::Dir::PhoneNumberBatches
- Inherits:
-
Object
- Object
- Telnyx::Resources::Dir::PhoneNumberBatches
- Defined in:
- lib/telnyx/resources/dir/phone_number_batches.rb
Overview
Phone numbers are submitted to Telnyx for vetting in batches. Batches group all numbers added in a single request under the same Letter of Authorization.
Instance Method Summary collapse
-
#initialize(client:) ⇒ PhoneNumberBatches
constructor
private
A new instance of PhoneNumberBatches.
-
#list(dir_id, filter_status: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Dir::PhoneNumberBatchListResponse>
Some parameter documentations has been truncated, see Models::Dir::PhoneNumberBatchListParams for more details.
-
#retrieve(batch_id, dir_id:, request_options: {}) ⇒ Telnyx::Models::Dir::PhoneNumberBatchRetrieveResponse
Get a single phone-number batch by id.
Constructor Details
#initialize(client:) ⇒ PhoneNumberBatches
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 PhoneNumberBatches.
78 79 80 |
# File 'lib/telnyx/resources/dir/phone_number_batches.rb', line 78 def initialize(client:) @client = client end |
Instance Method Details
#list(dir_id, filter_status: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Dir::PhoneNumberBatchListResponse>
Some parameter documentations has been truncated, see Models::Dir::PhoneNumberBatchListParams for more details.
List the phone-number batches submitted under a DIR. The enterprise is resolved server-side from the DIR id.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/telnyx/resources/dir/phone_number_batches.rb', line 58 def list(dir_id, params = {}) parsed, = Telnyx::Dir::PhoneNumberBatchListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["dir/%1$s/phone_number_batches", dir_id], query: query.transform_keys( filter_status: "filter[status]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::Dir::PhoneNumberBatchListResponse, options: ) end |
#retrieve(batch_id, dir_id:, request_options: {}) ⇒ Telnyx::Models::Dir::PhoneNumberBatchRetrieveResponse
Get a single phone-number batch by id. The enterprise is resolved server-side from the DIR id.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/telnyx/resources/dir/phone_number_batches.rb', line 23 def retrieve(batch_id, params) parsed, = Telnyx::Dir::PhoneNumberBatchRetrieveParams.dump_request(params) dir_id = parsed.delete(:dir_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["dir/%1$s/phone_number_batches/%2$s", dir_id, batch_id], model: Telnyx::Models::Dir::PhoneNumberBatchRetrieveResponse, options: ) end |