Module: Unit::Webhook
- Defined in:
- lib/unit/models/webhook/webhook.rb,
lib/unit/models/webhook/list_webhook_params.rb,
lib/unit/models/webhook/patch_webhook_request.rb,
lib/unit/models/webhook/create_webhook_request.rb
Defined Under Namespace
Classes: CreateWebhookRequest, ListWebhookParams, PatchWebhookRequest
Constant Summary collapse
- WEBHOOK_LIMIT =
100
- WEBHOOK_OFFSET =
0
Class Method Summary collapse
-
.create_webhook(label:, url:, token:, content_type:, delivery_mode:, include_resources: nil, subscription_type: nil) ⇒ Object
Create a webhook.
-
.disable_webhook(webhook_id:) ⇒ Object
Request to disable a webhook.
-
.enable_webhook(webhook_id:) ⇒ Object
Request to enable a webhook.
-
.get_webhook(webhook_id:) ⇒ Object
Request to get a webhook.
-
.list_webhooks(limit: WEBHOOK_LIMIT, offset: WEBHOOK_OFFSET, since: nil, until_: nil, from_id: nil, told: nil) ⇒ Object
Request to list webhooks.
-
.update_webhook(webhook_id:, label:, url:, content_type:, token:, include_resources: nil, subscription_type: nil) ⇒ Object
Request to patch webhook.
Class Method Details
.create_webhook(label:, url:, token:, content_type:, delivery_mode:, include_resources: nil, subscription_type: nil) ⇒ Object
Create a webhook
21 22 23 24 25 26 |
# File 'lib/unit/models/webhook/webhook.rb', line 21 def create_webhook(label:, url:, token:, content_type:, delivery_mode:, include_resources: nil, subscription_type: nil) request = CreateWebhookRequest.new(label, url, token, content_type, delivery_mode, include_resources, subscription_type) Unit::Resource::WebhookResource.create_webhook(request) end |
.disable_webhook(webhook_id:) ⇒ Object
Request to disable a webhook
75 76 77 |
# File 'lib/unit/models/webhook/webhook.rb', line 75 def disable_webhook(webhook_id:) Unit::Resource::WebhookResource.disable_webhook(webhook_id) end |
.enable_webhook(webhook_id:) ⇒ Object
Request to enable a webhook
68 69 70 |
# File 'lib/unit/models/webhook/webhook.rb', line 68 def enable_webhook(webhook_id:) Unit::Resource::WebhookResource.enable_webhook(webhook_id) end |
.get_webhook(webhook_id:) ⇒ Object
Request to get a webhook
61 62 63 |
# File 'lib/unit/models/webhook/webhook.rb', line 61 def get_webhook(webhook_id:) Unit::Resource::WebhookResource.get_webhook(webhook_id) end |
.list_webhooks(limit: WEBHOOK_LIMIT, offset: WEBHOOK_OFFSET, since: nil, until_: nil, from_id: nil, told: nil) ⇒ Object
Request to list webhooks
36 37 38 39 40 |
# File 'lib/unit/models/webhook/webhook.rb', line 36 def list_webhooks(limit: WEBHOOK_LIMIT, offset: WEBHOOK_OFFSET, since: nil, until_: nil, from_id: nil, told: nil) request = ListWebhookParams.new(limit, offset, since, until_, from_id, told) Unit::Resource::WebhookResource.list_webhooks(request) end |
.update_webhook(webhook_id:, label:, url:, content_type:, token:, include_resources: nil, subscription_type: nil) ⇒ Object
Request to patch webhook
51 52 53 54 55 56 |
# File 'lib/unit/models/webhook/webhook.rb', line 51 def update_webhook(webhook_id:, label:, url:, content_type:, token:, include_resources: nil, subscription_type: nil) request = PatchWebhookRequest.new(webhook_id, label, url, content_type, token, include_resources, subscription_type) Unit::Resource::WebhookResource.update_webhook(request) end |