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
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.
101 102 103 104 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 101 def initialize(client:) @client = client @messaging = Telnyx::Resources::MobilePhoneNumbers::Messaging.new(client: client) end |
Instance Attribute Details
#messaging ⇒ Telnyx::Resources::MobilePhoneNumbers::Messaging (readonly)
7 8 9 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 7 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
86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 86 def list(params = {}) parsed, = Telnyx::MobilePhoneNumberListParams.dump_request(params) @client.request( method: :get, path: "v2/mobile_phone_numbers", query: parsed.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
20 21 22 23 24 25 26 27 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 20 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
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/telnyx/resources/mobile_phone_numbers.rb', line 62 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 |