Class: Telnyx::Resources::PhoneNumbers::Messaging
- Inherits:
-
Object
- Object
- Telnyx::Resources::PhoneNumbers::Messaging
- Defined in:
- lib/telnyx/resources/phone_numbers/messaging.rb,
sig/telnyx/resources/phone_numbers/messaging.rbs
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>
Returns phone numbers with their current messaging product and messaging-profile assignments.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::PhoneNumbers::MessagingRetrieveResponse
Returns the messaging product and messaging-profile assignment for the specified phone number.
-
#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.
109 110 111 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 109 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>
Returns phone numbers with their current messaging product and messaging-profile assignments.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 85 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
Returns the messaging product and messaging-profile assignment for the specified phone number.
20 21 22 23 24 25 26 27 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 20 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.
Updates the messaging product, messaging profile, or both for the specified phone number.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/telnyx/resources/phone_numbers/messaging.rb', line 50 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 |