Class: Courier::Resources::Journeys::Runs
- Inherits:
-
Object
- Object
- Courier::Resources::Journeys::Runs
- Defined in:
- lib/courier/resources/journeys/runs.rb,
sig/courier/resources/journeys/runs.rbs
Overview
Build, version, publish, invoke, and cancel multi-step notification workflows, along with the templates scoped to them.
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::JourneyRunListResponse
Some parameter documentations has been truncated, see Models::Journeys::RunListParams for more details.
-
#list_steps(run_id, request_options: {}) ⇒ Courier::Models::JourneyRunStepsResponse
List the per-node state of one Journey run, in full — this endpoint is not paginated.
-
#retrieve(run_id, request_options: {}) ⇒ Courier::Models::JourneyRunResponse
Fetch one Journey run by id.
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.
98 99 100 |
# File 'lib/courier/resources/journeys/runs.rb', line 98 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::JourneyRunListResponse
Some parameter documentations has been truncated, see Models::Journeys::RunListParams for more details.
List runs of the workspace's Journeys, newest first, filtered by status,
Journey, or date range and paged by cursor. Runs of v2 Automations are listed by
GET /automations/runs instead — the two surfaces never return each other's
runs. Runs are retained for 95 days.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/courier/resources/journeys/runs.rb', line 59 def list(params = {}) parsed, = Courier::Journeys::RunListParams.dump_request(params) query = Courier::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "journeys/runs", query: query, model: Courier::JourneyRunListResponse, options: ) end |
#list_steps(run_id, request_options: {}) ⇒ Courier::Models::JourneyRunStepsResponse
List the per-node state of one Journey run, in full — this endpoint is not
paginated. Each step's node_id is the id of the node in the published Journey,
so a step maps directly onto the Journey graph. message_id is present on send
steps that produced a message; follow it to GET /messages/{message_id} for
delivery status.
86 87 88 89 90 91 92 93 |
# File 'lib/courier/resources/journeys/runs.rb', line 86 def list_steps(run_id, params = {}) @client.request( method: :get, path: ["journeys/runs/%1$s/steps", run_id], model: Courier::JourneyRunStepsResponse, options: params[:request_options] ) end |
#retrieve(run_id, request_options: {}) ⇒ Courier::Models::JourneyRunResponse
Fetch one Journey run by id. Returns 404 for an unknown run, a run belonging
to another workspace, a run past the 95-day retention window, or an Automation
run id — the same body in every case, so the response never reveals whether a
run exists elsewhere.
23 24 25 26 27 28 29 30 |
# File 'lib/courier/resources/journeys/runs.rb', line 23 def retrieve(run_id, params = {}) @client.request( method: :get, path: ["journeys/runs/%1$s", run_id], model: Courier::JourneyRunResponse, options: params[:request_options] ) end |