Module: Resend::Automations

Defined in:
lib/resend/automations.rb,
lib/resend/automations/runs.rb

Overview

automations api wrapper

Defined Under Namespace

Modules: Runs

Class Method Summary collapse

Class Method Details

.create(params = {}) ⇒ Object



8
9
10
# File 'lib/resend/automations.rb', line 8

def create(params = {})
  Resend::Request.new("automations", params, "post").perform
end

.get(automation_id = "") ⇒ Object



13
14
15
# File 'lib/resend/automations.rb', line 13

def get(automation_id = "")
  Resend::Request.new("automations/#{automation_id}", {}, "get").perform
end

.list(params = {}) ⇒ Object



35
36
37
38
# File 'lib/resend/automations.rb', line 35

def list(params = {})
  path = Resend::PaginationHelper.build_paginated_path("automations", params)
  Resend::Request.new(path, {}, "get").perform
end

.remove(automation_id = "") ⇒ Object



25
26
27
# File 'lib/resend/automations.rb', line 25

def remove(automation_id = "")
  Resend::Request.new("automations/#{automation_id}", {}, "delete").perform
end

.stop(automation_id = "") ⇒ Object



30
31
32
# File 'lib/resend/automations.rb', line 30

def stop(automation_id = "")
  Resend::Request.new("automations/#{automation_id}/stop", {}, "post").perform
end

.update(params = {}) ⇒ Object



18
19
20
21
22
# File 'lib/resend/automations.rb', line 18

def update(params = {})
  path = "automations/#{params[:automation_id]}"
  payload = params.reject { |k, _| k == :automation_id }
  Resend::Request.new(path, payload, "patch").perform
end