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
Defined Under Namespace
Classes: Actions, CsvDownloads, Jobs, Messaging, Voice, Voicemail
Instance Attribute Summary collapse
- #actions ⇒ Telnyx::Resources::PhoneNumbers::Actions readonly
- #csv_downloads ⇒ Telnyx::Resources::PhoneNumbers::CsvDownloads readonly
- #jobs ⇒ Telnyx::Resources::PhoneNumbers::Jobs readonly
- #messaging ⇒ Telnyx::Resources::PhoneNumbers::Messaging readonly
- #voice ⇒ Telnyx::Resources::PhoneNumbers::Voice readonly
- #voicemail ⇒ Telnyx::Resources::PhoneNumbers::Voicemail readonly
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, 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.
175 176 177 178 179 180 181 182 183 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 175 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)
7 8 9 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 7 def actions @actions end |
#csv_downloads ⇒ Telnyx::Resources::PhoneNumbers::CsvDownloads (readonly)
10 11 12 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 10 def csv_downloads @csv_downloads end |
#jobs ⇒ Telnyx::Resources::PhoneNumbers::Jobs (readonly)
13 14 15 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 13 def jobs @jobs end |
#messaging ⇒ Telnyx::Resources::PhoneNumbers::Messaging (readonly)
16 17 18 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 16 def messaging @messaging end |
#voice ⇒ Telnyx::Resources::PhoneNumbers::Voice (readonly)
19 20 21 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 19 def voice @voice end |
#voicemail ⇒ Telnyx::Resources::PhoneNumbers::Voicemail (readonly)
22 23 24 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 22 def voicemail @voicemail end |
Instance Method Details
#delete(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumberDeleteResponse
Delete a phone number
126 127 128 129 130 131 132 133 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 126 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
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 103 def list(params = {}) parsed, = Telnyx::PhoneNumberListParams.dump_request(params) @client.request( method: :get, path: "phone_numbers", query: parsed.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
35 36 37 38 39 40 41 42 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 35 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.
160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 160 def slim_list(params = {}) parsed, = Telnyx::PhoneNumberSlimListParams.dump_request(params) @client.request( method: :get, path: "phone_numbers/slim", query: parsed.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::PhoneNumberSlimListResponse, options: ) end |
#update(phone_number_id, 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
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/telnyx/resources/phone_numbers.rb', line 70 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 |