Full Code of VingtCinq/python-mailchimp for AI

master bf61cd602dc4 cached
86 files
317.3 KB
76.3k tokens
414 symbols
1 requests
Download .txt
Showing preview only (341K chars total). Download the full file or copy to clipboard to get everything.
Repository: VingtCinq/python-mailchimp
Branch: master
Commit: bf61cd602dc4
Files: 86
Total size: 317.3 KB

Directory structure:
gitextract_mzccawi9/

├── .gitignore
├── LICENSE
├── README.md
├── README.rst
├── mailchimp3/
│   ├── __init__.py
│   ├── baseapi.py
│   ├── entities/
│   │   ├── __init__.py
│   │   ├── authorizedapps.py
│   │   ├── automationactions.py
│   │   ├── automationemailactions.py
│   │   ├── automationemailqueues.py
│   │   ├── automationemails.py
│   │   ├── automationremovedsubscribers.py
│   │   ├── automations.py
│   │   ├── batchoperations.py
│   │   ├── batchwebhooks.py
│   │   ├── campaignactions.py
│   │   ├── campaigncontent.py
│   │   ├── campaignfeedback.py
│   │   ├── campaignfolders.py
│   │   ├── campaigns.py
│   │   ├── campaignsendchecklist.py
│   │   ├── conversationmessages.py
│   │   ├── conversations.py
│   │   ├── customerjourney.py
│   │   ├── filemanagerfiles.py
│   │   ├── filemanagerfolders.py
│   │   ├── landingpageaction.py
│   │   ├── landingpagecontent.py
│   │   ├── landingpages.py
│   │   ├── listabusereports.py
│   │   ├── listactivity.py
│   │   ├── listclients.py
│   │   ├── listgrowthhistory.py
│   │   ├── listinterestcategories.py
│   │   ├── listinterestcategoryinterest.py
│   │   ├── listmemberactivity.py
│   │   ├── listmemberevents.py
│   │   ├── listmembergoals.py
│   │   ├── listmembernotes.py
│   │   ├── listmembers.py
│   │   ├── listmembertags.py
│   │   ├── listmergefields.py
│   │   ├── lists.py
│   │   ├── listsegmentmembers.py
│   │   ├── listsegments.py
│   │   ├── listsignupforms.py
│   │   ├── listwebhooks.py
│   │   ├── ping.py
│   │   ├── reportcampaignabusereports.py
│   │   ├── reportcampaignadvice.py
│   │   ├── reportclickdetailmembers.py
│   │   ├── reportclickdetailreports.py
│   │   ├── reportdomainperformance.py
│   │   ├── reporteepurl.py
│   │   ├── reportemailactivity.py
│   │   ├── reportgoogleanalytics.py
│   │   ├── reportlocations.py
│   │   ├── reportopendetails.py
│   │   ├── reports.py
│   │   ├── reportsentto.py
│   │   ├── reportsubreports.py
│   │   ├── reportunsubscribes.py
│   │   ├── root.py
│   │   ├── searchcampaigns.py
│   │   ├── searchmembers.py
│   │   ├── segments.py
│   │   ├── storecartlines.py
│   │   ├── storecarts.py
│   │   ├── storecustomers.py
│   │   ├── storeorderlines.py
│   │   ├── storeorders.py
│   │   ├── storeproductimages.py
│   │   ├── storeproducts.py
│   │   ├── storeproductvariants.py
│   │   ├── storepromocodes.py
│   │   ├── storepromorules.py
│   │   ├── stores.py
│   │   ├── templatedefaultcontent.py
│   │   ├── templatefolders.py
│   │   └── templates.py
│   ├── helpers.py
│   └── mailchimpclient.py
├── setup.cfg
├── setup.py
└── test.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
venv/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# PyCharm project files
.idea

# vscode
.vscode

# sonarlint
.sonarlint


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015 Charles TISSIER

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



