Module: Emma::API::Webhooks
- Included in:
- Client
- Defined in:
- lib/emma/api/webhooks.rb
Instance Method Summary collapse
-
#add_webhook(params = {}) ⇒ Object
Create an new webhook.
-
#get_webhook(id) ⇒ Object
Get information for a specific webhook belonging to a specific account.
-
#my_webhooks(params = {}) ⇒ Object
Get a basic listing of all webhooks associated with an account.
-
#remove_all_webhooks ⇒ Object
Delete all webhooks registered for an account.
-
#remove_webhook(id) ⇒ Object
Deletes an existing webhook.
-
#update_webhook(id, params = {}) ⇒ Object
Update an existing webhook.
-
#webhook_events(id) ⇒ Object
Get a listing of all event types that are available for webhooks.
Instance Method Details
#add_webhook(params = {}) ⇒ Object
Create an new webhook.
22 23 24 |
# File 'lib/emma/api/webhooks.rb', line 22 def add_webhook(params = {}) post("/webhooks", params) end |
#get_webhook(id) ⇒ Object
Get information for a specific webhook belonging to a specific account.
12 13 14 |
# File 'lib/emma/api/webhooks.rb', line 12 def get_webhook(id) get("/webhooks/#{id}") end |
#my_webhooks(params = {}) ⇒ Object
Get a basic listing of all webhooks associated with an account.
7 8 9 |
# File 'lib/emma/api/webhooks.rb', line 7 def my_webhooks(params = {}) get("/webhooks") end |
#remove_all_webhooks ⇒ Object
Delete all webhooks registered for an account.
37 38 39 |
# File 'lib/emma/api/webhooks.rb', line 37 def remove_all_webhooks delete("/webhooks") end |
#remove_webhook(id) ⇒ Object
Deletes an existing webhook.
32 33 34 |
# File 'lib/emma/api/webhooks.rb', line 32 def remove_webhook(id) delete("/webhooks/#{id}") end |
#update_webhook(id, params = {}) ⇒ Object
Update an existing webhook. Takes the same params as create_webhook.
27 28 29 |
# File 'lib/emma/api/webhooks.rb', line 27 def update_webhook(id, params = {}) put("/webhooks/#{id}", params) end |
#webhook_events(id) ⇒ Object
Get a listing of all event types that are available for webhooks.
17 18 19 |
# File 'lib/emma/api/webhooks.rb', line 17 def webhook_events(id) get("/webhooks/#{id}/events") end |