Class: Telnyx::Resources::CallReasons
- Inherits:
-
Object
- Object
- Telnyx::Resources::CallReasons
- Defined in:
- lib/telnyx/resources/call_reasons.rb,
sig/telnyx/resources/call_reasons.rbs
Overview
Static reference values the API accepts: call reasons, document types, rejection types.
Instance Method Summary collapse
-
#initialize(client:) ⇒ CallReasons
constructor
private
A new instance of CallReasons.
-
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::CallReasonListResponse>
Some parameter documentations has been truncated, see Models::CallReasonListParams for more details.
-
#validate(body:, request_options: {}) ⇒ Telnyx::Models::CallReasonValidateResponse
Some parameter documentations has been truncated, see Models::CallReasonValidateParams for more details.
Constructor Details
#initialize(client:) ⇒ CallReasons
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 CallReasons.
72 73 74 |
# File 'lib/telnyx/resources/call_reasons.rb', line 72 def initialize(client:) @client = client end |
Instance Method Details
#list(page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::CallReasonListResponse>
Some parameter documentations has been truncated, see Models::CallReasonListParams for more details.
Telnyx maintains a library of pre-vetted call-reason phrases (e.g. "Appointment
reminders", "Billing inquiries") that carry through DIR vetting smoothly. You
can use any string that fits your use case in DirCreateRequest.call_reasons,
but matching one of these reduces the chance the vetting team flags the phrasing
for clarification.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/telnyx/resources/call_reasons.rb', line 28 def list(params = {}) parsed, = Telnyx::CallReasonListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "call_reasons", query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::CallReasonListResponse, options: ) end |
#validate(body:, request_options: {}) ⇒ Telnyx::Models::CallReasonValidateResponse
Some parameter documentations has been truncated, see Models::CallReasonValidateParams for more details.
Check up to 10 candidate call_reasons strings against Telnyx's vetting
heuristics before sending them on a DIR create or update. The endpoint flags
strings that are likely to be rejected during vetting (too generic, banned
phrases, length issues, etc.) so you can fix them up front.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/telnyx/resources/call_reasons.rb', line 58 def validate(params) parsed, = Telnyx::CallReasonValidateParams.dump_request(params) @client.request( method: :post, path: "call_reasons/validate", body: parsed[:body], model: Telnyx::Models::CallReasonValidateResponse, options: ) end |