self.store_id = store_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>'])<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT>'] not in [True, False]:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.customer_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.customer_id = None<EOL><DEDENT>return response<EOL>

Add a new customer to a store.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string*,
    "email_address": string*,
    "opt_in_status": boolean*
}


def all(self, store_id, get_all=False, **queryparams):

self.store_id = store_id<EOL>self.customer_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(store_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about a store’s customers.

:param store_id: The store id.
:type store_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_address'] = string


def get(self, store_id, customer_id, **queryparams):

self.store_id = store_id<EOL>self.customer_id = customer_id<EOL>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>', customer_id), **queryparams)<EOL>

Get information about a specific customer.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param customer_id: The id for the customer of a store.
:type customer_id: :py:class:`str`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


def update(self, store_id, customer_id, data):

self.store_id = store_id<EOL>self.customer_id = customer_id<EOL>return self._mc_client._patch(url=self._build_path(store_id, '<STR_LIT>', customer_id), data=data)<EOL>

Update a customer.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param customer_id: The id for the customer of a store.
:type customer_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`


def create_or_update(self, store_id, customer_id, data):

self.store_id = store_id<EOL>self.customer_id = customer_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>'])<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT>'] not in [True, False]:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._put(url=self._build_path(store_id, '<STR_LIT>', customer_id), data=data)<EOL>

Add or update a customer.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param customer_id: The id for the customer of a store.
:type customer_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string*,
    "email_address": string*,
    "opt_in_status": boolean
}


def delete(self, store_id, customer_id):

self.store_id = store_id<EOL>self.customer_id = customer_id<EOL>return self._mc_client._delete(url=self._build_path(store_id, '<STR_LIT>', customer_id))<EOL>

Delete a customer from a store.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param customer_id: The id for the customer of a store.
:type customer_id: :py:class:`str`


super(ListInterestCategoryInterest, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.category_id = None<EOL>self.interest_id = None<EOL>


def create(self, list_id, category_id, data):

self.list_id = list_id<EOL>self.category_id = category_id<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response =  self._mc_client._post(<EOL>url=self._build_path(list_id, '<STR_LIT>', category_id, '<STR_LIT>'),<EOL>data=data<EOL>)<EOL>if response is not None:<EOL><INDENT>self.interest_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.interest_id = None<EOL><DEDENT>return response<EOL>

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*
}


def all(self, list_id, category_id, get_all=False, **queryparams):

self.list_id = list_id<EOL>self.category_id = category_id<EOL>self.interest_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(list_id, '<STR_LIT>', category_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(<EOL>url=self._build_path(list_id, '<STR_LIT>', category_id, '<STR_LIT>'),<EOL>**queryparams<EOL>)<EOL><DEDENT>

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


def get(self, list_id, category_id, interest_id, **queryparams):

self.list_id = list_id<EOL>self.category_id = category_id<EOL>self.interest_id = interest_id<EOL>return self._mc_client._get(<EOL>url=self._build_path(list_id, '<STR_LIT>', category_id, '<STR_LIT>', interest_id),<EOL>**queryparams<EOL>)<EOL>

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'] = []


def update(self, list_id, category_id, interest_id, data):

self.list_id = list_id<EOL>self.category_id = category_id<EOL>self.interest_id = interest_id<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(<EOL>url=self._build_path(list_id, '<STR_LIT>', category_id, '<STR_LIT>', interest_id),<EOL>data=data<EOL>)<EOL>

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*
}


def delete(self, list_id, category_id, interest_id):

self.list_id = list_id<EOL>self.category_id = category_id<EOL>self.interest_id = interest_id<EOL>return self._mc_client._delete(<EOL>url=self._build_path(list_id, '<STR_LIT>', category_id, '<STR_LIT>', interest_id)<EOL>)<EOL>

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`


super(CampaignFolders, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.folder_id = None<EOL>


if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(), data=data)<EOL>if response is not None:<EOL><INDENT>self.folder_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.folder_id = None<EOL><DEDENT>return response<EOL>

Create a new campaign folder.

:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "name": string*
}


def all(self, get_all=False, **queryparams):

self.folder_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(), **queryparams)<EOL><DEDENT>

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


def get(self, folder_id, **queryparams):

self.folder_id = folder_id<EOL>return self._mc_client._get(url=self._build_path(folder_id), **queryparams)<EOL>

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<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(url=self._build_path(folder_id), data=data)<EOL>

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<EOL>return self._mc_client._delete(url=self._build_path(folder_id))<EOL>

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`


super(ListActivity, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>


self.list_id = list_id<EOL>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL>

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'] = []


super(ListMemberActivity, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.subscriber_hash = None<EOL>


def all(self, list_id, subscriber_hash, **queryparams):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>'), **queryparams)<EOL>

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'] = []


super(ReportCampaignAdvice, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>


def all(self, campaign_id, **queryparams):

self.campaign_id = campaign_id<EOL>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL>

Get feedback based on a campaign’s statistics. Advice feedback is
based on campaign stats like opens, clicks, unsubscribes, bounces, and
more.

: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'] = []


super(CampaignActions, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>


self.campaign_id = campaign_id<EOL>return self._mc_client._post(url=self._build_path(campaign_id, '<STR_LIT>'))<EOL>

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`


Pause an RSS-Driven campaign.

:param campaign_id: The unique id for the campaign.
:type campaign_id: :py:class:`str`


Replicate a campaign in saved or send status.

:param campaign_id: The unique id for the campaign.
:type campaign_id: :py:class:`str`


Resume an RSS-Driven campaign.

:param campaign_id: The unique id for the campaign.
:type campaign_id: :py:class:`str`


