Class: Crystil::API::Workflow

Inherits:
Base
  • Object
show all
Defined in:
lib/crystil/api/workflow.rb,
sig/crystil/api/workflow.rbs

Overview

API client for managing a specific workflow

Instance Method Summary collapse

Methods inherited from Base

#build_request, #delete, #get, #handle_response, #parse_json_response, #post, #put, #request

Constructor Details

#initialize(uuid, api_url, api_key, timeout) ⇒ Workflow

Returns a new instance of Workflow.

Parameters:

  • uuid (String)
  • api_url (String)
  • api_key (String)
  • timeout (Numeric)


7
8
9
10
# File 'lib/crystil/api/workflow.rb', line 7

def initialize(uuid, api_url, api_key, timeout)
  super(api_url, api_key, timeout)
  @uuid = uuid
end

Instance Method Details

#destroyObject

Delete workflow

Returns:

  • (Object)


24
25
26
# File 'lib/crystil/api/workflow.rb', line 24

def destroy
  delete("/workflow/#{@uuid}")
end

#detailsObject

Get workflow details

Returns:

  • (Object)


13
14
15
# File 'lib/crystil/api/workflow.rb', line 13

def details
  get("/workflow/#{@uuid}")
end

#invocationCrystil::API::Invocation

Get invocation client for this workflow



29
30
31
# File 'lib/crystil/api/workflow.rb', line 29

def invocation
  Invocation.new(@uuid, @original_api_url, @api_key, @timeout)
end

#update(label:) ⇒ Object

Update workflow label

Parameters:

  • label: (String)

Returns:

  • (Object)


18
19
20
21
# File 'lib/crystil/api/workflow.rb', line 18

def update(label:)
  body = { label: label }
  put("/workflow/#{@uuid}", body)
end