Class: Telnyx::Resources::ExternalConnections::PhoneNumbers
- Inherits:
-
Object
- Object
- Telnyx::Resources::ExternalConnections::PhoneNumbers
- Defined in:
- lib/telnyx/resources/external_connections/phone_numbers.rb
Overview
External Connections operations
Instance Method Summary collapse
-
#initialize(client:) ⇒ PhoneNumbers
constructor
private
A new instance of PhoneNumbers.
-
#list(id, filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ExternalConnections::ExternalConnectionPhoneNumber>
Some parameter documentations has been truncated, see Models::ExternalConnections::PhoneNumberListParams for more details.
-
#retrieve(phone_number_id, id:, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::PhoneNumberRetrieveResponse
Return the details of a phone number associated with the given external connection.
-
#update(phone_number_id, id:, location_id: nil, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::PhoneNumberUpdateResponse
Asynchronously update settings of the phone number associated with the given external connection.
Constructor Details
#initialize(client:) ⇒ PhoneNumbers
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 PhoneNumbers.
104 105 106 |
# File 'lib/telnyx/resources/external_connections/phone_numbers.rb', line 104 def initialize(client:) @client = client end |
Instance Method Details
#list(id, filter: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::ExternalConnections::ExternalConnectionPhoneNumber>
Some parameter documentations has been truncated, see Models::ExternalConnections::PhoneNumberListParams for more details.
Returns a list of all active phone numbers associated with the given external connection.
88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/telnyx/resources/external_connections/phone_numbers.rb', line 88 def list(id, params = {}) parsed, = Telnyx::ExternalConnections::PhoneNumberListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["external_connections/%1$s/phone_numbers", id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::ExternalConnections::ExternalConnectionPhoneNumber, options: ) end |
#retrieve(phone_number_id, id:, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::PhoneNumberRetrieveResponse
Return the details of a phone number associated with the given external connection.
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/telnyx/resources/external_connections/phone_numbers.rb', line 22 def retrieve(phone_number_id, params) parsed, = Telnyx::ExternalConnections::PhoneNumberRetrieveParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["external_connections/%1$s/phone_numbers/%2$s", id, phone_number_id], model: Telnyx::Models::ExternalConnections::PhoneNumberRetrieveResponse, options: ) end |
#update(phone_number_id, id:, location_id: nil, request_options: {}) ⇒ Telnyx::Models::ExternalConnections::PhoneNumberUpdateResponse
Asynchronously update settings of the phone number associated with the given external connection.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/telnyx/resources/external_connections/phone_numbers.rb', line 52 def update(phone_number_id, params) parsed, = Telnyx::ExternalConnections::PhoneNumberUpdateParams.dump_request(params) id = parsed.delete(:id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["external_connections/%1$s/phone_numbers/%2$s", id, phone_number_id], body: parsed, model: Telnyx::Models::ExternalConnections::PhoneNumberUpdateResponse, options: ) end |