# coding: utf-8

"""
    Moosend API

    TODO: Add a description

    OpenAPI spec version: 1.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient


class SubscribersApi(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    def adding_multiple_subscribers(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Adding multiple subscribers
        This method allows you to add multiple subscribers in a mailing list with a single call. If some subscribers already exist with the given email addresses, they will be updated. If you try to add a subscriber with an invalid email address, this attempt will be ignored, as the process will skip to the next subscriber automatically.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.adding_multiple_subscribers(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to add subscribers to. (required)
        :param AddingMultipleSubscribersRequest body:  (required)
        :return: AddingMultipleSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.adding_multiple_subscribers_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
        else:
            (data) = self.adding_multiple_subscribers_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
            return data

    def adding_multiple_subscribers_with_http_info(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Adding multiple subscribers
        This method allows you to add multiple subscribers in a mailing list with a single call. If some subscribers already exist with the given email addresses, they will be updated. If you try to add a subscriber with an invalid email address, this attempt will be ignored, as the process will skip to the next subscriber automatically.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.adding_multiple_subscribers_with_http_info(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to add subscribers to. (required)
        :param AddingMultipleSubscribersRequest body:  (required)
        :return: AddingMultipleSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'mailing_list_id', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method adding_multiple_subscribers" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `adding_multiple_subscribers`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `adding_multiple_subscribers`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `adding_multiple_subscribers`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `adding_multiple_subscribers`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/subscribe_many.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='AddingMultipleSubscribersResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def adding_subscribers(self, format, mailing_list_id, apikey, body, **kwargs):
        """
        Adding subscribers
        Adds a new subscriber to the specified mailing list. If there is already a subscriber with the specified email address in the list, an update will be performed instead.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.adding_subscribers(format, mailing_list_id, apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str mailing_list_id: The ID of the mailing list to add the new member. (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param AddingSubscribersRequest body:  (required)
        :return: AddingSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.adding_subscribers_with_http_info(format, mailing_list_id, apikey, body, **kwargs)
        else:
            (data) = self.adding_subscribers_with_http_info(format, mailing_list_id, apikey, body, **kwargs)
            return data

    def adding_subscribers_with_http_info(self, format, mailing_list_id, apikey, body, **kwargs):
        """
        Adding subscribers
        Adds a new subscriber to the specified mailing list. If there is already a subscriber with the specified email address in the list, an update will be performed instead.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.adding_subscribers_with_http_info(format, mailing_list_id, apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str mailing_list_id: The ID of the mailing list to add the new member. (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param AddingSubscribersRequest body:  (required)
        :return: AddingSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'mailing_list_id', 'apikey', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method adding_subscribers" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `adding_subscribers`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `adding_subscribers`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `adding_subscribers`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `adding_subscribers`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/subscribe.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='AddingSubscribersResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_subscriber_by_email_address(self, format, apikey, mailing_list_id, email, **kwargs):
        """
        Get subscriber by email address
        Searches for a subscriber with the specified email address in the specified mailing list and returns detailed information such as id, name, date created, date unsubscribed, status and custom fields
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_subscriber_by_email_address(format, apikey, mailing_list_id, email, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list where the subscriber belongs. (required)
        :param str email: The email of the subscriber. (required)
        :return: GetSubscriberByEmailAddressResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_subscriber_by_email_address_with_http_info(format, apikey, mailing_list_id, email, **kwargs)
        else:
            (data) = self.get_subscriber_by_email_address_with_http_info(format, apikey, mailing_list_id, email, **kwargs)
            return data

    def get_subscriber_by_email_address_with_http_info(self, format, apikey, mailing_list_id, email, **kwargs):
        """
        Get subscriber by email address
        Searches for a subscriber with the specified email address in the specified mailing list and returns detailed information such as id, name, date created, date unsubscribed, status and custom fields
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_subscriber_by_email_address_with_http_info(format, apikey, mailing_list_id, email, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list where the subscriber belongs. (required)
        :param str email: The email of the subscriber. (required)
        :return: GetSubscriberByEmailAddressResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'mailing_list_id', 'email']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_subscriber_by_email_address" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `get_subscriber_by_email_address`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_subscriber_by_email_address`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `get_subscriber_by_email_address`")
        # verify the required parameter 'email' is set
        if ('email' not in params) or (params['email'] is None):
            raise ValueError("Missing the required parameter `email` when calling `get_subscriber_by_email_address`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))
        if 'email' in params:
            query_params.append(('Email', params['email']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/view.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetSubscriberByEmailAddressResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_subscriber_by_id(self, format, apikey, mailing_list_id, subscriber_id, **kwargs):
        """
        Get subscriber by id
        Searches for a subscriber with the specified unique id in the specified mailing list and returns detailed information such as email, name, date created, date unsubscribed, status and custom fields.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_subscriber_by_id(format, apikey, mailing_list_id, subscriber_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to search the subscriber in. (required)
        :param str subscriber_id: The id of the subscriber being searched. (required)
        :return: GetSubscriberByIdResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_subscriber_by_id_with_http_info(format, apikey, mailing_list_id, subscriber_id, **kwargs)
        else:
            (data) = self.get_subscriber_by_id_with_http_info(format, apikey, mailing_list_id, subscriber_id, **kwargs)
            return data

    def get_subscriber_by_id_with_http_info(self, format, apikey, mailing_list_id, subscriber_id, **kwargs):
        """
        Get subscriber by id
        Searches for a subscriber with the specified unique id in the specified mailing list and returns detailed information such as email, name, date created, date unsubscribed, status and custom fields.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_subscriber_by_id_with_http_info(format, apikey, mailing_list_id, subscriber_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to search the subscriber in. (required)
        :param str subscriber_id: The id of the subscriber being searched. (required)
        :return: GetSubscriberByIdResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'mailing_list_id', 'subscriber_id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_subscriber_by_id" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `get_subscriber_by_id`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `get_subscriber_by_id`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `get_subscriber_by_id`")
        # verify the required parameter 'subscriber_id' is set
        if ('subscriber_id' not in params) or (params['subscriber_id'] is None):
            raise ValueError("Missing the required parameter `subscriber_id` when calling `get_subscriber_by_id`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']
        if 'subscriber_id' in params:
            path_params['SubscriberID'] = params['subscriber_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/find/{SubscriberID}.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetSubscriberByIdResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def getting_subscribers(self, format, mailing_list_id, apikey, status, **kwargs):
        """
        Getting subscribers
        Gets a list of all subscribers in a given mailing list. You may filter the list by setting a date to fetch those subscribed since then and/or by their status. Because the results for this call could be quite big, paging information is required as input.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.getting_subscribers(format, mailing_list_id, apikey, status, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str mailing_list_id: The ID of the mailing list where the subscribers belong. (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str status: Specifies what type of subscriber statistics results will be returned. (required)
        :param float page: Specifies the page of subscriber statistics results will be returned.
        :param float page_size: Specifies the page size of subscriber statistics results will be returned.
        :return: GettingSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.getting_subscribers_with_http_info(format, mailing_list_id, apikey, status, **kwargs)
        else:
            (data) = self.getting_subscribers_with_http_info(format, mailing_list_id, apikey, status, **kwargs)
            return data

    def getting_subscribers_with_http_info(self, format, mailing_list_id, apikey, status, **kwargs):
        """
        Getting subscribers
        Gets a list of all subscribers in a given mailing list. You may filter the list by setting a date to fetch those subscribed since then and/or by their status. Because the results for this call could be quite big, paging information is required as input.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.getting_subscribers_with_http_info(format, mailing_list_id, apikey, status, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str mailing_list_id: The ID of the mailing list where the subscribers belong. (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str status: Specifies what type of subscriber statistics results will be returned. (required)
        :param float page: Specifies the page of subscriber statistics results will be returned.
        :param float page_size: Specifies the page size of subscriber statistics results will be returned.
        :return: GettingSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'mailing_list_id', 'apikey', 'status', 'page', 'page_size']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method getting_subscribers" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `getting_subscribers`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `getting_subscribers`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `getting_subscribers`")
        # verify the required parameter 'status' is set
        if ('status' not in params) or (params['status'] is None):
            raise ValueError("Missing the required parameter `status` when calling `getting_subscribers`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']
        if 'status' in params:
            path_params['Status'] = params['status']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))
        if 'page' in params:
            query_params.append(('Page', params['page']))
        if 'page_size' in params:
            query_params.append(('PageSize', params['page_size']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/lists/{MailingListID}/subscribers/{Status}.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GettingSubscribersResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def removing_a_subscriber(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Removing a subscriber
        Removes a subscriber from the specified mailing list permanently (without moving to the suppression list).
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.removing_a_subscriber(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to remove the subscriber from. (required)
        :param RemovingASubscriberRequest body:  (required)
        :return: RemovingASubscriberResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.removing_a_subscriber_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
        else:
            (data) = self.removing_a_subscriber_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
            return data

    def removing_a_subscriber_with_http_info(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Removing a subscriber
        Removes a subscriber from the specified mailing list permanently (without moving to the suppression list).
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.removing_a_subscriber_with_http_info(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to remove the subscriber from. (required)
        :param RemovingASubscriberRequest body:  (required)
        :return: RemovingASubscriberResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'mailing_list_id', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method removing_a_subscriber" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `removing_a_subscriber`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `removing_a_subscriber`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `removing_a_subscriber`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `removing_a_subscriber`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/remove.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='RemovingASubscriberResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def removing_multiple_subscribers(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Removing multiple subscribers
        Removes a list of subscribers from the specified mailing list permanently (without putting them in the suppression list). Any invalid email addresses specified will be ignored.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.removing_multiple_subscribers(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to remove the subscribers from. (required)
        :param RemovingMultipleSubscribersRequest body:  (required)
        :return: RemovingMultipleSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.removing_multiple_subscribers_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
        else:
            (data) = self.removing_multiple_subscribers_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
            return data

    def removing_multiple_subscribers_with_http_info(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Removing multiple subscribers
        Removes a list of subscribers from the specified mailing list permanently (without putting them in the suppression list). Any invalid email addresses specified will be ignored.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.removing_multiple_subscribers_with_http_info(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to remove the subscribers from. (required)
        :param RemovingMultipleSubscribersRequest body:  (required)
        :return: RemovingMultipleSubscribersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'mailing_list_id', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method removing_multiple_subscribers" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `removing_multiple_subscribers`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `removing_multiple_subscribers`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `removing_multiple_subscribers`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `removing_multiple_subscribers`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/remove_many.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='RemovingMultipleSubscribersResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def unsubscribing_subscribers_from_account(self, format, apikey, body, **kwargs):
        """
        Unsubscribing subscribers from account
        Unsubscribes a subscriber from the account.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unsubscribing_subscribers_from_account(format, apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param UnsubscribingSubscribersFromAccountRequest body:  (required)
        :return: UnsubscribingSubscribersFromAccountResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.unsubscribing_subscribers_from_account_with_http_info(format, apikey, body, **kwargs)
        else:
            (data) = self.unsubscribing_subscribers_from_account_with_http_info(format, apikey, body, **kwargs)
            return data

    def unsubscribing_subscribers_from_account_with_http_info(self, format, apikey, body, **kwargs):
        """
        Unsubscribing subscribers from account
        Unsubscribes a subscriber from the account.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unsubscribing_subscribers_from_account_with_http_info(format, apikey, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param UnsubscribingSubscribersFromAccountRequest body:  (required)
        :return: UnsubscribingSubscribersFromAccountResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method unsubscribing_subscribers_from_account" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `unsubscribing_subscribers_from_account`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `unsubscribing_subscribers_from_account`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `unsubscribing_subscribers_from_account`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/unsubscribe.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='UnsubscribingSubscribersFromAccountResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def unsubscribing_subscribers_from_mailing_list(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Unsubscribing subscribers from mailing list
        Unsubscribes a subscriber from the specified mailing list. The subscriber is not deleted, but moved to the suppression list.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unsubscribing_subscribers_from_mailing_list(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to add subscribers to. (required)
        :param UnsubscribingSubscribersFromMailingListRequest body:  (required)
        :return: UnsubscribingSubscribersFromMailingListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.unsubscribing_subscribers_from_mailing_list_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
        else:
            (data) = self.unsubscribing_subscribers_from_mailing_list_with_http_info(format, apikey, mailing_list_id, body, **kwargs)
            return data

    def unsubscribing_subscribers_from_mailing_list_with_http_info(self, format, apikey, mailing_list_id, body, **kwargs):
        """
        Unsubscribing subscribers from mailing list
        Unsubscribes a subscriber from the specified mailing list. The subscriber is not deleted, but moved to the suppression list.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unsubscribing_subscribers_from_mailing_list_with_http_info(format, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to add subscribers to. (required)
        :param UnsubscribingSubscribersFromMailingListRequest body:  (required)
        :return: UnsubscribingSubscribersFromMailingListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'mailing_list_id', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method unsubscribing_subscribers_from_mailing_list" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `unsubscribing_subscribers_from_mailing_list`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `unsubscribing_subscribers_from_mailing_list`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `unsubscribing_subscribers_from_mailing_list`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `unsubscribing_subscribers_from_mailing_list`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/unsubscribe.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='UnsubscribingSubscribersFromMailingListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign(self, format, campaign_id, apikey, mailing_list_id, body, **kwargs):
        """
        Unsubscribing subscribers from mailing list and a specified campaign
        Unsubscribes a subscriber from the specified mailing list and the specified campaign. The subscriber is not deleted, but moved to the suppression list.  This call will take into account the setting you have in \"suppression list and unsubscribe settings\" and will remove the subscriber from all other mailing lists or not accordingly.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign(format, campaign_id, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str campaign_id: The ID of the campaign that was sent to the specific mailing list. (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to remove the subscriber from. (required)
        :param UnsubscribingSubscribersFromMailingListAndASpecifiedCampaignRequest body:  (required)
        :return: UnsubscribingSubscribersFromMailingListAndASpecifiedCampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign_with_http_info(format, campaign_id, apikey, mailing_list_id, body, **kwargs)
        else:
            (data) = self.unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign_with_http_info(format, campaign_id, apikey, mailing_list_id, body, **kwargs)
            return data

    def unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign_with_http_info(self, format, campaign_id, apikey, mailing_list_id, body, **kwargs):
        """
        Unsubscribing subscribers from mailing list and a specified campaign
        Unsubscribes a subscriber from the specified mailing list and the specified campaign. The subscriber is not deleted, but moved to the suppression list.  This call will take into account the setting you have in \"suppression list and unsubscribe settings\" and will remove the subscriber from all other mailing lists or not accordingly.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign_with_http_info(format, campaign_id, apikey, mailing_list_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str campaign_id: The ID of the campaign that was sent to the specific mailing list. (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list to remove the subscriber from. (required)
        :param UnsubscribingSubscribersFromMailingListAndASpecifiedCampaignRequest body:  (required)
        :return: UnsubscribingSubscribersFromMailingListAndASpecifiedCampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'campaign_id', 'apikey', 'mailing_list_id', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign`")
        # verify the required parameter 'campaign_id' is set
        if ('campaign_id' not in params) or (params['campaign_id'] is None):
            raise ValueError("Missing the required parameter `campaign_id` when calling `unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `unsubscribing_subscribers_from_mailing_list_and_a_specified_campaign`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'campaign_id' in params:
            path_params['CampaignID'] = params['campaign_id']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/{CampaignID}/unsubscribe.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='UnsubscribingSubscribersFromMailingListAndASpecifiedCampaignResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def updating_a_subscriber(self, format, apikey, mailing_list_id, subscriber_id, body, **kwargs):
        """
        Updating a subscriber
        Updates a subscriber in the specified mailing list. You can even update the subscribers email, if he has not unsubscribed.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.updating_a_subscriber(format, apikey, mailing_list_id, subscriber_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list that contains the subscriber (required)
        :param str subscriber_id: The id of the subscriber to be updated (required)
        :param UpdatingASubscriberRequest body:  (required)
        :return: UpdatingASubscriberResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.updating_a_subscriber_with_http_info(format, apikey, mailing_list_id, subscriber_id, body, **kwargs)
        else:
            (data) = self.updating_a_subscriber_with_http_info(format, apikey, mailing_list_id, subscriber_id, body, **kwargs)
            return data

    def updating_a_subscriber_with_http_info(self, format, apikey, mailing_list_id, subscriber_id, body, **kwargs):
        """
        Updating a subscriber
        Updates a subscriber in the specified mailing list. You can even update the subscribers email, if he has not unsubscribed.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.updating_a_subscriber_with_http_info(format, apikey, mailing_list_id, subscriber_id, body, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str format:  (required)
        :param str apikey: You may find your API Key or generate a new one in your account settings. (required)
        :param str mailing_list_id: The ID of the mailing list that contains the subscriber (required)
        :param str subscriber_id: The id of the subscriber to be updated (required)
        :param UpdatingASubscriberRequest body:  (required)
        :return: UpdatingASubscriberResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'mailing_list_id', 'subscriber_id', 'body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method updating_a_subscriber" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'format' is set
        if ('format' not in params) or (params['format'] is None):
            raise ValueError("Missing the required parameter `format` when calling `updating_a_subscriber`")
        # verify the required parameter 'apikey' is set
        if ('apikey' not in params) or (params['apikey'] is None):
            raise ValueError("Missing the required parameter `apikey` when calling `updating_a_subscriber`")
        # verify the required parameter 'mailing_list_id' is set
        if ('mailing_list_id' not in params) or (params['mailing_list_id'] is None):
            raise ValueError("Missing the required parameter `mailing_list_id` when calling `updating_a_subscriber`")
        # verify the required parameter 'subscriber_id' is set
        if ('subscriber_id' not in params) or (params['subscriber_id'] is None):
            raise ValueError("Missing the required parameter `subscriber_id` when calling `updating_a_subscriber`")
        # verify the required parameter 'body' is set
        if ('body' not in params) or (params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `updating_a_subscriber`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'mailing_list_id' in params:
            path_params['MailingListID'] = params['mailing_list_id']
        if 'subscriber_id' in params:
            path_params['SubscriberID'] = params['subscriber_id']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = []

        return self.api_client.call_api('/subscribers/{MailingListID}/update/{SubscriberID}.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='UpdatingASubscriberResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)