================================================
FILE: README.md
================================================
[![mailchimp3 v3.0.21 on PyPi](https://img.shields.io/pypi/v/mailchimp3.svg)](https://pypi.python.org/pypi/mailchimp3)
![MIT license](https://img.shields.io/badge/licence-MIT-blue.svg)
![Stable](https://img.shields.io/badge/status-stable-green.svg)

# python-mailchimp-api

A straightforward python client for v3 of MailChimp API using
requests >= 2.7.0.

## Getting Started

### Installation

This client is hosted at PyPi under the name `mailchimp3`, to install
it, simply run

`pip install mailchimp3`

### Upgrading from v2.x

The order of arguments for initializing the Mailchimp API has been
reversed starting in 2.1.0 as the username is an optional argument for
basic auth. Please reverse the order of your arguments or remove the
username argument entirely. The name of the authentication argument has
also changed from `mc_secret` to `mc_api`.

### Upgrading from v1.x

The installation procedure for 2.x is the same as before, however
there are a massive number of changes to the naming conventions within
this wrapper and the way in which certain methods are called. Please
read the documentation below carefully for information on the new
structure and expanded functionality. With this release, all documented
endpoints are implemented and all endpoint methods are available.

### History

Up to date with [changelog](http://developer.mailchimp.com/documentation/mailchimp/guides/changelog/)
features listed through 3/03/2017.

### Initialization

Grab `YOUR_API_KEY` from your mailchimp account (Account > Extra > Api
Keys). `YOUR_USERNAME` is the one you use to log in on the website and
is optional.

    from mailchimp3 import MailChimp

    client = MailChimp(mc_api='YOUR_API_KEY', mc_user='YOUR_USERNAME')

### OAuth Support

In addition to HTTP Basic Authentication, MailChimp supports
authentication through OAuth2. Information on obtaining the proper
access key can be found
[here](http://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/).

### Pagination

Simply add `count` and `offset` arguments in your function. The count is how
many records to return, the offset is how many records to skip. For endpoints
that allow the pagination parameters, the all() method has an additional boolean
`get_all` argument that will loop through all records until the API no longer
returns any to get all records without manually performing an additional query.
By default, count is 10 and offset is 0 for all endpoints that support it. The
`get_all` parameter on the all() method on any endpoint defaults to false, which
follows the values that are provided in the call, and using `get_all=True` will
ignore the provided offset to ensure that all records are returned. When using
get_all, the count will be 500 unless otherwise specified. It is strongly
recommended to avoid small values for `count` to fetch large numbers of records
because this will flood the system. A large `count` size should not impact calls
which are expected to return a very small number of records, and should improve
performance for calls where fetching 500 records would only provide a fraction
by preventing the delay of making a huge number of requests.

    client.lists.members.all('123456', count=100, offset=0)

### Fields

Many endpoints allow you to select which fields will be returned out of
all available fields (for example, only the email_address of a member).
Simply add `fields` arguments in your function. The following only
display email_address and id for each member in list 123456:

    client.lists.members.all('123456', get_all=True, fields="members.email_address,members.id")

### Examples

    # returns all the lists (only name and id)
    client.lists.all(get_all=True, fields="lists.name,lists.id")

    # returns all members inside list '123456'
    client.lists.members.all('123456', get_all=True)

    # return the first 100 member's email addresses for the list with id 123456
    client.lists.members.all('123456', count=100, offset=0, fields="members.email_address")

    # returns the list matching id '123456'
    client.lists.get('123456')

    # add John Doe with email john.doe@example.com to list matching id '123456'
    client.lists.members.create('123456', {
        'email_address': 'john.doe@example.com',
        'status': 'subscribed',
        'merge_fields': {
            'FNAME': 'John',
            'LNAME': 'Doe',
        },
    })

    # returns all the campaigns
    client.campaigns.all(get_all=True)

    # You can also disable at runtime with the optional ``enabled`` parameter.
    # Every API call will return None
    client = MailChimp('YOUR SECRET KEY', enabled=False)

    # You are encouraged to specify a value in seconds for the ``timeout``
    # parameter to avoid hanging requests.
    client = MailChimp('YOUR SECRET KEY', timeout=10.0)

    # You are encouraged to specify a User-Agent for requests to the MailChimp
    # API. Headers can be specified using the ``request_headers`` parameter.
    headers = requests.utils.default_headers()
    headers['User-Agent'] = 'Example (example@example.com)'
    client = MailChimp('YOUR SECRET KEY', request_headers=headers)

## API Structure

All endpoints follow the structure listed in the official MailChimp API
v3 documentation. The structure will be listed below and then the
individual methods available after.

    MailChimp
    +- Root
    +- Authorized Apps
    +- Automations
    |  +- Actions
    |  +- Emails
    |  |  +- Actions
    |  |  +- Queues
    |  +- Removed Subscribers
    +- Batch Operations
    +- Batch Webhooks
    +- Campaign Folders
    +- Campaigns
    |  +- Actions
    |  +- Content
    |  +- Feedback
    |  +- Send Checklist
    +- Conversations
    |  +- Messages
    +- Customer Journeys
    +- Stores
    |  +- Carts
    |  |  +- Lines
    |  +- Customers
    |  +- Orders
    |  |  +- Lines
    |  +- Products
    |     +- Images
    |     +- Variants
    |  +- Promo Rules
    |     +- Promo Codes
    +- File Manager Files
    +- File Manager Folders
    +- Landing Pages
    |  +- Actions
    |  +- Content
    +- Lists
    |  +- Abuse Reports
    |  +- Activity
    |  +- Clients
    |  +- Growth History
    |  +- Interest Categories
    |  |  +- Interests
    |  +- Members
    |  |  +- Activity
    |  |  +- Events
    |  |  +- Goals
    |  |  +- Notes
    |  |  +- Tags
    |  +- Merge Fields
    |  +- Segments
    |  |  +- Segment Members
    |  +- Signup Forms
    |  +- Twitter Lead Generation Carts
    |  +- Webhooks
    +- Ping
    +- Reports
    |  +- Campaign Abuse
    |  +- Campaign Advice
    |  +- Campaign Open reports
    |  +- Click Reports
    |  |  +- Members
    |  +- Domain Performance
    |  +- EepURL Reports
    |  +- Email Activity
    |  +- Google Analytics
    |  +- Location
    |  +- Sent To
    |  +- Sub-Reports
    |  +- Unsubscribes
    +- Search Campaigns
    +- Search Members
    +- Template Folders
    +- Templates
       +- Default Content

## API Endpoints

Below is the list of all endpoints and the methods that can be called
against them. Any endpoint that has a method that takes an ID argument
(for example the app_id in the authorized_apps endpoint or the
subscriber_hash in the list members endpoints) will record all IDs
passed as well as those generated by methods that will only ever return
a single result such as the create() method present on some endpoints.
These stored attributes are only available at the level that they were
passed or created at and must be passed again to interact with a lower
or higher level such as accessing a list and then a member. The below
code assumes that you have initialized the MailChimp class as listed
above with the name `client`.

### Root

#### Root

    client.root.get()

### Authorized Apps

#### Authorized Apps

    client.authorized_apps.create(data={})
    client.authorized_apps.all(get_all=False)
    client.authorized_apps.get(app_id='')

### Automations

#### Automations

    client.automations.all(get_all=False)
    client.automations.get(workflow_id='')

#### Automation Actions

    client.automations.actions.pause(workflow_id='')
    client.automations.actions.start(workflow_id='')

#### Automation Emails

    client.automations.emails.all(workflow_id='')
    client.automations.emails.get(workflow_id='', email_id='')

#### Automation Email Actions

    client.automations.emails.actions.pause(workflow_id='', email_id='')
    client.automations.emails.actions.start(workflow_id='', email_id='')

#### Automation Email Queues

    client.automations.emails.queues.create(workflow_id='', email_id='', data={})
    client.automations.emails.queues.all(workflow_id='', email_id='')
    client.automations.emails.queues.get(workflow_id='', email_id='', subscriber_hash='')

#### Automation Removed Subscribers

    client.automations.removed_subscribers.create(workflow_id='', data={})
    client.automations.removed_subscribers.all(workflow_id='')

### Batch Operations

#### Batch Operations

    client.batch_operations.create(data={})
    client.batch_operations.all(get_all=False)
    client.batch_operations.get(batch_id='')
    client.batch_operations.delete(batch_id='')

### Batch Webhooks

#### Batch Webhooks

    client.batch_webhooks.create(data={})
    client.batch_webhooks.all(get_all=False)
    client.batch_webhooks.get(batch_webhook_id='')
    client.batch_webhooks.update(batch_webhook_id='', data={})
    client.batch_webhooks.delete(batch_webhook_id='')

### Campaigns

#### Folders

    client.campaign_folders.create(data={})
    client.campaign_folders.all(get_all=False)
    client.campaign_folders.get(folder_id='')
    client.campaign_folders.update(folder_id='', data={})
    client.campaign_folders.delete(folder_id='')

#### Campaigns

    client.campaigns.create(data={})
    client.campaigns.all(get_all=False)
    client.campaigns.get(campaign_id='')
    client.campaigns.update(campaign_id='')
    client.campaigns.delete(campaign_id='')

#### Campaign Actions

    client.campaigns.actions.cancel(campaign_id='')
    client.campaigns.actions.pause(campaign_id='')
    client.campaigns.actions.replicate(campaign_id='')
    client.campaigns.actions.resume(campaign_id='')
    client.campaigns.actions.schedule(campaign_id='', data={})
    client.campaigns.actions.send(campaign_id='')
    client.campaigns.actions.resend(campaign_id='')
    client.campaigns.actions.test(campaign_id='', data={})
    client.campaigns.actions.unschedule(campaign_id='')

#### Campaign Content

    client.campaigns.content.get(campaign_id='')
    client.campaigns.content.update(campaign_id='', data={})

#### Campaign Feedback

    client.campaigns.feedback.create(campaign_id='', data={})
    client.campaigns.feedback.all(campaign_id='', get_all=False)
    client.campaigns.feedback.get(campaign_id='', feedback_id='')
    client.campaigns.feedback.update(campaign_id='', feedback_id='', data={})
    client.campaigns.feedback.delete(campaign_id='', feedback_id='')

#### Campaign Send Checklist

    client.campaigns.send_checklist.get(campaign_id='')

### Conversations

#### Conversations

    client.conversations.all(get_all=False)
    client.conversations.get(conversation_id='')

#### Conversation Messages

    client.conversations.messages.create(conversation_id='', data={})
    client.conversations.messages.all(conversation_id='')
    client.conversations.messages.get(conversation_id='', message_id='')

### Customer Journeys

#### Customer Journeys

    client.customer_journeys.trigger(journey_id='', step_id='', data={})

### E-Commerce

#### Stores

    client.stores.create(data={})
    client.stores.all(get_all=False)
    client.stores.get(store_id='')
    client.stores.update(store_id='', data={})
    client.stores.delete(store_id='')

#### Store Carts

    client.stores.carts.create(store_id='', data={})
    client.stores.carts.all(store_id='', get_all=False)
    client.stores.carts.get(store_id='', cart_id='')
    client.stores.carts.update(store_id='', cart_id='', data={})
    client.stores.carts.delete(store_id='', cart_id='')

#### Store Cart Lines

    client.stores.carts.lines.create(store_id='', cart_id='', data={})
    client.stores.carts.lines.all(store_id='', cart_id='', get_all=False)
    client.stores.carts.lines.get(store_id='', cart_id='', line_id='')
    client.stores.carts.lines.update(store_id='', cart_id='', line_id='', data={})
    client.stores.carts.lines.delete(store_id='', cart_id='', line_id='')

#### Store Customers

    client.stores.customers.create(store_id='', data={})
    client.stores.customers.all(store_id='', get_all=False)
    client.stores.customers.get(store_id='', customer_id='')
    client.stores.customers.update(store_id='', customer_id='', data={})
    client.stores.customers.create_or_update(store_id='', customer_id='', data={})
    client.stores.customers.delete(store_id='', customer_id='')

#### Store Orders

    client.stores.orders.create(store_id='', data={})
    client.stores.orders.all(store_id='', get_all=False)
    client.stores.orders.get(store_id='', order_id='')
    client.stores.orders.update(store_id='', order_id='', data={})
    client.stores.orders.delete(store_id='', order_id='')

#### Store Order Lines

    client.stores.orders.lines.create(store_id='', order_id='', data={})
    client.stores.orders.lines.all(store_id='', order_id='', get_all=False)
    client.stores.orders.lines.get(store_id='', order_id='', line_id='')
    client.stores.orders.lines.update(store_id='', order_id='', line_id='', data={})
    client.stores.orders.lines.delete(store_id='', order_id='', line_id='')

#### Store Products

    client.stores.products.create(store_id='', data={})
    client.stores.products.all(store_id='', get_all=False)
    client.stores.products.get(store_id='', product_id='')
    client.stores.products.update(store_id='', product_id='')
    client.stores.products.delete(store_id='', product_id='')

#### Store Product Images

    client.stores.products.images.create(store_id='', product_id='', data={})
    client.stores.products.images.all(store_id='', product_id='', get_all=False)
    client.stores.products.images.get(store_id='', product_id='', image_id='')
    client.stores.products.images.update(store_id='', product_id='', image_id='', data={})
    client.stores.products.images.delete(store_id='', product_id='', image_id='')

#### Store Product Variants

    client.stores.products.variants.create(store_id='', product_id='', data={})
    client.stores.products.variants.all(store_id='', product_id='', get_all=False)
    client.stores.products.variants.get(store_id='', product_id='', variant_id='')
    client.stores.products.variants.update(store_id='', product_id='', variant_id='', data={})
    client.stores.products.variants.create_or_update(store_id='', product_id='', variant_id='', data={})
    client.stores.products.variants.delete(store_id='', product_id='', variant_id='')

### File Manager

#### Files

    client.files.create(data={})
    client.files.all(get_all=False)
    client.files.get(file_id='')
    client.files.update(file_id='', data={})
    client.files.delete(file_id='')

#### Folders

    client.folders.create(data={})
    client.folders.all(get_all=False)
    client.folders.get(folder_id='')
    client.folders.update(folder_id='', data={})
    client.folders.delete(folder_id='')

### Landing Pages

#### Landing Pages

    client.landing_pages.create(data={})
    client.landing_pages.all()
    client.landing_pages.all(fields='')
    client.landing_pages.get(page_id='')
    client.landing_pages.update(page_id='', data={})
    client.landing_pages.delete(page_id='')
   
#### Landing Pages Actions

    client.landing_pages.actions.publish(page_id='')
    client.landing_pages.actions.unpublish(page_id='')
   
#### Landing Pages Content

    client.landing_pages.content.get(page_id='')

### Lists

#### Lists

    client.lists.create(data={})
    client.lists.update_members(list_id='', data={})
    client.lists.all(get_all=False)
    client.lists.get(list_id='')
    client.lists.update(list_id='', data={})
    client.lists.delete(list_id='')

#### List Abuse Reports

    client.lists.abuse_reports.all(list_id='', get_all=False)
    client.lists.abuse_reports.get(list_id='', report_id='')

#### List Activity

    client.lists.activity.all(list_id='', subscriber_hash='')
    client.lists.activity.feed(list_id='', subscriber_hash='')

#### List Clients

    client.lists.clients.all(list_id='')

#### List Growth History

    client.lists.growth_history.all(list_id='', get_all=False)
    client.lists.growth_history.get(list_id='', month='')

#### List Interest Categories

    client.lists.interest_categories.create(list_id='', data={})
    client.lists.interest_categories.all(list_id='', get_all=False)
    client.lists.interest_categories.get(list_id='', category_id='')
    client.lists.interest_categories.update(list_id='', category_id='', data={})
    client.lists.interest_categories.delete(list_id='', category_id='')

#### List Interest Category Interests

    client.lists.interest_categories.interests.create(list_id='', category_id='', data={})
    client.lists.interest_categories.interests.all(list_id='', category_id='', get_all=False)
    client.lists.interest_categories.interests.get(list_id='', category_id='', interest_id='')
    client.lists.interest_categories.interests.update(list_id='', category_id='', interest_id='', data={})
    client.lists.interest_categories.interests.delete(list_id='', category_id='', interest_id='')

#### List Members

    client.lists.members.create(list_id='', data={})
    client.lists.members.all(list_id='', get_all=False)
    client.lists.members.get(list_id='', subscriber_hash='')
    client.lists.members.update(list_id='', subscriber_hash='', data={})
    client.lists.members.create_or_update(list_id='', subscriber_hash='', data={})
    client.lists.members.delete(list_id='', subscriber_hash='')
    client.lists.members.delete_permanent(list_id='', subscriber_hash='')

#### List Member Activity

    client.lists.members.activity.all(list_id='', subscriber_hash='')

#### List Member Events

    client.lists.members.events.create(list_id='', subscriber_hash='', data={})
    client.lists.members.events.all(list_id='', subscriber_hash='', get_all=False)

#### List Member Goals

    client.lists.members.goals.all(list_id='', subscriber_hash='')

#### List Member Notes

    client.lists.members.notes.create(list_id='', subscriber_hash='', data={})
    client.lists.members.notes.all(list_id='', subscriber_hash='', get_all=False)
    client.lists.members.notes.get(list_id='', subscriber_hash='', note_id='')
    client.lists.members.notes.update(list_id='', subscriber_hash='', note_id='', data={})
    client.lists.members.notes.delete(list_id='', subscriber_hash='', note_id='')

#### List Member Tags

    client.lists.members.tags.update(list_id='', subscriber_hash='', data={})
    client.lists.members.tags.all(list_id='', subscriber_hash='')

#### List Merge Fields

    client.lists.merge_fields.create(list_id='', data={})
    client.lists.merge_fields.all(list_id='', get_all=False)
    client.lists.merge_fields.get(list_id='', merge_id='')
    client.lists.merge_fields.update(list_id='', merge_id='', data={})
    client.lists.merge_fields.delete(list_id='', merge_id='')

#### List Segments

    client.lists.segments.create(list_id='', data={})
    client.lists.segments.all(list_id='', get_all=False)
    client.lists.segments.get(list_id='', segment_id='')
    client.lists.segments.update(list_id='', segment_id='', data={})
    client.lists.segments.update_members(list_id='', segment_id='', data={})
    client.lists.segments.delete(list_id='', segment_id='')

#### List Segment Members

    client.lists.segments.members.create(list_id='', segment_id='', data={})
    client.lists.segments.members.all(list_id='', segment_id='', get_all=False)
    client.lists.segments.members.delete(list_id='', segment_id='', subscriber_hash='')

#### List Signup Forms

    client.lists.signup_forms.create(list_id='', data={})
    client.lists.signup_forms.all(list_id='')

#### List Webhooks

    client.lists.webhooks.create(list_id='', data={})
    client.lists.webhooks.all(list_id='')
    client.lists.webhooks.get(list_id='', webhook_id='')
    client.lists.webhooks.update(list_id='', webhook_id='', data={})
    client.lists.webhooks.delete(list_id='', webhook_id='')

### Reports

#### Reports

    client.reports.all(get_all=False)
    client.reports.get(campaign_id='')

#### Campaign Abuse Reports

    client.reports.abuse_reports.all(campaign_id='')
    client.reports.abuse_reports.get(campaign_id='', report_id='')

#### Campaign Advice

    client.reports.advice.all(campaign_id='')

#### Click Details Report

    client.reports.click_details.all(campaign_id='', get_all=False)
    client.reports.click_details.get(campaign_id='', link_id='')

#### Click Details Report Members

    client.reports.click_details.members.all(campaign_id='', link_id='', get_all=False)
    client.reports.click_details.members.get(campaign_id='', link_id='', subscriber_hash='')

#### Domain Performance Reports

    client.reports.domain_performance.all(campaign_id='')

#### EepURL Reports

    client.reports.eepurl.all(camnpaign_id='')

#### Email Activity Reports

    client.reports.email_activity.all(campaign_id='', get_all=False)
    client.reports.email_activity.get(campaign_id='', subscriber_hash='')

#### Locations Report

    client.reports.locations.all(campaign_id='', get_all=False)

#### Sent To Reports

    client.reports.sent_to.all(campaign_id='', get_all=False)
    client.reports.sent_to.get(campaign_id='', subscriber_hash='')

#### Sub-Reports

    client.reports.subreports.all(campaign_id='')

#### Unsubscribes

    client.reports.unsubscribes.all(campaign_id='', get_all=False)
    client.reports.unsubscribes.get(campaign_id='', subscriber_hash='')

### Search

#### Campaigns

    client.search_campaigns.get()

#### Members

    client.search_members.get()

### Templates

#### Folders

    client.template_folders.create(data={})
    client.template_folders.all(get_all=False)
    client.template_folders.get(folder_id='')
    client.template_folders.update(folder_id='', data={})
    client.template_folders.delete(folder_id='')

#### Templates

    client.templates.create(data={})
    client.templates.all(get_all=False)
    client.templates.get(template_id='')
    client.templates.update(template_id='', data={})
    client.templates.delete(template_id='')

#### Default Content

    client.templates.default_content.all(template_id='')

## Logging

The MailChimp client will log request/response detail into the mailchimp3.client
logging namespace. Consider the following snippet to get started with logging:

```python
import logging
fh = logging.FileHandler('/path/to/some/log.log')
logger = logging.getLogger('mailchimp3.client')
logger.addHandler(fh)

# use the client normally
client.lists.all(**{'fields': 'lists.date_created'})
```

request/response detail will be appended into /path/to/some/log.log:
```
GET Request: https://us15.api.mailchimp.com/3.0/lists?fields=lists.date_created
GET Response: 200 {"lists":[{"date_created":"2017-05-10T13:53:05+00:00"},{"date_created":"2017-08-22T20:27:56+00:00"},{"date_created":"2017-05-12T21:22:15+00:00"},{"date_created":"2017-04-27T17:42:04+00:00"},{"date_created":"2017-05-10T14:14:49+00:00"},{"date_created":"2017-05-10T13:52:37+00:00"},{"date_created":"2017-05-10T13:51:40+00:00"}]}
```

Check the [docs](https://docs.python.org/2/library/logging.html) for more detail on the Python logging package.

## Support

If you are having issues, please let us know or submit a pull request.

## License

The project is licensed under the MIT License.


================================================
FILE: README.rst
================================================
|mailchimp3 v3.0.21 on PyPi| |MIT license| |Stable|

python-mailchimp-api
====================

A straightforward python client for v3 of MailChimp API using requests
>= 2.7.0.

Getting Started
---------------

Installation
~~~~~~~~~~~~

This client is hosted at PyPi under the name ``mailchimp3``, to install
it, simply run

``pip install mailchimp3``

Upgrading from v2.x
~~~~~~~~~~~~~~~~~~~

The order of arguments for initializing the Mailchimp API has been
reversed starting in 2.1.0 as the username is an optional argument for
basic auth. Please reverse the order of your arguments or remove the
username argument entirely. The name of the authentication argument has
also changed from ``mc_secret`` to ``mc_api``.

Upgrading from v1.x
~~~~~~~~~~~~~~~~~~~

The installation procedure for 2.x is the same as before, however there
are a massive number of changes to the naming conventions within this
wrapper and the way in which certain methods are called. Please read the
documentation below carefully for information on the new structure and
expanded functionality. With this release, all documented endpoints are
implemented and all endpoint methods are available.

History
~~~~~~~

Up to date with
`changelog <http://developer.mailchimp.com/documentation/mailchimp/guides/changelog/>`__
features listed through 3/03/2017.

Initialization
~~~~~~~~~~~~~~

Grab ``YOUR_API_KEY`` from your mailchimp account (Account > Extra > Api
Keys). ``YOUR_USERNAME`` is the one you use to log in on the website and
is optional.

::

   from mailchimp3 import MailChimp

   client = MailChimp(mc_api='YOUR_API_KEY', mc_user='YOUR_USERNAME')

OAuth Support
~~~~~~~~~~~~~

In addition to HTTP Basic Authentication, MailChimp supports
authentication through OAuth2. Information on obtaining the proper
access key can be found
`here <http://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/>`__.

Pagination
~~~~~~~~~~

Simply add ``count`` and ``offset`` arguments in your function. The
count is how many records to return, the offset is how many records to
skip. For endpoints that allow the pagination parameters, the all()
method has an additional boolean ``get_all`` argument that will loop
through all records until the API no longer returns any to get all
records without manually performing an additional query. By default,
count is 10 and offset is 0 for all endpoints that support it. The
``get_all`` parameter on the all() method on any endpoint defaults to
false, which follows the values that are provided in the call, and using
``get_all=True`` will ignore the provided offset to ensure that all
records are returned. When using get_all, the count will be 500 unless
otherwise specified. It is strongly recommended to avoid small values
for ``count`` to fetch large numbers of records because this will flood
the system. A large ``count`` size should not impact calls which are
expected to return a very small number of records, and should improve
performance for calls where fetching 500 records would only provide a
fraction by preventing the delay of making a huge number of requests.

::

   client.lists.members.all('123456', count=100, offset=0)

Fields
~~~~~~

Many endpoints allow you to select which fields will be returned out of
all available fields (for example, only the email_address of a member).
Simply add ``fields`` arguments in your function. The following only
display email_address and id for each member in list 123456:

::

   client.lists.members.all('123456', get_all=True, fields="members.email_address,members.id")

Examples
~~~~~~~~

::

   # returns all the lists (only name and id)
   client.lists.all(get_all=True, fields="lists.name,lists.id")

   # returns all members inside list '123456'
   client.lists.members.all('123456', get_all=True)

   # return the first 100 member's email addresses for the list with id 123456
   client.lists.members.all('123456', count=100, offset=0, fields="members.email_address")

   # returns the list matching id '123456'
   client.lists.get('123456')

   # add John Doe with email john.doe@example.com to list matching id '123456'
   client.lists.members.create('123456', {
       'email_address': 'john.doe@example.com',
       'status': 'subscribed',
       'merge_fields': {
           'FNAME': 'John',
           'LNAME': 'Doe',
       },
   })

   # returns all the campaigns
   client.campaigns.all(get_all=True)

   # You can also disable at runtime with the optional ``enabled`` parameter.
   # Every API call will return None
   client = MailChimp('YOUR SECRET KEY', enabled=False)

   # You are encouraged to specify a value in seconds for the ``timeout``
   # parameter to avoid hanging requests.
   client = MailChimp('YOUR SECRET KEY', timeout=10.0)

   # You are encouraged to specify a User-Agent for requests to the MailChimp
   # API. Headers can be specified using the ``request_headers`` parameter.
   headers = requests.utils.default_headers()
   headers['User-Agent'] = 'Example (example@example.com)'
   client = MailChimp('YOUR SECRET KEY', request_headers=headers)

API Structure
-------------

All endpoints follow the structure listed in the official MailChimp API
v3 documentation. The structure will be listed below and then the
individual methods available after.

::

   MailChimp
   +- Root
   +- Authorized Apps
   +- Automations
   |  +- Actions
   |  +- Emails
   |  |  +- Actions
   |  |  +- Queues
   |  +- Removed Subscribers
   +- Batch Operations
   +- Batch Webhooks
   +- Campaign Folders
   +- Campaigns
   |  +- Actions
   |  +- Content
   |  +- Feedback
   |  +- Send Checklist
   +- Conversations
   |  +- Messages
   +- Customer Journeys
   +- Stores
   |  +- Carts
   |  |  +- Lines
   |  +- Customers
   |  +- Orders
   |  |  +- Lines
   |  +- Products
   |     +- Images
   |     +- Variants
   |  +- Promo Rules
   |     +- Promo Codes
   +- File Manager Files
   +- File Manager Folders
   +- Landing Pages
   |  +- Actions
   |  +- Content
   +- Lists
   |  +- Abuse Reports
   |  +- Activity
   |  +- Clients
   |  +- Growth History
   |  +- Interest Categories
   |  |  +- Interests
   |  +- Members
   |  |  +- Activity
   |  |  +- Events
   |  |  +- Goals
   |  |  +- Notes
   |  |  +- Tags
   |  +- Merge Fields
   |  +- Segments
   |  |  +- Segment Members
   |  +- Signup Forms
   |  +- Twitter Lead Generation Carts
   |  +- Webhooks
   +- Ping
   +- Reports
   |  +- Campaign Abuse
   |  +- Campaign Advice
   |  +- Campaign Open reports
   |  +- Click Reports
   |  |  +- Members
   |  +- Domain Performance
   |  +- EepURL Reports
   |  +- Email Activity
   |  +- Google Analytics
   |  +- Location
   |  +- Sent To
   |  +- Sub-Reports
   |  +- Unsubscribes
   +- Search Campaigns
   +- Search Members
   +- Template Folders
   +- Templates
      +- Default Content

API Endpoints
-------------

Below is the list of all endpoints and the methods that can be called
against them. Any endpoint that has a method that takes an ID argument
(for example the app_id in the authorized_apps endpoint or the
subscriber_hash in the list members endpoints) will record all IDs
passed as well as those generated by methods that will only ever return
a single result such as the create() method present on some endpoints.
These stored attributes are only available at the level that they were
passed or created at and must be passed again to interact with a lower
or higher level such as accessing a list and then a member. The below
code assumes that you have initialized the MailChimp class as listed
above with the name ``client``.

Root
~~~~

.. _root-1:

Root
^^^^

::

   client.root.get()

Authorized Apps
~~~~~~~~~~~~~~~

.. _authorized-apps-1:

Authorized Apps
^^^^^^^^^^^^^^^

::

   client.authorized_apps.create(data={})
   client.authorized_apps.all(get_all=False)
   client.authorized_apps.get(app_id='')

Automations
~~~~~~~~~~~

.. _automations-1:

Automations
^^^^^^^^^^^

::

   client.automations.all(get_all=False)
   client.automations.get(workflow_id='')

Automation Actions
^^^^^^^^^^^^^^^^^^

::

   client.automations.actions.pause(workflow_id='')
   client.automations.actions.start(workflow_id='')

Automation Emails
^^^^^^^^^^^^^^^^^

::

   client.automations.emails.all(workflow_id='')
   client.automations.emails.get(workflow_id='', email_id='')

Automation Email Actions
^^^^^^^^^^^^^^^^^^^^^^^^

::

   client.automations.emails.actions.pause(workflow_id='', email_id='')
   client.automations.emails.actions.start(workflow_id='', email_id='')

Automation Email Queues
^^^^^^^^^^^^^^^^^^^^^^^

::

   client.automations.emails.queues.create(workflow_id='', email_id='', data={})
   client.automations.emails.queues.all(workflow_id='', email_id='')
   client.automations.emails.queues.get(workflow_id='', email_id='', subscriber_hash='')

Automation Removed Subscribers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

   client.automations.removed_subscribers.create(workflow_id='', data={})
   client.automations.removed_subscribers.all(workflow_id='')

Batch Operations
~~~~~~~~~~~~~~~~

.. _batch-operations-1:

Batch Operations
^^^^^^^^^^^^^^^^

::

   client.batch_operations.create(data={})
   client.batch_operations.all(get_all=False)
   client.batch_operations.get(batch_id='')
   client.batch_operations.delete(batch_id='')

Batch Webhooks
~~~~~~~~~~~~~~

.. _batch-webhooks-1:

Batch Webhooks
^^^^^^^^^^^^^^

::

   client.batch_webhooks.create(data={})
   client.batch_webhooks.all(get_all=False)
   client.batch_webhooks.get(batch_webhook_id='')
   client.batch_webhooks.update(batch_webhook_id='', data={})
   client.batch_webhooks.delete(batch_webhook_id='')

Campaigns
~~~~~~~~~

Folders
^^^^^^^

::

   client.campaign_folders.create(data={})
   client.campaign_folders.all(get_all=False)
   client.campaign_folders.get(folder_id='')
   client.campaign_folders.update(folder_id='', data={})
   client.campaign_folders.delete(folder_id='')

.. _campaigns-1:

Campaigns
^^^^^^^^^

::

   client.campaigns.create(data={})
   client.campaigns.all(get_all=False)
   client.campaigns.get(campaign_id='')
   client.campaigns.update(campaign_id='')
   client.campaigns.delete(campaign_id='')

Campaign Actions
^^^^^^^^^^^^^^^^

::

   client.campaigns.actions.cancel(campaign_id='')
   client.campaigns.actions.pause(campaign_id='')
   client.campaigns.actions.replicate(campaign_id='')
   client.campaigns.actions.resume(campaign_id='')
   client.campaigns.actions.schedule(campaign_id='', data={})
   client.campaigns.actions.send(campaign_id='')
   client.campaigns.actions.resend(campaign_id='')
   client.campaigns.actions.test(campaign_id='', data={})
   client.campaigns.actions.unschedule(campaign_id='')

Campaign Content
^^^^^^^^^^^^^^^^

::

   client.campaigns.content.get(campaign_id='')
   client.campaigns.content.update(campaign_id='', data={})

Campaign Feedback
^^^^^^^^^^^^^^^^^

::

   client.campaigns.feedback.create(campaign_id='', data={})
   client.campaigns.feedback.all(campaign_id='', get_all=False)
   client.campaigns.feedback.get(campaign_id='', feedback_id='')
   client.campaigns.feedback.update(campaign_id='', feedback_id='', data={})
   client.campaigns.feedback.delete(campaign_id='', feedback_id='')

Campaign Send Checklist
^^^^^^^^^^^^^^^^^^^^^^^

::

   client.campaigns.send_checklist.get(campaign_id='')

Conversations
~~~~~~~~~~~~~

.. _conversations-1:

Conversations
^^^^^^^^^^^^^

::

   client.conversations.all(get_all=False)
   client.conversations.get(conversation_id='')

Conversation Messages
^^^^^^^^^^^^^^^^^^^^^

::

   client.conversations.messages.create(conversation_id='', data={})
   client.conversations.messages.all(conversation_id='')
   client.conversations.messages.get(conversation_id='', message_id='')

Customer Journeys
~~~~~~~~~~~~~~~~~

.. _customer-journeys-1:

Customer Journeys
^^^^^^^^^^^^^^^^^

::

   client.customer_journeys.trigger(journey_id='', step_id='', data={})

E-Commerce
~~~~~~~~~~

Stores
^^^^^^

::

   client.stores.create(data={})
   client.stores.all(get_all=False)
   client.stores.get(store_id='')
   client.stores.update(store_id='', data={})
   client.stores.delete(store_id='')

Store Carts
^^^^^^^^^^^

::

   client.stores.carts.create(store_id='', data={})
   client.stores.carts.all(store_id='', get_all=False)
   client.stores.carts.get(store_id='', cart_id='')
   client.stores.carts.update(store_id='', cart_id='', data={})
   client.stores.carts.delete(store_id='', cart_id='')

Store Cart Lines
^^^^^^^^^^^^^^^^

::

   client.stores.carts.lines.create(store_id='', cart_id='', data={})
   client.stores.carts.lines.all(store_id='', cart_id='', get_all=False)
   client.stores.carts.lines.get(store_id='', cart_id='', line_id='')
   client.stores.carts.lines.update(store_id='', cart_id='', line_id='', data={})
   client.stores.carts.lines.delete(store_id='', cart_id='', line_id='')

Store Customers
^^^^^^^^^^^^^^^

::

   client.stores.customers.create(store_id='', data={})
   client.stores.customers.all(store_id='', get_all=False)
   client.stores.customers.get(store_id='', customer_id='')
   client.stores.customers.update(store_id='', customer_id='', data={})
   client.stores.customers.create_or_update(store_id='', customer_id='', data={})
   client.stores.customers.delete(store_id='', customer_id='')

Store Orders
^^^^^^^^^^^^

::

   client.stores.orders.create(store_id='', data={})
   client.stores.orders.all(store_id='', get_all=False)
   client.stores.orders.get(store_id='', order_id='')
   client.stores.orders.update(store_id='', order_id='', data={})
   client.stores.orders.delete(store_id='', order_id='')

Store Order Lines
^^^^^^^^^^^^^^^^^

::

   client.stores.orders.lines.create(store_id='', order_id='', data={})
   client.stores.orders.lines.all(store_id='', order_id='', get_all=False)
   client.stores.orders.lines.get(store_id='', order_id='', line_id='')
   client.stores.orders.lines.update(store_id='', order_id='', line_id='', data={})
   client.stores.orders.lines.delete(store_id='', order_id='', line_id='')

Store Products
^^^^^^^^^^^^^^

::

   client.stores.products.create(store_id='', data={})
   client.stores.products.all(store_id='', get_all=False)
   client.stores.products.get(store_id='', product_id='')
   client.stores.products.update(store_id='', product_id='')
   client.stores.products.delete(store_id='', product_id='')

Store Product Images
^^^^^^^^^^^^^^^^^^^^

::

   client.stores.products.images.create(store_id='', product_id='', data={})
   client.stores.products.images.all(store_id='', product_id='', get_all=False)
   client.stores.products.images.get(store_id='', product_id='', image_id='')
   client.stores.products.images.update(store_id='', product_id='', image_id='', data={})
   client.stores.products.images.delete(store_id='', product_id='', image_id='')

Store Product Variants
^^^^^^^^^^^^^^^^^^^^^^

::

   client.stores.products.variants.create(store_id='', product_id='', data={})
   client.stores.products.variants.all(store_id='', product_id='', get_all=False)
   client.stores.products.variants.get(store_id='', product_id='', variant_id='')
   client.stores.products.variants.update(store_id='', product_id='', variant_id='', data={})
   client.stores.products.variants.create_or_update(store_id='', product_id='', variant_id='', data={})
   client.stores.products.variants.delete(store_id='', product_id='', variant_id='')

File Manager
~~~~~~~~~~~~

Files
^^^^^

::

   client.files.create(data={})
   client.files.all(get_all=False)
   client.files.get(file_id='')
   client.files.update(file_id='', data={})
   client.files.delete(file_id='')

.. _folders-1:

Folders
^^^^^^^

::

   client.folders.create(data={})
   client.folders.all(get_all=False)
   client.folders.get(folder_id='')
   client.folders.update(folder_id='', data={})
   client.folders.delete(folder_id='')

Landing Pages
~~~~~~~~~~~~~

.. _landing-pages-1:

Landing Pages
^^^^^^^^^^^^^

::

   client.landing_pages.create(data={})
   client.landing_pages.all()
   client.landing_pages.all(fields='')
   client.landing_pages.get(page_id='')
   client.landing_pages.update(page_id='', data={})
   client.landing_pages.delete(page_id='')

Landing Pages Actions
^^^^^^^^^^^^^^^^^^^^^

::

   client.landing_pages.actions.publish(page_id='')
   client.landing_pages.actions.unpublish(page_id='')

Landing Pages Content
^^^^^^^^^^^^^^^^^^^^^

::

   client.landing_pages.content.get(page_id='')

Lists
~~~~~

.. _lists-1:

Lists
^^^^^

::

   client.lists.create(data={})
   client.lists.update_members(list_id='', data={})
   client.lists.all(get_all=False)
   client.lists.get(list_id='')
   client.lists.update(list_id='', data={})
   client.lists.delete(list_id='')

List Abuse Reports
^^^^^^^^^^^^^^^^^^

::

   client.lists.abuse_reports.all(list_id='', get_all=False)
   client.lists.abuse_reports.get(list_id='', report_id='')

List Activity
^^^^^^^^^^^^^

::

   client.lists.activity.all(list_id='', subscriber_hash='')
   client.lists.activity.feed(list_id='', subscriber_hash='')

List Clients
^^^^^^^^^^^^

::

   client.lists.clients.all(list_id='')

List Growth History
^^^^^^^^^^^^^^^^^^^

::

   client.lists.growth_history.all(list_id='', get_all=False)
   client.lists.growth_history.get(list_id='', month='')

List Interest Categories
^^^^^^^^^^^^^^^^^^^^^^^^

::

   client.lists.interest_categories.create(list_id='', data={})
   client.lists.interest_categories.all(list_id='', get_all=False)
   client.lists.interest_categories.get(list_id='', category_id='')
   client.lists.interest_categories.update(list_id='', category_id='', data={})
   client.lists.interest_categories.delete(list_id='', category_id='')

List Interest Category Interests
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

   client.lists.interest_categories.interests.create(list_id='', category_id='', data={})
   client.lists.interest_categories.interests.all(list_id='', category_id='', get_all=False)
   client.lists.interest_categories.interests.get(list_id='', category_id='', interest_id='')
   client.lists.interest_categories.interests.update(list_id='', category_id='', interest_id='', data={})
   client.lists.interest_categories.interests.delete(list_id='', category_id='', interest_id='')

List Members
^^^^^^^^^^^^

::

   client.lists.members.create(list_id='', data={})
   client.lists.members.all(list_id='', get_all=False)
   client.lists.members.get(list_id='', subscriber_hash='')
   client.lists.members.update(list_id='', subscriber_hash='', data={})
   client.lists.members.create_or_update(list_id='', subscriber_hash='', data={})
   client.lists.members.delete(list_id='', subscriber_hash='')
   client.lists.members.delete_permanent(list_id='', subscriber_hash='')

List Member Activity
^^^^^^^^^^^^^^^^^^^^

::

   client.lists.members.activity.all(list_id='', subscriber_hash='')

List Member Events
^^^^^^^^^^^^^^^^^^

::

   client.lists.members.events.create(list_id='', subscriber_hash='', data={})
   client.lists.members.events.all(list_id='', subscriber_hash='', get_all=False)

List Member Goals
^^^^^^^^^^^^^^^^^

::

   client.lists.members.goals.all(list_id='', subscriber_hash='')

List Member Notes
^^^^^^^^^^^^^^^^^

::

   client.lists.members.notes.create(list_id='', subscriber_hash='', data={})
   client.lists.members.notes.all(list_id='', subscriber_hash='', get_all=False)
   client.lists.members.notes.get(list_id='', subscriber_hash='', note_id='')
   client.lists.members.notes.update(list_id='', subscriber_hash='', note_id='', data={})
   client.lists.members.notes.delete(list_id='', subscriber_hash='', note_id='')

List Member Tags
^^^^^^^^^^^^^^^^

::

   client.lists.members.tags.update(list_id='', subscriber_hash='', data={})
   client.lists.members.tags.all(list_id='', subscriber_hash='')

List Merge Fields
^^^^^^^^^^^^^^^^^

::

   client.lists.merge_fields.create(list_id='', data={})
   client.lists.merge_fields.all(list_id='', get_all=False)
   client.lists.merge_fields.get(list_id='', merge_id='')
   client.lists.merge_fields.update(list_id='', merge_id='', data={})
   client.lists.merge_fields.delete(list_id='', merge_id='')

List Segments
^^^^^^^^^^^^^

::

   client.lists.segments.create(list_id='', data={})
   client.lists.segments.all(list_id='', get_all=False)
   client.lists.segments.get(list_id='', segment_id='')
   client.lists.segments.update(list_id='', segment_id='', data={})
   client.lists.segments.update_members(list_id='', segment_id='', data={})
   client.lists.segments.delete(list_id='', segment_id='')

List Segment Members
^^^^^^^^^^^^^^^^^^^^

::

   client.lists.segments.members.create(list_id='', segment_id='', data={})
   client.lists.segments.members.all(list_id='', segment_id='', get_all=False)
   client.lists.segments.members.delete(list_id='', segment_id='', subscriber_hash='')

List Signup Forms
^^^^^^^^^^^^^^^^^

::

   client.lists.signup_forms.create(list_id='', data={})
   client.lists.signup_forms.all(list_id='')

List Webhooks
^^^^^^^^^^^^^

::

   client.lists.webhooks.create(list_id='', data={})
   client.lists.webhooks.all(list_id='')
   client.lists.webhooks.get(list_id='', webhook_id='')
   client.lists.webhooks.update(list_id='', webhook_id='', data={})
   client.lists.webhooks.delete(list_id='', webhook_id='')

Reports
~~~~~~~

.. _reports-1:

Reports
^^^^^^^

::

   client.reports.all(get_all=False)
   client.reports.get(campaign_id='')

Campaign Abuse Reports
^^^^^^^^^^^^^^^^^^^^^^

::

   client.reports.abuse_reports.all(campaign_id='')
   client.reports.abuse_reports.get(campaign_id='', report_id='')

Campaign Advice
^^^^^^^^^^^^^^^

::

   client.reports.advice.all(campaign_id='')

Click Details Report
^^^^^^^^^^^^^^^^^^^^

::

   client.reports.click_details.all(campaign_id='', get_all=False)
   client.reports.click_details.get(campaign_id='', link_id='')

Click Details Report Members
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

   client.reports.click_details.members.all(campaign_id='', link_id='', get_all=False)
   client.reports.click_details.members.get(campaign_id='', link_id='', subscriber_hash='')

Domain Performance Reports
^^^^^^^^^^^^^^^^^^^^^^^^^^

::

   client.reports.domain_performance.all(campaign_id='')

EepURL Reports
^^^^^^^^^^^^^^

::

   client.reports.eepurl.all(camnpaign_id='')

Email Activity Reports
^^^^^^^^^^^^^^^^^^^^^^

::

   client.reports.email_activity.all(campaign_id='', get_all=False)
   client.reports.email_activity.get(campaign_id='', subscriber_hash='')

Locations Report
^^^^^^^^^^^^^^^^

::

   client.reports.locations.all(campaign_id='', get_all=False)

Sent To Reports
^^^^^^^^^^^^^^^

::

   client.reports.sent_to.all(campaign_id='', get_all=False)
   client.reports.sent_to.get(campaign_id='', subscriber_hash='')

Sub-Reports
^^^^^^^^^^^

::

   client.reports.subreports.all(campaign_id='')

Unsubscribes
^^^^^^^^^^^^

::

   client.reports.unsubscribes.all(campaign_id='', get_all=False)
   client.reports.unsubscribes.get(campaign_id='', subscriber_hash='')

Search
~~~~~~

.. _campaigns-2:

Campaigns
^^^^^^^^^

::

   client.search_campaigns.get()

Members
^^^^^^^

::

   client.search_members.get()

Templates
~~~~~~~~~

.. _folders-2:

Folders
^^^^^^^

::

   client.template_folders.create(data={})
   client.template_folders.all(get_all=False)
   client.template_folders.get(folder_id='')
   client.template_folders.update(folder_id='', data={})
   client.template_folders.delete(folder_id='')

.. _templates-1:

Templates
^^^^^^^^^

::

   client.templates.create(data={})
   client.templates.all(get_all=False)
   client.templates.get(template_id='')
   client.templates.update(template_id='', data={})
   client.templates.delete(template_id='')

Default Content
^^^^^^^^^^^^^^^

::

   client.templates.default_content.all(template_id='')

Logging
-------

The MailChimp client will log request/response detail into the
mailchimp3.client logging namespace. Consider the following snippet to
get started with logging:

.. code:: python

   import logging
   fh = logging.FileHandler('/path/to/some/log.log')
   logger = logging.getLogger('mailchimp3.client')
   logger.addHandler(fh)

   # use the client normally
   client.lists.all(**{'fields': 'lists.date_created'})

request/response detail will be appended into /path/to/some/log.log:

::

   GET Request: https://us15.api.mailchimp.com/3.0/lists?fields=lists.date_created
   GET Response: 200 {"lists":[{"date_created":"2017-05-10T13:53:05+00:00"},{"date_created":"2017-08-22T20:27:56+00:00"},{"date_created":"2017-05-12T21:22:15+00:00"},{"date_created":"2017-04-27T17:42:04+00:00"},{"date_created":"2017-05-10T14:14:49+00:00"},{"date_created":"2017-05-10T13:52:37+00:00"},{"date_created":"2017-05-10T13:51:40+00:00"}]}

Check the `docs <https://docs.python.org/2/library/logging.html>`__ for
more detail on the Python logging package.

Support
-------

If you are having issues, please let us know or submit a pull request.

License
-------

The project is licensed under the MIT License.

.. |mailchimp3 v3.0.21 on PyPi| image:: https://img.shields.io/pypi/v/mailchimp3.svg
   :target: https://pypi.python.org/pypi/mailchimp3
.. |MIT license| image:: https://img.shields.io/badge/licence-MIT-blue.svg
.. |Stable| image:: https://img.shields.io/badge/status-stable-green.svg


================================================
FILE: mailchimp3/__init__.py
================================================
# coding=utf-8
"""
Mailchimp v3 Api SDK

Documentation at http://developer.mailchimp.com/documentation/mailchimp/reference/overview/
"""
# API Client
from mailchimp3.mailchimpclient import MailChimpClient
# API Root
from mailchimp3.entities.root import Root
# Authorized Apps
from mailchimp3.entities.authorizedapps import AuthorizedApps
# Automations
from mailchimp3.entities.automations import Automations
from mailchimp3.entities.automationactions import AutomationActions
from mailchimp3.entities.automationemails import AutomationEmails
from mailchimp3.entities.automationemailactions import AutomationEmailActions
from mailchimp3.entities.automationemailqueues import AutomationEmailQueues
from mailchimp3.entities.automationremovedsubscribers import AutomationRemovedSubscribers
# Batch Operations
from mailchimp3.entities.batchoperations import BatchOperations
# Batch Webhooks
from mailchimp3.entities.batchwebhooks import BatchWebhooks
# Campaign Folders
from mailchimp3.entities.campaignfolders import CampaignFolders
# Campaigns
from mailchimp3.entities.campaigns import Campaigns
from mailchimp3.entities.campaignactions import CampaignActions
from mailchimp3.entities.campaigncontent import CampaignContent
from mailchimp3.entities.campaignfeedback import CampaignFeedback
from mailchimp3.entities.campaignsendchecklist import CampaignSendChecklist
# Conversations
from mailchimp3.entities.conversations import Conversations
from mailchimp3.entities.conversationmessages import ConversationMessages
# Customer Journeys
from mailchimp3.entities.customerjourney import CustomerJourney
# E-commerce Stores
from mailchimp3.entities.stores import Stores
from mailchimp3.entities.storecarts import StoreCarts
from mailchimp3.entities.storecartlines import StoreCartLines
from mailchimp3.entities.storecustomers import StoreCustomers
from mailchimp3.entities.storeorders import StoreOrders
from mailchimp3.entities.storeorderlines import StoreOrderLines
from mailchimp3.entities.storeproducts import StoreProducts
from mailchimp3.entities.storeproductimages import StoreProductImages
from mailchimp3.entities.storeproductvariants import StoreProductVariants
from mailchimp3.entities.storepromorules import StorePromoRules
from mailchimp3.entities.storepromocodes import StorePromoCodes
# File Manager Files
from mailchimp3.entities.filemanagerfiles import FileManagerFiles
# File Manager Folders
from mailchimp3.entities.filemanagerfolders import FileManagerFolders
# Landinge Pages
from mailchimp3.entities.landingpages import LandingPages
from mailchimp3.entities.landingpageaction import LandingPageAction
from mailchimp3.entities.landingpagecontent import LandingPageContent
# Lists
from mailchimp3.entities.lists import Lists
from mailchimp3.entities.listabusereports import ListAbuseReports
from mailchimp3.entities.listactivity import ListActivity
from mailchimp3.entities.listclients import ListClients
from mailchimp3.entities.listgrowthhistory import ListGrowthHistory
from mailchimp3.entities.listinterestcategories import ListInterestCategories
from mailchimp3.entities.listinterestcategoryinterest import ListInterestCategoryInterest
from mailchimp3.entities.listmembers import ListMembers
from mailchimp3.entities.listmemberactivity import ListMemberActivity
from mailchimp3.entities.listmemberevents import ListMemberEvents
from mailchimp3.entities.listmembergoals import ListMemberGoals
from mailchimp3.entities.listmembernotes import ListMemberNotes
from mailchimp3.entities.listmembertags import ListMemberTags
from mailchimp3.entities.listmergefields import ListMergeFields
from mailchimp3.entities.listsegments import ListSegments
from mailchimp3.entities.listsegmentmembers import ListSegmentMembers
from mailchimp3.entities.listsignupforms import ListSignupForms
from mailchimp3.entities.listwebhooks import ListWebhooks

# ping
from mailchimp3.entities.ping import Ping

# Reports
from mailchimp3.entities.reports import Reports
from mailchimp3.entities.reportcampaignabusereports import ReportCampaignAbuseReports
from mailchimp3.entities.reportcampaignadvice import ReportCampaignAdvice
from mailchimp3.entities.reportclickdetailreports import ReportClickDetailReports
from mailchimp3.entities.reportclickdetailmembers import ReportClickDetailMembers
from mailchimp3.entities.reportdomainperformance import ReportDomainPerformance
from mailchimp3.entities.reporteepurl import ReportEepURL
from mailchimp3.entities.reportemailactivity import ReportEmailActivity
from mailchimp3.entities.reportlocations import ReportLocations
from mailchimp3.entities.reportsentto import ReportSentTo
from mailchimp3.entities.reportsubreports import ReportSubReports
from mailchimp3.entities.reportunsubscribes import ReportUnsubscribes
from mailchimp3.entities.reportopendetails import ReportOpenDetails
from mailchimp3.entities.reportgoogleanalytics import ReportGoogleAnalytics

# Search Campaigns
from mailchimp3.entities.searchcampaigns import SearchCampaigns
# Search Members
from mailchimp3.entities.searchmembers import SearchMembers
# Template Folders
from mailchimp3.entities.templatefolders import TemplateFolders
# Templates
from mailchimp3.entities.templates import Templates
from mailchimp3.entities.templatedefaultcontent import TemplateDefaultContent


class MailChimp(MailChimpClient):
    """
    MailChimp class to communicate with the v3 API
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the class with your api_key and user_id and attach all of
        the endpoints
        """
        super(MailChimp, self).__init__(*args, **kwargs)
        # API Root
        self.root = self.api_root = Root(self)
        # Authorized Apps
        self.authorized_apps = AuthorizedApps(self)
        # Automations - Paid feature
        self.automations = Automations(self)
        self.automations.actions = AutomationActions(self)
        self.automations.emails = AutomationEmails(self)
        self.automations.emails.actions = AutomationEmailActions(self)
        self.automations.emails.queues = AutomationEmailQueues(self)
        self.automations.removed_subscribers = AutomationRemovedSubscribers(self)
        # Batch Operations
        self.batches = self.batch_operations = BatchOperations(self)
        # Batch Webhooks
        self.batch_webhooks = BatchWebhooks(self)
        # Campaign Folders
        self.campaign_folders = CampaignFolders(self)
        # Campaigns
        self.campaigns = Campaigns(self)
        self.campaigns.actions = CampaignActions(self)
        self.campaigns.content = CampaignContent(self)
        self.campaigns.feedback = CampaignFeedback(self)
        self.campaigns.send_checklist = CampaignSendChecklist(self)
        # Conversations - Paid feature
        self.conversations = Conversations(self)
        self.conversations.messages = ConversationMessages(self)
        # Customer Journey
        self.journeys = self.customer_journeys = CustomerJourney(self)
        # E-commerce Stores
        self.stores = self.ecommerce = Stores(self)
        self.stores.carts = StoreCarts(self)
        self.stores.carts.lines = StoreCartLines(self)
        self.stores.customers = StoreCustomers(self)
        self.stores.orders = StoreOrders(self)
        self.stores.orders.lines = StoreOrderLines(self)
        self.stores.products = StoreProducts(self)
        self.stores.products.images = StoreProductImages(self)
        self.stores.products.variants = StoreProductVariants(self)
        self.stores.promo_rules = StorePromoRules(self)
        self.stores.promo_codes = StorePromoCodes(self)
        # File Manager Files
        self.files = FileManagerFiles(self)
        # File Manager Folders
        self.folders = FileManagerFolders(self)
        # Landinge Pages
        self.landing_pages = LandingPages(self)
        self.landing_pages.actions = LandingPageAction(self)
        self.landing_pages.content = LandingPageContent(self)
        # Lists
        self.lists = Lists(self)
        self.lists.abuse_reports = ListAbuseReports(self)
        self.lists.activity = ListActivity(self)
        self.lists.clients = ListClients(self)
        self.lists.growth_history = ListGrowthHistory(self)
        self.lists.interest_categories = ListInterestCategories(self)
        self.lists.interest_categories.interests = ListInterestCategoryInterest(self)
        self.lists.members = ListMembers(self)
        self.lists.members.activity = ListMemberActivity(self)
        self.lists.members.events = ListMemberEvents(self)
        self.lists.members.goals = ListMemberGoals(self)
        self.lists.members.notes = ListMemberNotes(self)
        self.lists.members.tags = ListMemberTags(self)
        self.lists.merge_fields = ListMergeFields(self)
        self.lists.segments = ListSegments(self)
        self.lists.segments.members = ListSegmentMembers(self)
        self.lists.signup_forms = ListSignupForms(self)
        self.lists.webhooks = ListWebhooks(self)
        # Ping
        self.ping = Ping(self)
        # Reports
        self.reports = Reports(self)
        self.reports.abuse_reports = ReportCampaignAbuseReports(self)
        self.reports.advice = ReportCampaignAdvice(self)
        self.reports.click_details = ReportClickDetailReports(self)
        self.reports.click_details.members = ReportClickDetailMembers(self)
        self.reports.domain_performance = ReportDomainPerformance(self)
        self.reports.eepurl = ReportEepURL(self)
        self.reports.email_activity = ReportEmailActivity(self)
        self.reports.locations = ReportLocations(self)
        self.reports.sent_to = ReportSentTo(self)
        self.reports.subreports = ReportSubReports(self)
        self.reports.unsubscribes = ReportUnsubscribes(self)
        self.reports.open_details = ReportOpenDetails(self)
        self.reports.google_analytics = ReportGoogleAnalytics(self)
        # Search Campaigns
        self.search_campaigns = SearchCampaigns(self)
        # Search Members
        self.search_members = SearchMembers(self)
        # Template Folders
        self.template_folders = TemplateFolders(self)
        # Templates
        self.templates = Templates(self)
        self.templates.default_content = TemplateDefaultContent(self)


================================================
FILE: mailchimp3/baseapi.py
================================================
# coding=utf-8
"""
The base API object that allows constructions of various endpoint paths
"""
from __future__ import unicode_literals
from itertools import chain

from mailchimp3.helpers import merge_results


class BaseApi(object):
    """
    Simple class to buid path for entities
    """

    def __init__(self, mc_client):
        """
        Initialize the class with you user_id and secret_key

        :param mc_client: The mailchimp client connection
        :type mc_client: :mod:`mailchimp3.mailchimpclient.MailChimpClient`
        """
        super(BaseApi, self).__init__()
        self._mc_client = mc_client
        self.endpoint = ''

    def _build_path(self, *args):
        """
        Build path with endpoint and args

        :param args: Tokens in the endpoint URL
        :type args: :py:class:`unicode`
        """
        return '/'.join(chain((self.endpoint,), map(str, args)))

    def _iterate(self, url, **queryparams):
        """
        Iterate over all pages for the given url. Feed in the result of self._build_path as the url.

        :param url: The url of the endpoint
        :type url: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        # fields as a query string parameter should be a string with
        # comma-separated substring values to pass along to
        # self._mc_client._get(). It should also contain total_items whenever
        # the parameter is employed, which is forced here.
        if not self._mc_client.enabled:
            return
        if 'fields' in queryparams:
            if 'total_items' not in queryparams['fields'].split(','):
                queryparams['fields'] += ',total_items'
        # Remove offset if provided in queryparams to avoid 'multiple values
        # for keyword argument' TypeError
        queryparams.pop("offset", None)

        # Fetch results from mailchimp, up to first count. If count is not
        # provided, return a count of 500. The maximum value supported by the
        # api is 1000, but such a large request can cause 504 errors. See:
        # https://github.com/VingtCinq/python-mailchimp/pull/207
        count = queryparams.pop("count", 500)
        result = self._mc_client._get(url=url, offset=0, count=count, **queryparams)
        total = result['total_items']
        # Fetch further results if necessary
        if total > count:
            for offset in range(1, int(total / count) + 1):
                result = merge_results(result, self._mc_client._get(
                    url=url,
                    offset=int(offset * count),
                    count=count,
                    **queryparams
                ))
            return result
        else:  # Further results not necessary
            return result


================================================
FILE: mailchimp3/entities/__init__.py
================================================


================================================
FILE: mailchimp3/entities/authorizedapps.py
================================================
# coding=utf-8
"""
The Authorized Apps endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/authorized-apps/
Schema: http://api.mailchimp.com/schema/3.0/AuthorizedApps/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class AuthorizedApps(BaseApi):
    """
    Manage registered, connected apps for your MailChimp account with the
    Authorized Apps endpoints.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(AuthorizedApps, self).__init__(*args, **kwargs)
        self.endpoint = 'authorized-apps'
        self.app_id = None


    def create(self, data):
        """
        Retrieve OAuth2-based credentials to associate API calls with your
        application.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "client_id": string*,
            "client_secret": string*
        }
        """
        self.app_id = None
        if 'client_id' not in data:
            raise KeyError('The authorized app must have a client_id')
        if 'client_secret' not in data:
            raise KeyError('The authorized app must have a client_secret')
        return self._mc_client._post(url=self._build_path(), data=data)


    def all(self, get_all=False, **queryparams):
        """
        Get a list of an account’s registered, connected applications.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.app_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, app_id, **queryparams):
        """
        Get information about a specific authorized application

        :param app_id: The unique id for the connected authorized application
        :type app_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.app_id = app_id
        return self._mc_client._get(url=self._build_path(app_id), **queryparams)


================================================
FILE: mailchimp3/entities/automationactions.py
================================================
# coding=utf-8
"""
The Automations API endpoint actions

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class AutomationActions(BaseApi):
    """
    Actions for the Automations endpoint.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(AutomationActions, self).__init__(*args, **kwargs)
        self.endpoint = 'automations'
        self.workflow_id = None


    # Paid feature
    def pause(self, workflow_id):
        """
        Pause all emails in a specific Automation workflow.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        """
        self.workflow_id = workflow_id
        return self._mc_client._post(url=self._build_path(workflow_id, 'actions/pause-all-emails'))


    # Paid feature
    def start(self, workflow_id):
        """
        Start all emails in an Automation workflow.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        """
        self.workflow_id = workflow_id
        return self._mc_client._post(url=self._build_path(workflow_id, 'actions/start-all-emails'))


================================================
FILE: mailchimp3/entities/automationemailactions.py
================================================
# coding=utf-8
"""
The Automation Emails endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class AutomationEmailActions(BaseApi):
    """
    Manage individual emails in an Automation workflow.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(AutomationEmailActions, self).__init__(*args, **kwargs)
        self.endpoint = 'automations'
        self.workflow_id = None
        self.email_id = None


    # Paid feature
    def pause(self, workflow_id, email_id):
        """
        Pause an automated email.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        """
        self.workflow_id = workflow_id
        self.email_id = email_id
        return self._mc_client._post(url=self._build_path(workflow_id, 'emails', email_id, 'actions/pause'))


    # Paid feature
    def start(self, workflow_id, email_id):
        """
        Start an automated email.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        """
        self.workflow_id = workflow_id
        self.email_id = email_id
        return self._mc_client._post(url=self._build_path(workflow_id, 'emails', email_id, 'actions/start'))

    #Paid feature
    def delete(self, workflow_id, email_id):
        """
        Removes an individual Automation workflow email.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        """

        self.workflow_id = workflow_id
        self.email_id = email_id
        return self._mc_client._delete(url=self._build_path(workflow_id, 'emails', email_id))




================================================
FILE: mailchimp3/entities/automationemailqueues.py
================================================
# coding=utf-8
"""
The Automation Email Queue endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/queue/
Schema: https://api.mailchimp.com/schema/3.0/Automations/Emails/Queue/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_email, check_subscriber_hash


class AutomationEmailQueues(BaseApi):
    """
    Manage list member queues for Automation emails.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(AutomationEmailQueues, self).__init__(*args, **kwargs)
        self.endpoint = 'automations'
        self.workflow_id = None
        self.email_id = None
        self.subscriber_hash = None

    # Paid feature
    def create(self, workflow_id, email_id, data):
        """
        Manually add a subscriber to a workflow, bypassing the default trigger
        settings. You can also use this endpoint to trigger a series of
        automated emails in an API 3.0 workflow type or add subscribers to an
        automated email queue that uses the API request delay type.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "email_address": string*
        }
        """
        self.workflow_id = workflow_id
        self.email_id = email_id
        if 'email_address' not in data:
            raise KeyError('The automation email queue must have an email_address')
        check_email(data['email_address'])
        response = self._mc_client._post(
            url=self._build_path(workflow_id, 'emails', email_id, 'queue'),
            data=data
        )
        if response is not None:
            self.subscriber_hash = response['id']
        else:
            self.subscriber_hash = None
        return response


    # Paid feature
    def all(self, workflow_id, email_id):
        """
        Get information about an Automation email queue.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        """
        self.workflow_id = workflow_id
        self.email_id = email_id
        self.subscriber_hash = None
        return self._mc_client._get(url=self._build_path(workflow_id, 'emails', email_id, 'queue'))


    # Paid feature
    def get(self, workflow_id, email_id, subscriber_hash):
        """
        Get information about a specific subscriber in an Automation email
        queue.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.workflow_id = workflow_id
        self.email_id = email_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._get(url=self._build_path(workflow_id, 'emails', email_id, 'queue', subscriber_hash))



================================================
FILE: mailchimp3/entities/automationemails.py
================================================
# coding=utf-8
"""
The Automation Emails endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/
Schema: https://api.mailchimp.com/schema/3.0/Automations/Emails/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.automationemailactions import AutomationEmailActions
from mailchimp3.entities.automationemailqueues import AutomationEmailQueues


class AutomationEmails(BaseApi):
    """
    Manage individual emails in an Automation workflow.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(AutomationEmails, self).__init__(*args, **kwargs)
        self.endpoint = 'automations'
        self.workflow_id = None
        self.email_id = None
        self.actions = AutomationEmailActions(self)
        self.queues = AutomationEmailQueues(self)


    # Paid feature
    def all(self, workflow_id, get_all=False, **queryparams):
        """
        Get a summary of the emails in an Automation workflow.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: the query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.workflow_id = workflow_id
        self.email_id = None
        if get_all:
            return self._iterate(url=self._build_path(workflow_id, 'emails'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(workflow_id, 'emails'), **queryparams)


    # Paid feature
    def get(self, workflow_id, email_id):
        """
        Get information about an individual Automation workflow email.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        """
        self.workflow_id = workflow_id
        self.email_id = email_id
        return self._mc_client._get(url=self._build_path(workflow_id, 'emails', email_id))


================================================
FILE: mailchimp3/entities/automationremovedsubscribers.py
================================================
# coding=utf-8
"""
The Automation Removed Subscribers endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/removed-subscribers/
Schema: https://api.mailchimp.com/schema/3.0/Automations/RemovedSubscribers/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_email

class AutomationRemovedSubscribers(BaseApi):
    """
    Remove subscribers from an Automation workflow.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(AutomationRemovedSubscribers, self).__init__(*args, **kwargs)
        self.endpoint = 'automations'
        self.workflow_id = None


    # Paid feature
    def create(self, workflow_id, data):
        """
        Remove a subscriber from a specific Automation workflow. You can
        remove a subscriber at any point in an Automation workflow, regardless
        of how many emails they’ve been sent from that workflow. Once they’re
        removed, they can never be added back to the same workflow.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "email_address": string*
        }
        """
        self.workflow_id = workflow_id
        if 'email_address' not in data:
            raise KeyError('The automation removed subscriber must have an email_address')
        check_email(data['email_address'])
        return self._mc_client._post(url=self._build_path(workflow_id, 'removed-subscribers'), data=data)


    # Paid feature
    def all(self, workflow_id):
        """
        Get information about subscribers who were removed from an Automation
        workflow.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        """
        self.workflow_id = workflow_id
        return self._mc_client._get(url=self._build_path(workflow_id, 'removed-subscribers'))



================================================
FILE: mailchimp3/entities/automations.py
================================================
# coding=utf-8
"""
The Automations API endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/
Schema: https://api.mailchimp.com/schema/3.0/Automations/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.automationactions import AutomationActions
from mailchimp3.entities.automationemails import AutomationEmails
from mailchimp3.entities.automationremovedsubscribers import AutomationRemovedSubscribers


class Automations(BaseApi):
    """
    Automation is a paid feature that lets you build a series of triggered
    emails that are sent to subscribers over a set period of time. Use the
    Automation API calls to manage Automation workflows, emails, and queues.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(Automations, self).__init__(*args, **kwargs)
        self.endpoint = 'automations'
        self.workflow_id = None
        self.actions = AutomationActions(self)
        self.emails = AutomationEmails(self)
        self.removed_subscribers = AutomationRemovedSubscribers(self)


    # Paid feature
    def all(self, get_all=False, **queryparams):
        """
        Get a summary of an account’s Automations.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: the query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.workflow_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    # Paid feature
    def get(self, workflow_id, **queryparams):
        """
        Get a summary of an individual Automation workflow’s settings and
        content. The trigger_settings object returns information for the first
        email in the workflow.

        :param workflow_id: The unique id for the Automation workflow
        :type workflow_id: :py:class:`str`
        :param queryparams: the query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.workflow_id = workflow_id
        return self._mc_client._get(url=self._build_path(workflow_id), **queryparams)


================================================
FILE: mailchimp3/entities/batchoperations.py
================================================
# coding=utf-8
"""
The Batch Operations API Endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/batches/
Schema: https://api.mailchimp.com/schema/3.0/Batches/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class BatchOperations(BaseApi):
    """
    Use batch operations to complete multiple operations with a single call.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(BatchOperations, self).__init__(*args, **kwargs)
        self.endpoint = 'batches'
        self.batch_id = None
        self.operation_status = None


    def create(self, data):
        """
        Begin processing a batch operations request.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "operations": array*
            [
                {
                    "method": string* (Must be one of "GET", "POST", "PUT", "PATCH", or "DELETE")
                    "path": string*,
                }
            ]
        }
        """
        if 'operations' not in data:
            raise KeyError('The batch must have operations')
        for op in data['operations']:
            if 'method' not in op:
                raise KeyError('The batch operation must have a method')
            if op['method'] not in ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']:
                raise ValueError('The batch operation method must be one of "GET", "POST", "PUT", "PATCH", '
                                 'or "DELETE", not {0}'.format(op['method']))
            if 'path' not in op:
                raise KeyError('The batch operation must have a path')
        return self._mc_client._post(url=self._build_path(), data=data)


    def all(self, get_all=False, **queryparams):
        """
        Get a summary of batch requests that have been made.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.batch_id = None
        self.operation_status = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, batch_id, **queryparams):
        """
        Get the status of a batch request.

        :param batch_id: The unique id for the batch operation.
        :type batch_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.batch_id = batch_id
        self.operation_status = None
        return self._mc_client._get(url=self._build_path(batch_id), **queryparams)


    def delete(self, batch_id):
        """
        Stops a batch request from running. Since only one batch request is
        run at a time, this can be used to cancel a long running request. The
        results of any completed operations will not be available after this
        call.

        :param batch_id: The unique id for the batch operation.
        :type batch_id: :py:class:`str`
        """
        self.batch_id = batch_id
        self.operation_status = None
        return self._mc_client._delete(url=self._build_path(batch_id))


================================================
FILE: mailchimp3/entities/batchwebhooks.py
================================================
# coding=utf-8
"""
The Batch Webhooks API Endpoint

Documentation: https://developer.mailchimp.com/documentation/mailchimp/reference/batch-webhooks/
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class BatchWebhooks(BaseApi):
    """
    Manage webhooks for batch operations.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(BatchWebhooks, self).__init__(*args, **kwargs)
        self.endpoint = 'batch-webhooks'
        self.batch_webhook_id = None


    def create(self, data):
        """
        Configure a webhook that will fire whenever any batch request
        completes processing.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "url": string*
        }
        """
        if 'url' not in data:
            raise KeyError('The batch webhook must have a valid url')
        response = self._mc_client._post(url=self._build_path(), data=data)
        if response is not None:
            self.batch_webhook_id = response['id']
        else:
            self.batch_webhook_id = None
        return response


    def all(self, get_all=False, **queryparams):
        """
        Get all webhooks that have been configured for batches.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.batch_webhook_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, batch_webhook_id, **queryparams):
        """
        Get information about a specific batch webhook.

        :param batch_webhook_id: The unique id for the batch webhook.
        :type batch_webhook_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.batch_webhook_id = batch_webhook_id
        return self._mc_client._get(url=self._build_path(batch_webhook_id), **queryparams)


    def update(self, batch_webhook_id, data):
        """
        Update a webhook that will fire whenever any batch request completes
        processing.

        :param batch_webhook_id: The unique id for the batch webhook.
        :type batch_webhook_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "url": string*
        }
        """
        self.batch_webhook_id = batch_webhook_id
        if 'url' not in data:
            raise KeyError('The batch webhook must have a valid url')
        return self._mc_client._patch(url=self._build_path(batch_webhook_id), data=data)


    def delete(self, batch_webhook_id):
        """
        Remove a batch webhook. Webhooks will no longer be sent to the given
        URL.

        :param batch_webhook_id: The unique id for the batch webhook.
        :type batch_webhook_id: :py:class:`str`
        """
        self.batch_webhook_id = batch_webhook_id
        return self._mc_client._delete(url=self._build_path(batch_webhook_id))


================================================
FILE: mailchimp3/entities/campaignactions.py
================================================
# coding=utf-8
"""
The Campaigns API actions endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/
Schema: https://api.mailchimp.com/schema/3.0/CampaignFolders/Instance.json
"""
from __future__ import unicode_literals

from datetime import timedelta

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_email


class CampaignActions(BaseApi):
    """
    Campaigns are how you send emails to your MailChimp list. Use the
    Campaigns API calls to manage campaigns in your MailChimp account.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(CampaignActions, self).__init__(*args, **kwargs)
        self.endpoint = 'campaigns'
        self.campaign_id = None


    # Pro feature
    def cancel(self, campaign_id):
        """
        Cancel a Regular or Plain-Text Campaign after you send, before all of
        your recipients receive it. This feature is included with MailChimp
        Pro.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/cancel-send'))


    def pause(self, campaign_id):
        """
        Pause an RSS-Driven campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/pause'))


    def replicate(self, campaign_id):
        """
        Replicate a campaign in saved or send status.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/replicate'))


    def resume(self, campaign_id):
        """
        Resume an RSS-Driven campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/resume'))


    def schedule(self, campaign_id, data):
        """
        Schedule a campaign for delivery. If you’re using Multivariate
        Campaigns to test send times or sending RSS Campaigns, use the send
        action instead.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "schedule_time": datetime* (A UTC timezone datetime that ends on the quarter hour [:00, :15, :30, or :45])
        }
        """
        if not data['schedule_time']:
            raise ValueError('You must supply a schedule_time')
        else:
            if data['schedule_time'].tzinfo is None:
                raise ValueError('The schedule_time must be in UTC')
            else:
                if data['schedule_time'].tzinfo.utcoffset(None) != timedelta(0):
                    raise ValueError('The schedule_time must be in UTC')
        if data['schedule_time'].minute not in [0, 15, 30, 45]:
            raise ValueError('The schedule_time must end on the quarter hour (00, 15, 30, 45)')
        data['schedule_time'] = data['schedule_time'].strftime('%Y-%m-%dT%H:%M:00+00:00')
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/schedule'), data=data)


    def send(self, campaign_id):
        """
        Send a MailChimp campaign. For RSS Campaigns, the campaign will send
        according to its schedule. All other campaigns will send immediately.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/send'))


    def resend(self, campaign_id):
        """
        Creates a Resend to Non-Openers version of this campaign. We will also
        check if this campaign meets the criteria for Resend to Non-Openers
        campaigns.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/create-resend'))


    def test(self, campaign_id, data):
        """
        Send a test email.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "test_emails": array*,
            "send_type": string* (Must be one of "html" or "plaintext")
        }
        """
        for email in data['test_emails']:
            check_email(email)
        if data['send_type'] not in ['html', 'plaintext']:
            raise ValueError('The send_type must be either "html" or "plaintext"')
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/test'), data=data)


    def unschedule(self, campaign_id):
        """
        Unschedule a scheduled campaign that hasn’t started sending.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._post(url=self._build_path(campaign_id, 'actions/unschedule'))


================================================
FILE: mailchimp3/entities/campaigncontent.py
================================================
# coding=utf-8
"""
The Campaign Content API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/content/
Schema: https://api.mailchimp.com/schema/3.0/Campaigns/Content/Collection.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class CampaignContent(BaseApi):
    """
    Manage the HTML, plain-text, and template content for your MailChimp
    campaigns.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(CampaignContent, self).__init__(*args, **kwargs)
        self.endpoint = 'campaigns'
        self.campaign_id = None


    def get(self, campaign_id, **queryparams):
        """
        Get the the HTML and plain-text content for a campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.campaign_id = campaign_id
        return self._mc_client._get(url=self._build_path(campaign_id, 'content'), **queryparams)


    def update(self, campaign_id, data):
        """
        Set the content for a campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        """
        self.campaign_id = campaign_id
        return self._mc_client._put(url=self._build_path(campaign_id, 'content'), data=data)


