Class: Courier::Resources::Automations

Inherits:
Object
  • Object
show all
Defined in:
lib/courier/resources/automations.rb,
lib/courier/resources/automations/runs.rb,
lib/courier/resources/automations/invoke.rb,
sig/courier/resources/automations.rbs,
sig/courier/resources/automations/runs.rbs,
sig/courier/resources/automations/invoke.rbs

Overview

Invoke a stored automation template or an ad hoc automation defined in the request.

Defined Under Namespace

Classes: Invoke, Runs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Automations

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

Parameters:



50
51
52
53
54
# File 'lib/courier/resources/automations.rb', line 50

def initialize(client:)
  @client = client
  @invoke = Courier::Resources::Automations::Invoke.new(client: client)
  @runs = Courier::Resources::Automations::Runs.new(client: client)
end

Instance Attribute Details

#invokeCourier::Resources::Automations::Invoke (readonly)

Invoke a stored automation template or an ad hoc automation defined in the request.



11
12
13
# File 'lib/courier/resources/automations.rb', line 11

def invoke
  @invoke
end

#runsCourier::Resources::Automations::Runs (readonly)

Invoke a stored automation template or an ad hoc automation defined in the request.



16
17
18
# File 'lib/courier/resources/automations.rb', line 16

def runs
  @runs
end

Instance Method Details

#list(cursor: nil, version: nil, request_options: {}) ⇒ Courier::Models::AutomationTemplateListResponse

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

Lists the workspace's saved automation templates, each with its id and a cursor for paging to the next page of results.

Parameters:

Returns:

See Also:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/courier/resources/automations.rb', line 35

def list(params = {})
  parsed, options = Courier::AutomationListParams.dump_request(params)
  query = Courier::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "automations",
    query: query,
    model: Courier::AutomationTemplateListResponse,
    options: options
  )
end