Class: Knockapi::Resources::Workflows
- Inherits:
-
Object
- Object
- Knockapi::Resources::Workflows
- Defined in:
- lib/knockapi/resources/workflows.rb,
sig/knockapi/resources/workflows.rbs
Overview
A workflow is a structured set of steps that is triggered to produce notifications sent over channels.
Instance Method Summary collapse
-
#cancel(key, cancellation_key:, recipients: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::WorkflowCancelParams for more details.
-
#initialize(client:) ⇒ Workflows
constructor
private
A new instance of Workflows.
-
#trigger(key, recipients:, actor: nil, cancellation_key: nil, data: nil, settings: nil, tenant: nil, request_options: {}) ⇒ Knockapi::Models::WorkflowTriggerResponse
Some parameter documentations has been truncated, see Models::WorkflowTriggerParams for more details.
Constructor Details
#initialize(client:) ⇒ Workflows
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 Workflows.
83 84 85 |
# File 'lib/knockapi/resources/workflows.rb', line 83 def initialize(client:) @client = client end |
Instance Method Details
#cancel(key, cancellation_key:, recipients: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::WorkflowCancelParams for more details.
When invoked for a workflow using a specific workflow key and cancellation key, will cancel any queued workflow runs associated with that key/cancellation key pair. Can optionally be provided one or more recipients to scope the request to.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/knockapi/resources/workflows.rb', line 28 def cancel(key, params) parsed, = Knockapi::WorkflowCancelParams.dump_request(params) @client.request( method: :post, path: ["v1/workflows/%1$s/cancel", key], body: parsed, model: NilClass, options: ) end |
#trigger(key, recipients:, actor: nil, cancellation_key: nil, data: nil, settings: nil, tenant: nil, request_options: {}) ⇒ Knockapi::Models::WorkflowTriggerResponse
Some parameter documentations has been truncated, see Models::WorkflowTriggerParams for more details.
Trigger a workflow (specified by the key) to run for the given recipients, using
the parameters provided. Returns an identifier for the workflow run request. All
workflow runs are executed asynchronously. This endpoint also handles
inline identifications
for the actor, recipient, and tenant fields.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/knockapi/resources/workflows.rb', line 69 def trigger(key, params) parsed, = Knockapi::WorkflowTriggerParams.dump_request(params) @client.request( method: :post, path: ["v1/workflows/%1$s/trigger", key], body: parsed, model: Knockapi::Models::WorkflowTriggerResponse, options: ) end |