================================================
FILE: mailchimp3/entities/campaignfeedback.py
================================================
# coding=utf-8
"""
The Campaign Feedback API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/feedback/
Schema: https://api.mailchimp.com/schema/3.0/Campaigns/Feedback/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class CampaignFeedback(BaseApi):
    """
    Post comments, reply to team feedback, and send test emails while you’re
    working together on a MailChimp campaign.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(CampaignFeedback, self).__init__(*args, **kwargs)
        self.endpoint = 'campaigns'
        self.campaign_id = None
        self.feedback_id = None


    def create(self, campaign_id, data, **queryparams):
        """
        Add feedback on a specific campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "message": string*
        }
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.campaign_id = campaign_id
        if 'message' not in data:
            raise KeyError('The campaign feedback must have a message')
        response = self._mc_client._post(url=self._build_path(campaign_id, 'feedback'), data=data, **queryparams)
        if response is not None:
            self.feedback_id = response['feedback_id']
        else:
            self.feedback_id = None
        return response


    def all(self, campaign_id, get_all=False, **queryparams):
        """
        Get team feedback while you’re working together on a MailChimp
        campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.campaign_id = campaign_id
        self.feedback_id = None
        if get_all:
            return self._iterate(url=self._build_path(campaign_id, 'feedback'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(campaign_id, 'feedback'), **queryparams)


    def get(self, campaign_id, feedback_id, **queryparams):
        """
        Get a specific feedback message from a campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param feedback_id: The unique id for the feedback message.
        :type feedback_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.campaign_id = campaign_id
        self.feedback_id = feedback_id
        return self._mc_client._get(url=self._build_path(campaign_id, 'feedback', feedback_id), **queryparams)


    def update(self, campaign_id, feedback_id, data):
        """
        Update a specific feedback message for a campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param feedback_id: The unique id for the feedback message.
        :type feedback_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "message": string*
        }
        """
        self.campaign_id = campaign_id
        self.feedback_id = feedback_id
        if 'message' not in data:
            raise KeyError('The campaign feedback must have a message')
        return self._mc_client._patch(url=self._build_path(campaign_id, 'feedback', feedback_id), data=data)


    def delete(self, campaign_id, feedback_id):
        """
        Remove a specific feedback message for a campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param feedback_id: The unique id for the feedback message.
        :type feedback_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        self.feedback_id = feedback_id
        return self._mc_client._delete(url=self._build_path(campaign_id, 'feedback', feedback_id))


