Class: Telnyx::Resources::AlphanumericSenderIDs
- Inherits:
-
Object
- Object
- Telnyx::Resources::AlphanumericSenderIDs
- Defined in:
- lib/telnyx/resources/alphanumeric_sender_ids.rb
Instance Method Summary collapse
-
#create(alphanumeric_sender_id:, messaging_profile_id:, us_long_code_fallback: nil, request_options: {}) ⇒ Telnyx::Models::AlphanumericSenderIDCreateResponse
Create a new alphanumeric sender ID associated with a messaging profile.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::AlphanumericSenderIDDeleteResponse
Delete an alphanumeric sender ID and disassociate it from its messaging profile.
-
#initialize(client:) ⇒ AlphanumericSenderIDs
constructor
private
A new instance of AlphanumericSenderIDs.
-
#list(filter_messaging_profile_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AlphanumericSenderID>
List all alphanumeric sender IDs for the authenticated user.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::AlphanumericSenderIDRetrieveResponse
Retrieve a specific alphanumeric sender ID.
Constructor Details
#initialize(client:) ⇒ AlphanumericSenderIDs
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 AlphanumericSenderIDs.
107 108 109 |
# File 'lib/telnyx/resources/alphanumeric_sender_ids.rb', line 107 def initialize(client:) @client = client end |
Instance Method Details
#create(alphanumeric_sender_id:, messaging_profile_id:, us_long_code_fallback: nil, request_options: {}) ⇒ Telnyx::Models::AlphanumericSenderIDCreateResponse
Create a new alphanumeric sender ID associated with a messaging profile.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/telnyx/resources/alphanumeric_sender_ids.rb', line 21 def create(params) parsed, = Telnyx::AlphanumericSenderIDCreateParams.dump_request(params) @client.request( method: :post, path: "alphanumeric_sender_ids", body: parsed, model: Telnyx::Models::AlphanumericSenderIDCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::AlphanumericSenderIDDeleteResponse
Delete an alphanumeric sender ID and disassociate it from its messaging profile.
95 96 97 98 99 100 101 102 |
# File 'lib/telnyx/resources/alphanumeric_sender_ids.rb', line 95 def delete(id, params = {}) @client.request( method: :delete, path: ["alphanumeric_sender_ids/%1$s", id], model: Telnyx::Models::AlphanumericSenderIDDeleteResponse, options: params[:request_options] ) end |
#list(filter_messaging_profile_id: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AlphanumericSenderID>
List all alphanumeric sender IDs for the authenticated user.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/telnyx/resources/alphanumeric_sender_ids.rb', line 67 def list(params = {}) parsed, = Telnyx::AlphanumericSenderIDListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "alphanumeric_sender_ids", query: query.transform_keys( filter_messaging_profile_id: "filter[messaging_profile_id]", page_number: "page[number]", page_size: "page[size]" ), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::AlphanumericSenderID, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::AlphanumericSenderIDRetrieveResponse
Retrieve a specific alphanumeric sender ID.
43 44 45 46 47 48 49 50 |
# File 'lib/telnyx/resources/alphanumeric_sender_ids.rb', line 43 def retrieve(id, params = {}) @client.request( method: :get, path: ["alphanumeric_sender_ids/%1$s", id], model: Telnyx::Models::AlphanumericSenderIDRetrieveResponse, options: params[:request_options] ) end |