Class: Telnyx::Resources::AI::Assistants::ScheduledEvents
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Assistants::ScheduledEvents
- Defined in:
- lib/telnyx/resources/ai/assistants/scheduled_events.rb,
sig/telnyx/resources/ai/assistants/scheduled_events.rbs
Overview
Configure AI assistant specifications
Instance Method Summary collapse
-
#create(assistant_id, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, call_settings: nil, conversation_metadata: nil, dynamic_variables: nil, max_retries_client_errors: nil, retry_interval_secs: nil, text: nil, idempotency_key: nil, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::ScheduledPhoneCallEventResponse, Telnyx::Models::AI::Assistants::ScheduledSMSEventResponse
Some parameter documentations has been truncated, see Models::AI::Assistants::ScheduledEventCreateParams for more details.
-
#delete(event_id, assistant_id:, request_options: {}) ⇒ nil
If the event is pending, this will cancel the event.
-
#initialize(client:) ⇒ ScheduledEvents
constructor
private
A new instance of ScheduledEvents.
-
#list(assistant_id, conversation_channel: nil, from_date: nil, page_number: nil, page_size: nil, to_date: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::Assistants::ScheduledPhoneCallEventResponse, Telnyx::Models::AI::Assistants::ScheduledSMSEventResponse>
Get scheduled events for an assistant with pagination and filtering.
-
#retrieve(event_id, assistant_id:, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::ScheduledPhoneCallEventResponse, Telnyx::Models::AI::Assistants::ScheduledSMSEventResponse
Returns the details of a single scheduled event configured for the specified assistant.
Constructor Details
#initialize(client:) ⇒ ScheduledEvents
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 ScheduledEvents.
151 152 153 |
# File 'lib/telnyx/resources/ai/assistants/scheduled_events.rb', line 151 def initialize(client:) @client = client end |
Instance Method Details
#create(assistant_id, scheduled_at_fixed_datetime:, telnyx_agent_target:, telnyx_conversation_channel:, telnyx_end_user_target:, call_settings: nil, conversation_metadata: nil, dynamic_variables: nil, max_retries_client_errors: nil, retry_interval_secs: nil, text: nil, idempotency_key: nil, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::ScheduledPhoneCallEventResponse, Telnyx::Models::AI::Assistants::ScheduledSMSEventResponse
Some parameter documentations has been truncated, see Models::AI::Assistants::ScheduledEventCreateParams for more details.
Create a scheduled event for an assistant
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/telnyx/resources/ai/assistants/scheduled_events.rb', line 45 def create(assistant_id, params) parsed, = Telnyx::AI::Assistants::ScheduledEventCreateParams.dump_request(params) header_params = {idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["ai/assistants/%1$s/scheduled_events", assistant_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Telnyx::AI::Assistants::ScheduledEventResponse, options: ) end |
#delete(event_id, assistant_id:, request_options: {}) ⇒ nil
If the event is pending, this will cancel the event. Otherwise, this will simply remove the record of the event.
134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/telnyx/resources/ai/assistants/scheduled_events.rb', line 134 def delete(event_id, params) parsed, = Telnyx::AI::Assistants::ScheduledEventDeleteParams.dump_request(params) assistant_id = parsed.delete(:assistant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["ai/assistants/%1$s/scheduled_events/%2$s", assistant_id, event_id], model: NilClass, options: ) end |
#list(assistant_id, conversation_channel: nil, from_date: nil, page_number: nil, page_size: nil, to_date: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AI::Assistants::ScheduledPhoneCallEventResponse, Telnyx::Models::AI::Assistants::ScheduledSMSEventResponse>
Get scheduled events for an assistant with pagination and filtering
107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/telnyx/resources/ai/assistants/scheduled_events.rb', line 107 def list(assistant_id, params = {}) parsed, = Telnyx::AI::Assistants::ScheduledEventListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["ai/assistants/%1$s/scheduled_events", assistant_id], query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"), page: Telnyx::Internal::DefaultFlatPagination, model: Telnyx::Models::AI::Assistants::ScheduledEventListResponse, options: ) end |
#retrieve(event_id, assistant_id:, request_options: {}) ⇒ Telnyx::Models::AI::Assistants::ScheduledPhoneCallEventResponse, Telnyx::Models::AI::Assistants::ScheduledSMSEventResponse
Returns the details of a single scheduled event configured for the specified assistant.
72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/telnyx/resources/ai/assistants/scheduled_events.rb', line 72 def retrieve(event_id, params) parsed, = Telnyx::AI::Assistants::ScheduledEventRetrieveParams.dump_request(params) assistant_id = parsed.delete(:assistant_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["ai/assistants/%1$s/scheduled_events/%2$s", assistant_id, event_id], model: Telnyx::AI::Assistants::ScheduledEventResponse, options: ) end |