================================================
FILE: mailchimp3/entities/campaignfolders.py
================================================
# coding=utf-8
"""
The Campaign Folders API endpoints

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/campaign-folders/
Schema: https://api.mailchimp.com/schema/3.0/CampaignFolders/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class CampaignFolders(BaseApi):
    """
    Organize your campaigns using folders.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(CampaignFolders, self).__init__(*args, **kwargs)
        self.endpoint = 'campaign-folders'
        self.folder_id = None


    def create(self, data):
        """
        Create a new campaign folder.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        if 'name' not in data:
            raise KeyError('The campaign folder must have a name')
        response = self._mc_client._post(url=self._build_path(), data=data)
        if response is not None:
            self.folder_id = response['id']
        else:
            self.folder_id = None
        return response


    def all(self, get_all=False, **queryparams):
        """
        Get all folders used to organize campaigns.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.folder_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, folder_id, **queryparams):
        """
        Get information about a specific folder used to organize campaigns.

        :param folder_id: The unique id for the campaign folder.
        :type folder_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.folder_id = folder_id
        return self._mc_client._get(url=self._build_path(folder_id), **queryparams)


    def update(self, folder_id, data):
        """
        Update a specific folder used to organize campaigns.

        :param folder_id: The unique id for the campaign folder.
        :type folder_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        self.folder_id = folder_id
        if 'name' not in data:
            raise KeyError('The campaign folder must have a name')
        return self._mc_client._patch(url=self._build_path(folder_id), data=data)


    def delete(self, folder_id):
        """
        Delete a specific campaign folder, and mark all the campaigns in the
        folder as ‘unfiled’.

        :param folder_id: The unique id for the campaign folder.
        :type folder_id: :py:class:`str`
        """
        self.folder_id = folder_id
        return self._mc_client._delete(url=self._build_path(folder_id))


================================================
FILE: mailchimp3/entities/campaigns.py
================================================
# coding=utf-8
"""
The Campaigns API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/
Schema: https://api.mailchimp.com/schema/3.0/Campaigns/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.campaignactions import CampaignActions
from mailchimp3.entities.campaigncontent import CampaignContent
from mailchimp3.entities.campaignfeedback import CampaignFeedback
from mailchimp3.entities.campaignsendchecklist import CampaignSendChecklist
from mailchimp3.helpers import check_email


class Campaigns(BaseApi):
    """
    Campaigns are how you send emails to your MailChimp list. Use the
    Campaigns API calls to manage campaigns in your MailChimp account.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(Campaigns, self).__init__(*args, **kwargs)
        self.endpoint = 'campaigns'
        self.campaign_id = None
        self.actions = CampaignActions(self)
        self.content = CampaignContent(self)
        self.feedback = CampaignFeedback(self)
        self.send_checklist = CampaignSendChecklist(self)


    def create(self, data):
        """
        Create a new MailChimp campaign.

        The ValueError raised by an invalid type in data does not mention
        'absplit' as a potential value because the documentation indicates
        that the absplit type has been deprecated.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "recipients": object*
            {
                "list_id": string*
            },
            "variate_settings": object* (Required if type is "variate")
            {
                "subject_lines": string* (can be empty if subject_line in settings)
                "from_names": string* (can be empty if from_name in settings)
                "reply_to_addresses": string* (can be empty if reply_to in settings)
                "winner_criteria": string* (Must be one of "opens", "clicks", "total_revenue", or "manual")
            },
            "rss_opts": object* (Required if type is "rss")
            {
                "feed_url": string*,
                "frequency": string* (Must be one of "daily", "weekly", or "monthly")
            },
            "type": string* (Must be one of "regular", "plaintext", "rss", "variate", or "absplit")
        }
        """
        if 'recipients' not in data:
            raise KeyError('The campaign must have recipients')
        if 'list_id' not in data['recipients']:
            raise KeyError('The campaign recipients must have a list_id')
        if 'reply_to' in data.get('settings', {}):
            check_email(data['settings']['reply_to'])
        if 'type' not in data:
            raise KeyError('The campaign must have a type')
        if not data['type'] in ['regular', 'plaintext', 'rss', 'variate', 'abspilt']:
            raise ValueError('The campaign type must be one of "regular", "plaintext", "rss", or "variate"')
        if data['type'] == 'variate':
            if 'variate_settings' not in data:
                raise KeyError('The variate campaign must have variate_settings')
            if 'winner_criteria' not in data['variate_settings']:
                raise KeyError('The campaign variate_settings must have a winner_criteria')
            if data['variate_settings']['winner_criteria'] not in ['opens', 'clicks', 'total_revenue', 'manual']:
                raise ValueError('The campaign variate_settings '
                                 'winner_criteria must be one of "opens", "clicks", "total_revenue", or "manual"')
            if 'subject_lines' not in data['variate_settings'] and 'subject_line' not in data.get('settings'):
                raise KeyError('The campaign variate_settings must have a subject_lines')
            if 'from_names' not in data['variate_settings'] and 'from_name' not in data.get('settings'):
                raise KeyError('The campaign variate_settings must have a from_names')
            if 'reply_to_addresses' not in data['variate_settings'] and 'reply_to' not in data.get('settings'):
                raise KeyError('The campaign variate_settings must have a reply_to_addresses')
        if data['type'] == 'rss':
            if 'rss_opts' not in data:
                raise KeyError('The rss campaign must have rss_opts')
            if 'feed_url' not in data['rss_opts']:
                raise KeyError('The campaign rss_opts must have a feed_url')
            if not data['rss_opts']['frequency'] in ['daily', 'weekly', 'monthly']:
                raise ValueError('The rss_opts frequency must be one of "daily", "weekly", or "monthly"')
        response = self._mc_client._post(url=self._build_path(), data=data)
        if response is not None:
            self.campaign_id = response['id']
        else:
            self.campaign_id = None
        return response


    def all(self, get_all=False, **queryparams):
        """
        Get all campaigns in an account.

        .. note::
            The before_create_time, since_create_time, before_send_time, and
            since_send_time queryparams expect times to be listed in the ISO
            8601 format in UTC (ex. 2015-10-21T15:41:36+00:00).

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['type'] = []
        queryparams['status'] = []
        queryparams['before_send_time'] = string
        queryparams['since_send_time'] = string
        queryparams['before_create_time'] = string
        queryparams['since_create_time'] = string
        queryparams['list_id'] = string
        queryparams['folder_id'] = string
        queryparams['sort_field'] = string
        queryparams['sort_dir'] = string
        """
        self.campaign_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, campaign_id, **queryparams):
        """
        Get information about a specific campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['sort_field'] = string
        queryparams['create_time'] = string
        """
        self.campaign_id = campaign_id
        return self._mc_client._get(url=self._build_path(campaign_id), **queryparams)


    def update(self, campaign_id, data):
        """
        Update some or all of the settings for a specific campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "settings": object*
            {
                "subject_line": string*,
                "from_name": string*,
                "reply_to": string*
            },
        }
        """
        self.campaign_id = campaign_id
        if 'settings' not in data:
            raise KeyError('The campaign must have settings')
        if 'subject_line' not in data['settings']:
            raise KeyError('The campaign settings must have a subject_line')
        if 'from_name' not in data['settings']:
            raise KeyError('The campaign settings must have a from_name')
        if 'reply_to' not in data['settings']:
            raise KeyError('The campaign settings must have a reply_to')
        check_email(data['settings']['reply_to'])
        return self._mc_client._patch(url=self._build_path(campaign_id), data=data)


    def delete(self, campaign_id):
        """
        Remove a campaign from your MailChimp account.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        self.campaign_id = campaign_id
        return self._mc_client._delete(url=self._build_path(campaign_id))


================================================
FILE: mailchimp3/entities/campaignsendchecklist.py
================================================
# coding=utf-8
"""
The Campaign Send Checklist API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/send-checklist/
Schema: https://api.mailchimp.com/schema/3.0/Campaigns/Checklist/Collection.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class CampaignSendChecklist(BaseApi):
    """
    Review the send checklist for your campaign, and resolve any issues before
    sending.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(CampaignSendChecklist, self).__init__(*args, **kwargs)
        self.endpoint = 'campaigns'
        self.campaign_id = None


    def get(self, campaign_id, **queryparams):
        """
        Review the send checklist for a campaign, and resolve any issues
        before sending.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.campaign_id = campaign_id
        return self._mc_client._get(url=self._build_path(campaign_id, 'send-checklist'), **queryparams)



