Module: MailchimpAPI::Audience::Interests::APIs
- Includes:
- Pagination::ListEachItemHelper
- Defined in:
- lib/mailchimp-api/resources/audience/interests.rb
Overview
Module with endpoints for Interests APIs
Instance Method Summary collapse
-
#create(list_id, interest_category_id, query: nil, body: nil, headers: nil) ⇒ Response
Create a new interest.
-
#delete(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete an interest.
-
#each(list_id, interest_category_id, query: nil, body: nil, headers: nil) {|Hash| ... } ⇒ Object
Iterate through all interests in an interest category.
-
#list(list_id, interest_category_id, query: nil, body: nil, headers: nil) ⇒ Response
List interests in a specific interest category.
-
#show(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) ⇒ Response
Show details for a specific interest.
-
#update(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) ⇒ Response
Update an interest.
Instance Method Details
#create(list_id, interest_category_id, query: nil, body: nil, headers: nil) ⇒ Response
Create a new interest
38 39 40 41 |
# File 'lib/mailchimp-api/resources/audience/interests.rb', line 38 def create(list_id, interest_category_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/interest-categories/#{interest_category_id}/interests" client.post(path, query: query, body: body, headers: headers) end |
#delete(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete an interest
68 69 70 71 |
# File 'lib/mailchimp-api/resources/audience/interests.rb', line 68 def delete(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/interest-categories/#{interest_category_id}/interests/#{interest_id}" client.delete(path, query: query, body: body, headers: headers) end |
#each(list_id, interest_category_id, query: nil, body: nil, headers: nil) {|Hash| ... } ⇒ Object
Iterate through all interests in an interest category
100 101 102 |
# File 'lib/mailchimp-api/resources/audience/interests.rb', line 100 def each(list_id, interest_category_id, query: nil, body: nil, headers: nil, &block) list_each_item(:interests, list_id, interest_category_id, query: query, body: body, headers: headers, &block) end |
#list(list_id, interest_category_id, query: nil, body: nil, headers: nil) ⇒ Response
List interests in a specific interest category
21 22 23 24 |
# File 'lib/mailchimp-api/resources/audience/interests.rb', line 21 def list(list_id, interest_category_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/interest-categories/#{interest_category_id}/interests" client.get(path, query: query, body: body, headers: headers) end |
#show(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) ⇒ Response
Show details for a specific interest
53 54 55 56 |
# File 'lib/mailchimp-api/resources/audience/interests.rb', line 53 def show(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/interest-categories/#{interest_category_id}/interests/#{interest_id}" client.get(path, query: query, body: body, headers: headers) end |
#update(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) ⇒ Response
Update an interest
85 86 87 88 |
# File 'lib/mailchimp-api/resources/audience/interests.rb', line 85 def update(list_id, interest_category_id, interest_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}/interest-categories/#{interest_category_id}/interests/#{interest_id}" client.patch(path, query: query, body: body, headers: headers) end |