# 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 CampaignsApi(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 a_b_test_campaign_summary(self, format, apikey, campaign_id, **kwargs):
        """
        AB Test Campaign Summary
        Provides a basic summary of the results for a sent AB test campaign, separately for each version (A and B), such as the number of recipients, opens, clicks, bounces, unsubscribes, forwards etc to date.
        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.a_b_test_campaign_summary(format, apikey, campaign_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 campaign_id: The ID of the requested AB test campaign (required)
        :return: AbTestCampaignSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.a_b_test_campaign_summary_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.a_b_test_campaign_summary_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def a_b_test_campaign_summary_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        AB Test Campaign Summary
        Provides a basic summary of the results for a sent AB test campaign, separately for each version (A and B), such as the number of recipients, opens, clicks, bounces, unsubscribes, forwards etc to date.
        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.a_b_test_campaign_summary_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the requested AB test campaign (required)
        :return: AbTestCampaignSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 a_b_test_campaign_summary" % 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 `a_b_test_campaign_summary`")
        # 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 `a_b_test_campaign_summary`")
        # 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 `a_b_test_campaign_summary`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'campaign_id' in params:
            path_params['CampaignID'] = params['campaign_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('/campaigns/{CampaignID}/view_ab_summary.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='AbTestCampaignSummaryResponse',
                                        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 activity_by_location(self, format, apikey, campaign_id, **kwargs):
        """
        Activity By Location
        Returns a detailed report of your campaign opens (unique and total) by country.
        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.activity_by_location(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: ActivityByLocationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.activity_by_location_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.activity_by_location_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def activity_by_location_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        Activity By Location
        Returns a detailed report of your campaign opens (unique and total) by country.
        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.activity_by_location_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: ActivityByLocationResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 activity_by_location" % 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 `activity_by_location`")
        # 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 `activity_by_location`")
        # 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 `activity_by_location`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'campaign_id' in params:
            path_params['CampaignID'] = params['campaign_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('/campaigns/{CampaignID}/stats/countries.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='ActivityByLocationResponse',
                                        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 campaign_summary(self, format, apikey, campaign_id, **kwargs):
        """
        Campaign Summary
        Provides a basic summary of the results for any sent campaign such as the number of recipients, opens, clicks, bounces, unsubscribes, forwards etc. to date.
        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.campaign_summary(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: CampaignSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.campaign_summary_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.campaign_summary_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def campaign_summary_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        Campaign Summary
        Provides a basic summary of the results for any sent campaign such as the number of recipients, opens, clicks, bounces, unsubscribes, forwards etc. to date.
        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.campaign_summary_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: CampaignSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 campaign_summary" % 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 `campaign_summary`")
        # 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 `campaign_summary`")
        # 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 `campaign_summary`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'campaign_id' in params:
            path_params['CampaignID'] = params['campaign_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('/campaigns/{CampaignID}/view_summary.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='CampaignSummaryResponse',
                                        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 cloning_an_existing_campaign(self, format, campaign_id, apikey, **kwargs):
        """
        Cloning An Existing Campaign
        Creates an exact copy of an existing campaign. The new campaign is created as a draft.
        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.cloning_an_existing_campaign(format, campaign_id, apikey, callback=callback_function)

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

    def cloning_an_existing_campaign_with_http_info(self, format, campaign_id, apikey, **kwargs):
        """
        Cloning An Existing Campaign
        Creates an exact copy of an existing campaign. The new campaign is created as a draft.
        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.cloning_an_existing_campaign_with_http_info(format, campaign_id, apikey, callback=callback_function)

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

        all_params = ['format', 'campaign_id', 'apikey']
        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 cloning_an_existing_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 `cloning_an_existing_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 `cloning_an_existing_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 `cloning_an_existing_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']

        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('/campaigns/{CampaignID}/clone.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='CloningAnExistingCampaignResponse',
                                        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 creating_a_draft_campaign(self, format, apikey, body, **kwargs):
        """
        Creating A Draft Campaign
        Creates a new campaign in your account. This method does not send the campaign, but rather creates it as a draft, ready for sending or testing.  You can choose to send either a regular campaign or an AB split campaign. Campaign content must be specified from a web location.  Ignore ***(A/B Split Campaign Option)*** if you want to create a regular campaign.
        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.creating_a_draft_campaign(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 CreatingADraftCampaignRequest body:  (required)
        :return: CreatingADraftCampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.creating_a_draft_campaign_with_http_info(format, apikey, body, **kwargs)
        else:
            (data) = self.creating_a_draft_campaign_with_http_info(format, apikey, body, **kwargs)
            return data

    def creating_a_draft_campaign_with_http_info(self, format, apikey, body, **kwargs):
        """
        Creating A Draft Campaign
        Creates a new campaign in your account. This method does not send the campaign, but rather creates it as a draft, ready for sending or testing.  You can choose to send either a regular campaign or an AB split campaign. Campaign content must be specified from a web location.  Ignore ***(A/B Split Campaign Option)*** if you want to create a regular campaign.
        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.creating_a_draft_campaign_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 CreatingADraftCampaignRequest body:  (required)
        :return: CreatingADraftCampaignResponse
                 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 creating_a_draft_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 `creating_a_draft_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 `creating_a_draft_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 `creating_a_draft_campaign`")


        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('/campaigns/create.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='CreatingADraftCampaignResponse',
                                        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 deleting_a_campaign(self, format, apikey, campaign_id, **kwargs):
        """
        Deleting A Campaign
        Deletes a campaign from your account, draft or even sent.
        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.deleting_a_campaign(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to update. (required)
        :return: DeletingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.deleting_a_campaign_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.deleting_a_campaign_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def deleting_a_campaign_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        Deleting A Campaign
        Deletes a campaign from your account, draft or even sent.
        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.deleting_a_campaign_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to update. (required)
        :return: DeletingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 deleting_a_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 `deleting_a_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 `deleting_a_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 `deleting_a_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']

        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('/campaigns/{CampaignID}/delete.{Format}', 'DELETE',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='DeletingACampaignResponse',
                                        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_all_campaigns(self, format, apikey, **kwargs):
        """
        Get All Campaigns
        Returns a list of all campaigns in your account with detailed information. 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.get_all_campaigns(format, apikey, 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)
        :return: GetAllCampaignsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_all_campaigns_with_http_info(format, apikey, **kwargs)
        else:
            (data) = self.get_all_campaigns_with_http_info(format, apikey, **kwargs)
            return data

    def get_all_campaigns_with_http_info(self, format, apikey, **kwargs):
        """
        Get All Campaigns
        Returns a list of all campaigns in your account with detailed information. 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.get_all_campaigns_with_http_info(format, apikey, 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)
        :return: GetAllCampaignsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey']
        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_all_campaigns" % 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_all_campaigns`")
        # 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_all_campaigns`")


        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
        # 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('/campaigns.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetAllCampaignsResponse',
                                        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_campaign_statistics_with_paging__filtered(self, format, apikey, campaign_id, type, **kwargs):
        """
        Get Campaign Statistics With Paging & Filtered
        Returns a detailed list of statistics for a given campaign based on activity such as emails sent, opened, bounced, link clicked, etc.  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.get_campaign_statistics_with_paging__filtered(format, apikey, campaign_id, type, 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 campaign_id: The ID of the requested AB test campaign (required)
        :param str type: The type of the activity to display results for. This must be one of the following values : * Sent : To get information about when and to which recipients the campaign was sent. * Opened : To get information about who opened the campaign. * LinkClicked : To get information about who clicked on which link. * Forward : To get information about who forwarded the campaign using the relevant link on the email body and when. * Unsubscribed : To get information about who unsubscribed from the campaign by clicking on the unsubscribe link and when. * Bounced : To get information about which email recipients failed to receive the campaign. If not specified, the value Sent will be used by default. (required)
        :param str page: The page number to display results for. If not specified, the first page will be returned.
        :param str page_size: The maximum number of results per page. This must be a positive integer up to 100. If not specified, 50 results per page will be returned.  If a value greater than 100 is specified, it will be treated as 100.
        :param str _from: A date value that specifies since when to start returning results. If omitted, results will be returned from the moment the campaign was sent.
        :param str to: A date value that specifies up to when to return results. If omitted, results will be returned up to date.
        :return: GetCampaignStatisticsWithPagingFilteredResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_campaign_statistics_with_paging__filtered_with_http_info(format, apikey, campaign_id, type, **kwargs)
        else:
            (data) = self.get_campaign_statistics_with_paging__filtered_with_http_info(format, apikey, campaign_id, type, **kwargs)
            return data

    def get_campaign_statistics_with_paging__filtered_with_http_info(self, format, apikey, campaign_id, type, **kwargs):
        """
        Get Campaign Statistics With Paging & Filtered
        Returns a detailed list of statistics for a given campaign based on activity such as emails sent, opened, bounced, link clicked, etc.  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.get_campaign_statistics_with_paging__filtered_with_http_info(format, apikey, campaign_id, type, 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 campaign_id: The ID of the requested AB test campaign (required)
        :param str type: The type of the activity to display results for. This must be one of the following values : * Sent : To get information about when and to which recipients the campaign was sent. * Opened : To get information about who opened the campaign. * LinkClicked : To get information about who clicked on which link. * Forward : To get information about who forwarded the campaign using the relevant link on the email body and when. * Unsubscribed : To get information about who unsubscribed from the campaign by clicking on the unsubscribe link and when. * Bounced : To get information about which email recipients failed to receive the campaign. If not specified, the value Sent will be used by default. (required)
        :param str page: The page number to display results for. If not specified, the first page will be returned.
        :param str page_size: The maximum number of results per page. This must be a positive integer up to 100. If not specified, 50 results per page will be returned.  If a value greater than 100 is specified, it will be treated as 100.
        :param str _from: A date value that specifies since when to start returning results. If omitted, results will be returned from the moment the campaign was sent.
        :param str to: A date value that specifies up to when to return results. If omitted, results will be returned up to date.
        :return: GetCampaignStatisticsWithPagingFilteredResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_id', 'type', 'page', 'page_size', '_from', 'to']
        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_campaign_statistics_with_paging__filtered" % 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_campaign_statistics_with_paging__filtered`")
        # 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_campaign_statistics_with_paging__filtered`")
        # 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 `get_campaign_statistics_with_paging__filtered`")
        # verify the required parameter 'type' is set
        if ('type' not in params) or (params['type'] is None):
            raise ValueError("Missing the required parameter `type` when calling `get_campaign_statistics_with_paging__filtered`")


        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 'type' in params:
            path_params['Type'] = params['type']

        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']))
        if '_from' in params:
            query_params.append(('From', params['_from']))
        if 'to' in params:
            query_params.append(('To', params['to']))

        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('/campaigns/{CampaignID}/stats/{Type}.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetCampaignStatisticsWithPagingFilteredResponse',
                                        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_campaigns_by_page(self, format, apikey, page, **kwargs):
        """
        Get Campaigns By Page
        Returns a list of all campaigns in your account with detailed information. 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.get_campaigns_by_page(format, apikey, page, 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 float page: The page number to display results for. (required)
        :return: GetCampaignsByPageResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_campaigns_by_page_with_http_info(format, apikey, page, **kwargs)
        else:
            (data) = self.get_campaigns_by_page_with_http_info(format, apikey, page, **kwargs)
            return data

    def get_campaigns_by_page_with_http_info(self, format, apikey, page, **kwargs):
        """
        Get Campaigns By Page
        Returns a list of all campaigns in your account with detailed information. 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.get_campaigns_by_page_with_http_info(format, apikey, page, 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 float page: The page number to display results for. (required)
        :return: GetCampaignsByPageResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'page']
        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_campaigns_by_page" % 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_campaigns_by_page`")
        # 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_campaigns_by_page`")
        # verify the required parameter 'page' is set
        if ('page' not in params) or (params['page'] is None):
            raise ValueError("Missing the required parameter `page` when calling `get_campaigns_by_page`")


        collection_formats = {}

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

        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('/campaigns/{Page}.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetCampaignsByPageResponse',
                                        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_campaigns_by_page_and_pagesize(self, format, apikey, page, page_size, **kwargs):
        """
        Get Campaigns By Page And Pagesize
        Returns a list of all campaigns in your account with detailed information. 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.get_campaigns_by_page_and_pagesize(format, apikey, page, page_size, 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 float page: The page number to display results for. (required)
        :param float page_size: The maximum number of results per page.  This must be a positive integer up to 100. If not specified, 50 results per page will be returned.  If a value greater than 100 is specified, it will be treated as 100. (required)
        :param str short_by: The name of the campaign property to sort results by. If not specified, results will be sorted by the CreatedOn property
        :param str sort_method: The method to sort results: ASC for ascending, DESC for descending. If not specified, `ASC` will be assumed
        :return: GetCampaignsByPageAndPagesizeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_campaigns_by_page_and_pagesize_with_http_info(format, apikey, page, page_size, **kwargs)
        else:
            (data) = self.get_campaigns_by_page_and_pagesize_with_http_info(format, apikey, page, page_size, **kwargs)
            return data

    def get_campaigns_by_page_and_pagesize_with_http_info(self, format, apikey, page, page_size, **kwargs):
        """
        Get Campaigns By Page And Pagesize
        Returns a list of all campaigns in your account with detailed information. 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.get_campaigns_by_page_and_pagesize_with_http_info(format, apikey, page, page_size, 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 float page: The page number to display results for. (required)
        :param float page_size: The maximum number of results per page.  This must be a positive integer up to 100. If not specified, 50 results per page will be returned.  If a value greater than 100 is specified, it will be treated as 100. (required)
        :param str short_by: The name of the campaign property to sort results by. If not specified, results will be sorted by the CreatedOn property
        :param str sort_method: The method to sort results: ASC for ascending, DESC for descending. If not specified, `ASC` will be assumed
        :return: GetCampaignsByPageAndPagesizeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'page', 'page_size', 'short_by', 'sort_method']
        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_campaigns_by_page_and_pagesize" % 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_campaigns_by_page_and_pagesize`")
        # 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_campaigns_by_page_and_pagesize`")
        # verify the required parameter 'page' is set
        if ('page' not in params) or (params['page'] is None):
            raise ValueError("Missing the required parameter `page` when calling `get_campaigns_by_page_and_pagesize`")
        # verify the required parameter 'page_size' is set
        if ('page_size' not in params) or (params['page_size'] is None):
            raise ValueError("Missing the required parameter `page_size` when calling `get_campaigns_by_page_and_pagesize`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'page' in params:
            path_params['Page'] = params['page']
        if 'page_size' in params:
            path_params['PageSize'] = params['page_size']

        query_params = []
        if 'apikey' in params:
            query_params.append(('apikey', params['apikey']))
        if 'short_by' in params:
            query_params.append(('ShortBy', params['short_by']))
        if 'sort_method' in params:
            query_params.append(('SortMethod', params['sort_method']))

        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('/campaigns/{Page}/{PageSize}.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetCampaignsByPageAndPagesizeResponse',
                                        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_all_your_senders(self, format, apikey, **kwargs):
        """
        Getting All Your Senders
        Gets a list of your active senders in your account. You may specify any email address of these senders when sending a campaign.
        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_all_your_senders(format, apikey, 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)
        :return: GettingAllYourSendersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.getting_all_your_senders_with_http_info(format, apikey, **kwargs)
        else:
            (data) = self.getting_all_your_senders_with_http_info(format, apikey, **kwargs)
            return data

    def getting_all_your_senders_with_http_info(self, format, apikey, **kwargs):
        """
        Getting All Your Senders
        Gets a list of your active senders in your account. You may specify any email address of these senders when sending a campaign.
        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_all_your_senders_with_http_info(format, apikey, 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)
        :return: GettingAllYourSendersResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey']
        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_all_your_senders" % 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_all_your_senders`")
        # 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_all_your_senders`")


        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
        # 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('/senders/find_all.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GettingAllYourSendersResponse',
                                        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_campaign_details(self, format, apikey, campaign_id, **kwargs):
        """
        Getting Campaign Details
        Returns a complete set of properties that describe the requested campaign in detail. No statistics are included in the result.
        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_campaign_details(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: GettingCampaignDetailsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.getting_campaign_details_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.getting_campaign_details_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def getting_campaign_details_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        Getting Campaign Details
        Returns a complete set of properties that describe the requested campaign in detail. No statistics are included in the result.
        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_campaign_details_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: GettingCampaignDetailsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 getting_campaign_details" % 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_campaign_details`")
        # 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_campaign_details`")
        # 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 `getting_campaign_details`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'campaign_id' in params:
            path_params['CampaignID'] = params['campaign_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('/campaigns/{CampaignID}/view.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GettingCampaignDetailsResponse',
                                        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_sender_details(self, format, email, apikey, **kwargs):
        """
        Getting Sender Details
        Returns basic information for the specified sender identified by its email address.
        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_sender_details(format, email, apikey, callback=callback_function)

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

    def getting_sender_details_with_http_info(self, format, email, apikey, **kwargs):
        """
        Getting Sender Details
        Returns basic information for the specified sender identified by its email address.
        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_sender_details_with_http_info(format, email, apikey, callback=callback_function)

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

        all_params = ['format', 'email', 'apikey']
        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_sender_details" % 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_sender_details`")
        # 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 `getting_sender_details`")
        # 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_sender_details`")


        collection_formats = {}

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

        query_params = []
        if 'email' in params:
            query_params.append(('Email', params['email']))
        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('/senders/find_one.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GettingSenderDetailsResponse',
                                        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 link_activity(self, format, apikey, campaign_id, **kwargs):
        """
        Link Activity
        Returns a list with your campaign links and how many clicks have been made by your recipients, either unique or total.
        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.link_activity(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: LinkActivityResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.link_activity_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.link_activity_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def link_activity_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        Link Activity
        Returns a list with your campaign links and how many clicks have been made by your recipients, either unique or total.
        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.link_activity_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the requested campaign (required)
        :return: LinkActivityResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 link_activity" % 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 `link_activity`")
        # 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 `link_activity`")
        # 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 `link_activity`")


        collection_formats = {}

        path_params = {}
        if 'format' in params:
            path_params['Format'] = params['format']
        if 'campaign_id' in params:
            path_params['CampaignID'] = params['campaign_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('/campaigns/{CampaignID}/stats/links.{Format}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='LinkActivityResponse',
                                        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 scheduling_a_campaign(self, format, apikey, campaign_id, body, **kwargs):
        """
        Scheduling A Campaign
        Assigns a scheduled date and time at which the campaign will be delivered.
        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.scheduling_a_campaign(format, apikey, campaign_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 campaign_id: The ID of the campaign to be scheduled (required)
        :param SchedulingACampaignRequest body:  (required)
        :return: SchedulingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.scheduling_a_campaign_with_http_info(format, apikey, campaign_id, body, **kwargs)
        else:
            (data) = self.scheduling_a_campaign_with_http_info(format, apikey, campaign_id, body, **kwargs)
            return data

    def scheduling_a_campaign_with_http_info(self, format, apikey, campaign_id, body, **kwargs):
        """
        Scheduling A Campaign
        Assigns a scheduled date and time at which the campaign will be delivered.
        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.scheduling_a_campaign_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the campaign to be scheduled (required)
        :param SchedulingACampaignRequest body:  (required)
        :return: SchedulingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 scheduling_a_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 `scheduling_a_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 `scheduling_a_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 `scheduling_a_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 `scheduling_a_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']

        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('/campaigns/{CampaignID}/schedule.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='SchedulingACampaignResponse',
                                        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 sending_a_campaign(self, format, apikey, campaign_id, **kwargs):
        """
        Sending a campaign
        Sends an existing draft campaign to all recipients specified in its mailing list. The campaign is sent immediatelly.
        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.sending_a_campaign(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to be sent. (required)
        :return: SendingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.sending_a_campaign_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.sending_a_campaign_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def sending_a_campaign_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        Sending a campaign
        Sends an existing draft campaign to all recipients specified in its mailing list. The campaign is sent immediatelly.
        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.sending_a_campaign_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to be sent. (required)
        :return: SendingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 sending_a_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 `sending_a_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 `sending_a_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 `sending_a_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']

        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('/campaigns/{CampaignID}/send.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='SendingACampaignResponse',
                                        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 testing_a_campaign(self, format, apikey, campaign_id, body, **kwargs):
        """
        Testing a campaign
        Sends a test email of a draft campaign to a list of email addresses you specify for previewing.
        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.testing_a_campaign(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to be tested. (required)
        :param TestingACampaignRequest body:  (required)
        :return: TestingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.testing_a_campaign_with_http_info(format, apikey, campaign_id, body, **kwargs)
        else:
            (data) = self.testing_a_campaign_with_http_info(format, apikey, campaign_id, body, **kwargs)
            return data

    def testing_a_campaign_with_http_info(self, format, apikey, campaign_id, body, **kwargs):
        """
        Testing a campaign
        Sends a test email of a draft campaign to a list of email addresses you specify for previewing.
        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.testing_a_campaign_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to be tested. (required)
        :param TestingACampaignRequest body:  (required)
        :return: TestingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 testing_a_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 `testing_a_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 `testing_a_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 `testing_a_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 `testing_a_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']

        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('/campaigns/{CampaignID}/send_test.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='TestingACampaignResponse',
                                        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 unscheduling_a_campaign(self, format, apikey, campaign_id, **kwargs):
        """
        Unscheduling a campaign
        Removes a previously defined scheduled date and time from a campaign, so that it will be delivered immediately if already queued or when sent.
        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.unscheduling_a_campaign(format, apikey, campaign_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 campaign_id: The ID of the campaign to be scheduled (required)
        :return: UnschedulingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.unscheduling_a_campaign_with_http_info(format, apikey, campaign_id, **kwargs)
        else:
            (data) = self.unscheduling_a_campaign_with_http_info(format, apikey, campaign_id, **kwargs)
            return data

    def unscheduling_a_campaign_with_http_info(self, format, apikey, campaign_id, **kwargs):
        """
        Unscheduling a campaign
        Removes a previously defined scheduled date and time from a campaign, so that it will be delivered immediately if already queued or when sent.
        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.unscheduling_a_campaign_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the campaign to be scheduled (required)
        :return: UnschedulingACampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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 unscheduling_a_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 `unscheduling_a_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 `unscheduling_a_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 `unscheduling_a_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']

        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('/campaigns/{CampaignID}/unschedule.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='UnschedulingACampaignResponse',
                                        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_draft_campaign(self, format, apikey, campaign_id, body, **kwargs):
        """
        Updating A Draft Campaign
        Updates properties of an existing draft A/B campaign in your account. Non-draft campaigns cannot be updated. Ignore ***(A/B Split Campaign Option)*** if you want to create a regular campaign.
        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_draft_campaign(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to update. (required)
        :param UpdatingADraftCampaignRequest body:  (required)
        :return: UpdatingADraftCampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.updating_a_draft_campaign_with_http_info(format, apikey, campaign_id, body, **kwargs)
        else:
            (data) = self.updating_a_draft_campaign_with_http_info(format, apikey, campaign_id, body, **kwargs)
            return data

    def updating_a_draft_campaign_with_http_info(self, format, apikey, campaign_id, body, **kwargs):
        """
        Updating A Draft Campaign
        Updates properties of an existing draft A/B campaign in your account. Non-draft campaigns cannot be updated. Ignore ***(A/B Split Campaign Option)*** if you want to create a regular campaign.
        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_draft_campaign_with_http_info(format, apikey, campaign_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 campaign_id: The ID of the draft campaign to update. (required)
        :param UpdatingADraftCampaignRequest body:  (required)
        :return: UpdatingADraftCampaignResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format', 'apikey', 'campaign_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_draft_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 `updating_a_draft_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 `updating_a_draft_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 `updating_a_draft_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 `updating_a_draft_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']

        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('/campaigns/{CampaignID}/update.{Format}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='UpdatingADraftCampaignResponse',
                                        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)