================================================
FILE: mailchimp3/entities/conversationmessages.py
================================================
# coding=utf-8
"""
The Conversation Messages API endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/conversations/messages/
Schema: https://api.mailchimp.com/schema/3.0/Conversations/Messages/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_email


class ConversationMessages(BaseApi):
    """
    Manage messages in a specific campaign conversation.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ConversationMessages, self).__init__(*args, **kwargs)
        self.endpoint = 'conversations'
        self.conversation_id = None
        self.message_id = None


    # Paid feature
    def create(self, conversation_id, data):
        """
        Post a new message to a conversation.

        :param conversation_id: The unique id for the conversation.
        :type conversation_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "from_email": string*,
            "read": boolean*
        }
        """
        self.conversation_id = conversation_id
        if 'from_email' not in data:
            raise KeyError('The conversation message must have a from_email')
        check_email(data['from_email'])
        if 'read' not in data:
            raise KeyError('The conversation message must have a read')
        if data['read'] not in [True, False]:
            raise TypeError('The conversation message read must be True or False')
        response =  self._mc_client._post(url=self._build_path(conversation_id, 'messages'), data=data)
        if response is not None:
            self.message_id = response['id']
        else:
            self.message_id = None
        return response


    # Paid feature
    def all(self, conversation_id, **queryparams):
        """
        Get messages from a specific conversation.

        This endpoint does not currently support count and offset, preventing
        it from having the get_all parameter that most all() methods have

        :param conversation_id: The unique id for the conversation.
        :type conversation_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = p[
        queryparams['is_read'] = string
        queryparams['before_timestamp'] = string
        queryparams['since_timestamp'] = string
        """
        self.conversation_id = conversation_id
        self.message_id = None
        return self._mc_client._get(url=self._build_path(conversation_id, 'messages'), **queryparams)


    # Paid feature
    def get(self, conversation_id, message_id, **queryparams):
        """
        Get an individual message in a conversation.

        :param conversation_id: The unique id for the conversation.
        :type conversation_id: :py:class:`str`
        :param message_id: The unique id for the conversation message.
        :type message_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.conversation_id = conversation_id
        self.message_id = message_id
        return self._mc_client._get(url=self._build_path(conversation_id, 'messages', message_id), **queryparams)


================================================
FILE: mailchimp3/entities/conversations.py
================================================
# coding=utf-8
"""
The Conversations API endpoint

Note: This is a paid feature

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/conversations/
Schema: https://api.mailchimp.com/schema/3.0/Conversations/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.conversationmessages import ConversationMessages


class Conversations(BaseApi):
    """
    Conversation tracking is a paid feature that lets you view subscribers’
    replies to your campaigns in your MailChimp account.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(Conversations, self).__init__(*args, **kwargs)
        self.endpoint = 'conversations'
        self.conversation_id = None
        self.messages = ConversationMessages(self)


    # Paid feature
    def all(self, get_all=False, **queryparams):
        """
        Get a list of conversations for the account.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['has_unread_messages'] = string
        queryparams['list_id'] = string
        queryparams['campaign_id'] = string
        """
        self.conversation_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    # Paid feature
    def get(self, conversation_id, **queryparams):
        """
        Get details about an individual conversation.

        :param conversation_id: The unique id for the conversation.
        :type conversation_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.conversation_id = conversation_id
        return self._mc_client._get(url=self._build_path(conversation_id), **queryparams)


================================================
FILE: mailchimp3/entities/customerjourney.py
================================================
# coding=utf-8
"""
The Customer Journey API endpoint

Documentation: https://mailchimp.com/developer/marketing/api/customer-journeys-journeys-steps-actions/
Schema: https://us1.api.mailchimp.com/schema/3.0/Paths/CustomerJourneys/Journeys/Steps/Actions/Trigger.json
"""

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_email


class CustomerJourney(BaseApi):
    """
    Manage specific customer journeys in your Mailchimp account.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(CustomerJourney, self).__init__(*args, **kwargs)
        self.endpoint = 'customer-journeys'
        self.journey_id = None
        self.step_id = None

    def trigger(self, journey_id, step_id, data):
        """
        Trigger a step in a customer journey.

        :param journey_id: The unique id for the Customer Journey
        :type journey_id: :py:class:`str`
        :param step_id: The unique id for the step within the customer journey
        :type step_id: :py:class:`str`
        :type data: :py:class:`dict`
        data = {
            "email": string*,
        }
        """
        self.journey_id = journey_id
        self.step_id = step_id
        if 'email_address' not in data:
            raise KeyError('The automation email queue must have an email_address')

        check_email(data['email_address'])
        response = self._mc_client._post(
            url=self._build_path("journeys", journey_id, 'steps', step_id, 'actions', "trigger"),
            data=data
        )

        return response


================================================
FILE: mailchimp3/entities/filemanagerfiles.py
================================================
# coding=utf-8
"""
The File Manager Files API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/file-manager/files/
Schema: https://api.mailchimp.com/schema/3.0/FileManager/Files/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class FileManagerFiles(BaseApi):
    """
    Manage specific files in the File Manager for your MailChimp account. The
    File Manager is a place to store images, documents, and other files you
    include or link to in your campaigns, templates, or signup forms.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(FileManagerFiles, self).__init__(*args, **kwargs)
        self.endpoint = 'file-manager/files'
        self.file_id = None


    def create(self, data):
        """
        Upload a new image or file to the File Manager.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*,
            "file_data": string*
        }
        """
        if 'name' not in data:
            raise KeyError('The file must have a name')
        if 'file_data' not in data:
            raise KeyError('The file must have file_data')
        response = self._mc_client._post(url=self._build_path(), data=data)
        if response is not None:
            self.file_id = response['id']
        else:
            self.file_id = None
        return response


    def all(self, get_all=False, **queryparams):
        """
        Get a list of available images and files stored in the File Manager for the account.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['type'] = string
        queryparams['created_by'] = string
        queryparams['before_created_at'] = string
        queryparams['since_created_at'] = string
        queryparams['sort_field'] = string
        queryparams['sort_dir'] = string
        """
        self.file_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, file_id, **queryparams):
        """
        Get information about a specific file in the File Manager.

        :param file_id: The unique id for the File Manager file.
        :type file_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.file_id = file_id
        return self._mc_client._get(url=self._build_path(file_id), **queryparams)


    def update(self, file_id, data):
        """
        Update a file in the File Manager.

        :param file_id: The unique id for the File Manager file.
        :type file_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*,
            "file_data": string*
        }
        """
        self.file_id = file_id
        if 'name' not in data:
            raise KeyError('The file must have a name')
        if 'file_data' not in data:
            raise KeyError('The file must have file_data')
        return self._mc_client._patch(url=self._build_path(file_id), data=data)


    def delete(self, file_id):
        """
        Remove a specific file from the File Manager.

        :param file_id: The unique id for the File Manager file.
        :type file_id: :py:class:`str`
        """
        self.file_id = file_id
        return self._mc_client._delete(url=self._build_path(file_id))


================================================
FILE: mailchimp3/entities/filemanagerfolders.py
================================================
# coding=utf-8
"""
The File Manager Folders API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/file-manager/folders/
Schema: https://api.mailchimp.com/schema/3.0/FileManager/Folders/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class FileManagerFolders(BaseApi):
    """
    Manage specific folders in the File Manager for your MailChimp account.
    The File Manager is a place to store images, documents, and other files
    you include or link to in your campaigns, templates, or signup forms.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(FileManagerFolders, self).__init__(*args, **kwargs)
        self.endpoint = 'file-manager/folders'
        self.folder_id = None


    def create(self, data):
        """
        Create a new folder in the File Manager.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        if 'name' not in data:
            raise KeyError('The folder must have a name')
        response = self._mc_client._post(url=self._build_path(), data=data)
        if response is not None:
            self.folder_id = response['id']
        else:
            self.folder_id = None
        return response


    def all(self, get_all=False, **queryparams):
        """
        Get a list of all folders in the File Manager.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['created_by'] = string
        queryparams['before_created_at'] = string
        queryparams['since_created_at'] = string
        """
        self.folder_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, folder_id, **queryparams):
        """
        Get information about a specific folder in the File Manager.

        :param folder_id: The unique id for the File Manager folder.
        :type folder_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.folder_id = folder_id
        return self._mc_client._get(url=self._build_path(folder_id), **queryparams)


    def update(self, folder_id, data):
        """
        Update a specific File Manager file.

        :param folder_id: The unique id for the File Manager folder.
        :type folder_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        self.folder_id = folder_id
        if 'name' not in data:
            raise KeyError('The folder must have a name')
        return self._mc_client._patch(url=self._build_path(folder_id), data=data)


    def delete(self, folder_id):
        """
        Delete a specific folder in the File Manager.

        :param folder_id: The unique id for the File Manager folder.
        :type folder_id: :py:class:`str`
        """
        self.folder_id = folder_id
        return self._mc_client._delete(url=self._build_path(folder_id))




================================================
FILE: mailchimp3/entities/landingpageaction.py
================================================
# coding=utf-8
"""
The Landinge Page actions API endpoint

Documentation: https://mailchimp.com/developer/reference/landing-pages/
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class LandingPageAction(BaseApi):
    """
    Manage your Landing Pages, including publishing and unpublishing.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(LandingPageAction, self).__init__(*args, **kwargs)
        self.endpoint = 'landing-pages'
        self.page_id = None


    def publish(self, page_id):
        """
        Publish a landing page that is in draft, unpublished, or has been
        previously published and edited.

        :param page_id: The unique id for the page.
        :type page_id: :py:class:`str`
        """
        self.page_id = page_id
        return self._mc_client._post(url=self._build_path(page_id, 'actions/publish'))


    def unpublish(self, page_id):
        """
        Unpublish a landing page that is in draft or has been published.

        :param page_id: The unique id for the page.
        :type page_id: :py:class:`str`
        """
        self.page_id = page_id
        return self._mc_client._post(url=self._build_path(page_id, 'actions/unpublish'))


================================================
FILE: mailchimp3/entities/landingpagecontent.py
================================================
# coding=utf-8
"""
The Landing Page Content API endpoint

Documentation: https://mailchimp.com/developer/reference/landing-pages/landing-pages_content/
Schema: https://api.mailchimp.com/schema/3.0/Definitions/LandingPages/Content/Response.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class LandingPageContent(BaseApi):
    """
    The HTML content for your Mailchimp landing pages.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(LandingPageContent, self).__init__(*args, **kwargs)
        self.endpoint = 'landing-pages'
        self.page_id = None


    def get(self, page_id, **queryparams):
        """
        Get the the HTML for your landing page.

        :param page_id: The unique id for the page.
        :type page_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.page_id = page_id
        return self._mc_client._get(url=self._build_path(page_id, 'content'), **queryparams)


================================================
FILE: mailchimp3/entities/landingpages.py
================================================
# coding=utf-8
"""
The Landing Pages API endpoint

Documentation: https://mailchimp.com/developer/reference/landing-pages/
Schema: https://api.mailchimp.com/schema/3.0/LandingPages/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.landingpageaction import LandingPageAction
from mailchimp3.entities.landingpagecontent import LandingPageContent


class LandingPages(BaseApi):
    """
    Manage your Landing Pages, including publishing and unpublishing.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(LandingPages, self).__init__(*args, **kwargs)
        self.endpoint = 'landing-pages'
        self.page_id = None
        self.content = LandingPageContent(self)
        self.actions = LandingPageAction(self)


    def create(self, data):
        """
        Create a new Landing Page.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "list_id": string*,
        }
        """
        if 'list_id' not in data:
            raise KeyError('The landing page must have a list_id')
        response = self._mc_client._post(url=self._build_path(), data=data)
        if response is not None:
            self.page_id = response['id']
        else:
            self.page_id = None
        return response


    def all(self, get_all=False, **queryparams):
        """
        Get all landinge pages.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['sort_field'] = string
        queryparams['sort_dir'] = string
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        """
        self.page_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, page_id, **queryparams):
        """
        Get information about a specific page.

        :param page_id: The unique id for the page.
        :type page_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.page_id = page_id
        return self._mc_client._get(url=self._build_path(page_id), **queryparams)


    def update(self, page_id, data):
        """
        Update a landing page.

        :param page_id: The unique id for the landing page.
        :type page_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        """
        self.page_id = page_id
        return self._mc_client._patch(url=self._build_path(page_id), data=data)


    def delete(self, page_id):
        """
        Remove a landing page from your MailChimp account.

        :param page_id: The unique id for the landing page.
        :type page_id: :py:class:`str`
        """
        self.page_id = page_id
        return self._mc_client._delete(url=self._build_path(page_id))


================================================
FILE: mailchimp3/entities/listabusereports.py
================================================
# coding=utf-8
"""
The List Abuse Reports API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/abuse-reports/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Abuse/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class ListAbuseReports(BaseApi):
    """
    Manage abuse complaints for a specific list. An abuse complaint occurs
    when your recipient reports an email as spam in their mail program.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListAbuseReports, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.report_id = None


    def all(self, list_id, get_all=False, **queryparams):
        """
        Get all abuse reports for a specific list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.list_id = list_id
        self.report_id = None
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'abuse-reports'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(list_id, 'abuse-reports'), **queryparams)


    def get(self, list_id, report_id, **queryparams):
        """
        Get details about a specific abuse report.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param report_id: The id for the abuse report.
        :type report_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.list_id = list_id
        self.report_id = report_id
        return self._mc_client._get(url=self._build_path(list_id, 'abuse-reports', report_id), **queryparams)


================================================
FILE: mailchimp3/entities/listactivity.py
================================================
# coding=utf-8
"""
The List Activity API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/activity/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Activity/Collection.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class ListActivity(BaseApi):
    """
    Get recent daily, aggregated activity stats for your list. For example,
    view unsubscribes, signups, total emails sent, opens, clicks, and more,
    for up to 180 days.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListActivity, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None


    def all(self, list_id, **queryparams):
        """
        Get up to the previous 180 days of daily detailed aggregated activity
        stats for a list, not including Automation activity.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.list_id = list_id
        return self._mc_client._get(url=self._build_path(list_id, 'activity'), **queryparams)


================================================
FILE: mailchimp3/entities/listclients.py
================================================
# coding=utf-8
"""
The List Clients API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/clients/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Clients/Collection.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class ListClients(BaseApi):
    """
    Get information about the most popular email clients for subscribers in a
    specific MailChimp list.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListClients, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None


    def all(self, list_id, **queryparams):
        """
        Get a list of the top email clients based on user-agent strings.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.list_id = list_id
        return self._mc_client._get(url=self._build_path(list_id, 'clients'), **queryparams)


================================================
FILE: mailchimp3/entities/listgrowthhistory.py
================================================
# coding=utf-8
"""
The List Growth History API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/growth-history/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Growth/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class ListGrowthHistory(BaseApi):
    """
    View a summary of the month-by-month growth activity for a specific list.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListGrowthHistory, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.month = None


    def all(self, list_id, get_all=False, **queryparams):
        """
        Get a month-by-month summary of a specific list’s growth activity.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.list_id = list_id
        self.month = None
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'growth-history'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(list_id, 'growth-history'), **queryparams)


    def get(self, list_id, month, **queryparams):
        """
        Get a summary of a specific list’s growth activity for a specific month and year.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param month: A specific month of list growth history.
        :type month: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.list_id = list_id
        self.month = month
        return self._mc_client._get(url=self._build_path(list_id, 'growth-history', month), **queryparams)


================================================
FILE: mailchimp3/entities/listinterestcategories.py
================================================
# coding=utf-8
"""
The List Interest Categories API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/interest-categories/
Schema: https://api.mailchimp.com/schema/3.0/Lists/InterestCategories/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.listinterestcategoryinterest import ListInterestCategoryInterest


class ListInterestCategories(BaseApi):
    """
    Manage interest categories for a specific list. Interest categories
    organize interests, which are used to group subscribers based on their
    preferences. These correspond to ‘group titles’ in the MailChimp
    application.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListInterestCategories, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.category_id = None
        self.interests = ListInterestCategoryInterest(self)


    def create(self, list_id, data):
        """
        Create a new interest category.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "title": string*,
            "type": string* (Must be one of 'checkboxes', 'dropdown', 'radio', or 'hidden')
        }
        """
        self.list_id = list_id
        if 'title' not in data:
            raise KeyError('The list interest category must have a title')
        if 'type' not in data:
            raise KeyError('The list interest category must have a type')
        if data['type'] not in ['checkboxes', 'dropdown', 'radio', 'hidden']:
            raise ValueError('The list interest category type must be one of "checkboxes", "dropdown", "radio", or '
                             '"hidden"')
        response = self._mc_client._post(url=self._build_path(list_id, 'interest-categories'), data=data)
        if response is not None:
            self.category_id = response['id']
        else:
            self.category_id = None
        return response


    def all(self, list_id, get_all=False, **queryparams):
        """
        Get information about a list’s interest categories.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['type'] = string
        """
        self.list_id = list_id
        self.category_id = None
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'interest-categories'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(list_id, 'interest-categories'), **queryparams)


    def get(self, list_id, category_id, **queryparams):
        """
        Get information about a specific interest category.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.list_id = list_id
        self.category_id = category_id
        return self._mc_client._get(url=self._build_path(list_id, 'interest-categories', category_id), **queryparams)


    def update(self, list_id, category_id, data):
        """
        Update a specific interest category.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "title": string*,
            "type": string* (Must be one of 'checkboxes', 'dropdown', 'radio', or 'hidden')
        }
        """
        self.list_id = list_id
        self.category_id = category_id
        if 'title' not in data:
            raise KeyError('The list interest category must have a title')
        if 'type' not in data:
            raise KeyError('The list interest category must have a type')
        if data['type'] not in ['checkboxes', 'dropdown', 'radio', 'hidden']:
            raise ValueError('The list interest category type must be one of "checkboxes", "dropdown", "radio", or '
                             '"hidden"')
        return self._mc_client._patch(url=self._build_path(list_id, 'interest-categories', category_id), data=data)


    def delete(self, list_id, category_id):
        """
        Delete a specific interest category.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        """
        self.list_id = list_id
        self.category_id = category_id
        return self._mc_client._delete(url=self._build_path(list_id, 'interest-categories', category_id))


================================================
FILE: mailchimp3/entities/listinterestcategoryinterest.py
================================================
# coding=utf-8
"""
The List Interest Category Interests API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/interest-categories/interests/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Interests/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class ListInterestCategoryInterest(BaseApi):
    """
    Manage interests for a specific MailChimp list. Assign subscribers to
    interests to group them together. Interests are referred to as ‘group
    names’ in the MailChimp application.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListInterestCategoryInterest, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.category_id = None
        self.interest_id = None


    def create(self, list_id, category_id, data):
        """
        Create a new interest or ‘group name’ for a specific category.

        The documentation lists only the name request body parameter so it is
        being documented and error-checked as if it were required based on the
        description of the method.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        self.list_id = list_id
        self.category_id = category_id
        if 'name' not in data:
            raise KeyError('The list interest category interest must have a name')
        response =  self._mc_client._post(
            url=self._build_path(list_id, 'interest-categories', category_id, 'interests'),
            data=data
        )
        if response is not None:
            self.interest_id = response['id']
        else:
            self.interest_id = None
        return response


    def all(self, list_id, category_id, get_all=False, **queryparams):
        """
        Get a list of this category’s interests.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        self.list_id = list_id
        self.category_id = category_id
        self.interest_id = None
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'interest-categories', category_id, 'interests'), **queryparams)
        else:
            return self._mc_client._get(
                url=self._build_path(list_id, 'interest-categories', category_id, 'interests'),
                **queryparams
            )


    def get(self, list_id, category_id, interest_id, **queryparams):
        """
        Get interests or ‘group names’ for a specific category.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        :param interest_id: The specific interest or ‘group name’.
        :type interest_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.list_id = list_id
        self.category_id = category_id
        self.interest_id = interest_id
        return self._mc_client._get(
            url=self._build_path(list_id, 'interest-categories', category_id, 'interests', interest_id),
            **queryparams
        )


    def update(self, list_id, category_id, interest_id, data):
        """
        Update interests or ‘group names’ for a specific category.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        :param interest_id: The specific interest or ‘group name’.
        :type interest_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        self.list_id = list_id
        self.category_id = category_id
        self.interest_id = interest_id
        if 'name' not in data:
            raise KeyError('The list interest category interest must have a name')
        return self._mc_client._patch(
            url=self._build_path(list_id, 'interest-categories', category_id, 'interests', interest_id),
            data=data
        )


    def delete(self, list_id, category_id, interest_id):
        """
        Delete interests or group names in a specific category.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param category_id: The unique id for the interest category.
        :type category_id: :py:class:`str`
        :param interest_id: The specific interest or ‘group name’.
        :type interest_id: :py:class:`str`
        """
        self.list_id = list_id
        self.category_id = category_id
        self.interest_id = interest_id
        return self._mc_client._delete(
            url=self._build_path(list_id, 'interest-categories', category_id, 'interests', interest_id)
        )


================================================
FILE: mailchimp3/entities/listmemberactivity.py
================================================
# coding=utf-8
"""
The List Member Activity API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/activity/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Members/Activity/Collection.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_subscriber_hash


class ListMemberActivity(BaseApi):
    """
    Get details about subscribers’ recent activity.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListMemberActivity, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.subscriber_hash = None


    def all(self, list_id, subscriber_hash, **queryparams):
        """
        Get the last 50 events of a member’s activity on a specific list,
        including opens, clicks, and unsubscribes.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._get(url=self._build_path(list_id, 'members', subscriber_hash, 'activity'), **queryparams)
    
    def feed(self, list_id, subscriber_hash, **queryparams):
        """
        Get the last 10 events of a member’s activity on a specific list,
        including opens, clicks, and unsubscribes. 
        With count parameter, get as many past events as you would like.
        Returns many more fields not accessible by all endpoint.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._get(url=self._build_path(list_id, 'members', subscriber_hash, 'activity-feed'), **queryparams)