if not data['<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>if data['<STR_LIT>'].tzinfo is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>if data['<STR_LIT>'].tzinfo.utcoffset(None) != timedelta(<NUM_LIT:0>):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>if data['<STR_LIT>'].minute not in [<NUM_LIT:0>, <NUM_LIT:15>, <NUM_LIT:30>, <NUM_LIT>]:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>data['<STR_LIT>'] = data['<STR_LIT>'].strftime('<STR_LIT>')<EOL>self.campaign_id = campaign_id<EOL>return self._mc_client._post(url=self._build_path(campaign_id, '<STR_LIT>'), data=data)<EOL>

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])
}


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`


Unschedule a scheduled campaign that hasn’t started sending.

:param campaign_id: The unique id for the campaign.
:type campaign_id: :py:class:`str`


super(CampaignContent, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>


def get(self, campaign_id, **queryparams):

self.campaign_id = campaign_id<EOL>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT:content>'), **queryparams)<EOL>

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<EOL>return self._mc_client._put(url=self._build_path(campaign_id, '<STR_LIT:content>'), data=data)<EOL>

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`


super(ReportClickDetailReports, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>self.link_id = None<EOL>self.members = ReportClickDetailMembers(self)<EOL>


def all(self, campaign_id, get_all=False, **queryparams):

self.campaign_id = campaign_id<EOL>self.link_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about clicks on specific links in your MailChimp
campaigns.

: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'] = []
queryparams['count'] = integer
queryparams['offset'] = integer


def get(self, campaign_id, link_id, **queryparams):

self.campaign_id = campaign_id<EOL>self.link_id = link_id<EOL>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>', link_id), **queryparams)<EOL>

Get click details for a specific link in a campaign.

:param campaign_id: The unique id for the campaign.
:type campaign_id: :py:class:`str`
:param link_id: The id for the link.
:type link_id: :py:class:`str`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


super(StoreCartLines, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.store_id = None<EOL>self.cart_id = None<EOL>self.line_id = None<EOL>


def create(self, store_id, cart_id, data):

self.store_id = store_id<EOL>self.cart_id = cart_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>', cart_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.line_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.line_id = None<EOL><DEDENT>return response<EOL>

Add a new line item to an existing cart.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param cart_id: The id for the cart.
:type cart_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string*,
    "product_id": string*,
    "product_variant_id": string*,
    "quantity": integer*,
    "price": number*
}


def all(self, store_id, cart_id, get_all=False, **queryparams):

self.store_id = store_id<EOL>self.cart_id = cart_id<EOL>self.line_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(store_id, '<STR_LIT>', cart_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>', cart_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about a cart’s line items.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param cart_id: The id for the cart.
:type cart_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


def get(self, store_id, cart_id, line_id, **queryparams):

self.store_id = store_id<EOL>self.cart_id = cart_id<EOL>self.line_id = line_id<EOL>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>', cart_id, '<STR_LIT>', line_id), **queryparams)<EOL>

Get information about a specific cart line item.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param cart_id: The id for the cart.
:type cart_id: :py:class:`str`
:param line_id: The id for the line item of a cart.
:type line_id: :py:class:`str`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


def update(self, store_id, cart_id, line_id, data):

self.store_id = store_id<EOL>self.cart_id = cart_id<EOL>self.line_id = line_id<EOL>return self._mc_client._patch(url=self._build_path(store_id, '<STR_LIT>', cart_id, '<STR_LIT>', line_id), data=data)<EOL>

Update a specific cart line item.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param cart_id: The id for the cart.
:type cart_id: :py:class:`str`
:param line_id: The id for the line item of a cart.
:type line_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`


def delete(self, store_id, cart_id, line_id):

self.store_id = store_id<EOL>self.cart_id = cart_id<EOL>self.line_id = line_id<EOL>return self._mc_client._delete(url=self._build_path(store_id, '<STR_LIT>', cart_id, '<STR_LIT>', line_id))<EOL>

Delete a cart.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param cart_id: The id for the cart.
:type cart_id: :py:class:`str`
:param line_id: The id for the line item of a cart.
:type line_id: :py:class:`str`


super(SearchMembers, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>


if '<STR_LIT>' in queryparams:<EOL><INDENT>self.list_id = queryparams['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>self.list_id = None<EOL><DEDENT>return self._mc_client._get(url=self._build_path(), **queryparams)<EOL>

Search for list members. This search can be restricted to a specific
list, or can be used to search across all lists in an account.

:param queryparams: The query string parameters
queryparams['fields'] = array
queryparams['exclude_fields'] = array
queryparams['query'] = string
queryparams['list_id'] = string
queryparams['offset'] = integer


super(ListSegments, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.segment_id = None<EOL>self.members = ListSegmentMembers(self)<EOL>


self.list_id = list_id<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(list_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.segment_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.segment_id = None<EOL><DEDENT>return response<EOL>

Create a new segment in 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*
}


def all(self, list_id, get_all=False, **queryparams):

self.list_id = list_id<EOL>self.segment_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about all available segments 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
queryparams['type'] = string
queryparams['before_created_at'] = string
queryparams['since_created_at'] = string
queryparams['before_updated_at'] = string
queryparams['since_updated_at'] = string


def get(self, list_id, segment_id, **queryparams):

self.list_id = list_id<EOL>self.segment_id = segment_id<EOL>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>', segment_id), **queryparams)<EOL>

Get information about a specific segment.

: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`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


def update(self, list_id, segment_id, data):

self.list_id = list_id<EOL>self.segment_id = segment_id<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(url=self._build_path(list_id, '<STR_LIT>', segment_id), data=data)<EOL>

Update a specific segment in a list.

: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`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "name": string*
}


def update_members(self, list_id, segment_id, data):

self.list_id = list_id<EOL>self.segment_id = segment_id<EOL>return self._mc_client._post(url=self._build_path(list_id, '<STR_LIT>', segment_id), data=data)<EOL>

Batch add/remove list members to static segment.

: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`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "members_to_add": array,
    "members_to_remove": array
}


self.list_id = list_id<EOL>self.segment_id = segment_id<EOL>return self._mc_client._delete(url=self._build_path(list_id, '<STR_LIT>', segment_id))<EOL>

Delete a specific segment in a list.

: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`


super(StoreOrders, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.store_id = None<EOL>self.order_id = None<EOL>self.lines = StoreOrderLines(self)<EOL>


self.store_id = store_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:id>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if not re.match(r"<STR_LIT>", data['<STR_LIT>']):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>for line in data['<STR_LIT>']:<EOL><INDENT>if '<STR_LIT:id>' not in line:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in line:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in line:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in line:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in line:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT><DEDENT>response = self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.order_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.order_id = None<EOL><DEDENT>return response<EOL>

Add a new order to a store.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string*,
    "customer": object*
    {
        "'id": string*
    },
    "curency_code": string*,
    "order_total": number*,
    "lines": array*
    [
        {
            "id": string*,
            "product_id": string*,
            "product_variant_id": string*,
            "quantity": integer*,
            "price": number*
        }
    ]
}


def all(self, store_id, get_all=False, **queryparams):

self.store_id = store_id<EOL>self.order_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(store_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about a store’s orders.

:param store_id: The store id.
:type store_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['customer_id'] = string


def get(self, store_id, order_id, **queryparams):

self.store_id = store_id<EOL>self.order_id = order_id<EOL>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>', order_id), **queryparams)<EOL>

Get information about a specific order.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param order_id: The id for the order in a store.
:type order_id: :py:class:`str`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


def update(self, store_id, order_id, data):

self.store_id = store_id<EOL>self.order_id = order_id<EOL>return self._mc_client._patch(url=self._build_path(store_id, '<STR_LIT>', order_id), data=data)<EOL>

Update a specific order.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param order_id: The id for the order in a store.
:type order_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`


self.store_id = store_id<EOL>self.order_id = order_id<EOL>return self._mc_client._delete(url=self._build_path(store_id, '<STR_LIT>', order_id))<EOL>

Delete an order.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param order_id: The id for the order in a store.
:type order_id: :py:class:`str`


super(AutomationEmailActions, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.workflow_id = None<EOL>self.email_id = None<EOL>


self.workflow_id = workflow_id<EOL>self.email_id = email_id<EOL>return self._mc_client._post(url=self._build_path(workflow_id, '<STR_LIT>', email_id, '<STR_LIT>'))<EOL>

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`


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`


def delete(self, workflow_id, email_id):

self.workflow_id = workflow_id<EOL>self.email_id = email_id<EOL>return self._mc_client._delete(url=self._build_path(workflow_id, '<STR_LIT>', email_id))<EOL>

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`


super(StorePromoCodes, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.store_id = None<EOL>

Initialize the Endpoint
:param args:
:param kwargs:


def create(self, store_id, promo_rule_id, data):

self.store_id = store_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:code>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>return response<EOL><DEDENT>

Add a new promo code to a store.

:param store_id: The store id
:type store_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict'
data = {
    "id": string*,
    "code": string*,
    "redemption_url": string*,
    "usage_count": string,
    "enabled": boolean,
    "created_at_foreign": string,
    "updated_at_foreign": string,
}


def all(self, store_id, promo_rule_id, get_all=False, **queryparams):

self.store_id=store_id<EOL>self.promo_rule_id=promo_rule_id<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id), **queryparams)<EOL><DEDENT>

Get information about a store’s promo codes.

:param store_id: The store's id
:type store_id: `str`
:param promo_rule_id: The store promo rule id
:type store_id: `str`
:param get_all:
:type get_all: :py:class:`bool`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []
queryparams['count'] = integer
queryparams['offset'] = integer


def get(self, store_id, promo_rule_id, promo_code_id, **queryparams):

self.store_id = store_id<EOL>self.promo_rule_id = promo_rule_id<EOL>self.promo_code_id = promo_code_id<EOL>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id, '<STR_LIT>', promo_code_id), **queryparams)<EOL>

Get information about a specific promo code.

:param store_id: The store's id
:type store_id: `string`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []
queryparams['count'] = integer
queryparams['offset'] = integer


def update(self, store_id, promo_rule_id, promo_code_id, data):

self.store_id = store_id<EOL>self.promo_rule_id = promo_rule_id<EOL>self.promo_code_id = promo_code_id<EOL>return self._mc_client._patch(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id, '<STR_LIT>', promo_code_id), data=data)<EOL>

Update a promo code

:param store_id: The store id
:type :py:class:`str`
:param promo_rule_id: The id for the promo rule of a store.
:type :py:class:`str`
:param promo_code_id: The id for the promo code of a store.
:type :py:class:`str`
:param data:
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string,
    "title": string,
    "description": string,
    "starts_at": string,
    "ends_at": string,
    "amount": number,
    "type": string,
    "target": string,
    "enabled": boolean,
    "created_at_foreign": string,
    "updated_at_foreign": string,
}


def delete(self, store_id, promo_rule_id, promo_code_id):

self.store_id=store_id<EOL>self.promo_rule_id=promo_rule_id<EOL>return self._mc_client._delete(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id, '<STR_LIT>', promo_code_id))<EOL>

Delete a promo code
:param store_id: The store id
:type :py:class:`str`
:param promo_rule_id: The id for the promo rule of a store.
:type :py:class:`str`
:param promo_code_id: The id for the promo code of a store.
:type :py:class:`str`


super(Ping, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>


return self._mc_client._get(url=self._build_path())<EOL>

A health check for the API that won’t return any account-specific information.


super(ListInterestCategories, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.category_id = None<EOL>self.interests = ListInterestCategoryInterest(self)<EOL>


self.list_id = list_id<EOL>if '<STR_LIT:title>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:type>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT:type>'] not in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(list_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.category_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.category_id = None<EOL><DEDENT>return response<EOL>

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<EOL>self.category_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

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


def get(self, list_id, category_id, **queryparams):

self.list_id = list_id<EOL>self.category_id = category_id<EOL>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>', category_id), **queryparams)<EOL>

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'] = []


def update(self, list_id, category_id, data):

self.list_id = list_id<EOL>self.category_id = category_id<EOL>if '<STR_LIT:title>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:type>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT:type>'] not in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(url=self._build_path(list_id, '<STR_LIT>', category_id), data=data)<EOL>

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<EOL>self.category_id = category_id<EOL>return self._mc_client._delete(url=self._build_path(list_id, '<STR_LIT>', category_id))<EOL>

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`


super(ReportGoogleAnalytics, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>self.profile_id = None<EOL>


def all(self, campaign_id, get_all=False, **queryparams):

self.campaign_id = campaign_id<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get a summary of Google Analytics reports for a specific 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'] = []


def get(self, campaign_id, profile_id, **queryparams):

self.campaign_id = campaign_id<EOL>self.profile_id = profile_id<EOL>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>', profile_id), **queryparams)<EOL>

Get information about a specific Google Analytics report for a campaign.

:param campaign_id: The unique id for the campaign
:type campaign_id: :py:class:`str`
:param profile_id: The Google Analytics View ID
:type campaign_id: :py:class:`str`
:param queryparams:
:param queryparams:  The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


super(ListMergeFields, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.merge_id = None<EOL>


self.list_id = list_id<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:type>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(list_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.merge_id = response['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>self.merge_id = None<EOL><DEDENT>return response<EOL>

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*
}


def all(self, list_id, get_all=False, **queryparams):

self.list_id = list_id<EOL>self.merge_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

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<EOL>self.merge_id = merge_id<EOL>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>', merge_id))<EOL>

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`


def update(self, list_id, merge_id, data):

self.list_id = list_id<EOL>self.merge_id = merge_id<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(url=self._build_path(list_id, '<STR_LIT>', merge_id), data=data)<EOL>

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<EOL>self.merge_id = merge_id<EOL>return self._mc_client._delete(url=self._build_path(list_id, '<STR_LIT>', merge_id))<EOL>

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.campaign_id = campaign_id<EOL>self.subscriber_hash = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about members who have unsubscribed from a specific
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'] = []
queryparams['count'] = integer
queryparams['offset'] = integer


def get(self, campaign_id, subscriber_hash, **queryparams):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.campaign_id = campaign_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>', subscriber_hash), **queryparams)<EOL>

Get information about a specific list member who unsubscribed from a
campaign.

:param campaign_id: The unique id for the campaign.
:type campaign_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'] = []


super(ListMembers, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.subscriber_hash = None<EOL>self.activity = ListMemberActivity(self)<EOL>self.goals = ListMemberGoals(self)<EOL>self.notes = ListMemberNotes(self)<EOL>


self.list_id = list_id<EOL>if '<STR_LIT:status>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT:status>'] not in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>'])<EOL>response = self._mc_client._post(url=self._build_path(list_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.subscriber_hash = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.subscriber_hash = None<EOL><DEDENT>return response<EOL>

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<EOL>self.subscriber_hash = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

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


def get(self, list_id, subscriber_hash, **queryparams):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash), **queryparams)<EOL>

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'] = []


def update(self, list_id, subscriber_hash, data):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._patch(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash), data=data)<EOL>

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`


def create_or_update(self, list_id, subscriber_hash, data):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>'])<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT>'] not in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>return self._mc_client._put(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash), data=data)<EOL>

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')
}


def delete(self, list_id, subscriber_hash):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._delete(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash))<EOL>

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`


def delete_permanent(self, list_id, subscriber_hash):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._post(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>', '<STR_LIT>'))<EOL>

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`


super(BatchOperations, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.batch_id = None<EOL>self.operation_status = None<EOL>


if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>for op in data['<STR_LIT>']:<EOL><INDENT>if '<STR_LIT>' not in op:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if op['<STR_LIT>'] not in ['<STR_LIT:GET>', '<STR_LIT:POST>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>'.format(op['<STR_LIT>']))<EOL><DEDENT>if '<STR_LIT:path>' not in op:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT><DEDENT>return self._mc_client._post(url=self._build_path(), data=data)<EOL>

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*,
        }
    ]
}


