Class: Knockapi::Resources::Workflows
- Inherits:
-
Object
- Object
- Knockapi::Resources::Workflows
- Defined in:
- lib/knockapi/resources/workflows.rb
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, 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.
79 80 81 |
# File 'lib/knockapi/resources/workflows.rb', line 79 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.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/knockapi/resources/workflows.rb', line 26 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, 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](/managing-recipients/identifying-recipients#inline-identifying-recipients) for the ‘actor`, `recipient`, and `tenant` fields.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/knockapi/resources/workflows.rb', line 65 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 |