# coding: utf-8

"""
    SendinBlue API

    SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to :   - Manage your campaigns and get the statistics   - Manage your contacts   - Send transactional Emails and SMS   - and much more...  You can download our wrappers at https://github.com/orgs/sendinblue  **Possible responses**   | Code | Message |   | :-------------: | ------------- |   | 200  | OK. Successful Request  |   | 201  | OK. Successful Creation |   | 202  | OK. Request accepted |   | 204  | OK. Successful Update/Deletion  |   | 400  | Error. Bad Request  |   | 401  | Error. Authentication Needed  |   | 402  | Error. Not enough credit, plan upgrade needed  |   | 403  | Error. Permission denied  |   | 404  | Error. Object does not exist |   | 405  | Error. Method not allowed  | 

    OpenAPI spec version: 3.0.0
    Contact: contact@sendinblue.com
    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 SMSCampaignsApi(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 create_sms_campaign(self, create_sms_campaign, **kwargs):
        """
        Creates an SMS 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.create_sms_campaign(create_sms_campaign, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param CreateSmsCampaign create_sms_campaign: Values to create an SMS Campaign (required)
        :return: CreateModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_sms_campaign_with_http_info(create_sms_campaign, **kwargs)
        else:
            (data) = self.create_sms_campaign_with_http_info(create_sms_campaign, **kwargs)
            return data

    def create_sms_campaign_with_http_info(self, create_sms_campaign, **kwargs):
        """
        Creates an SMS 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.create_sms_campaign_with_http_info(create_sms_campaign, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param CreateSmsCampaign create_sms_campaign: Values to create an SMS Campaign (required)
        :return: CreateModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['create_sms_campaign']
        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 create_sms_campaign" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'create_sms_campaign' is set
        if ('create_sms_campaign' not in params) or (params['create_sms_campaign'] is None):
            raise ValueError("Missing the required parameter `create_sms_campaign` when calling `create_sms_campaign`")


        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'create_sms_campaign' in params:
            body_params = params['create_sms_campaign']
        # 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 = ['api-key']

        return self.api_client.call_api('/smsCampaigns', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='CreateModel',
                                        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 delete_sms_campaigns(self, campaign_id, **kwargs):
        """
        Delete the SMS 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.delete_sms_campaigns(campaign_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the SMS campaign (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.delete_sms_campaigns_with_http_info(campaign_id, **kwargs)
        else:
            (data) = self.delete_sms_campaigns_with_http_info(campaign_id, **kwargs)
            return data

    def delete_sms_campaigns_with_http_info(self, campaign_id, **kwargs):
        """
        Delete the SMS 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.delete_sms_campaigns_with_http_info(campaign_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the SMS campaign (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['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 delete_sms_campaigns" % key
                )
            params[key] = val
        del params['kwargs']
        # 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 `delete_sms_campaigns`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

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

        return self.api_client.call_api('/smsCampaigns/{campaignId}', 'DELETE',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=None,
                                        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_sms_campaign(self, campaign_id, get_sms_campaign, **kwargs):
        """
        Get an SMS 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.get_sms_campaign(campaign_id, get_sms_campaign, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the SMS campaign (required)
        :param GetSmsCampaign get_sms_campaign: Values to update an SMS Campaign (required)
        :return: GetSmsCampaign
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_sms_campaign_with_http_info(campaign_id, get_sms_campaign, **kwargs)
        else:
            (data) = self.get_sms_campaign_with_http_info(campaign_id, get_sms_campaign, **kwargs)
            return data

    def get_sms_campaign_with_http_info(self, campaign_id, get_sms_campaign, **kwargs):
        """
        Get an SMS 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.get_sms_campaign_with_http_info(campaign_id, get_sms_campaign, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the SMS campaign (required)
        :param GetSmsCampaign get_sms_campaign: Values to update an SMS Campaign (required)
        :return: GetSmsCampaign
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['campaign_id', 'get_sms_campaign']
        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_sms_campaign" % key
                )
            params[key] = val
        del params['kwargs']
        # 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_sms_campaign`")
        # verify the required parameter 'get_sms_campaign' is set
        if ('get_sms_campaign' not in params) or (params['get_sms_campaign'] is None):
            raise ValueError("Missing the required parameter `get_sms_campaign` when calling `get_sms_campaign`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'get_sms_campaign' in params:
            body_params = params['get_sms_campaign']
        # 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 = ['api-key']

        return self.api_client.call_api('/smsCampaigns/{campaignId}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetSmsCampaign',
                                        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_sms_campaigns(self, **kwargs):
        """
        Returns the informations for all your created SMS campaigns
        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_sms_campaigns(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str status: Status of campaign.
        :param int limit: Number limitation for the result returned
        :param int offset: Beginning point in the list to retrieve from.
        :return: GetSmsCampaigns
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_sms_campaigns_with_http_info(**kwargs)
        else:
            (data) = self.get_sms_campaigns_with_http_info(**kwargs)
            return data

    def get_sms_campaigns_with_http_info(self, **kwargs):
        """
        Returns the informations for all your created SMS campaigns
        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_sms_campaigns_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str status: Status of campaign.
        :param int limit: Number limitation for the result returned
        :param int offset: Beginning point in the list to retrieve from.
        :return: GetSmsCampaigns
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['status', 'limit', 'offset']
        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_sms_campaigns" % key
                )
            params[key] = val
        del params['kwargs']

        if 'limit' in params and params['limit'] > 1000:
            raise ValueError("Invalid value for parameter `limit` when calling `get_sms_campaigns`, must be a value less than or equal to `1000`")

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'status' in params:
            query_params.append(('status', params['status']))
        if 'limit' in params:
            query_params.append(('limit', params['limit']))
        if 'offset' in params:
            query_params.append(('offset', params['offset']))

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

        return self.api_client.call_api('/smsCampaigns', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetSmsCampaigns',
                                        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 request_sms_recipient_export(self, campaign_id, **kwargs):
        """
        Exports the recipients of the specified campaign.
        It returns the background process ID which on completion calls the notify URL that you have set in the 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.request_sms_recipient_export(campaign_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :param RequestSMSRecipientExport recipient_export: Values to send for a recipient export request
        :return: CreatedProcessId
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.request_sms_recipient_export_with_http_info(campaign_id, **kwargs)
        else:
            (data) = self.request_sms_recipient_export_with_http_info(campaign_id, **kwargs)
            return data

    def request_sms_recipient_export_with_http_info(self, campaign_id, **kwargs):
        """
        Exports the recipients of the specified campaign.
        It returns the background process ID which on completion calls the notify URL that you have set in the 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.request_sms_recipient_export_with_http_info(campaign_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :param RequestSMSRecipientExport recipient_export: Values to send for a recipient export request
        :return: CreatedProcessId
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['campaign_id', 'recipient_export']
        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 request_sms_recipient_export" % key
                )
            params[key] = val
        del params['kwargs']
        # 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 `request_sms_recipient_export`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'recipient_export' in params:
            body_params = params['recipient_export']
        # 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 = ['api-key']

        return self.api_client.call_api('/smsCampaigns/{campaignId}/exportRecipients', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='CreatedProcessId',
                                        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 send_sms_campaign_now(self, campaign_id, **kwargs):
        """
        Send your SMS campaign immediately
        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.send_sms_campaign_now(campaign_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.send_sms_campaign_now_with_http_info(campaign_id, **kwargs)
        else:
            (data) = self.send_sms_campaign_now_with_http_info(campaign_id, **kwargs)
            return data

    def send_sms_campaign_now_with_http_info(self, campaign_id, **kwargs):
        """
        Send your SMS campaign immediately
        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.send_sms_campaign_now_with_http_info(campaign_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['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 send_sms_campaign_now" % key
                )
            params[key] = val
        del params['kwargs']
        # 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 `send_sms_campaign_now`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

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

        return self.api_client.call_api('/smsCampaigns/{campaignId}/sendNow', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=None,
                                        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 send_sms_report(self, campaign_id, send_report, **kwargs):
        """
        Send report of SMS campaigns
        Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.
        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.send_sms_report(campaign_id, send_report, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :param SendReport send_report: Values for send a report (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.send_sms_report_with_http_info(campaign_id, send_report, **kwargs)
        else:
            (data) = self.send_sms_report_with_http_info(campaign_id, send_report, **kwargs)
            return data

    def send_sms_report_with_http_info(self, campaign_id, send_report, **kwargs):
        """
        Send report of SMS campaigns
        Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.
        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.send_sms_report_with_http_info(campaign_id, send_report, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :param SendReport send_report: Values for send a report (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['campaign_id', 'send_report']
        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 send_sms_report" % key
                )
            params[key] = val
        del params['kwargs']
        # 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 `send_sms_report`")
        # verify the required parameter 'send_report' is set
        if ('send_report' not in params) or (params['send_report'] is None):
            raise ValueError("Missing the required parameter `send_report` when calling `send_sms_report`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'send_report' in params:
            body_params = params['send_report']
        # 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 = ['api-key']

        return self.api_client.call_api('/smsCampaigns/{campaignId}/sendReport', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=None,
                                        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 send_test_sms(self, campaign_id, send_test_sms, **kwargs):
        """
        Send an SMS
        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.send_test_sms(campaign_id, send_test_sms, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: Id of the SMS campaign (required)
        :param SendTestSms send_test_sms: Mobile number to which send the test (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.send_test_sms_with_http_info(campaign_id, send_test_sms, **kwargs)
        else:
            (data) = self.send_test_sms_with_http_info(campaign_id, send_test_sms, **kwargs)
            return data

    def send_test_sms_with_http_info(self, campaign_id, send_test_sms, **kwargs):
        """
        Send an SMS
        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.send_test_sms_with_http_info(campaign_id, send_test_sms, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: Id of the SMS campaign (required)
        :param SendTestSms send_test_sms: Mobile number to which send the test (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['campaign_id', 'send_test_sms']
        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 send_test_sms" % key
                )
            params[key] = val
        del params['kwargs']
        # 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 `send_test_sms`")
        # verify the required parameter 'send_test_sms' is set
        if ('send_test_sms' not in params) or (params['send_test_sms'] is None):
            raise ValueError("Missing the required parameter `send_test_sms` when calling `send_test_sms`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'send_test_sms' in params:
            body_params = params['send_test_sms']
        # 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 = ['api-key']

        return self.api_client.call_api('/smsCampaigns/{campaignId}/sendTest', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=None,
                                        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 update_sms_campaign(self, campaign_id, update_sms_campaign, **kwargs):
        """
        Updates an SMS 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.update_sms_campaign(campaign_id, update_sms_campaign, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the SMS campaign (required)
        :param UpdateSmsCampaign update_sms_campaign: Values to update an SMS Campaign (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, **kwargs)
        else:
            (data) = self.update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, **kwargs)
            return data

    def update_sms_campaign_with_http_info(self, campaign_id, update_sms_campaign, **kwargs):
        """
        Updates an SMS 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.update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the SMS campaign (required)
        :param UpdateSmsCampaign update_sms_campaign: Values to update an SMS Campaign (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['campaign_id', 'update_sms_campaign']
        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 update_sms_campaign" % key
                )
            params[key] = val
        del params['kwargs']
        # 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 `update_sms_campaign`")
        # verify the required parameter 'update_sms_campaign' is set
        if ('update_sms_campaign' not in params) or (params['update_sms_campaign'] is None):
            raise ValueError("Missing the required parameter `update_sms_campaign` when calling `update_sms_campaign`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'update_sms_campaign' in params:
            body_params = params['update_sms_campaign']
        # 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 = ['api-key']

        return self.api_client.call_api('/smsCampaigns/{campaignId}', 'PUT',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=None,
                                        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 update_sms_campaign_status(self, campaign_id, status, **kwargs):
        """
        Update the campaign status
        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.update_sms_campaign_status(campaign_id, status, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :param UpdateCampaignStatus status: Status of the campaign. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_sms_campaign_status_with_http_info(campaign_id, status, **kwargs)
        else:
            (data) = self.update_sms_campaign_status_with_http_info(campaign_id, status, **kwargs)
            return data

    def update_sms_campaign_status_with_http_info(self, campaign_id, status, **kwargs):
        """
        Update the campaign status
        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.update_sms_campaign_status_with_http_info(campaign_id, status, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int campaign_id: id of the campaign (required)
        :param UpdateCampaignStatus status: Status of the campaign. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['campaign_id', 'status']
        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 update_sms_campaign_status" % key
                )
            params[key] = val
        del params['kwargs']
        # 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 `update_sms_campaign_status`")
        # verify the required parameter 'status' is set
        if ('status' not in params) or (params['status'] is None):
            raise ValueError("Missing the required parameter `status` when calling `update_sms_campaign_status`")


        collection_formats = {}

        path_params = {}
        if 'campaign_id' in params:
            path_params['campaignId'] = params['campaign_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'status' in params:
            body_params = params['status']
        # 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 = ['api-key']

        return self.api_client.call_api('/smsCampaigns/{campaignId}/status', 'PUT',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=None,
                                        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)
