Class: Telnyx::Resources::PhoneNumbers
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumbers
- Defined in:
- lib/telnyx/resources/phone_numbers.rb,
lib/telnyx/resources/phone_numbers/jobs.rb,
lib/telnyx/resources/phone_numbers/voice.rb,
lib/telnyx/resources/phone_numbers/actions.rb,
lib/telnyx/resources/phone_numbers/messaging.rb,
lib/telnyx/resources/phone_numbers/voicemail.rb,
lib/telnyx/resources/phone_numbers/csv_downloads.rb,
sig/telnyx/resources/phone_numbers.rbs,
sig/telnyx/resources/phone_numbers/jobs.rbs,
sig/telnyx/resources/phone_numbers/voice.rbs,
sig/telnyx/resources/phone_numbers/actions.rbs,
sig/telnyx/resources/phone_numbers/messaging.rbs,
sig/telnyx/resources/phone_numbers/voicemail.rbs,
sig/telnyx/resources/phone_numbers/csv_downloads.rbs
Overview
Configure your phone numbers
Defined Under Namespace
Classes: Actions, CsvDownloads, Jobs, Messaging, Voice, Voicemail
Instance Attribute Summary collapse
-
#actions ⇒ Telnyx::Resources::PhoneNumbers::Actions
readonly
Configure your phone numbers.
- #csv_downloads ⇒ Telnyx::Resources::PhoneNumbers::CsvDownloads readonly
-
#jobs ⇒ Telnyx::Resources::PhoneNumbers::Jobs
readonly
Background jobs performed over a batch of phone numbers.
-
#messaging ⇒ Telnyx::Resources::PhoneNumbers::Messaging
readonly
Configure your phone numbers.
-
#voice ⇒ Telnyx::Resources::PhoneNumbers::Voice
readonly
Configure your phone numbers.
-
#voicemail ⇒ Telnyx::Resources::PhoneNumbers::Voicemail
readonly
Voicemail API.
Instance Method Summary collapse
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberDeleteResponse
Deletes the specified phone number from the account.
-
#initialize(client:) ⇒ PhoneNumbers
constructor
private
A new instance of PhoneNumbers.
-
#list(filter: nil, handle_messaging_profile_error: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::NumbersPhoneNumberDetailed>
Some parameter documentations has been truncated, see Models::PhoneNumberListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberRetrieveResponse
Returns the detailed configuration and current state of the phone number identified by
id. -
#slim_list(filter: nil, include_connection: nil, include_tags: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumberSlimListResponse>
Some parameter documentations has been truncated, see Models::PhoneNumberSlimListParams for more details.
-
#update(phone_number_id, address_id: nil, billing_group_id: nil, connection_id: nil, customer_reference: nil, external_pin: nil, hd_voice_enabled: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumberUpdateResponse
Some parameter documentations has been truncated, see Models::PhoneNumberUpdateParams for more details.
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.
190 191 192 193 194 195 196 197 198 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 190 def initialize(client:) @client = client @actions = Telnyx::Resources::PhoneNumbers::Actions.new(client: client) @csv_downloads = Telnyx::Resources::PhoneNumbers::CsvDownloads.new(client: client) @jobs = Telnyx::Resources::PhoneNumbers::Jobs.new(client: client) @messaging = Telnyx::Resources::PhoneNumbers::Messaging.new(client: client) @voice = Telnyx::Resources::PhoneNumbers::Voice.new(client: client) @voicemail = Telnyx::Resources::PhoneNumbers::Voicemail.new(client: client) end |
Instance Attribute Details
#actions ⇒ Telnyx::Resources::PhoneNumbers::Actions (readonly)
Configure your phone numbers
9 10 11 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 9 def actions @actions end |
#csv_downloads ⇒ Telnyx::Resources::PhoneNumbers::CsvDownloads (readonly)
12 13 14 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 12 def csv_downloads @csv_downloads end |
#jobs ⇒ Telnyx::Resources::PhoneNumbers::Jobs (readonly)
Background jobs performed over a batch of phone numbers
16 17 18 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 16 def jobs @jobs end |
#messaging ⇒ Telnyx::Resources::PhoneNumbers::Messaging (readonly)
Configure your phone numbers
20 21 22 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 20 def messaging @messaging end |
#voice ⇒ Telnyx::Resources::PhoneNumbers::Voice (readonly)
Configure your phone numbers
24 25 26 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 24 def voice @voice end |
#voicemail ⇒ Telnyx::Resources::PhoneNumbers::Voicemail (readonly)
Voicemail API
28 29 30 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 28 def voicemail @voicemail end |
Instance Method Details
#delete(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberDeleteResponse
Deletes the specified phone number from the account. The response contains the phone number's final deleted representation.
140 141 142 143 144 145 146 147 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 140 def delete(id, params = {}) @client.request( method: :delete, path: ["phone_numbers/%1$s", id], model: Telnyx::Models::PhoneNumberDeleteResponse, options: params[:request_options] ) end |
#list(filter: nil, handle_messaging_profile_error: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::NumbersPhoneNumberDetailed>
Some parameter documentations has been truncated, see Models::PhoneNumberListParams for more details.
Returns phone numbers associated with the account. Results support pagination, sorting, and filters for number attributes, status, source, connections, billing groups, emergency addresses, tags, and customer references.
115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 115 def list(params = {}) parsed, = Telnyx::PhoneNumberListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "phone_numbers", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::NumbersPhoneNumberDetailed, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberRetrieveResponse
Returns the detailed configuration and current state of the phone number
identified by id.
42 43 44 45 46 47 48 49 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 42 def retrieve(id, params = {}) @client.request( method: :get, path: ["phone_numbers/%1$s", id], model: Telnyx::Models::PhoneNumberRetrieveResponse, options: params[:request_options] ) end |
#slim_list(filter: nil, include_connection: nil, include_tags: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumberSlimListResponse>
Some parameter documentations has been truncated, see Models::PhoneNumberSlimListParams for more details.
List phone numbers, This endpoint is a lighter version of the /phone_numbers endpoint having higher performance and rate limit.
174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 174 def slim_list(params = {}) parsed, = Telnyx::PhoneNumberSlimListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "phone_numbers/slim", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::PhoneNumberSlimListResponse, options: ) end |
#update(phone_number_id, address_id: nil, billing_group_id: nil, connection_id: nil, customer_reference: nil, external_pin: nil, hd_voice_enabled: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumberUpdateResponse
Some parameter documentations has been truncated, see Models::PhoneNumberUpdateParams for more details.
Updates the configurable settings of the specified phone number. The response contains the complete updated phone-number representation.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 80 def update(phone_number_id, params = {}) parsed, = Telnyx::PhoneNumberUpdateParams.dump_request(params) @client.request( method: :patch, path: ["phone_numbers/%1$s", phone_number_id], body: parsed, model: Telnyx::Models::PhoneNumberUpdateResponse, options: ) end |