Class: TrueTrial::Resources::Webhooks
- Inherits:
-
Object
- Object
- TrueTrial::Resources::Webhooks
- Defined in:
- lib/truetrial/resources/webhooks.rb
Overview
Provides access to webhook subscription management endpoints.
Instance Method Summary collapse
-
#create(data) ⇒ Hash
Creates a new webhook subscription.
-
#delete(id) ⇒ Hash
Deletes a webhook subscription.
-
#initialize(http_client) ⇒ Webhooks
constructor
A new instance of Webhooks.
-
#list ⇒ Hash
Lists all webhook subscriptions.
Constructor Details
#initialize(http_client) ⇒ Webhooks
Returns a new instance of Webhooks.
7 8 9 |
# File 'lib/truetrial/resources/webhooks.rb', line 7 def initialize(http_client) @http = http_client end |
Instance Method Details
#create(data) ⇒ Hash
Creates a new webhook subscription.
22 23 24 |
# File 'lib/truetrial/resources/webhooks.rb', line 22 def create(data) @http.post("/webhooks", body: data) end |
#delete(id) ⇒ Hash
Deletes a webhook subscription.
30 31 32 |
# File 'lib/truetrial/resources/webhooks.rb', line 30 def delete(id) @http.delete("/webhooks/#{id}") end |
#list ⇒ Hash
Lists all webhook subscriptions.
14 15 16 |
# File 'lib/truetrial/resources/webhooks.rb', line 14 def list @http.get("/webhooks") end |