Class: Hookdeck::Resources::Destination

Inherits:
Base
  • Object
show all
Defined in:
lib/hookdeck/resources/destination.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 destination



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

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

#delete(id) ⇒ Object

Delete a destination

Parameters:

  • Destination ID



44
45
46
# File 'lib/hookdeck/resources/destination.rb', line 44

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

#disable(id) ⇒ Object

Disable a destination

Parameters:

  • Destination ID



32
33
34
# File 'lib/hookdeck/resources/destination.rb', line 32

def disable(id)
  put("destinations/#{id}/disable")
end

#enable(id) ⇒ Object

Enable a destination

Parameters:

  • Destination ID



38
39
40
# File 'lib/hookdeck/resources/destination.rb', line 38

def enable(id)
  put("destinations/#{id}/enable")
end

#list(params = {}) ⇒ Object

List all destinations



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

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

#retrieve(id) ⇒ Object

Retrieve a single destination

Parameters:

  • Destination ID



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

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

#update(id, params) ⇒ Object

Update a destination



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

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

#upsert(params) ⇒ Object

Upsert (create or update) a destination



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

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