Class: Fizzy::Services::WebhooksService
- Inherits:
-
BaseService
- Object
- BaseService
- Fizzy::Services::WebhooksService
- Defined in:
- lib/fizzy/generated/services/webhooks_service.rb
Overview
Service for Webhooks operations
Instance Method Summary collapse
-
#activate(account_id:, board_id:, webhook_id:) ⇒ void
activate operation.
-
#create(account_id:, board_id:, name:, url:, subscribed_actions: nil) ⇒ Hash
create operation.
-
#delete(account_id:, board_id:, webhook_id:) ⇒ void
delete operation.
-
#get(account_id:, board_id:, webhook_id:) ⇒ Hash
get operation.
-
#list(account_id:, board_id:) ⇒ Hash
list operation.
-
#list_webhook_deliveries(account_id:, board_id:, webhook_id:) ⇒ Enumerator<Hash>
list_webhook_deliveries operation.
-
#update(account_id:, board_id:, webhook_id:, name: nil, url: nil, subscribed_actions: nil) ⇒ Hash
update operation.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Fizzy::Services::BaseService
Instance Method Details
#activate(account_id:, board_id:, webhook_id:) ⇒ void
This method returns an undefined value.
activate operation
75 76 77 78 79 80 |
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 75 def activate(account_id:, board_id:, webhook_id:) with_operation(service: "webhooks", operation: "ActivateWebhook", is_mutation: true, resource_id: webhook_id) do http_post("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}/activation.json", retryable: true) nil end end |
#create(account_id:, board_id:, name:, url:, subscribed_actions: nil) ⇒ Hash
create operation
27 28 29 30 31 |
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 27 def create(account_id:, board_id:, name:, url:, subscribed_actions: nil) with_operation(service: "webhooks", operation: "CreateWebhook", is_mutation: true, resource_id: board_id) do http_post("/#{account_id}/boards/#{board_id}/webhooks.json", body: compact_params(name: name, url: url, subscribed_actions: subscribed_actions)).json end end |
#delete(account_id:, board_id:, webhook_id:) ⇒ void
This method returns an undefined value.
delete operation
63 64 65 66 67 68 |
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 63 def delete(account_id:, board_id:, webhook_id:) with_operation(service: "webhooks", operation: "DeleteWebhook", is_mutation: true, resource_id: webhook_id) do http_delete("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}") nil end end |
#get(account_id:, board_id:, webhook_id:) ⇒ Hash
get operation
38 39 40 41 42 |
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 38 def get(account_id:, board_id:, webhook_id:) with_operation(service: "webhooks", operation: "GetWebhook", is_mutation: false, resource_id: webhook_id) do http_get("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}").json end end |
#list(account_id:, board_id:) ⇒ Hash
list operation
14 15 16 17 18 |
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 14 def list(account_id:, board_id:) with_operation(service: "webhooks", operation: "ListWebhooks", is_mutation: false, resource_id: board_id) do http_get("/#{account_id}/boards/#{board_id}/webhooks.json").json end end |
#list_webhook_deliveries(account_id:, board_id:, webhook_id:) ⇒ Enumerator<Hash>
list_webhook_deliveries operation
87 88 89 90 91 |
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 87 def list_webhook_deliveries(account_id:, board_id:, webhook_id:) wrap_paginated(service: "webhooks", operation: "ListWebhookDeliveries", is_mutation: false, resource_id: webhook_id) do paginate("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}/deliveries.json") end end |
#update(account_id:, board_id:, webhook_id:, name: nil, url: nil, subscribed_actions: nil) ⇒ Hash
update operation
52 53 54 55 56 |
# File 'lib/fizzy/generated/services/webhooks_service.rb', line 52 def update(account_id:, board_id:, webhook_id:, name: nil, url: nil, subscribed_actions: nil) with_operation(service: "webhooks", operation: "UpdateWebhook", is_mutation: true, resource_id: webhook_id) do http_patch("/#{account_id}/boards/#{board_id}/webhooks/#{webhook_id}", body: compact_params(name: name, url: url, subscribed_actions: subscribed_actions)).json end end |