Class: Zazu::Resources::WebhookEndpoints
- Defined in:
- lib/zazu/resources/webhook_endpoints.rb
Overview
Webhook endpoint configuration.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(url:, events:, description: nil) ⇒ Object
POST /api/webhook_endpoints.
-
#delete(id) ⇒ Object
DELETE /api/webhook_endpoints/:id.
-
#disable(id) ⇒ Object
POST /api/webhook_endpoints/:id/disable.
-
#enable(id) ⇒ Object
POST /api/webhook_endpoints/:id/enable.
-
#get(id) ⇒ Object
GET /api/webhook_endpoints/:id.
-
#list(limit: MAX_PER_PAGE, cursor: nil) ⇒ Object
GET /api/webhook_endpoints.
-
#regenerate_secret(id) ⇒ Object
POST /api/webhook_endpoints/:id/regenerate_secret.
-
#test_endpoint(id) ⇒ Object
POST /api/webhook_endpoints/:id/test.
-
#update(id, **attributes) ⇒ Object
PATCH /api/webhook_endpoints/:id.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Zazu::Resources::Base
Instance Method Details
#create(url:, events:, description: nil) ⇒ Object
POST /api/webhook_endpoints
22 23 24 25 26 27 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 22 def create(url:, events:, description: nil) http_post( "api/webhook_endpoints", body: { url: url, events: events, description: description }.compact ) end |
#delete(id) ⇒ Object
DELETE /api/webhook_endpoints/:id
35 36 37 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 35 def delete(id) http_delete(encode_path("api/webhook_endpoints", id)) end |
#disable(id) ⇒ Object
POST /api/webhook_endpoints/:id/disable
55 56 57 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 55 def disable(id) http_post(encode_path("api/webhook_endpoints", id, "disable")) end |
#enable(id) ⇒ Object
POST /api/webhook_endpoints/:id/enable
50 51 52 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 50 def enable(id) http_post(encode_path("api/webhook_endpoints", id, "enable")) end |
#get(id) ⇒ Object
GET /api/webhook_endpoints/:id
13 14 15 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 13 def get(id) http_get(encode_path("api/webhook_endpoints", id)) end |
#list(limit: MAX_PER_PAGE, cursor: nil) ⇒ Object
GET /api/webhook_endpoints
8 9 10 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 8 def list(limit: MAX_PER_PAGE, cursor: nil) list_page("api/webhook_endpoints", limit: limit, cursor: cursor) end |
#regenerate_secret(id) ⇒ Object
POST /api/webhook_endpoints/:id/regenerate_secret
45 46 47 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 45 def regenerate_secret(id) http_post(encode_path("api/webhook_endpoints", id, "regenerate_secret")) end |
#test_endpoint(id) ⇒ Object
POST /api/webhook_endpoints/:id/test
40 41 42 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 40 def test_endpoint(id) http_post(encode_path("api/webhook_endpoints", id, "test")) end |
#update(id, **attributes) ⇒ Object
PATCH /api/webhook_endpoints/:id
30 31 32 |
# File 'lib/zazu/resources/webhook_endpoints.rb', line 30 def update(id, **attributes) http_patch(encode_path("api/webhook_endpoints", id), body: attributes) end |