Class: Hookdeck::Resources::Transformation

Inherits:
Base
  • Object
show all
Defined in:
lib/hookdeck/resources/transformation.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Hookdeck::Resources::Base

Instance Method Details

#create(params) ⇒ Object

Create a new transformation



16
17
18
# File 'lib/hookdeck/resources/transformation.rb', line 16

def create(params)
  post('transformations', params)
end

#delete(id) ⇒ Object

Delete a transformation

Parameters:

  • id (String)

    Transformation ID



49
50
51
# File 'lib/hookdeck/resources/transformation.rb', line 49

def delete(id)
  delete("transformations/#{id}")
end

#list(params = {}) ⇒ Object

List all transformations



5
6
7
# File 'lib/hookdeck/resources/transformation.rb', line 5

def list(params = {})
  get('transformations', params)
end

#list_executions(id, params = {}) ⇒ Object

List executions for a transformation



36
37
38
# File 'lib/hookdeck/resources/transformation.rb', line 36

def list_executions(id, params = {})
  get("transformations/#{id}/executions", params)
end

#retrieve(id) ⇒ Object

Retrieve a single transformation

Parameters:

  • id (String)

    Transformation ID



11
12
13
# File 'lib/hookdeck/resources/transformation.rb', line 11

def retrieve(id)
  get("transformations/#{id}")
end

#retrieve_execution(id, execution_id) ⇒ Object

Get a specific execution

Parameters:

  • id (String)

    Transformation ID

  • execution_id (String)

    Execution ID



43
44
45
# File 'lib/hookdeck/resources/transformation.rb', line 43

def retrieve_execution(id, execution_id)
  get("transformations/#{id}/executions/#{execution_id}")
end

#run(params) ⇒ Object

Run a transformation



31
32
33
# File 'lib/hookdeck/resources/transformation.rb', line 31

def run(params)
  put('transformations/run', params)
end

#update(id, params) ⇒ Object

Update a transformation



21
22
23
# File 'lib/hookdeck/resources/transformation.rb', line 21

def update(id, params)
  put("transformations/#{id}", params)
end

#upsert(params) ⇒ Object

Upsert (create or update) a transformation



26
27
28
# File 'lib/hookdeck/resources/transformation.rb', line 26

def upsert(params)
  put('transformations', params)
end