================================================
FILE: mailchimp3/entities/listmemberevents.py
================================================
# coding=utf-8
"""
The List Member Events API endpoint

Documentation: https://mailchimp.com/developer/reference/lists/list-members/list-member-events/
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_subscriber_hash


class ListMemberEvents(BaseApi):
    """
    Use the Events endpoint to collect website or in-app actions and trigger targeted automations.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListMemberEvents, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.subscriber_hash = None

    def create(self, list_id, subscriber_hash, data):
        """
        Add an event for a list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*, (Must be 2-30 characters in length)
        }
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        if 'name' not in data:
            raise KeyError('The list member events must have a name')
        if len(data['name']) < 2 or len(data['name']) > 30:
            raise ValueError('The list member events name must be 2-30 in length')
        return self._mc_client._post(url=self._build_path(list_id, 'members', subscriber_hash, 'events'), data=data)

    def all(self, list_id, subscriber_hash, get_all=False, **queryparams):
        """
        Get events for a contact

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'members', subscriber_hash, 'events'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(list_id, 'members', subscriber_hash, 'events'), **queryparams)


================================================
FILE: mailchimp3/entities/listmembergoals.py
================================================
# coding=utf-8
"""
The List Member Goals API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/goals/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Members/Goals/Collection.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_subscriber_hash


class ListMemberGoals(BaseApi):
    """
    Get information about recent goal events for a specific list member.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListMemberGoals, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.subscriber_hash = None


    def all(self, list_id, subscriber_hash, **queryparams):
        """
        Get the last 50 Goal events for a member on a specific list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._get(url=self._build_path(list_id, 'members', subscriber_hash, 'goals'), **queryparams)


================================================
FILE: mailchimp3/entities/listmembernotes.py
================================================
# coding=utf-8
"""
The List Member Notes API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/notes/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Members/Notes/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_subscriber_hash


class ListMemberNotes(BaseApi):
    """
    Retrieve recent notes for a specific list member.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListMemberNotes, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.subscriber_hash = None
        self.note_id = None


    def create(self, list_id, subscriber_hash, data):
        """
        Add a new note for a specific subscriber.

        The documentation lists only the note request body parameter so it is
        being documented and error-checked as if it were required based on the
        description of the method.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "note": string*
        }
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        if 'note' not in data:
            raise KeyError('The list member note must have a note')
        response = self._mc_client._post(url=self._build_path(list_id, 'members', subscriber_hash, 'notes'), data=data)
        if response is not None:
            self.note_id = response['id']
        else:
            self.note_id = None
        return response


    def all(self, list_id, subscriber_hash, get_all=False, **queryparams):
        """
        Get recent notes for a specific list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        self.note_id = None
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'members', subscriber_hash, 'notes'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(list_id, 'members', subscriber_hash, 'notes'), **queryparams)


    def get(self, list_id, subscriber_hash, note_id, **queryparams):
        """
        Get a specific note for a specific list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param note_id: The id for the note.
        :type note_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        self.note_id = note_id
        return self._mc_client._get(
            url=self._build_path(list_id, 'members', subscriber_hash, 'notes', note_id),
            **queryparams
        )


    def update(self, list_id, subscriber_hash, note_id, data):
        """
        Update a specific note for a specific list member.

        The documentation lists only the note request body parameter so it is
        being documented and error-checked as if it were required based on the
        description of the method.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param note_id: The id for the note.
        :type note_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "note": string*
        }
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        self.note_id = note_id
        if 'note' not in data:
            raise KeyError('The list member note must have a note')
        return self._mc_client._patch(
            url=self._build_path(list_id, 'members', subscriber_hash, 'notes', note_id),
            data=data
        )


    def delete(self, list_id, subscriber_hash, note_id):
        """
        Delete a specific note for a specific list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param note_id: The id for the note.
        :type note_id: :py:class:`str`
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        self.note_id = note_id
        return self._mc_client._delete(url=self._build_path(list_id, 'members', subscriber_hash, 'notes', note_id))


================================================
FILE: mailchimp3/entities/listmembers.py
================================================
# coding=utf-8
"""
The List Members API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Members/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.listmemberactivity import ListMemberActivity
from mailchimp3.entities.listmemberevents import ListMemberEvents
from mailchimp3.entities.listmembergoals import ListMemberGoals
from mailchimp3.entities.listmembernotes import ListMemberNotes
from mailchimp3.helpers import check_email, check_subscriber_hash


class ListMembers(BaseApi):
    """
    Manage members of a specific MailChimp list, including currently
    subscribed, unsubscribed, and bounced members.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListMembers, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.subscriber_hash = None
        self.activity = ListMemberActivity(self)
        self.events = ListMemberEvents(self)
        self.goals = ListMemberGoals(self)
        self.notes = ListMemberNotes(self)


    def create(self, list_id, data):
        """
        Add a new member to the list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "status": string*, (Must be one of 'subscribed', 'unsubscribed', 'cleaned',
                'pending', or 'transactional')
            "email_address": string*
        }
        """
        self.list_id = list_id
        if 'status' not in data:
            raise KeyError('The list member must have a status')
        if data['status'] not in ['subscribed', 'unsubscribed', 'cleaned', 'pending', 'transactional']:
            raise ValueError('The list member status must be one of "subscribed", "unsubscribed", "cleaned", '
                             '"pending", or "transactional"')
        if 'email_address' not in data:
            raise KeyError('The list member must have an email_address')
        check_email(data['email_address'])
        response = self._mc_client._post(url=self._build_path(list_id, 'members'), data=data)
        if response is not None:
            self.subscriber_hash = response['id']
        else:
            self.subscriber_hash = None
        return response


    def all(self, list_id, get_all=False, **queryparams):
        """
        Get information about members in a specific MailChimp list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['email_type'] = string
        queryparams['status'] = string
        queryparams['before_timestamp_opt'] = string
        queryparams['since_timestamp_opt'] = string
        queryparams['before_last_changed'] = string
        queryparams['since_last_changed'] = string
        queryparams['unique_email_id'] = string
        queryparams['vip_only'] = boolean
        queryparams['interest_category_id'] = string
        queryparams['interest_ids'] = string
        queryparams['interest_match'] = string
        """
        self.list_id = list_id
        self.subscriber_hash = None
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'members'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(list_id, 'members'), **queryparams)


    def get(self, list_id, subscriber_hash, **queryparams):
        """
        Get information about a specific list member, including a currently
        subscribed, unsubscribed, or bounced member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
            list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._get(url=self._build_path(list_id, 'members', subscriber_hash), **queryparams)


    def update(self, list_id, subscriber_hash, data):
        """
        Update information for a specific list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
            list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._patch(url=self._build_path(list_id, 'members', subscriber_hash), data=data)


    def create_or_update(self, list_id, subscriber_hash, data):
        """
        Add or update a list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
            list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "email_address": string*,
            "status_if_new": string* (Must be one of 'subscribed',
                'unsubscribed', 'cleaned', 'pending', or 'transactional')
        }
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        if 'email_address' not in data:
            raise KeyError('The list member must have an email_address')
        check_email(data['email_address'])
        if 'status_if_new' not in data:
            raise KeyError('The list member must have a status_if_new')
        if data['status_if_new'] not in ['subscribed', 'unsubscribed', 'cleaned', 'pending', 'transactional']:
            raise ValueError('The list member status_if_new must be one of "subscribed", "unsubscribed", "cleaned", '
                             '"pending", or "transactional"')
        return self._mc_client._put(url=self._build_path(list_id, 'members', subscriber_hash), data=data)


    def delete(self, list_id, subscriber_hash):
        """
        Delete a member from a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._delete(url=self._build_path(list_id, 'members', subscriber_hash))

    def delete_permanent(self, list_id, subscriber_hash):
        """
        Delete permanently a member from a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._post(url=self._build_path(list_id, 'members', subscriber_hash, 'actions', 'delete-permanent'))


================================================
FILE: mailchimp3/entities/listmembertags.py
================================================
# coding=utf-8
"""
The List Member Tags API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/tags/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Members/Tags/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_subscriber_hash


class ListMemberTags(BaseApi):
    """
    Retrieve tags for a specific list member.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListMemberTags, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.subscriber_hash = None


    def update(self, list_id, subscriber_hash, data):
        """
        Update tags for a specific subscriber.

        The documentation lists only the tags request body parameter so it is
        being documented and error-checked as if it were required based on the
        description of the method.

        The data list needs to include a "status" key. This determines if the
        tag should be added or removed from the user:

        data = {
            'tags': [
                {'name': 'foo', 'status': 'active'},
                {'name': 'bar', 'status': 'inactive'}
            ]
        }

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "tags": list*
        }
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        if 'tags' not in data:
            raise KeyError('The list member tags must have a tag')
        response = self._mc_client._post(url=self._build_path(list_id, 'members', subscriber_hash, 'tags'), data=data)
        return response


    def all(self, list_id, subscriber_hash, **queryparams):
        """
        Get all tags for a specific list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        """
        subscriber_hash = check_subscriber_hash(subscriber_hash)
        self.list_id = list_id
        self.subscriber_hash = subscriber_hash
        return self._mc_client._get(url=self._build_path(list_id, 'members', subscriber_hash, 'tags'), **queryparams)


================================================
FILE: mailchimp3/entities/listmergefields.py
================================================
# coding=utf-8
"""
The List Merge Fields API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/merge-fields/
Schema: https://api.mailchimp.com/schema/3.0/Lists/MergeFields/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi


class ListMergeFields(BaseApi):
    """
    Manage merge fields (formerly merge vars) for a specific list.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListMergeFields, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.merge_id = None


    def create(self, list_id, data):
        """
        Add a new merge field for a specific list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*,
            "type": string*
        }
        """
        self.list_id = list_id
        if 'name' not in data:
            raise KeyError('The list merge field must have a name')
        if 'type' not in data:
            raise KeyError('The list merge field must have a type')
        response = self._mc_client._post(url=self._build_path(list_id, 'merge-fields'), data=data)
        if response is not None:
            self.merge_id = response['merge_id']
        else:
            self.merge_id = None
        return response


    def all(self, list_id, get_all=False, **queryparams):
        """
        Get a list of all merge fields (formerly merge vars) for a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['type'] = string
        queryparams['required'] = boolean
        """
        self.list_id = list_id
        self.merge_id = None
        if get_all:
            return self._iterate(url=self._build_path(list_id, 'merge-fields'), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(list_id, 'merge-fields'), **queryparams)


    def get(self, list_id, merge_id):
        """
        Get information about a specific merge field in a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param merge_id: The id for the merge field.
        :type merge_id: :py:class:`str`
        """
        self.list_id = list_id
        self.merge_id = merge_id
        return self._mc_client._get(url=self._build_path(list_id, 'merge-fields', merge_id))


    def update(self, list_id, merge_id, data):
        """
        Update a specific merge field in a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param merge_id: The id for the merge field.
        :type merge_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*
        }
        """
        self.list_id = list_id
        self.merge_id = merge_id
        if 'name' not in data:
            raise KeyError('The list merge field must have a name')
        return self._mc_client._patch(url=self._build_path(list_id, 'merge-fields', merge_id), data=data)


    def delete(self, list_id, merge_id):
        """
        Delete a specific merge field in a list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param merge_id: The id for the merge field.
        :type merge_id: :py:class:`str`
        """
        self.list_id = list_id
        self.merge_id = merge_id
        return self._mc_client._delete(url=self._build_path(list_id, 'merge-fields', merge_id))


================================================
FILE: mailchimp3/entities/lists.py
================================================
# coding=utf-8
"""
The Lists API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.entities.listabusereports import ListAbuseReports
from mailchimp3.entities.listactivity import ListActivity
from mailchimp3.entities.listclients import ListClients
from mailchimp3.entities.listgrowthhistory import ListGrowthHistory
from mailchimp3.entities.listinterestcategories import ListInterestCategories
from mailchimp3.entities.listmembers import ListMembers
from mailchimp3.entities.listmergefields import ListMergeFields
from mailchimp3.entities.listsegments import ListSegments
from mailchimp3.entities.listsignupforms import ListSignupForms
from mailchimp3.entities.listwebhooks import ListWebhooks
from mailchimp3.helpers import check_email


class Lists(BaseApi):
    """
    A MailChimp list is a powerful and flexible tool that helps you manage your contacts.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(Lists, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.abuse_reports = ListAbuseReports(self)
        self.activity = ListActivity(self)
        self.clients = ListClients(self)
        self.growth_history = ListGrowthHistory(self)
        self.interest_categories = ListInterestCategories(self)
        self.members = ListMembers(self)
        self.merge_fields = ListMergeFields(self)
        self.segments = ListSegments(self)
        self.signup_forms = ListSignupForms(self)
        self.webhooks = ListWebhooks(self)


    def create(self, data):
        """
        Create a new list in your MailChimp account.

        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*,
            "contact": object*
            {
                "company": string*,
                "address1": string*,
                "city": string*,
                "state": string*,
                "zip": string*,
                "country": string*
            },
            "permission_reminder": string*,
            "campaign_defaults": object*
            {
                "from_name": string*,
                "from_email": string*,
                "subject": string*,
                "language": string*
            },
            "email_type_option": boolean
        }
        """
        if 'name' not in data:
            raise KeyError('The list must have a name')
        if 'contact' not in data:
            raise KeyError('The list must have a contact')
        if 'company' not in data['contact']:
            raise KeyError('The list contact must have a company')
        if 'address1' not in data['contact']:
            raise KeyError('The list contact must have a address1')
        if 'city' not in data['contact']:
            raise KeyError('The list contact must have a city')
        if 'state' not in data['contact']:
            raise KeyError('The list contact must have a state')
        if 'zip' not in data['contact']:
            raise KeyError('The list contact must have a zip')
        if 'country' not in data['contact']:
            raise KeyError('The list contact must have a country')
        if 'permission_reminder' not in data:
            raise KeyError('The list must have a permission_reminder')
        if 'campaign_defaults' not in data:
            raise KeyError('The list must have a campaign_defaults')
        if 'from_name' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a from_name')
        if 'from_email' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a from_email')
        check_email(data['campaign_defaults']['from_email'])
        if 'subject' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a subject')
        if 'language' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a language')
        if 'email_type_option' not in data:
            raise KeyError('The list must have an email_type_option')
        if data['email_type_option'] not in [True, False]:
            raise TypeError('The list email_type_option must be True or False')
        response = self._mc_client._post(url=self._build_path(), data=data)
        if response is not None:
            self.list_id = response['id']
        else:
            self.list_id = None
        return response


    def update_members(self, list_id, data):
        """
        Batch subscribe or unsubscribe list members.

        Only the members array is required in the request body parameters.
        Within the members array, each member requires an email_address
        and either a status or status_if_new. The update_existing parameter
        will also be considered required to help prevent accidental updates
        to existing members and will default to false if not present.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "members": array*
            [
                {
                    "email_address": string*,
                    "status": string* (Must be one of 'subscribed', 'unsubscribed', 'cleaned', or 'pending'),
                    "status_if_new": string* (Must be one of 'subscribed', 'unsubscribed', 'cleaned', or 'pending')
                }
            ],
            "update_existing": boolean*
        }
        """
        self.list_id = list_id
        if 'members' not in data:
            raise KeyError('The update must have at least one member')
        else:
            if not len(data['members']) <= 500:
                raise ValueError('You may only batch sub/unsub 500 members at a time')
        for member in data['members']:
            if 'email_address' not in member:
                raise KeyError('Each list member must have an email_address')
            check_email(member['email_address'])
            if 'status' not in member and 'status_if_new' not in member:
                raise KeyError('Each list member must have either a status or a status_if_new')
            valid_statuses = ['subscribed', 'unsubscribed', 'cleaned', 'pending']
            if 'status' in member and member['status'] not in valid_statuses:
                raise ValueError('The list member status must be one of "subscribed", "unsubscribed", "cleaned", or '
                                 '"pending"')
            if 'status_if_new' in member and member['status_if_new'] not in valid_statuses:
                raise ValueError('The list member status_if_new must be one of "subscribed", "unsubscribed", '
                                 '"cleaned", or "pending"')
        if 'update_existing' not in data:
            data['update_existing'] = False
        return self._mc_client._post(url=self._build_path(list_id), data=data)


    def all(self, get_all=False, **queryparams):
        """
        Get information about all lists in the account.

        :param get_all: Should the query get all results
        :type get_all: :py:class:`bool`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        queryparams['before_date_created'] = string
        queryparams['since_date_created'] = string
        queryparams['before_campaign_last_sent'] = string
        queryparams['since_campaign_last_sent'] = string
        queryparams['email'] = string
        queryparams['sort_field'] = string (Must be 'date_created')
        queryparams['sort_dir'] = string (Must be one of 'ASC' or 'DESC')
        """
        self.list_id = None
        if get_all:
            return self._iterate(url=self._build_path(), **queryparams)
        else:
            return self._mc_client._get(url=self._build_path(), **queryparams)


    def get(self, list_id, **queryparams):
        """
        Get information about a specific list in your MailChimp account.
        Results include list members who have signed up but haven’t confirmed
        their subscription yet and unsubscribed or cleaned.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        self.list_id = list_id
        return self._mc_client._get(url=self._build_path(list_id), **queryparams)


    def update(self, list_id, data):
        """
        Update the settings for a specific list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "name": string*,
            "contact": object*
            {
                "company": string*,
                "address1": string*,
                "city": string*,
                "state": string*,
                "zip": string*,
                "country": string*
            },
            "permission_reminder": string*,
            "campaign_defaults": object*
            {
                "from_name": string*,
                "from_email": string*,
                "subject": string*,
                "language": string*
            },
            "email_type_option": boolean
        }
        """
        self.list_id = list_id
        if 'name' not in data:
            raise KeyError('The list must have a name')
        if 'contact' not in data:
            raise KeyError('The list must have a contact')
        if 'company' not in data['contact']:
            raise KeyError('The list contact must have a company')
        if 'address1' not in data['contact']:
            raise KeyError('The list contact must have a address1')
        if 'city' not in data['contact']:
            raise KeyError('The list contact must have a city')
        if 'state' not in data['contact']:
            raise KeyError('The list contact must have a state')
        if 'zip' not in data['contact']:
            raise KeyError('The list contact must have a zip')
        if 'country' not in data['contact']:
            raise KeyError('The list contact must have a country')
        if 'permission_reminder' not in data:
            raise KeyError('The list must have a permission_reminder')
        if 'campaign_defaults' not in data:
            raise KeyError('The list must have a campaign_defaults')
        if 'from_name' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a from_name')
        if 'from_email' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a from_email')
        check_email(data['campaign_defaults']['from_email'])
        if 'subject' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a subject')
        if 'language' not in data['campaign_defaults']:
            raise KeyError('The list campaign_defaults must have a language')
        if 'email_type_option' not in data:
            raise KeyError('The list must have an email_type_option')
        if data['email_type_option'] not in [True, False]:
            raise TypeError('The list email_type_option must be True or False')
        return self._mc_client._patch(url=self._build_path(list_id), data=data)


    def delete(self, list_id):
        """
        Delete a list from your MailChimp account. If you delete a list,
        you’ll lose the list history—including subscriber activity,
        unsubscribes, complaints, and bounces. You’ll also lose subscribers’
        email addresses, unless you exported and backed up your list.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        """
        self.list_id = list_id
        return self._mc_client._delete(url=self._build_path(list_id))



================================================
FILE: mailchimp3/entities/listsegmentmembers.py
================================================
# coding=utf-8
"""
The List Segment Members API endpoint

Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/segments/members/
Schema: https://api.mailchimp.com/schema/3.0/Lists/Members/Instance.json
"""
from __future__ import unicode_literals

from mailchimp3.baseapi import BaseApi
from mailchimp3.helpers import check_email, check_subscriber_hash


class ListSegmentMembers(BaseApi):
    """
    Manage list members in a saved segment.
    """
    def __init__(self, *args, **kwargs):
        """
        Initialize the endpoint
        """
        super(ListSegmentMembers, self).__init__(*args, **kwargs)
        self.endpoint = 'lists'
        self.list_id = None
        self.segment_id = None
        self.subscriber_hash = None


    def create(self, list_id, segment_id, data):
        """
        Add a member to a static segment.

        The documentation does not currently elaborate on the path or request
        body parameters. Looking at the example provided, it will be assumed
        that email_address and status are required request body parameters and
        they are documented and error-checked as such.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param segment_id: The unique id for the segment.
        :type segment_id: :py:class:`str`
        :
Download .txt
gitextract_mzccawi9/

├── .gitignore
├── LICENSE
├── README.md
├── README.rst
├── mailchimp3/
│   ├── __init__.py
│   ├── baseapi.py
│   ├── entities/
│   │   ├── __init__.py
│   │   ├── authorizedapps.py
│   │   ├── automationactions.py
│   │   ├── automationemailactions.py
│   │   ├── automationemailqueues.py
│   │   ├── automationemails.py
│   │   ├── automationremovedsubscribers.py
│   │   ├── automations.py
│   │   ├── batchoperations.py
│   │   ├── batchwebhooks.py
│   │   ├── campaignactions.py
│   │   ├── campaigncontent.py
│   │   ├── campaignfeedback.py
│   │   ├── campaignfolders.py
│   │   ├── campaigns.py
│   │   ├── campaignsendchecklist.py
│   │   ├── conversationmessages.py
│   │   ├── conversations.py
│   │   ├── customerjourney.py
│   │   ├── filemanagerfiles.py
│   │   ├── filemanagerfolders.py
│   │   ├── landingpageaction.py
│   │   ├── landingpagecontent.py
│   │   ├── landingpages.py
│   │   ├── listabusereports.py
│   │   ├── listactivity.py
│   │   ├── listclients.py
│   │   ├── listgrowthhistory.py
│   │   ├── listinterestcategories.py
│   │   ├── listinterestcategoryinterest.py
│   │   ├── listmemberactivity.py
│   │   ├── listmemberevents.py
│   │   ├── listmembergoals.py
│   │   ├── listmembernotes.py
│   │   ├── listmembers.py
│   │   ├── listmembertags.py
│   │   ├── listmergefields.py
│   │   ├── lists.py
│   │   ├── listsegmentmembers.py
│   │   ├── listsegments.py
│   │   ├── listsignupforms.py
│   │   ├── listwebhooks.py
│   │   ├── ping.py
│   │   ├── reportcampaignabusereports.py
│   │   ├── reportcampaignadvice.py
│   │   ├── reportclickdetailmembers.py
│   │   ├── reportclickdetailreports.py
│   │   ├── reportdomainperformance.py
│   │   ├── reporteepurl.py
│   │   ├── reportemailactivity.py
│   │   ├── reportgoogleanalytics.py
│   │   ├── reportlocations.py
│   │   ├── reportopendetails.py
│   │   ├── reports.py
│   │   ├── reportsentto.py
│   │   ├── reportsubreports.py
│   │   ├── reportunsubscribes.py
│   │   ├── root.py
│   │   ├── searchcampaigns.py
│   │   ├── searchmembers.py
│   │   ├── segments.py
│   │   ├── storecartlines.py
│   │   ├── storecarts.py
│   │   ├── storecustomers.py
│   │   ├── storeorderlines.py
│   │   ├── storeorders.py
│   │   ├── storeproductimages.py
│   │   ├── storeproducts.py
│   │   ├── storeproductvariants.py
│   │   ├── storepromocodes.py
│   │   ├── storepromorules.py
│   │   ├── stores.py
│   │   ├── templatedefaultcontent.py
│   │   ├── templatefolders.py
│   │   └── templates.py
│   ├── helpers.py
│   └── mailchimpclient.py
├── setup.cfg
├── setup.py
└── test.py
Download .txt
SYMBOL INDEX (414 symbols across 78 files)

