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
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
Delete a phone number.
-
#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::PhoneNumberDetailed>
Some parameter documentations has been truncated, see Models::PhoneNumberListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberRetrieveResponse
Retrieve a phone number.
-
#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.
185 186 187 188 189 190 191 192 193 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 185 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
Delete a phone number
135 136 137 138 139 140 141 142 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 135 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::PhoneNumberDetailed>
Some parameter documentations has been truncated, see Models::PhoneNumberListParams for more details.
List phone numbers
111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 111 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::PhoneNumberDetailed, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberRetrieveResponse
Retrieve a phone number
41 42 43 44 45 46 47 48 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 41 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.
169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 169 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.
Update a phone number
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 78 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 |