Class: Courier::Resources::Automations

Inherits:
Object
  • Object
show all
Defined in:
lib/courier/resources/automations.rb,
lib/courier/resources/automations/invoke.rb,
sig/courier/resources/automations.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

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:



45
46
47
48
# File 'lib/courier/resources/automations.rb', line 45

def initialize(client:)
  @client = client
  @invoke = Courier::Resources::Automations::Invoke.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

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:



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/courier/resources/automations.rb', line 30

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