Class: Hookdeck::Resources::Source
- Defined in:
- lib/hookdeck/resources/source.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(params) ⇒ Object
Create a new source.
-
#delete(id) ⇒ Object
Delete a source.
-
#disable(id) ⇒ Object
Disable a source.
-
#enable(id) ⇒ Object
Enable a source.
-
#list(params = {}) ⇒ Object
List all sources.
-
#retrieve(id) ⇒ Object
Retrieve a single source.
-
#update(id, params) ⇒ Object
Update a source.
-
#upsert(params) ⇒ Object
Upsert (create or update) a source.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Hookdeck::Resources::Base
Instance Method Details
#create(params) ⇒ Object
Create a new source
16 17 18 |
# File 'lib/hookdeck/resources/source.rb', line 16 def create(params) post('sources', params) end |
#delete(id) ⇒ Object
Delete a source
44 45 46 |
# File 'lib/hookdeck/resources/source.rb', line 44 def delete(id) delete("sources/#{id}") end |
#disable(id) ⇒ Object
Disable a source
32 33 34 |
# File 'lib/hookdeck/resources/source.rb', line 32 def disable(id) put("sources/#{id}/disable") end |
#enable(id) ⇒ Object
Enable a source
38 39 40 |
# File 'lib/hookdeck/resources/source.rb', line 38 def enable(id) put("sources/#{id}/enable") end |
#list(params = {}) ⇒ Object
List all sources
5 6 7 |
# File 'lib/hookdeck/resources/source.rb', line 5 def list(params = {}) get('sources', params) end |
#retrieve(id) ⇒ Object
Retrieve a single source
11 12 13 |
# File 'lib/hookdeck/resources/source.rb', line 11 def retrieve(id) get("sources/#{id}") end |
#update(id, params) ⇒ Object
Update a source
26 27 28 |
# File 'lib/hookdeck/resources/source.rb', line 26 def update(id, params) put("sources/#{id}", params) end |
#upsert(params) ⇒ Object
Upsert (create or update) a source
21 22 23 |
# File 'lib/hookdeck/resources/source.rb', line 21 def upsert(params) put('sources', params) end |