Class: Telnyx::Resources::PhoneNumbers::Messaging
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumbers::Messaging
- Defined in:
- lib/telnyx/resources/phone_numbers/messaging.rb
Overview
Configure your phone numbers
Instance Method Summary collapse
-
#initialize(client:) ⇒ Messaging
constructor
private
A new instance of Messaging.
-
#list(filter_messaging_profile_id: nil, filter_phone_number: nil, filter_phone_number_contains: nil, filter_type: nil, page_number: nil, page_size: nil, sort_phone_number: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumberWithMessagingSettings>
List phone numbers with messaging settings.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::MessagingRetrieveResponse
Retrieve a phone number with messaging settings.
-
#update(id, messaging_product: nil, messaging_profile_id: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::MessagingUpdateResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::MessagingUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Messaging
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 Messaging.
106 107 108 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 106 def initialize(client:) @client = client end |
Instance Method Details
#list(filter_messaging_profile_id: nil, filter_phone_number: nil, filter_phone_number_contains: nil, filter_type: nil, page_number: nil, page_size: nil, sort_phone_number: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::PhoneNumberWithMessagingSettings>
List phone numbers with messaging settings
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 82 def list(params = {}) parsed, = Telnyx::PhoneNumbers::MessagingListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "phone_numbers/messaging", query: query.transform_keys( filter_messaging_profile_id: "filter[messaging_profile_id]", filter_phone_number: "filter[phone_number]", filter_phone_number_contains: "filter[phone_number][contains]", filter_type: "filter[type]", page_number: "page[number]", page_size: "page[size]", sort_phone_number: "sort[phone_number]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::PhoneNumberWithMessagingSettings, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::MessagingRetrieveResponse
Retrieve a phone number with messaging settings
19 20 21 22 23 24 25 26 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 19 def retrieve(id, params = {}) @client.request( method: :get, path: ["phone_numbers/%1$s/messaging", id], model: Telnyx::Models::PhoneNumbers::MessagingRetrieveResponse, options: params[:request_options] ) end |
#update(id, messaging_product: nil, messaging_profile_id: nil, tags: nil, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::MessagingUpdateResponse
Some parameter documentations has been truncated, see Models::PhoneNumbers::MessagingUpdateParams for more details.
Update the messaging profile and/or messaging product of a phone number
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 48 def update(id, params = {}) parsed, = Telnyx::PhoneNumbers::MessagingUpdateParams.dump_request(params) @client.request( method: :patch, path: ["phone_numbers/%1$s/messaging", id], body: parsed, model: Telnyx::Models::PhoneNumbers::MessagingUpdateResponse, options: ) end |