Class: Knockapi::Resources::WorkflowRecipientRuns

Inherits:
Object
  • Object
show all
Defined in:
lib/knockapi/resources/workflow_recipient_runs.rb,
sig/knockapi/resources/workflow_recipient_runs.rbs

Overview

A workflow run represents an individual execution of a workflow for a specific recipient.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WorkflowRecipientRuns

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 WorkflowRecipientRuns.

Parameters:



76
77
78
# File 'lib/knockapi/resources/workflow_recipient_runs.rb', line 76

def initialize(client:)
  @client = client
end

Instance Method Details

#get(id, request_options: {}) ⇒ Knockapi::Models::WorkflowRecipientRunDetail

Returns a single workflow recipient run with its associated events.

Parameters:

  • id (String)

    The unique identifier for the workflow recipient run (per-recipient).

  • request_options (Knockapi::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



64
65
66
67
68
69
70
71
# File 'lib/knockapi/resources/workflow_recipient_runs.rb', line 64

def get(id, params = {})
  @client.request(
    method: :get,
    path: ["v1/workflow_recipient_runs/%1$s", id],
    model: Knockapi::WorkflowRecipientRunDetail,
    options: params[:request_options]
  )
end

#list(after: nil, before: nil, ending_at: nil, has_errors: nil, page_size: nil, recipient: nil, starting_at: nil, status: nil, tenant: nil, workflow: nil, request_options: {}) ⇒ Knockapi::Internal::ItemsCursor<Knockapi::Models::WorkflowRecipientRun>

Some parameter documentations has been truncated, see Models::WorkflowRecipientRunListParams for more details.

Returns a paginated list of workflow recipient runs for the current environment.

Parameters:

  • after (String)

    The cursor to fetch entries after.

  • before (String)

    The cursor to fetch entries before.

  • ending_at (Time)

    Limits the results to workflow recipient runs started before the given date.

  • has_errors (Boolean)

    Limits the results to workflow recipient runs that have errors.

  • page_size (Integer)

    The number of items per page (defaults to 50).

  • recipient (String, Knockapi::Models::RecipientReference::ObjectReference)

    Limits the results to workflow recipient runs for the given recipient. Accepts a

  • starting_at (Time)

    Limits the results to workflow recipient runs started after the given date.

  • status (Array<Symbol, Knockapi::Models::WorkflowRecipientRunListParams::Status>)

    Limits the results to workflow recipient runs with the given status.

  • tenant (String)

    Limits the results to workflow recipient runs for the given tenant.

  • workflow (String)

    Limits the results to workflow recipient runs for the given workflow key.

  • request_options (Knockapi::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/knockapi/resources/workflow_recipient_runs.rb', line 40

def list(params = {})
  parsed, options = Knockapi::WorkflowRecipientRunListParams.dump_request(params)
  query = Knockapi::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/workflow_recipient_runs",
    query: query,
    page: Knockapi::Internal::ItemsCursor,
    model: Knockapi::WorkflowRecipientRun,
    options: options
  )
end