Class: Telnyx::Resources::MobilePhoneNumbers
- Inherits:
-
Object
- Object
- Telnyx::Resources::MobilePhoneNumbers
- Defined in:
- lib/telnyx/resources/mobile_phone_numbers.rb,
lib/telnyx/resources/mobile_phone_numbers/messaging.rb
Overview
Mobile phone number operations
Defined Under Namespace
Classes: Messaging
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(client:) ⇒ MobilePhoneNumbers
constructor
private
A new instance of MobilePhoneNumbers.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::MobilePhoneNumber>
List Mobile Phone Numbers.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::MobilePhoneNumberRetrieveResponse
Retrieve a Mobile Phone Number.
-
#update(id, call_forwarding: nil, call_recording: nil, caller_id_name_enabled: nil, cnam_listing: nil, connection_id: nil, customer_reference: nil, inbound: nil, inbound_call_screening: nil, noise_suppression: nil, outbound: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::MobilePhoneNumberUpdateResponse
Update a Mobile Phone Number.
Constructor Details
#initialize(client:) ⇒ MobilePhoneNumbers
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 MobilePhoneNumbers.
103 104 105 106 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 103 def initialize(client:) @client = client @messaging = Telnyx::Resources::MobilePhoneNumbers::Messaging.new(client: client) end |
Instance Attribute Details
#messaging ⇒ Telnyx::Resources::MobilePhoneNumbers::Messaging (readonly)
8 9 10 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 8 def messaging @messaging end |
Instance Method Details
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::MobilePhoneNumber>
List Mobile Phone Numbers
87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 87 def list(params = {}) parsed, = Telnyx::MobilePhoneNumberListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/mobile_phone_numbers", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::MobilePhoneNumber, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::MobilePhoneNumberRetrieveResponse
Retrieve a Mobile Phone Number
21 22 23 24 25 26 27 28 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 21 def retrieve(id, params = {}) @client.request( method: :get, path: ["v2/mobile_phone_numbers/%1$s", id], model: Telnyx::Models::MobilePhoneNumberRetrieveResponse, options: params[:request_options] ) end |
#update(id, call_forwarding: nil, call_recording: nil, caller_id_name_enabled: nil, cnam_listing: nil, connection_id: nil, customer_reference: nil, inbound: nil, inbound_call_screening: nil, noise_suppression: nil, outbound: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::MobilePhoneNumberUpdateResponse
Update a Mobile Phone Number
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 63 def update(id, params = {}) parsed, = Telnyx::MobilePhoneNumberUpdateParams.dump_request(params) @client.request( method: :patch, path: ["v2/mobile_phone_numbers/%1$s", id], body: parsed, model: Telnyx::Models::MobilePhoneNumberUpdateResponse, options: ) end |