Module: MailchimpAPI::Audience::Webhooks::APIs
- Includes:
- Pagination::ListEachItemHelper
- Defined in:
- lib/mailchimp-api/resources/audience/webhooks.rb
Overview
Module with endpoints for Webhooks APIs
Instance Method Summary collapse
-
#create(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Create a new webhook.
-
#delete(list_id, webhook_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete a webhook.
-
#each(list_id, query: nil, body: nil, headers: nil) {|Hash| ... } ⇒ Object
Iterate through all webhooks for a list.
-
#list(list_id, query: nil, body: nil, headers: nil) ⇒ Response
List webhooks for a specific list.
-
#show(list_id, webhook_id, query: nil, body: nil, headers: nil) ⇒ Response
Show details for a specific webhook.
-
#update(list_id, webhook_id, query: nil, body: nil, headers: nil) ⇒ Response
Update a webhook.
Instance Method Details
#create(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Create a new webhook
38 39 40 41 |
# File 'lib/mailchimp-api/resources/audience/webhooks.rb', line 38 def create(list_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/webhooks" client.post(path, query: query, body: body, headers: headers) end |
#delete(list_id, webhook_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete a webhook
66 67 68 69 |
# File 'lib/mailchimp-api/resources/audience/webhooks.rb', line 66 def delete(list_id, webhook_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/webhooks/#{webhook_id}" client.delete(path, query: query, body: body, headers: headers) end |
#each(list_id, query: nil, body: nil, headers: nil) {|Hash| ... } ⇒ Object
Iterate through all webhooks for a list
97 98 99 |
# File 'lib/mailchimp-api/resources/audience/webhooks.rb', line 97 def each(list_id, query: nil, body: nil, headers: nil, &block) list_each_item(:webhooks, list_id, query: query, body: body, headers: headers, &block) end |
#list(list_id, query: nil, body: nil, headers: nil) ⇒ Response
List webhooks for a specific list
20 21 22 23 |
# File 'lib/mailchimp-api/resources/audience/webhooks.rb', line 20 def list(list_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/webhooks" client.get(path, query: query, body: body, headers: headers) end |
#show(list_id, webhook_id, query: nil, body: nil, headers: nil) ⇒ Response
Show details for a specific webhook
52 53 54 55 |
# File 'lib/mailchimp-api/resources/audience/webhooks.rb', line 52 def show(list_id, webhook_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/webhooks/#{webhook_id}" client.get(path, query: query, body: body, headers: headers) end |
#update(list_id, webhook_id, query: nil, body: nil, headers: nil) ⇒ Response
Update a webhook
82 83 84 85 |
# File 'lib/mailchimp-api/resources/audience/webhooks.rb', line 82 def update(list_id, webhook_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/webhooks/#{webhook_id}" client.patch(path, query: query, body: body, headers: headers) end |