def all(self, get_all=False, **queryparams):

self.batch_id = None<EOL>self.operation_status = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(), **queryparams)<EOL><DEDENT>

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 = batch_id<EOL>self.operation_status = None<EOL>return self._mc_client._get(url=self._build_path(batch_id), **queryparams)<EOL>

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<EOL>self.operation_status = None<EOL>return self._mc_client._delete(url=self._build_path(batch_id))<EOL>

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`


super(FileManagerFolders, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.folder_id = None<EOL>


if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(), data=data)<EOL>if response is not None:<EOL><INDENT>self.folder_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.folder_id = None<EOL><DEDENT>return response<EOL>

Create a new folder in the File Manager.

:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "name": string*
}


self.folder_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(), **queryparams)<EOL><DEDENT>

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


def get(self, folder_id, **queryparams):

self.folder_id = folder_id<EOL>return self._mc_client._get(url=self._build_path(folder_id), **queryparams)<EOL>

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<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(url=self._build_path(folder_id), data=data)<EOL>

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<EOL>return self._mc_client._delete(url=self._build_path(folder_id))<EOL>

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`


super(ListMemberNotes, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.subscriber_hash = None<EOL>self.note_id = None<EOL>


def create(self, list_id, subscriber_hash, data):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.note_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.note_id = None<EOL><DEDENT>return response<EOL>

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*
}


