Class: Courier::Resources::Automations::Runs
- Inherits:
-
Object
- Object
- Courier::Resources::Automations::Runs
- Defined in:
- lib/courier/resources/automations/runs.rb,
sig/courier/resources/automations/runs.rbs
Overview
Invoke a stored automation template or an ad hoc automation defined in the request.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Runs
constructor
private
A new instance of Runs.
-
#list(cursor: nil, end_date: nil, limit: nil, start_date: nil, status: nil, template_id: nil, request_options: {}) ⇒ Courier::Models::AutomationRunListResponse
Some parameter documentations has been truncated, see Models::Automations::RunListParams for more details.
-
#list_steps(id, request_options: {}) ⇒ Courier::Models::AutomationRunStepsResponse
List the per-step state of one Automation run, in full — this endpoint is not paginated.
Constructor Details
#initialize(client:) ⇒ Runs
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 Runs.
74 75 76 |
# File 'lib/courier/resources/automations/runs.rb', line 74 def initialize(client:) @client = client end |
Instance Method Details
#list(cursor: nil, end_date: nil, limit: nil, start_date: nil, status: nil, template_id: nil, request_options: {}) ⇒ Courier::Models::AutomationRunListResponse
Some parameter documentations has been truncated, see Models::Automations::RunListParams for more details.
List runs of the workspace's v2 Automations, newest first, filtered by status,
Template, or date range and paged by cursor. Journey (v3) runs are listed by
GET /journeys/runs instead — the two surfaces never return each other's runs.
Runs are retained for 95 days.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/courier/resources/automations/runs.rb', line 36 def list(params = {}) parsed, = Courier::Automations::RunListParams.dump_request(params) query = Courier::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "automations/runs", query: query, model: Courier::AutomationRunListResponse, options: ) end |
#list_steps(id, request_options: {}) ⇒ Courier::Models::AutomationRunStepsResponse
List the per-step state of one Automation run, in full — this endpoint is not
paginated. message_id is present on send steps that produced a message; follow
it to GET /messages/{message_id} for delivery status. A send to a List or an
Audience yields one message_id for the request, not one per recipient.
62 63 64 65 66 67 68 69 |
# File 'lib/courier/resources/automations/runs.rb', line 62 def list_steps(id, params = {}) @client.request( method: :get, path: ["automations/runs/%1$s/steps", id], model: Courier::AutomationRunStepsResponse, options: params[:request_options] ) end |