FILE: mailchimp3/__init__.py
  class MailChimp (line 107) | class MailChimp(MailChimpClient):
    method __init__ (line 111) | def __init__(self, *args, **kwargs):

FILE: mailchimp3/baseapi.py
  class BaseApi (line 11) | class BaseApi(object):
    method __init__ (line 16) | def __init__(self, mc_client):
    method _build_path (line 27) | def _build_path(self, *args):
    method _iterate (line 36) | def _iterate(self, url, **queryparams):

FILE: mailchimp3/entities/authorizedapps.py
  class AuthorizedApps (line 13) | class AuthorizedApps(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method create (line 27) | def create(self, data):
    method all (line 47) | def all(self, get_all=False, **queryparams):
    method get (line 66) | def get(self, app_id, **queryparams):

FILE: mailchimp3/entities/automationactions.py
  class AutomationActions (line 14) | class AutomationActions(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method pause (line 28) | def pause(self, workflow_id):
    method start (line 40) | def start(self, workflow_id):

FILE: mailchimp3/entities/automationemailactions.py
  class AutomationEmailActions (line 14) | class AutomationEmailActions(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method pause (line 29) | def pause(self, workflow_id, email_id):
    method start (line 44) | def start(self, workflow_id, email_id):
    method delete (line 58) | def delete(self, workflow_id, email_id):

FILE: mailchimp3/entities/automationemailqueues.py
  class AutomationEmailQueues (line 16) | class AutomationEmailQueues(BaseApi):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method create (line 31) | def create(self, workflow_id, email_id, data):
    method all (line 65) | def all(self, workflow_id, email_id):
    method get (line 81) | def get(self, workflow_id, email_id, subscriber_hash):

FILE: mailchimp3/entities/automationemails.py
  class AutomationEmails (line 17) | class AutomationEmails(BaseApi):
    method __init__ (line 21) | def __init__(self, *args, **kwargs):
    method all (line 34) | def all(self, workflow_id, get_all=False, **queryparams):
    method get (line 55) | def get(self, workflow_id, email_id):

FILE: mailchimp3/entities/automationremovedsubscribers.py
  class AutomationRemovedSubscribers (line 15) | class AutomationRemovedSubscribers(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method create (line 29) | def create(self, workflow_id, data):
    method all (line 52) | def all(self, workflow_id):

FILE: mailchimp3/entities/automations.py
  class Automations (line 18) | class Automations(BaseApi):
    method __init__ (line 24) | def __init__(self, *args, **kwargs):
    method all (line 37) | def all(self, get_all=False, **queryparams):
    method get (line 55) | def get(self, workflow_id, **queryparams):

FILE: mailchimp3/entities/batchoperations.py
  class BatchOperations (line 13) | class BatchOperations(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method create (line 27) | def create(self, data):
    method all (line 56) | def all(self, get_all=False, **queryparams):
    method get (line 76) | def get(self, batch_id, **queryparams):
    method delete (line 91) | def delete(self, batch_id):

FILE: mailchimp3/entities/batchwebhooks.py
  class BatchWebhooks (line 12) | class BatchWebhooks(BaseApi):
    method __init__ (line 16) | def __init__(self, *args, **kwargs):
    method create (line 25) | def create(self, data):
    method all (line 46) | def all(self, get_all=False, **queryparams):
    method get (line 65) | def get(self, batch_webhook_id, **queryparams):
    method update (line 79) | def update(self, batch_webhook_id, data):
    method delete (line 98) | def delete(self, batch_webhook_id):

FILE: mailchimp3/entities/campaignactions.py
  class CampaignActions (line 16) | class CampaignActions(BaseApi):
    method __init__ (line 21) | def __init__(self, *args, **kwargs):
    method cancel (line 31) | def cancel(self, campaign_id):
    method pause (line 44) | def pause(self, campaign_id):
    method replicate (line 55) | def replicate(self, campaign_id):
    method resume (line 66) | def resume(self, campaign_id):
    method schedule (line 77) | def schedule(self, campaign_id, data):
    method send (line 106) | def send(self, campaign_id):
    method resend (line 118) | def resend(self, campaign_id):
    method test (line 131) | def test(self, campaign_id, data):
    method unschedule (line 152) | def unschedule(self, campaign_id):

FILE: mailchimp3/entities/campaigncontent.py
  class CampaignContent (line 13) | class CampaignContent(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method get (line 27) | def get(self, campaign_id, **queryparams):
    method update (line 41) | def update(self, campaign_id, data):

FILE: mailchimp3/entities/campaignfeedback.py
  class CampaignFeedback (line 13) | class CampaignFeedback(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method create (line 28) | def create(self, campaign_id, data, **queryparams):
    method all (line 54) | def all(self, campaign_id, get_all=False, **queryparams):
    method get (line 75) | def get(self, campaign_id, feedback_id, **queryparams):
    method update (line 92) | def update(self, campaign_id, feedback_id, data):
    method delete (line 113) | def delete(self, campaign_id, feedback_id):

FILE: mailchimp3/entities/campaignfolders.py
  class CampaignFolders (line 13) | class CampaignFolders(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method create (line 26) | def create(self, data):
    method all (line 46) | def all(self, get_all=False, **queryparams):
    method get (line 65) | def get(self, folder_id, **queryparams):
    method update (line 79) | def update(self, folder_id, data):
    method delete (line 97) | def delete(self, folder_id):

FILE: mailchimp3/entities/campaigns.py
  class Campaigns (line 18) | class Campaigns(BaseApi):
    method __init__ (line 23) | def __init__(self, *args, **kwargs):
    method create (line 36) | def create(self, data):
    method all (line 105) | def all(self, get_all=False, **queryparams):
    method get (line 139) | def get(self, campaign_id, **queryparams):
    method update (line 155) | def update(self, campaign_id, data):
    method delete (line 185) | def delete(self, campaign_id):

FILE: mailchimp3/entities/campaignsendchecklist.py
  class CampaignSendChecklist (line 13) | class CampaignSendChecklist(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method get (line 27) | def get(self, campaign_id, **queryparams):

FILE: mailchimp3/entities/conversationmessages.py
  class ConversationMessages (line 16) | class ConversationMessages(BaseApi):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method create (line 31) | def create(self, conversation_id, data):
    method all (line 61) | def all(self, conversation_id, **queryparams):
    method get (line 83) | def get(self, conversation_id, message_id, **queryparams):

FILE: mailchimp3/entities/conversations.py
  class Conversations (line 16) | class Conversations(BaseApi):
    method __init__ (line 21) | def __init__(self, *args, **kwargs):
    method all (line 32) | def all(self, get_all=False, **queryparams):
    method get (line 55) | def get(self, conversation_id, **queryparams):

FILE: mailchimp3/entities/customerjourney.py
  class CustomerJourney (line 13) | class CustomerJourney(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method trigger (line 26) | def trigger(self, journey_id, step_id, data):

FILE: mailchimp3/entities/filemanagerfiles.py
  class FileManagerFiles (line 13) | class FileManagerFiles(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method create (line 28) | def create(self, data):
    method all (line 51) | def all(self, get_all=False, **queryparams):
    method get (line 76) | def get(self, file_id, **queryparams):
    method update (line 90) | def update(self, file_id, data):
    method delete (line 111) | def delete(self, file_id):

FILE: mailchimp3/entities/filemanagerfolders.py
  class FileManagerFolders (line 13) | class FileManagerFolders(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method create (line 28) | def create(self, data):
    method all (line 48) | def all(self, get_all=False, **queryparams):
    method get (line 70) | def get(self, folder_id, **queryparams):
    method update (line 84) | def update(self, folder_id, data):
    method delete (line 102) | def delete(self, folder_id):

FILE: mailchimp3/entities/landingpageaction.py
  class LandingPageAction (line 12) | class LandingPageAction(BaseApi):
    method __init__ (line 16) | def __init__(self, *args, **kwargs):
    method publish (line 25) | def publish(self, page_id):
    method unpublish (line 37) | def unpublish(self, page_id):

FILE: mailchimp3/entities/landingpagecontent.py
  class LandingPageContent (line 13) | class LandingPageContent(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method get (line 26) | def get(self, page_id, **queryparams):

FILE: mailchimp3/entities/landingpages.py
  class LandingPages (line 15) | class LandingPages(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method create (line 30) | def create(self, data):
    method all (line 50) | def all(self, get_all=False, **queryparams):
    method get (line 70) | def get(self, page_id, **queryparams):
    method update (line 84) | def update(self, page_id, data):
    method delete (line 97) | def delete(self, page_id):

FILE: mailchimp3/entities/listabusereports.py
  class ListAbuseReports (line 13) | class ListAbuseReports(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 28) | def all(self, list_id, get_all=False, **queryparams):
    method get (line 50) | def get(self, list_id, report_id, **queryparams):

FILE: mailchimp3/entities/listactivity.py
  class ListActivity (line 13) | class ListActivity(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method all (line 28) | def all(self, list_id, **queryparams):

FILE: mailchimp3/entities/listclients.py
  class ListClients (line 13) | class ListClients(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 27) | def all(self, list_id, **queryparams):

FILE: mailchimp3/entities/listgrowthhistory.py
  class ListGrowthHistory (line 13) | class ListGrowthHistory(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method all (line 27) | def all(self, list_id, get_all=False, **queryparams):
    method get (line 49) | def get(self, list_id, month, **queryparams):

FILE: mailchimp3/entities/listinterestcategories.py
  class ListInterestCategories (line 14) | class ListInterestCategories(BaseApi):
    method __init__ (line 21) | def __init__(self, *args, **kwargs):
    method create (line 32) | def create(self, list_id, data):
    method all (line 61) | def all(self, list_id, get_all=False, **queryparams):
    method get (line 84) | def get(self, list_id, category_id, **queryparams):
    method update (line 101) | def update(self, list_id, category_id, data):
    method delete (line 128) | def delete(self, list_id, category_id):

FILE: mailchimp3/entities/listinterestcategoryinterest.py
  class ListInterestCategoryInterest (line 13) | class ListInterestCategoryInterest(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method create (line 30) | def create(self, list_id, category_id, data):
    method all (line 63) | def all(self, list_id, category_id, get_all=False, **queryparams):
    method get (line 91) | def get(self, list_id, category_id, interest_id, **queryparams):
    method update (line 114) | def update(self, list_id, category_id, interest_id, data):
    method delete (line 141) | def delete(self, list_id, category_id, interest_id):

FILE: mailchimp3/entities/listmemberactivity.py
  class ListMemberActivity (line 14) | class ListMemberActivity(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 28) | def all(self, list_id, subscriber_hash, **queryparams):
    method feed (line 47) | def feed(self, list_id, subscriber_hash, **queryparams):

FILE: mailchimp3/entities/listmemberevents.py
  class ListMemberEvents (line 13) | class ListMemberEvents(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method create (line 26) | def create(self, list_id, subscriber_hash, data):
    method all (line 50) | def all(self, list_id, subscriber_hash, get_all=False, **queryparams):

FILE: mailchimp3/entities/listmembergoals.py
  class ListMemberGoals (line 14) | class ListMemberGoals(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 28) | def all(self, list_id, subscriber_hash, **queryparams):

FILE: mailchimp3/entities/listmembernotes.py
  class ListMemberNotes (line 14) | class ListMemberNotes(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method create (line 29) | def create(self, list_id, subscriber_hash, data):
    method all (line 61) | def all(self, list_id, subscriber_hash, get_all=False, **queryparams):
    method get (line 88) | def get(self, list_id, subscriber_hash, note_id, **queryparams):
    method update (line 113) | def update(self, list_id, subscriber_hash, note_id, data):
    method delete (line 146) | def delete(self, list_id, subscriber_hash, note_id):

FILE: mailchimp3/entities/listmembers.py
  class ListMembers (line 18) | class ListMembers(BaseApi):
    method __init__ (line 23) | def __init__(self, *args, **kwargs):
    method create (line 37) | def create(self, list_id, data):
    method all (line 68) | def all(self, list_id, get_all=False, **queryparams):
    method get (line 101) | def get(self, list_id, subscriber_hash, **queryparams):
    method update (line 121) | def update(self, list_id, subscriber_hash, data):
    method create_or_update (line 139) | def create_or_update(self, list_id, subscriber_hash, data):
    method delete (line 170) | def delete(self, list_id, subscriber_hash):
    method delete_permanent (line 185) | def delete_permanent(self, list_id, subscriber_hash):

FILE: mailchimp3/entities/listmembertags.py
  class ListMemberTags (line 14) | class ListMemberTags(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method update (line 28) | def update(self, list_id, subscriber_hash, data):
    method all (line 66) | def all(self, list_id, subscriber_hash, **queryparams):

FILE: mailchimp3/entities/listmergefields.py
  class ListMergeFields (line 13) | class ListMergeFields(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method create (line 27) | def create(self, list_id, data):
    method all (line 53) | def all(self, list_id, get_all=False, **queryparams):
    method get (line 77) | def get(self, list_id, merge_id):
    method update (line 91) | def update(self, list_id, merge_id, data):
    method delete (line 112) | def delete(self, list_id, merge_id):

FILE: mailchimp3/entities/lists.py
  class Lists (line 24) | class Lists(BaseApi):
    method __init__ (line 28) | def __init__(self, *args, **kwargs):
    method create (line 47) | def create(self, data):
    method update_members (line 116) | def update_members(self, list_id, data):
    method all (line 166) | def all(self, get_all=False, **queryparams):
    method get (line 192) | def get(self, list_id, **queryparams):
    method update (line 208) | def update(self, list_id, data):
    method delete (line 275) | def delete(self, list_id):

FILE: mailchimp3/entities/listsegmentmembers.py
  class ListSegmentMembers (line 14) | class ListSegmentMembers(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method create (line 29) | def create(self, list_id, segment_id, data):
    method all (line 67) | def all(self, list_id, segment_id, get_all=False, **queryparams):
    method delete (line 92) | def delete(self, list_id, segment_id, subscriber_hash):

FILE: mailchimp3/entities/listsegments.py
  class ListSegments (line 14) | class ListSegments(BaseApi):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method create (line 31) | def create(self, list_id, data):
    method all (line 54) | def all(self, list_id, get_all=False, **queryparams):
    method get (line 81) | def get(self, list_id, segment_id, **queryparams):
    method update (line 98) | def update(self, list_id, segment_id, data):
    method update_members (line 119) | def update_members(self, list_id, segment_id, data):
    method delete (line 139) | def delete(self, list_id, segment_id):

FILE: mailchimp3/entities/listsignupforms.py
  class ListSignupForms (line 13) | class ListSignupForms(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method create (line 26) | def create(self, list_id, data):
    method all (line 44) | def all(self, list_id):

FILE: mailchimp3/entities/listwebhooks.py
  class ListWebhooks (line 14) | class ListWebhooks(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method create (line 28) | def create(self, list_id, data):
    method all (line 57) | def all(self, list_id):
    method get (line 69) | def get(self, list_id, webhook_id):
    method update (line 83) | def update(self, list_id, webhook_id, data):
    method delete (line 97) | def delete(self, list_id, webhook_id):

FILE: mailchimp3/entities/ping.py
  class Ping (line 11) | class Ping(BaseApi):
    method __init__ (line 15) | def __init__(self, *args, **kwargs):
    method get (line 22) | def get(self):

FILE: mailchimp3/entities/reportcampaignabusereports.py
  class ReportCampaignAbuseReports (line 12) | class ReportCampaignAbuseReports(BaseApi):
    method __init__ (line 16) | def __init__(self, *args, **kwargs):
    method all (line 26) | def all(self, campaign_id, **queryparams):
    method get (line 41) | def get(self, campaign_id, report_id, **queryparams):

FILE: mailchimp3/entities/reportcampaignadvice.py
  class ReportCampaignAdvice (line 13) | class ReportCampaignAdvice(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method all (line 26) | def all(self, campaign_id, **queryparams):

FILE: mailchimp3/entities/reportclickdetailmembers.py
  class ReportClickDetailMembers (line 14) | class ReportClickDetailMembers(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method all (line 30) | def all(self, campaign_id, link_id, get_all=False, **queryparams):
    method get (line 59) | def get(self, campaign_id, link_id, subscriber_hash, **queryparams):

FILE: mailchimp3/entities/reportclickdetailreports.py
  class ReportClickDetailReports (line 14) | class ReportClickDetailReports(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 29) | def all(self, campaign_id, get_all=False, **queryparams):
    method get (line 52) | def get(self, campaign_id, link_id, **queryparams):

FILE: mailchimp3/entities/reportdomainperformance.py
  class ReportDomainPerformance (line 13) | class ReportDomainPerformance(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method all (line 26) | def all(self, campaign_id, **queryparams):

FILE: mailchimp3/entities/reporteepurl.py
  class ReportEepURL (line 13) | class ReportEepURL(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method all (line 26) | def all(self, campaign_id, **queryparams):

FILE: mailchimp3/entities/reportemailactivity.py
  class ReportEmailActivity (line 14) | class ReportEmailActivity(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 28) | def all(self, campaign_id, get_all=False, **queryparams):
    method get (line 50) | def get(self, campaign_id, subscriber_hash, **queryparams):

FILE: mailchimp3/entities/reportgoogleanalytics.py
  class ReportGoogleAnalytics (line 12) | class ReportGoogleAnalytics(BaseApi):
    method __init__ (line 16) | def __init__(self, *args, **kwargs):
    method all (line 25) | def all(self, campaign_id, get_all=False, **queryparams):
    method get (line 43) | def get(self, campaign_id, profile_id, **queryparams):

FILE: mailchimp3/entities/reportlocations.py
  class ReportLocations (line 13) | class ReportLocations(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method all (line 26) | def all(self, campaign_id, get_all=False, **queryparams):

FILE: mailchimp3/entities/reportopendetails.py
  class OpenDetails (line 12) | class OpenDetails(BaseApi):
    method __init__ (line 16) | def __init__(self, *args, **kwargs):
    method all (line 25) | def all(self, campaign_id, get_all=False,  **queryparams):
  class ReportOpenDetails (line 47) | class ReportOpenDetails(OpenDetails):

FILE: mailchimp3/entities/reports.py
  class Reports (line 23) | class Reports(BaseApi):
    method __init__ (line 29) | def __init__(self, *args, **kwargs):
    method all (line 48) | def all(self, get_all=False, **queryparams):
    method get (line 75) | def get(self, campaign_id, **queryparams):

FILE: mailchimp3/entities/reportsentto.py
  class ReportSentTo (line 14) | class ReportSentTo(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 28) | def all(self, campaign_id, get_all=False, **queryparams):
    method get (line 50) | def get(self, campaign_id, subscriber_hash, **queryparams):

FILE: mailchimp3/entities/reportsubreports.py
  class ReportSubReports (line 13) | class ReportSubReports(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method all (line 28) | def all(self, campaign_id, **queryparams):

FILE: mailchimp3/entities/reportunsubscribes.py
  class ReportUnsubscribes (line 14) | class ReportUnsubscribes(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method all (line 25) | def all(self, campaign_id, get_all=False, **queryparams):
    method get (line 48) | def get(self, campaign_id, subscriber_hash, **queryparams):

FILE: mailchimp3/entities/root.py
  class Root (line 13) | class Root(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method get (line 27) | def get(self, **queryparams):

FILE: mailchimp3/entities/searchcampaigns.py
  class SearchCampaigns (line 14) | class SearchCampaigns(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method get (line 26) | def get(self, **queryparams):

FILE: mailchimp3/entities/searchmembers.py
  class SearchMembers (line 14) | class SearchMembers(BaseApi):
    method __init__ (line 20) | def __init__(self, *args, **kwargs):
    method get (line 29) | def get(self, **queryparams):

FILE: mailchimp3/entities/segments.py
  class Segments (line 5) | class Segments(BaseApi):
    method __init__ (line 7) | def __init__(self, *args, **kwargs):
    method all (line 11) | def all(self, list_id, **queryparams):
    method get (line 17) | def get(self, list_id, segment_id):
    method update (line 23) | def update(self, list_id, segment_id, data):
    method delete (line 29) | def delete(self, list_id, segment_id):
    method create (line 35) | def create(self, list_id, data):

FILE: mailchimp3/entities/storecartlines.py
  class StoreCartLines (line 13) | class StoreCartLines(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method create (line 29) | def create(self, store_id, cart_id, data):
    method all (line 67) | def all(self, store_id, cart_id, get_all=False, **queryparams):
    method get (line 92) | def get(self, store_id, cart_id, line_id, **queryparams):
    method update (line 112) | def update(self, store_id, cart_id, line_id, data):
    method delete (line 131) | def delete(self, store_id, cart_id, line_id):

FILE: mailchimp3/entities/storecarts.py
  class StoreCarts (line 16) | class StoreCarts(BaseApi):
    method __init__ (line 22) | def __init__(self, *args, **kwargs):
    method create (line 33) | def create(self, store_id, data):
    method all (line 95) | def all(self, store_id, get_all=False, **queryparams):
    method get (line 117) | def get(self, store_id, cart_id, **queryparams):
    method update (line 134) | def update(self, store_id, cart_id, data):
    method delete (line 150) | def delete(self, store_id, cart_id):

FILE: mailchimp3/entities/storecustomers.py
  class StoreCustomers (line 14) | class StoreCustomers(BaseApi):
    method __init__ (line 21) | def __init__(self, *args, **kwargs):
    method create (line 31) | def create(self, store_id, data):
    method all (line 63) | def all(self, store_id, get_all=False, **queryparams):
    method get (line 86) | def get(self, store_id, customer_id, **queryparams):
    method update (line 103) | def update(self, store_id, customer_id, data):
    method create_or_update (line 119) | def create_or_update(self, store_id, customer_id, data):
    method delete (line 149) | def delete(self, store_id, customer_id):

FILE: mailchimp3/entities/storeorderlines.py
  class StoreOrderLines (line 13) | class StoreOrderLines(BaseApi):
    method __init__ (line 18) | def __init__(self, *args, **kwargs):
    method create (line 29) | def create(self, store_id, order_id, data):
    method all (line 67) | def all(self, store_id, order_id, get_all=False, **queryparams):
    method get (line 92) | def get(self, store_id, order_id, line_id, **queryparams):
    method update (line 112) | def update(self, store_id, order_id, line_id, data):
    method delete (line 131) | def delete(self, store_id, order_id, line_id):

FILE: mailchimp3/entities/storeorders.py
  class StoreOrders (line 16) | class StoreOrders(BaseApi):
    method __init__ (line 39) | def __init__(self, *args, **kwargs):
    method create (line 50) | def create(self, store_id, data):
    method all (line 112) | def all(self, store_id, get_all=False, **queryparams):
    method get (line 135) | def get(self, store_id, order_id, **queryparams):
    method update (line 152) | def update(self, store_id, order_id, data):
    method delete (line 168) | def delete(self, store_id, order_id):

FILE: mailchimp3/entities/storeproductimages.py
  class StoreProductImages (line 13) | class StoreProductImages(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method create (line 28) | def create(self, store_id, product_id, data):
    method all (line 57) | def all(self, store_id, product_id, get_all=False, **queryparams):
    method get (line 82) | def get(self, store_id, product_id, image_id, **queryparams):
    method update (line 105) | def update(self, store_id, product_id, image_id, data):
    method delete (line 127) | def delete(self, store_id, product_id, image_id):

FILE: mailchimp3/entities/storeproducts.py
  class StoreProducts (line 15) | class StoreProducts(BaseApi):
    method __init__ (line 21) | def __init__(self, *args, **kwargs):
    method create (line 33) | def create(self, store_id, data):
    method all (line 73) | def all(self, store_id, get_all=False, **queryparams):
    method get (line 95) | def get(self, store_id, product_id, **queryparams):
    method update (line 112) | def update(self, store_id, product_id, data):
    method delete (line 131) | def delete(self, store_id, product_id):

FILE: mailchimp3/entities/storeproductvariants.py
  class StoreProductVariants (line 13) | class StoreProductVariants(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method create (line 30) | def create(self, store_id, product_id, data):
    method all (line 59) | def all(self, store_id, product_id, get_all=False, **queryparams):
    method get (line 87) | def get(self, store_id, product_id, variant_id, **queryparams):
    method update (line 110) | def update(self, store_id, product_id, variant_id, data):
    method create_or_update (line 132) | def create_or_update(self, store_id, product_id, variant_id, data):
    method delete (line 162) | def delete(self, store_id, product_id, variant_id):

FILE: mailchimp3/entities/storepromocodes.py
  class StorePromoCodes (line 10) | class StorePromoCodes(BaseApi):
    method __init__ (line 15) | def __init__(self, *args, **kwargs):
    method create (line 25) | def create(self, store_id, promo_rule_id, data):
    method all (line 55) | def all(self, store_id, promo_rule_id, get_all=False, **queryparams):
    method get (line 78) | def get(self, store_id, promo_rule_id, promo_code_id, **queryparams):
    method update (line 96) | def update(self, store_id, promo_rule_id, promo_code_id, data):
    method delete (line 128) | def delete(self, store_id, promo_rule_id, promo_code_id):

FILE: mailchimp3/entities/storepromorules.py
  class StorePromoRules (line 10) | class StorePromoRules(BaseApi):
    method __init__ (line 15) | def __init__(self, *args, **kwargs):
    method create (line 25) | def create(self, store_id, data):
    method all (line 61) | def all(self, store_id, get_all=False, **queryparams):
    method get (line 81) | def get(self, store_id, promo_rule_id, **queryparams):
    method update (line 98) | def update(self, store_id, promo_rule_id, data):
    method delete (line 127) | def delete(self, store_id, promo_rule_id):

FILE: mailchimp3/entities/stores.py
  class Stores (line 19) | class Stores(BaseApi):
    method __init__ (line 25) | def __init__(self, *args, **kwargs):
    method create (line 37) | def create(self, data):
    method all (line 73) | def all(self, get_all=False, **queryparams):
    method get (line 92) | def get(self, store_id, **queryparams):
    method update (line 106) | def update(self, store_id, data):
    method delete (line 119) | def delete(self, store_id):

FILE: mailchimp3/entities/templatedefaultcontent.py
  class TemplateDefaultContent (line 13) | class TemplateDefaultContent(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method all (line 26) | def all(self, template_id, **queryparams):

FILE: mailchimp3/entities/templatefolders.py
  class TemplateFolders (line 13) | class TemplateFolders(BaseApi):
    method __init__ (line 17) | def __init__(self, *args, **kwargs):
    method create (line 26) | def create(self, data):
    method all (line 46) | def all(self, get_all=False, **queryparams):
    method get (line 65) | def get(self, folder_id, **queryparams):
    method update (line 79) | def update(self, folder_id, data):
    method delete (line 97) | def delete(self, folder_id):

FILE: mailchimp3/entities/templates.py
  class Templates (line 14) | class Templates(BaseApi):
    method __init__ (line 19) | def __init__(self, *args, **kwargs):
    method create (line 29) | def create(self, data):
    method all (line 53) | def all(self, get_all=False, **queryparams):
    method get (line 77) | def get(self, template_id, **queryparams):
    method update (line 91) | def update(self, template_id, data):
    method delete (line 112) | def delete(self, template_id):

FILE: mailchimp3/helpers.py
  function get_subscriber_hash (line 17) | def get_subscriber_hash(member_email):
  function check_subscriber_hash (line 33) | def check_subscriber_hash(potential_hash):
  function check_email (line 51) | def check_email(email):
  function check_url (line 67) | def check_url(url):
  function merge_results (line 103) | def merge_results(x, y):

FILE: mailchimp3/mailchimpclient.py
  function _enabled_or_noop (line 27) | def _enabled_or_noop(fn):
  class MailChimpError (line 35) | class MailChimpError(Exception):
  function _raise_response_error (line 39) | def _raise_response_error(r):
  class MailChimpClient (line 56) | class MailChimpClient(object):
    method __init__ (line 60) | def __init__(self, mc_api=None, mc_user='python-mailchimp', access_tok...
    method _make_request (line 105) | def _make_request(self, **kwargs):
    method _post (line 119) | def _post(self, url, data=None):
    method _get (line 152) | def _get(self, url, **queryparams):
    method _delete (line 182) | def _delete(self, url):
    method _patch (line 211) | def _patch(self, url, data=None):
    method _put (line 241) | def _put(self, url, data=None):
  class MailChimpOAuth (line 270) | class MailChimpOAuth(requests.auth.AuthBase):
    method __init__ (line 277) | def __init__(self, access_token):
    method __call__ (line 287) | def __call__(self, r):
    method get_metadata (line 295) | def get_metadata(self):
    method get_base_url (line 311) | def get_base_url(self):
Condensed preview — 86 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (344K chars).
[
  {
    "path": ".gitignore",
    "chars": 781,
    "preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\n"
  },
  {
    "path": "LICENSE",
    "chars": 1083,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Charles TISSIER\n\nPermission is hereby granted, free of charge, to any person o"
  },
  {
    "path": "README.md",
    "chars": 23807,
    "preview": "[![mailchimp3 v3.0.21 on PyPi](https://img.shields.io/pypi/v/mailchimp3.svg)](https://pypi.python.org/pypi/mailchimp3)\n!"
  },
  {
    "path": "README.rst",
    "chars": 25272,
    "preview": "|mailchimp3 v3.0.21 on PyPi| |MIT license| |Stable|\n\npython-mailchimp-api\n====================\n\nA straightforward python"
  },
  {
    "path": "mailchimp3/__init__.py",
    "chars": 10252,
    "preview": "# coding=utf-8\n\"\"\"\nMailchimp v3 Api SDK\n\nDocumentation at http://developer.mailchimp.com/documentation/mailchimp/referen"
  },
  {
    "path": "mailchimp3/baseapi.py",
    "chars": 2940,
    "preview": "# coding=utf-8\n\"\"\"\nThe base API object that allows constructions of various endpoint paths\n\"\"\"\nfrom __future__ import un"
  },
  {
    "path": "mailchimp3/entities/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "mailchimp3/entities/authorizedapps.py",
    "chars": 2503,
    "preview": "# coding=utf-8\n\"\"\"\nThe Authorized Apps endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/r"
  },
  {
    "path": "mailchimp3/entities/automationactions.py",
    "chars": 1368,
    "preview": "# coding=utf-8\n\"\"\"\nThe Automations API endpoint actions\n\nNote: This is a paid feature\n\nDocumentation: http://developer.m"
  },
  {
    "path": "mailchimp3/entities/automationemailactions.py",
    "chars": 2253,
    "preview": "# coding=utf-8\n\"\"\"\nThe Automation Emails endpoint\n\nNote: This is a paid feature\n\nDocumentation: http://developer.mailchi"
  },
  {
    "path": "mailchimp3/entities/automationemailqueues.py",
    "chars": 3626,
    "preview": "# coding=utf-8\n\"\"\"\nThe Automation Email Queue endpoint\n\nNote: This is a paid feature\n\nDocumentation: http://developer.ma"
  },
  {
    "path": "mailchimp3/entities/automationemails.py",
    "chars": 2327,
    "preview": "# coding=utf-8\n\"\"\"\nThe Automation Emails endpoint\n\nNote: This is a paid feature\n\nDocumentation: http://developer.mailchi"
  },
  {
    "path": "mailchimp3/entities/automationremovedsubscribers.py",
    "chars": 2171,
    "preview": "# coding=utf-8\n\"\"\"\nThe Automation Removed Subscribers endpoint\n\nNote: This is a paid feature\n\nDocumentation: http://deve"
  },
  {
    "path": "mailchimp3/entities/automations.py",
    "chars": 2455,
    "preview": "# coding=utf-8\n\"\"\"\nThe Automations API endpoint\n\nNote: This is a paid feature\n\nDocumentation: http://developer.mailchimp"
  },
  {
    "path": "mailchimp3/entities/batchoperations.py",
    "chars": 3571,
    "preview": "# coding=utf-8\n\"\"\"\nThe Batch Operations API Endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailch"
  },
  {
    "path": "mailchimp3/entities/batchwebhooks.py",
    "chars": 3461,
    "preview": "# coding=utf-8\n\"\"\"\nThe Batch Webhooks API Endpoint\n\nDocumentation: https://developer.mailchimp.com/documentation/mailchi"
  },
  {
    "path": "mailchimp3/entities/campaignactions.py",
    "chars": 5738,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaigns API actions endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/campaigncontent.py",
    "chars": 1622,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaign Content API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailch"
  },
  {
    "path": "mailchimp3/entities/campaignfeedback.py",
    "chars": 4493,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaign Feedback API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/campaignfolders.py",
    "chars": 3323,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaign Folders API endpoints\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/campaigns.py",
    "chars": 8394,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaigns API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/ref"
  },
  {
    "path": "mailchimp3/entities/campaignsendchecklist.py",
    "chars": 1266,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaign Send Checklist API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation"
  },
  {
    "path": "mailchimp3/entities/conversationmessages.py",
    "chars": 3493,
    "preview": "# coding=utf-8\n\"\"\"\nThe Conversation Messages API endpoint\n\nNote: This is a paid feature\n\nDocumentation: http://developer"
  },
  {
    "path": "mailchimp3/entities/conversations.py",
    "chars": 2225,
    "preview": "# coding=utf-8\n\"\"\"\nThe Conversations API endpoint\n\nNote: This is a paid feature\n\nDocumentation: http://developer.mailchi"
  },
  {
    "path": "mailchimp3/entities/customerjourney.py",
    "chars": 1605,
    "preview": "# coding=utf-8\n\"\"\"\nThe Customer Journey API endpoint\n\nDocumentation: https://mailchimp.com/developer/marketing/api/custo"
  },
  {
    "path": "mailchimp3/entities/filemanagerfiles.py",
    "chars": 3954,
    "preview": "# coding=utf-8\n\"\"\"\nThe File Manager Files API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mail"
  },
  {
    "path": "mailchimp3/entities/filemanagerfolders.py",
    "chars": 3604,
    "preview": "# coding=utf-8\n\"\"\"\nThe File Manager Folders API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/ma"
  },
  {
    "path": "mailchimp3/entities/landingpageaction.py",
    "chars": 1295,
    "preview": "# coding=utf-8\n\"\"\"\nThe Landinge Page actions API endpoint\n\nDocumentation: https://mailchimp.com/developer/reference/land"
  },
  {
    "path": "mailchimp3/entities/landingpagecontent.py",
    "chars": 1134,
    "preview": "# coding=utf-8\n\"\"\"\nThe Landing Page Content API endpoint\n\nDocumentation: https://mailchimp.com/developer/reference/landi"
  },
  {
    "path": "mailchimp3/entities/landingpages.py",
    "chars": 3249,
    "preview": "# coding=utf-8\n\"\"\"\nThe Landing Pages API endpoint\n\nDocumentation: https://mailchimp.com/developer/reference/landing-page"
  },
  {
    "path": "mailchimp3/entities/listabusereports.py",
    "chars": 2300,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Abuse Reports API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mail"
  },
  {
    "path": "mailchimp3/entities/listactivity.py",
    "chars": 1306,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Activity API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp"
  },
  {
    "path": "mailchimp3/entities/listclients.py",
    "chars": 1165,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Clients API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/"
  },
  {
    "path": "mailchimp3/entities/listgrowthhistory.py",
    "chars": 2203,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Growth History API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mai"
  },
  {
    "path": "mailchimp3/entities/listinterestcategories.py",
    "chars": 5452,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Interest Categories API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentatio"
  },
  {
    "path": "mailchimp3/entities/listinterestcategoryinterest.py",
    "chars": 5817,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Interest Category Interests API endpoint\n\nDocumentation: http://developer.mailchimp.com/docu"
  },
  {
    "path": "mailchimp3/entities/listmemberactivity.py",
    "chars": 2626,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Member Activity API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/ma"
  },
  {
    "path": "mailchimp3/entities/listmemberevents.py",
    "chars": 2868,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Member Events API endpoint\n\nDocumentation: https://mailchimp.com/developer/reference/lists/l"
  },
  {
    "path": "mailchimp3/entities/listmembergoals.py",
    "chars": 1559,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Member Goals API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/listmembernotes.py",
    "chars": 6134,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Member Notes API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/listmembers.py",
    "chars": 8228,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Members API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/"
  },
  {
    "path": "mailchimp3/entities/listmembertags.py",
    "chars": 2772,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Member Tags API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailch"
  },
  {
    "path": "mailchimp3/entities/listmergefields.py",
    "chars": 4116,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Merge Fields API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/lists.py",
    "chars": 12414,
    "preview": "# coding=utf-8\n\"\"\"\nThe Lists API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/referen"
  },
  {
    "path": "mailchimp3/entities/listsegmentmembers.py",
    "chars": 4342,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Segment Members API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/ma"
  },
  {
    "path": "mailchimp3/entities/listsegments.py",
    "chars": 5203,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Segments API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp"
  },
  {
    "path": "mailchimp3/entities/listsignupforms.py",
    "chars": 1522,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Signup Forms API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/listwebhooks.py",
    "chars": 3461,
    "preview": "# coding=utf-8\n\"\"\"\nThe List Webhooks API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp"
  },
  {
    "path": "mailchimp3/entities/ping.py",
    "chars": 683,
    "preview": "# coding=utf-8\n\"\"\"\nThe Google Analytics API Endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailch"
  },
  {
    "path": "mailchimp3/entities/reportcampaignabusereports.py",
    "chars": 1850,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaign Abuse Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/m"
  },
  {
    "path": "mailchimp3/entities/reportcampaignadvice.py",
    "chars": 1273,
    "preview": "# coding=utf-8\n\"\"\"\nThe Campaign Advice Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/"
  },
  {
    "path": "mailchimp3/entities/reportclickdetailmembers.py",
    "chars": 3014,
    "preview": "# coding=utf-8\n\"\"\"\nThe Click Detail Report Members API endpoint\n\nDocumentation: http://developer.mailchimp.com/documenta"
  },
  {
    "path": "mailchimp3/entities/reportclickdetailreports.py",
    "chars": 2395,
    "preview": "# coding=utf-8\n\"\"\"\nThe Click Details Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/ma"
  },
  {
    "path": "mailchimp3/entities/reportdomainperformance.py",
    "chars": 1234,
    "preview": "# coding=utf-8\n\"\"\"\nThe Domain Performance Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentati"
  },
  {
    "path": "mailchimp3/entities/reporteepurl.py",
    "chars": 1175,
    "preview": "# coding=utf-8\n\"\"\"\nThe EepURL Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp"
  },
  {
    "path": "mailchimp3/entities/reportemailactivity.py",
    "chars": 2553,
    "preview": "# coding=utf-8\n\"\"\"\nThe Email Activity Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/m"
  },
  {
    "path": "mailchimp3/entities/reportgoogleanalytics.py",
    "chars": 2211,
    "preview": "# coding=utf-8\n\"\"\"\nThe Google Analytics API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailch"
  },
  {
    "path": "mailchimp3/entities/reportlocations.py",
    "chars": 1473,
    "preview": "# coding=utf-8\n\"\"\"\nThe Location Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchi"
  },
  {
    "path": "mailchimp3/entities/reportopendetails.py",
    "chars": 1734,
    "preview": "# coding=utf-8\n\"\"\"\nThe Location Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchi"
  },
  {
    "path": "mailchimp3/entities/reports.py",
    "chars": 3456,
    "preview": "# coding=utf-8\n\"\"\"\nThe Reports API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/refer"
  },
  {
    "path": "mailchimp3/entities/reportsentto.py",
    "chars": 2383,
    "preview": "# coding=utf-8\n\"\"\"\nThe Sent To Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchim"
  },
  {
    "path": "mailchimp3/entities/reportsubreports.py",
    "chars": 1307,
    "preview": "# coding=utf-8\n\"\"\"\nThe Sub-Reports Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mail"
  },
  {
    "path": "mailchimp3/entities/reportunsubscribes.py",
    "chars": 2480,
    "preview": "# coding=utf-8\n\"\"\"\nThe Unsubscribes Report API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mai"
  },
  {
    "path": "mailchimp3/entities/root.py",
    "chars": 982,
    "preview": "# coding=utf-8\n\"\"\"\nThe API Root endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/referenc"
  },
  {
    "path": "mailchimp3/entities/searchcampaigns.py",
    "chars": 1246,
    "preview": "# coding=utf-8\n\"\"\"\nThe Search Members API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchim"
  },
  {
    "path": "mailchimp3/entities/searchmembers.py",
    "chars": 1596,
    "preview": "# coding=utf-8\n\"\"\"\nThe Search Members API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchim"
  },
  {
    "path": "mailchimp3/entities/segments.py",
    "chars": 1302,
    "preview": "from __future__ import unicode_literals\nfrom ..baseapi import BaseApi\n\n\nclass Segments(BaseApi):\n\n    def __init__(self,"
  },
  {
    "path": "mailchimp3/entities/storecartlines.py",
    "chars": 5201,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Cart Lines endpoint API endpoint\n\nDocumentation: http://developer.mailchimp.com/"
  },
  {
    "path": "mailchimp3/entities/storecarts.py",
    "chars": 5660,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Carts endpoint API endpoint\n\nDocumentation: http://developer.mailchimp.com/docum"
  },
  {
    "path": "mailchimp3/entities/storecustomers.py",
    "chars": 5841,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Customers API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentat"
  },
  {
    "path": "mailchimp3/entities/storeorderlines.py",
    "chars": 5288,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Orders endpoint API endpoint\n\nDocumentation: http://developer.mailchimp.com/docu"
  },
  {
    "path": "mailchimp3/entities/storeorders.py",
    "chars": 6739,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Orders endpoint API endpoint\n\nDocumentation: http://developer.mailchimp.com/docu"
  },
  {
    "path": "mailchimp3/entities/storeproductimages.py",
    "chars": 4945,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Product Images API endpoint\n\nDocumentation: http://developer.mailchimp.com/docum"
  },
  {
    "path": "mailchimp3/entities/storeproducts.py",
    "chars": 4886,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Products API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentati"
  },
  {
    "path": "mailchimp3/entities/storeproductvariants.py",
    "chars": 6251,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Store Product Variants API endpoint\n\nDocumentation: http://developer.mailchimp.com/doc"
  },
  {
    "path": "mailchimp3/entities/storepromocodes.py",
    "chars": 5298,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Stores Promo CodesAPI endpoint\n\nDocumentation: http://developer.mailchimp.com/document"
  },
  {
    "path": "mailchimp3/entities/storepromorules.py",
    "chars": 4892,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Stores Promo Rules API endpoint\n\nDocumentation: http://developer.mailchimp.com/documen"
  },
  {
    "path": "mailchimp3/entities/stores.py",
    "chars": 4360,
    "preview": "# coding=utf-8\n\"\"\"\nThe E-commerce Stores API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailc"
  },
  {
    "path": "mailchimp3/entities/templatedefaultcontent.py",
    "chars": 1251,
    "preview": "# coding=utf-8\n\"\"\"\nThe Template Default Content API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentatio"
  },
  {
    "path": "mailchimp3/entities/templatefolders.py",
    "chars": 3336,
    "preview": "# coding=utf-8\n\"\"\"\nThe Template Folders API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailch"
  },
  {
    "path": "mailchimp3/entities/templates.py",
    "chars": 3943,
    "preview": "# coding=utf-8\n\"\"\"\nThe Templates API endpoint\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/ref"
  },
  {
    "path": "mailchimp3/helpers.py",
    "chars": 3650,
    "preview": "# coding=utf-8\n\"\"\"\nHelper functions to perform simple tasks for multiple areas of the API\n\"\"\"\nimport hashlib\nimport re\n\n"
  },
  {
    "path": "mailchimp3/mailchimpclient.py",
    "chars": 10235,
    "preview": "# coding=utf-8\n\"\"\"\nMailchimp v3 Api SDK\n\nDocumentation: http://developer.mailchimp.com/documentation/mailchimp/\n\"\"\"\nfrom"
  },
  {
    "path": "setup.cfg",
    "chars": 28,
    "preview": "[bdist_wheel]\nuniversal = 1\n"
  },
  {
    "path": "setup.py",
    "chars": 1742,
    "preview": "#!/usr/bin/env python\nimport os\nfrom setuptools import setup, find_packages\n\n\nREADME = os.path.join(os.path.dirname(__fi"
  },
  {
    "path": "test.py",
    "chars": 317,
    "preview": "# coding=utf-8\n\"\"\"\nSome basic tests to verify that the wrapper is working\n\"\"\"\nfrom mailchimp3 import MailChimp\n\n\nclient "
  }
]

About this extraction

This page contains the full source code of the VingtCinq/python-mailchimp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 86 files (317.3 KB), approximately 76.3k tokens, and a symbol index with 414 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!