def all(self, list_id, subscriber_hash, get_all=False, **queryparams):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>self.note_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

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


def get(self, list_id, subscriber_hash, note_id, **queryparams):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>self.note_id = note_id<EOL>return self._mc_client._get(<EOL>url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>', note_id),<EOL>**queryparams<EOL>)<EOL>

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'] = []


def update(self, list_id, subscriber_hash, note_id, data):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>self.note_id = note_id<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(<EOL>url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>', note_id),<EOL>data=data<EOL>)<EOL>

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*
}


def delete(self, list_id, subscriber_hash, note_id):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>self.note_id = note_id<EOL>return self._mc_client._delete(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>', note_id))<EOL>

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`


super(StorePromoRules, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.store_id = None<EOL>

Initialize the Endpoint
:param args:
:param kwargs:


self.store_id = store_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:description>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:target>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>return response<EOL><DEDENT>

Add new promo rule to a store

:param store_id: The store id
:type store_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict'
data = {
    "id": string*,
    "title": string,
    "description": string*,
    "starts_at": string,
    "ends_at": string,
    "amount": number*,
    "type": string*,
    "target": string*,
    "enabled": boolean,
    "created_at_foreign": string,
    "updated_at_foreign": string,
}


def all(self, store_id, get_all=False, **queryparams):

self.store_id = store_id<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(store_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about a store’s promo rules.

:param store_id: The store's id
:type store_id: `str`
:param get_all:
:type get_all: :py:class:`bool`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []
queryparams['count'] = integer
queryparams['offset'] = integer


def get(self, store_id, promo_rule_id, **queryparams):

self.store_id = store_id<EOL>self.promo_rule_id = promo_rule_id<EOL>return self._mc_client._get(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id), **queryparams)<EOL>

Get information about a specific promo rule.

:param store_id: The store's id
:type store_id: `string`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []
queryparams['count'] = integer
queryparams['offset'] = integer


def update(self, store_id, promo_rule_id, data):

self.store_id = store_id<EOL>self.promo_rule_id = promo_rule_id<EOL>return self._mc_client._patch(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id), data=data)<EOL>

Update a promo rule

:param store_id: The store id
:type :py:class:`str`
:param promo_rule_id: The id for the promo rule of a store.
:type :py:class:`str`
:param data:
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string,
    "title": string,
    "description": string,
    "starts_at": string,
    "ends_at": string,
    "amount": number,
    "type": string,
    "target": string,
    "enabled": boolean,
    "created_at_foreign": string,
    "updated_at_foreign": string,
}


def delete(self, store_id, promo_rule_id):

self.store_id=store_id<EOL>self.promo_rule_id=promo_rule_id<EOL>return self._mc_client._delete(url=self._build_path(store_id, '<STR_LIT>', promo_rule_id))<EOL>

Delete a promo rule
:param store_id: The store id
:type :py:class:`str`
:param promo_rule_id: The id for the promo rule of a store.
:type :py:class:`str`


super(StoreProductImages, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.store_id = None<EOL>self.product_id = None<EOL>self.image_id = None<EOL>


def create(self, store_id, product_id, data):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:title>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.image_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.image_id = None<EOL><DEDENT>return response<EOL>

Add a new image to the product.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string*,
    "url": string*
}


def all(self, store_id, product_id, get_all=False, **queryparams):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.image_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about a product’s images.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_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


def get(self, store_id, product_id, image_id, **queryparams):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.image_id = image_id<EOL>return self._mc_client._post(<EOL>url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>', image_id),<EOL>**queryparams<EOL>)<EOL>

Get information about a specific product image.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param image_id: The id for the product image.
:type image_id: :py:class:`str`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


def update(self, store_id, product_id, image_id, data):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.image_id = image_id<EOL>return self._mc_client._patch(<EOL>url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>', image_id),<EOL>data=data<EOL>)<EOL>

Update a product image.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param image_id: The id for the product image.
:type image_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`


def delete(self, store_id, product_id, image_id):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.image_id = image_id<EOL>return self._mc_client._delete(url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>', image_id))<EOL>

Delete a product image.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param image_id: The id for the product image.
:type image_id: :py:class:`str`


super(ListMemberGoals, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.subscriber_hash = None<EOL>


def all(self, list_id, subscriber_hash, **queryparams):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.list_id = list_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._get(url=self._build_path(list_id, '<STR_LIT>', subscriber_hash, '<STR_LIT>'), **queryparams)<EOL>

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'] = []


super(StoreProductVariants, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.store_id = None<EOL>self.product_id = None<EOL>self.variant_id = None<EOL>


self.store_id = store_id<EOL>self.product_id = product_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:title>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>'), data=data)<EOL>if response is not None:<EOL><INDENT>self.variant_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.variant_id = None<EOL><DEDENT>return response<EOL>

Add a new variant to the product.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string*,
    "title": string*
}


self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.variant_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(<EOL>url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>'),<EOL>**queryparams<EOL>)<EOL><DEDENT>

Get information about a product’s variants.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_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


def get(self, store_id, product_id, variant_id, **queryparams):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.variant_id = variant_id<EOL>return self._mc_client._get(<EOL>url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>', variant_id),<EOL>**queryparams<EOL>)<EOL>

Get information about a specific product variant.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param variant_id: The id for the product variant.
:type variant_id: :py:class:`str`
:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


def update(self, store_id, product_id, variant_id, data):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.variant_id = variant_id<EOL>return self._mc_client._patch(<EOL>url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>', variant_id),<EOL>data=data<EOL>)<EOL>

Update a product variant.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param variant_id: The id for the product variant.
:type variant_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`


def create_or_update(self, store_id, product_id, variant_id, data):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.variant_id = variant_id<EOL>if '<STR_LIT:id>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:title>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._put(<EOL>url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>', variant_id),<EOL>data=data<EOL>)<EOL>

Add or update a product variant.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param variant_id: The id for the product variant.
:type variant_id: :py:class:`str`
:param data: The request body parameters
:type data: :py:class:`dict`
data = {
    "id": string*,
    "title": string*
}


def delete(self, store_id, product_id, variant_id):

self.store_id = store_id<EOL>self.product_id = product_id<EOL>self.variant_id = variant_id<EOL>return self._mc_client._delete(url=self._build_path(store_id, '<STR_LIT>', product_id, '<STR_LIT>', variant_id))<EOL>

Delete a product variant.

:param store_id: The store id.
:type store_id: :py:class:`str`
:param product_id: The id for the product of a store.
:type product_id: :py:class:`str`
:param variant_id: The id for the product variant.
:type variant_id: :py:class:`str`


super(Root, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>


return self._mc_client._get(url=self._build_path(), **queryparams)<EOL>

Get links to all other resources available in the API.

:param queryparams: The query string parameters
queryparams['fields'] = []
queryparams['exclude_fields'] = []


super(ReportSentTo, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>self.subscriber_hash = None<EOL>


def all(self, campaign_id, get_all=False, **queryparams):

self.campaign_id = campaign_id<EOL>self.subscriber_hash = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL><DEDENT>

Get information about campaign recipients.

: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'] = []
queryparams['count'] = integer
queryparams['offset'] = integer


def get(self, campaign_id, subscriber_hash, **queryparams):

subscriber_hash = check_subscriber_hash(subscriber_hash)<EOL>self.campaign_id = campaign_id<EOL>self.subscriber_hash = subscriber_hash<EOL>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>', subscriber_hash), **queryparams)<EOL>

Get information about a specific campaign recipient.

:param campaign_id: The unique id for the campaign.
:type campaign_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'] = []


super(Lists, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.list_id = None<EOL>self.abuse_reports = ListAbuseReports(self)<EOL>self.activity = ListActivity(self)<EOL>self.clients = ListClients(self)<EOL>self.growth_history = ListGrowthHistory(self)<EOL>self.interest_categories = ListInterestCategories(self)<EOL>self.members = ListMembers(self)<EOL>self.merge_fields = ListMergeFields(self)<EOL>self.segments = ListSegments(self)<EOL>self.signup_forms = ListSignupForms(self)<EOL>self.webhooks = ListWebhooks(self)<EOL>


if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:state>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>']['<STR_LIT>'])<EOL>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT>'] not in [True, False]:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>response = self._mc_client._post(url=self._build_path(), data=data)<EOL>if response is not None:<EOL><INDENT>self.list_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.list_id = None<EOL><DEDENT>return response<EOL>

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
}


def update_members(self, list_id, data):

self.list_id = list_id<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>if not len(data['<STR_LIT>']) <= <NUM_LIT>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>for member in data['<STR_LIT>']:<EOL><INDENT>if '<STR_LIT>' not in member:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(member['<STR_LIT>'])<EOL>if '<STR_LIT:status>' not in member and '<STR_LIT>' not in member:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>valid_statuses = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>if '<STR_LIT:status>' in member and member['<STR_LIT:status>'] not in valid_statuses:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in member and member['<STR_LIT>'] not in valid_statuses:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>data['<STR_LIT>'] = False<EOL><DEDENT>return self._mc_client._post(url=self._build_path(list_id), data=data)<EOL>

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*
}


def all(self, get_all=False, **queryparams):

self.list_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(), **queryparams)<EOL><DEDENT>

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 = list_id<EOL>return self._mc_client._get(url=self._build_path(list_id), **queryparams)<EOL>

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<EOL>if '<STR_LIT:name>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT:state>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>']['<STR_LIT>'])<EOL>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT>'] not in [True, False]:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>return self._mc_client._patch(url=self._build_path(list_id), data=data)<EOL>

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<EOL>return self._mc_client._delete(url=self._build_path(list_id))<EOL>

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`


super(CampaignSendChecklist, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>


def get(self, campaign_id, **queryparams):

self.campaign_id = campaign_id<EOL>return self._mc_client._get(url=self._build_path(campaign_id, '<STR_LIT>'), **queryparams)<EOL>

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'] = []


super(Campaigns, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.campaign_id = None<EOL>self.actions = CampaignActions(self)<EOL>self.content = CampaignContent(self)<EOL>self.feedback = CampaignFeedback(self)<EOL>self.send_checklist = CampaignSendChecklist(self)<EOL>


if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>']['<STR_LIT>'])<EOL>if '<STR_LIT:type>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if not data['<STR_LIT:type>'] in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if data['<STR_LIT>']['<STR_LIT>'] not in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>if data['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if not data['<STR_LIT>']['<STR_LIT>'] in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>response = self._mc_client._post(url=self._build_path(), data=data)<EOL>if response is not None:<EOL><INDENT>self.campaign_id = response['<STR_LIT:id>']<EOL><DEDENT>else:<EOL><INDENT>self.campaign_id = None<EOL><DEDENT>return response<EOL>

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*
    },
    "settings": object*
    {
        "subject_line": string*,
        "from_name": string*,
        "reply_to": string*
    },
    "variate_settings": object* (Required if type is "variate")
    {
        "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")
}


self.campaign_id = None<EOL>if get_all:<EOL><INDENT>return self._iterate(url=self._build_path(), **queryparams)<EOL><DEDENT>else:<EOL><INDENT>return self._mc_client._get(url=self._build_path(), **queryparams)<EOL><DEDENT>

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 = campaign_id<EOL>return self._mc_client._get(url=self._build_path(campaign_id), **queryparams)<EOL>

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<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' not in data['<STR_LIT>']:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>']['<STR_LIT>'])<EOL>return self._mc_client._patch(url=self._build_path(campaign_id), data=data)<EOL>

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<EOL>return self._mc_client._delete(url=self._build_path(campaign_id))<EOL>

Remove a campaign from your MailChimp account.

:param campaign_id: The unique id for the campaign.
:type campaign_id: :py:class:`str`


super(AutomationRemovedSubscribers, self).__init__(*args, **kwargs)<EOL>self.endpoint = '<STR_LIT>'<EOL>self.workflow_id = None<EOL>


self.workflow_id = workflow_id<EOL>if '<STR_LIT>' not in data:<EOL><INDENT>raise KeyError('<STR_LIT>')<EOL><DEDENT>check_email(data['<STR_LIT>'])<EOL>return self._mc_client._post(url=self._build_path(workflow_id, '<STR_LIT>'), data=data)<EOL>

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<EOL>return self._mc_client._get(url=self._build_path(workflow_id, '<STR_LIT>'))<EOL>

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`


def __init__(self, mc_api=None, mc_user='<STR_LIT>', access_token=None, enabled=True, timeout=None,<EOL>request_hooks=None, request_headers=None):

super(MailChimpClient, self).__init__()<EOL>self.enabled = enabled<EOL>self.timeout = timeout<EOL>if access_token:<EOL><INDENT>self.auth = MailChimpOAuth(access_token)<EOL>self.base_url = self.auth.get_base_url() + '<STR_LIT>'<EOL><DEDENT>elif mc_api:<EOL><INDENT>if not re.match(r"<STR_LIT>", mc_api.split('<STR_LIT:->')[<NUM_LIT:0>]):<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>self.auth = HTTPBasicAuth(mc_user, mc_api)<EOL>datacenter = mc_api.split('<STR_LIT:->').pop()<EOL>self.base_url = '<STR_LIT>'.format(datacenter)<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>self.request_headers = request_headers or requests.utils.default_headers()<EOL>self.request_hooks = request_hooks or requests.hooks.default_hooks()<EOL>

Initialize the class with your optional user_id and required api_key.

If `enabled` is not True, these methods become no-ops. This is
particularly useful for testing or disabling with configuration.

:param mc_api: Mailchimp API key
:type mc_api: :py:class:`str`
:param mc_user: Mailchimp user id
:type mc_user: :py:class:`str`
:param access_token: The OAuth access token
:type access_token: :py:class:`str`
:param enabled: Whether the API should execute any requests
:type enabled: :py:class:`bool`
:param timeout: (optional) How long to wait for the server to send
    data before giving up, as a float, or a :ref:`(connect timeout,
    read timeout) <timeouts>` tuple.
:type timeout: float or tuple
:param request_hooks: (optional) Hooks for :py:func:`requests.requests`.
:type request_hooks: :py:class:`dict`
:param request_headers: (optional) Headers for
    :py:func:`requests.requests`.
:type request_headers: :py:class:`dict`


@_enabled_or_noop<EOL><INDENT>def _post(self, url, data=None):<DEDENT>

url = urljoin(self.base_url, url)<EOL>try:<EOL><INDENT>r = self._make_request(**dict(<EOL>method='<STR_LIT:POST>',<EOL>url=url,<EOL>json=data,<EOL>auth=self.auth,<EOL>timeout=self.timeout,<EOL>hooks=self.request_hooks,<EOL>headers=self.request_headers<EOL>))<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise e<EOL><DEDENT>else:<EOL><INDENT>if r.status_code >= <NUM_LIT>:<EOL><INDENT>try:<EOL><INDENT>error_data = r.json()<EOL><DEDENT>except ValueError:<EOL><INDENT>error_data = { "<STR_LIT>": r }<EOL><DEDENT>raise MailChimpError(error_data)<EOL><DEDENT>if r.status_code == <NUM_LIT>:<EOL><INDENT>return None<EOL><DEDENT>return r.json()<EOL><DEDENT>

Handle authenticated POST requests

:param url: The url for the endpoint including path parameters
:type url: :py:class:`str`
:param data: The request body parameters
:type data: :py:data:`none` or :py:class:`dict`
:returns: The JSON output from the API or an error message


@_enabled_or_noop<EOL><INDENT>def _get(self, url, **queryparams):<DEDENT>

url = urljoin(self.base_url, url)<EOL>if len(queryparams):<EOL><INDENT>url += '<STR_LIT:?>' + urlencode(queryparams)<EOL><DEDENT>try:<EOL><INDENT>r = self._make_request(**dict(<EOL>method='<STR_LIT:GET>',<EOL>url=url,<EOL>auth=self.auth,<EOL>timeout=self.timeout,<EOL>hooks=self.request_hooks,<EOL>headers=self.request_headers<EOL>))<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise e<EOL><DEDENT>else:<EOL><INDENT>if r.status_code >= <NUM_LIT>:<EOL><INDENT>raise MailChimpError(r.json())<EOL><DEDENT>return r.json()<EOL><DEDENT>

Handle authenticated GET requests

:param url: The url for the endpoint including path parameters
:type url: :py:class:`str`
:param queryparams: The query string parameters
:returns: The JSON output from the API


url = urljoin(self.base_url, url)<EOL>try:<EOL><INDENT>r = self._make_request(**dict(<EOL>method='<STR_LIT>',<EOL>url=url,<EOL>auth=self.auth,<EOL>timeout=self.timeout,<EOL>hooks=self.request_hooks,<EOL>headers=self.request_headers<EOL>))<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise e<EOL><DEDENT>else:<EOL><INDENT>if r.status_code >= <NUM_LIT>:<EOL><INDENT>raise MailChimpError(r.json())<EOL><DEDENT>if r.status_code == <NUM_LIT>:<EOL><INDENT>return<EOL><DEDENT>return r.json()<EOL><DEDENT>

Handle authenticated DELETE requests

:param url: The url for the endpoint including path parameters
:type url: :py:class:`str`
:returns: The JSON output from the API


@_enabled_or_noop<EOL><INDENT>def _patch(self, url, data=None):<DEDENT>

url = urljoin(self.base_url, url)<EOL>try:<EOL><INDENT>r = self._make_request(**dict(<EOL>method='<STR_LIT>',<EOL>url=url,<EOL>json=data,<EOL>auth=self.auth,<EOL>timeout=self.timeout,<EOL>hooks=self.request_hooks,<EOL>headers=self.request_headers<EOL>))<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise e<EOL><DEDENT>else:<EOL><INDENT>if r.status_code >= <NUM_LIT>:<EOL><INDENT>raise MailChimpError(r.json())<EOL><DEDENT>return r.json()<EOL><DEDENT>

Handle authenticated PATCH requests

:param url: The url for the endpoint including path parameters
:type url: :py:class:`str`
:param data: The request body parameters
:type data: :py:data:`none` or :py:class:`dict`
:returns: The JSON output from the API


@_enabled_or_noop<EOL><INDENT>def _put(self, url, data=None):<DEDENT>

url = urljoin(self.base_url, url)<EOL>try:<EOL><INDENT>r = self._make_request(**dict(<EOL>method='<STR_LIT>',<EOL>url=url,<EOL>json=data,<EOL>auth=self.auth,<EOL>timeout=self.timeout,<EOL>hooks=self.request_hooks,<EOL>headers=self.request_headers<EOL>))<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise e<EOL><DEDENT>else:<EOL><INDENT>if r.status_code >= <NUM_LIT>:<EOL><INDENT>try:<EOL><INDENT>error_data = r.json()<EOL><DEDENT>except ValueError:<EOL><INDENT>error_data = { "<STR_LIT>": r }<EOL><DEDENT>raise MailChimpError(error_data)<EOL><DEDENT>return r.json()<EOL><DEDENT>

Handle authenticated PUT requests

:param url: The url for the endpoint including path parameters
:type url: :py:class:`str`
:param data: The request body parameters
:type data: :py:data:`none` or :py:class:`dict`
:returns: The JSON output from the API


self._access_token = access_token<EOL>

Initialize the OAuth and save the access token

:param access_token: The access token provided by OAuth authentication
:type access_token: :py:class:`str`


r.headers['<STR_LIT>'] = '<STR_LIT>' + self._access_token<EOL>return r<EOL>

Authorize with the access token provided in __init__


try:<EOL><INDENT>r = requests.get('<STR_LIT>', auth=self)<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise e<EOL><DEDENT>else:<EOL><INDENT>r.raise_for_status()<EOL>output = r.json()<EOL>if '<STR_LIT:error>' in output:<EOL><INDENT>raise requests.exceptions.RequestException(output['<STR_LIT:error>'])<EOL><DEDENT>return output<EOL><DEDENT>

Get the metadata returned after authentication


try:<EOL><INDENT>return self.get_metadata()['<STR_LIT>']<EOL><DEDENT>except requests.exceptions.RequestException:<EOL><INDENT>raise<EOL><DEDENT>

Get the base_url from the authentication metadata


<EOL>if isinstance(cookie_file, list):<EOL><INDENT>cookie_file = cookie_file[<NUM_LIT:0>]<EOL><DEDENT>if os.path.exists(cookie_file):<EOL><INDENT>tmp_cookie_file = tempfile.NamedTemporaryFile(suffix='<STR_LIT>').name<EOL>open(tmp_cookie_file, '<STR_LIT:wb>').write(open(cookie_file, '<STR_LIT:rb>').read())<EOL>return tmp_cookie_file<EOL><DEDENT>else:<EOL><INDENT>raise BrowserCookieError('<STR_LIT>' + cookie_file)<EOL><DEDENT>

Make a local copy of the sqlite cookie database and return the new filename.
    This is necessary in case this database is still being written to while the user browses
    to avoid sqlite locking errors.


def create_cookie(host, path, secure, expires, name, value):

return http.cookiejar.Cookie(<NUM_LIT:0>, name, value, None, False, host, host.startswith('<STR_LIT:.>'), host.startswith('<STR_LIT:.>'), path,<EOL>True, secure, expires, False, None, None, {})<EOL>


return Chrome(cookie_file, domain_name).load()<EOL>

Returns a cookiejar of the cookies used by Chrome. Optionally pass in a
    domain name to only load cookies from the specified domain


return Firefox(cookie_file, domain_name).load()<EOL>

Returns a cookiejar of the cookies and sessions used by Firefox. Optionally
    pass in a domain name to only load cookies from the specified domain


cj = http.cookiejar.CookieJar()<EOL>for cookie_fn in [chrome, firefox]:<EOL><INDENT>try:<EOL><INDENT>for cookie in cookie_fn(domain_name=domain_name):<EOL><INDENT>cj.set_cookie(cookie)<EOL><DEDENT><DEDENT>except BrowserCookieError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return cj<EOL>

Try to load cookies from all supported browsers and return combined cookiejar
    Optionally pass in a domain name to only load cookies from the specified domain