Class: Telnyx::Resources::PhoneNumbers::Voice

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/phone_numbers/voice.rb

Overview

Configure your phone numbers

Instance Method Summary collapse

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.

Parameters:



107
108
109
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 107

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.

List phone numbers with voice settings

Parameters:

Returns:

See Also:



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 91

def list(params = {})
  parsed, options = 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: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::VoiceRetrieveResponse

Retrieve a phone number with voice settings

Parameters:

  • id (String)

    Identifies the resource.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 19

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.

Update a phone number with voice settings

Parameters:

Returns:

See Also:



60
61
62
63
64
65
66
67
68
69
# File 'lib/telnyx/resources/phone_numbers/voice.rb', line 60

def update(id, params = {})
  parsed, options = 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: options
  )
end