Class: Telnyx::Resources::MessagingHostedNumberOrders
- Inherits:
-
Object
- Object
- Telnyx::Resources::MessagingHostedNumberOrders
- Defined in:
- lib/telnyx/resources/messaging_hosted_number_orders.rb,
lib/telnyx/resources/messaging_hosted_number_orders/actions.rb,
sig/telnyx/resources/messaging_hosted_number_orders.rbs,
sig/telnyx/resources/messaging_hosted_number_orders/actions.rbs
Overview
Manage your messaging hosted numbers
Defined Under Namespace
Classes: Actions
Instance Attribute Summary collapse
-
#actions ⇒ Telnyx::Resources::MessagingHostedNumberOrders::Actions
readonly
Manage your messaging hosted numbers.
Instance Method Summary collapse
-
#check_eligibility(phone_numbers:, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderCheckEligibilityResponse
Checks whether the supplied phone numbers are eligible for hosted messaging before an order is created.
-
#create(messaging_profile_id: nil, phone_numbers: nil, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderCreateResponse
Some parameter documentations has been truncated, see Models::MessagingHostedNumberOrderCreateParams for more details.
-
#create_verification_codes(id, phone_numbers:, verification_method:, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderCreateVerificationCodesResponse
Create verification codes to validate numbers of the hosted order.
-
#delete(id, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderDeleteResponse
Delete a messaging hosted number order and all associated phone numbers.
-
#initialize(client:) ⇒ MessagingHostedNumberOrders
constructor
private
A new instance of MessagingHostedNumberOrders.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::MessagingHostedNumberOrder>
Returns hosted-messaging orders for the authenticated account.
-
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderRetrieveResponse
Returns the current state, phone numbers, and required actions for the specified hosted-messaging order.
-
#validate_codes(id, verification_codes:, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderValidateCodesResponse
Validate the verification codes sent to the numbers of the hosted order.
Constructor Details
#initialize(client:) ⇒ MessagingHostedNumberOrders
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 MessagingHostedNumberOrders.
183 184 185 186 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 183 def initialize(client:) @client = client @actions = Telnyx::Resources::MessagingHostedNumberOrders::Actions.new(client: client) end |
Instance Attribute Details
#actions ⇒ Telnyx::Resources::MessagingHostedNumberOrders::Actions (readonly)
Manage your messaging hosted numbers
9 10 11 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 9 def actions @actions end |
Instance Method Details
#check_eligibility(phone_numbers:, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderCheckEligibilityResponse
Checks whether the supplied phone numbers are eligible for hosted messaging before an order is created.
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 117 def check_eligibility(params) parsed, = Telnyx::MessagingHostedNumberOrderCheckEligibilityParams.dump_request(params) @client.request( method: :post, path: "messaging_hosted_number_orders/eligibility_numbers_check", body: parsed, model: Telnyx::Models::MessagingHostedNumberOrderCheckEligibilityResponse, options: ) end |
#create(messaging_profile_id: nil, phone_numbers: nil, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderCreateResponse
Some parameter documentations has been truncated, see Models::MessagingHostedNumberOrderCreateParams for more details.
Creates an order to enable Telnyx messaging on phone numbers whose voice service remains with another carrier.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 28 def create(params = {}) parsed, = Telnyx::MessagingHostedNumberOrderCreateParams.dump_request(params) @client.request( method: :post, path: "messaging_hosted_number_orders", body: parsed, model: Telnyx::Models::MessagingHostedNumberOrderCreateResponse, options: ) end |
#create_verification_codes(id, phone_numbers:, verification_method:, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderCreateVerificationCodesResponse
Create verification codes to validate numbers of the hosted order. The verification codes will be sent to the numbers of the hosted order.
144 145 146 147 148 149 150 151 152 153 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 144 def create_verification_codes(id, params) parsed, = Telnyx::MessagingHostedNumberOrderCreateVerificationCodesParams.dump_request(params) @client.request( method: :post, path: ["messaging_hosted_number_orders/%1$s/verification_codes", id], body: parsed, model: Telnyx::Models::MessagingHostedNumberOrderCreateVerificationCodesResponse, options: ) end |
#delete(id, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderDeleteResponse
Delete a messaging hosted number order and all associated phone numbers.
96 97 98 99 100 101 102 103 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 96 def delete(id, params = {}) @client.request( method: :delete, path: ["messaging_hosted_number_orders/%1$s", id], model: Telnyx::Models::MessagingHostedNumberOrderDeleteResponse, options: params[:request_options] ) end |
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::MessagingHostedNumberOrder>
Returns hosted-messaging orders for the authenticated account. Apply the documented filters and pagination parameters to narrow the result set.
72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 72 def list(params = {}) parsed, = Telnyx::MessagingHostedNumberOrderListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "messaging_hosted_number_orders", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::MessagingHostedNumberOrder, options: ) end |
#retrieve(id, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderRetrieveResponse
Returns the current state, phone numbers, and required actions for the specified hosted-messaging order.
51 52 53 54 55 56 57 58 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 51 def retrieve(id, params = {}) @client.request( method: :get, path: ["messaging_hosted_number_orders/%1$s", id], model: Telnyx::Models::MessagingHostedNumberOrderRetrieveResponse, options: params[:request_options] ) end |
#validate_codes(id, verification_codes:, request_options: {}) ⇒ Telnyx::Models::MessagingHostedNumberOrderValidateCodesResponse
Validate the verification codes sent to the numbers of the hosted order. The verification codes must be created in the verification codes endpoint.
169 170 171 172 173 174 175 176 177 178 |
# File 'lib/telnyx/resources/messaging_hosted_number_orders.rb', line 169 def validate_codes(id, params) parsed, = Telnyx::MessagingHostedNumberOrderValidateCodesParams.dump_request(params) @client.request( method: :post, path: ["messaging_hosted_number_orders/%1$s/validation_codes", id], body: parsed, model: Telnyx::Models::MessagingHostedNumberOrderValidateCodesResponse, options: ) end |