Class: Nylas::Webhooks
- Includes:
- ApiOperations::Delete, ApiOperations::Get, ApiOperations::Post, ApiOperations::Put
- Defined in:
- lib/nylas/resources/webhooks.rb
Overview
Nylas Webhooks API
Instance Method Summary collapse
-
#create(request_body:) ⇒ Array(Hash, String)
Create a webhook.
-
#destroy(webhook_id:) ⇒ Array(TrueClass, String)
Delete a webhook.
-
#find(webhook_id:) ⇒ Array(Hash, String)
Return a webhook.
-
#list ⇒ Array(Array(Hash), String)
Return all webhooks.
-
#update(webhook_id:, request_body:) ⇒ Array(Hash, String)
Update a webhook.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Nylas::Resource
Instance Method Details
#create(request_body:) ⇒ Array(Hash, String)
Create a webhook.
57 58 59 60 61 62 |
# File 'lib/nylas/resources/webhooks.rb', line 57 def create(request_body:) post( path: "#{api_uri}/v3/webhooks", request_body: request_body ) end |
#destroy(webhook_id:) ⇒ Array(TrueClass, String)
Delete a webhook.
80 81 82 83 84 85 86 |
# File 'lib/nylas/resources/webhooks.rb', line 80 def destroy(webhook_id:) _, request_id = delete( path: "#{api_uri}/v3/webhooks/#{webhook_id}" ) [true, request_id] end |
#find(webhook_id:) ⇒ Array(Hash, String)
Return a webhook.
47 48 49 50 51 |
# File 'lib/nylas/resources/webhooks.rb', line 47 def find(webhook_id:) get( path: "#{api_uri}/v3/webhooks/#{webhook_id}" ) end |
#list ⇒ Array(Array(Hash), String)
Return all webhooks.
37 38 39 40 41 |
# File 'lib/nylas/resources/webhooks.rb', line 37 def list get( path: "#{api_uri}/v3/webhooks" ) end |
#update(webhook_id:, request_body:) ⇒ Array(Hash, String)
Update a webhook.
69 70 71 72 73 74 |
# File 'lib/nylas/resources/webhooks.rb', line 69 def update(webhook_id:, request_body:) put( path: "#{api_uri}/v3/webhooks/#{webhook_id}", request_body: request_body ) end |