Class: Telnyx::Resources::PhoneNumbers::Voice
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumbers::Voice
- Defined in:
- lib/telnyx/resources/phone_numbers/voice.rb,
sig/telnyx/resources/phone_numbers/voice.rbs
Overview
Configure your phone numbers
Instance Method Summary collapse
-
#initialize(client:) ⇒ Voice
constructor
private
A new instance of Voice.
-
#list(filter: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumbers::PhoneNumberWithVoiceSettings>
Some parameter documentations has been truncated, see Models::PhoneNumbers::VoiceListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoiceRetrieveResponse
Returns the specified phone number together with its current voice configuration.
-
#update(id, call_forwarding: nil, call_recording: nil, caller_id_name_enabled: nil, cnam_listing: nil, inbound_call_screening: nil, media_features: nil, tech_prefix_enabled: nil, translated_number: nil, usage_payment_method: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoiceUpdateResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::VoiceUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Voice
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 Voice.
111 112 113 |
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 111 def initialize(client:) @client = client end |
Instance Method Details
#list(filter: nil, page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumbers::PhoneNumberWithVoiceSettings>
Some parameter documentations has been truncated, see Models::PhoneNumbers::VoiceListParams for more details.
Returns account phone numbers together with their voice settings. Results support pagination, sorting, and filters for number, connection name, customer reference, and voice usage payment method.
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 95 def list(params = {}) parsed, = Telnyx::PhoneNumbers::VoiceListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "phone_numbers/voice", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::PhoneNumbers::PhoneNumberWithVoiceSettings, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoiceRetrieveResponse
Returns the specified phone number together with its current voice configuration.
20 21 22 23 24 25 26 27 |
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 20 def retrieve(id, params = {}) @client.request( method: :get, path: ["phone_numbers/%1$s/voice", id], model: Telnyx::Models::PhoneNumbers::VoiceRetrieveResponse, options: params[:request_options] ) end |
#update(id, call_forwarding: nil, call_recording: nil, caller_id_name_enabled: nil, cnam_listing: nil, inbound_call_screening: nil, media_features: nil, tech_prefix_enabled: nil, translated_number: nil, usage_payment_method: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoiceUpdateResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::VoiceUpdateParams for more details.
Updates the voice configuration for the specified phone number. The response contains the phone number with its updated voice settings.
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 62 def update(id, params = {}) parsed, = Telnyx::PhoneNumbers::VoiceUpdateParams.dump_request(params) @client.request( method: :patch, path: ["phone_numbers/%1$s/voice", id], body: parsed, model: Telnyx::Models::PhoneNumbers::VoiceUpdateResponse, options: ) end |