Class: AccessGrid::Webhooks
- Inherits:
-
Object
- Object
- AccessGrid::Webhooks
- Defined in:
- lib/accessgrid/console.rb
Overview
Manages webhook operations.
Instance Method Summary collapse
- #create(name:, url:, subscribed_events:, auth_method: 'bearer_token') ⇒ Object
- #delete(webhook_id) ⇒ Object
-
#initialize(client) ⇒ Webhooks
constructor
A new instance of Webhooks.
- #list(**params) ⇒ Object
Constructor Details
#initialize(client) ⇒ Webhooks
Returns a new instance of Webhooks.
329 330 331 |
# File 'lib/accessgrid/console.rb', line 329 def initialize(client) @client = client end |
Instance Method Details
#create(name:, url:, subscribed_events:, auth_method: 'bearer_token') ⇒ Object
333 334 335 336 337 338 339 340 341 342 |
# File 'lib/accessgrid/console.rb', line 333 def create(name:, url:, subscribed_events:, auth_method: 'bearer_token') data = { name: name, url: url, subscribed_events: subscribed_events, auth_method: auth_method } response = @client.make_request(:post, '/v1/console/webhooks', data) Webhook.new(response) end |
#delete(webhook_id) ⇒ Object
349 350 351 |
# File 'lib/accessgrid/console.rb', line 349 def delete(webhook_id) @client.make_request(:delete, "/v1/console/webhooks/#{webhook_id}") end |