Module: MailchimpAPI::Audiences::APIs
- Includes:
- Pagination::ListEachItemHelper
- Included in:
- MailchimpAPI::Audiences, MailchimpAPI::Audiences
- Defined in:
- lib/mailchimp-api/resources/audiences.rb
Overview
Module with endpoints for Audiences APIs
Instance Method Summary collapse
-
#batch_update_members(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Batch update members in audience.
-
#create(query: nil, body: nil, headers: nil) ⇒ Response
Create a new audience.
-
#delete(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete an audience.
-
#each(query: nil, body: nil, headers: nil) {|Hash| ... } ⇒ Object
Iterate through all audiences.
-
#list(query: nil, body: nil, headers: nil) ⇒ Response
List audiences.
-
#show(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Show details for a specific audience.
-
#update(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Update an audience.
Instance Method Details
#batch_update_members(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Batch update members in audience
87 88 89 90 |
# File 'lib/mailchimp-api/resources/audiences.rb', line 87 def batch_update_members(list_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}" client.post(path, query: query, body: body, headers: headers) end |
#create(query: nil, body: nil, headers: nil) ⇒ Response
Create a new audience
30 31 32 33 |
# File 'lib/mailchimp-api/resources/audiences.rb', line 30 def create(query: nil, body: nil, headers: nil) path = "/lists" client.post(path, query: query, body: body, headers: headers) end |
#delete(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Delete an audience
56 57 58 59 |
# File 'lib/mailchimp-api/resources/audiences.rb', line 56 def delete(list_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}" client.delete(path, query: query, body: body, headers: headers) end |
#each(query: nil, body: nil, headers: nil) {|Hash| ... } ⇒ Object
Iterate through all audiences
102 103 104 |
# File 'lib/mailchimp-api/resources/audiences.rb', line 102 def each(query: nil, body: nil, headers: nil, &block) list_each_item(:lists, query: query, body: body, headers: headers, &block) end |
#list(query: nil, body: nil, headers: nil) ⇒ Response
List audiences
18 19 20 21 |
# File 'lib/mailchimp-api/resources/audiences.rb', line 18 def list(query: nil, body: nil, headers: nil) path = "/lists" client.get(path, query: query, body: body, headers: headers) end |
#show(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Show details for a specific audience
43 44 45 46 |
# File 'lib/mailchimp-api/resources/audiences.rb', line 43 def show(list_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}" client.get(path, query: query, body: body, headers: headers) end |
#update(list_id, query: nil, body: nil, headers: nil) ⇒ Response
Update an audience
71 72 73 74 |
# File 'lib/mailchimp-api/resources/audiences.rb', line 71 def update(list_id, query: nil, body: nil, headers: nil) path = "/lists/#{list_id}" client.patch(path, query: query, body: body, headers: headers) end |