Class: UseParagon::Workflow

Inherits:
Base
  • Object
show all
Defined in:
lib/use_paragon/workflow.rb

Overview

API calls for workflows

Instance Attribute Summary

Attributes inherited from Base

#token, #user_id

Instance Method Summary collapse

Methods inherited from Base

#generate_token, #initialize

Constructor Details

This class inherits a constructor from UseParagon::Base

Instance Method Details

#disable(workflow_id) ⇒ Object



19
20
21
# File 'lib/use_paragon/workflow.rb', line 19

def disable(workflow_id)
  connection.delete(path("sdk/workflows/#{workflow_id}"))
end

#event(event_name, payload = {}, headers: {}) ⇒ Object



14
15
16
17
# File 'lib/use_paragon/workflow.rb', line 14

def event(event_name, payload = {}, headers: {})
  self.headers = headers
  connection.post(path("sdk/events/trigger"), event_payload(event_name, payload))
end

#request(workflow_id, payload, headers: {}) ⇒ Object



8
9
10
11
12
# File 'lib/use_paragon/workflow.rb', line 8

def request(workflow_id, payload, headers: {})
  # connection.headers = connection.headers.merge(headers)
  self.headers = headers
  connection.post(path("sdk/triggers/#{workflow_id}"), payload)
end