Class: Polar::Resources::Webhooks
- Defined in:
- lib/polar/resources/webhooks.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create_webhook_endpoint(attributes) ⇒ Hash
Create webhook endpoint.
-
#delete_webhook_endpoint(id) ⇒ Boolean
Delete webhook endpoint.
-
#get_webhook_endpoint(id) ⇒ Hash
Get webhook endpoint.
-
#list_webhook_deliveries(params = {}) ⇒ PaginatedResponse
List webhook deliveries.
-
#list_webhook_endpoints(params = {}) ⇒ PaginatedResponse
List webhook endpoints.
-
#redeliver_webhook_event(delivery_id) ⇒ Hash
Redeliver webhook event.
-
#reset_webhook_endpoint_secret(id) ⇒ Hash
Reset webhook endpoint secret.
-
#update_webhook_endpoint(id, attributes) ⇒ Hash
Update webhook endpoint.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Polar::Resources::Base
Instance Method Details
#create_webhook_endpoint(attributes) ⇒ Hash
Create webhook endpoint
24 25 26 27 |
# File 'lib/polar/resources/webhooks.rb', line 24 def create_webhook_endpoint(attributes) response = post('/webhooks/endpoints', attributes) response.body end |
#delete_webhook_endpoint(id) ⇒ Boolean
Delete webhook endpoint
49 50 51 52 |
# File 'lib/polar/resources/webhooks.rb', line 49 def delete_webhook_endpoint(id) delete("/webhooks/endpoints/#{id}") true end |
#get_webhook_endpoint(id) ⇒ Hash
Get webhook endpoint
32 33 34 35 |
# File 'lib/polar/resources/webhooks.rb', line 32 def get_webhook_endpoint(id) response = get("/webhooks/endpoints/#{id}") response.body end |
#list_webhook_deliveries(params = {}) ⇒ PaginatedResponse
List webhook deliveries
68 69 70 |
# File 'lib/polar/resources/webhooks.rb', line 68 def list_webhook_deliveries(params = {}) paginate('/webhooks/deliveries', params) end |
#list_webhook_endpoints(params = {}) ⇒ PaginatedResponse
List webhook endpoints
14 15 16 |
# File 'lib/polar/resources/webhooks.rb', line 14 def list_webhook_endpoints(params = {}) paginate('/webhooks/endpoints', params) end |
#redeliver_webhook_event(delivery_id) ⇒ Hash
Redeliver webhook event
75 76 77 78 |
# File 'lib/polar/resources/webhooks.rb', line 75 def redeliver_webhook_event(delivery_id) response = post("/webhooks/deliveries/#{delivery_id}/redeliver") response.body end |
#reset_webhook_endpoint_secret(id) ⇒ Hash
Reset webhook endpoint secret
57 58 59 60 |
# File 'lib/polar/resources/webhooks.rb', line 57 def reset_webhook_endpoint_secret(id) response = post("/webhooks/endpoints/#{id}/secret/reset") response.body end |
#update_webhook_endpoint(id, attributes) ⇒ Hash
Update webhook endpoint
41 42 43 44 |
# File 'lib/polar/resources/webhooks.rb', line 41 def update_webhook_endpoint(id, attributes) response = patch("/webhooks/endpoints/#{id}", attributes) response.body end |