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