# 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 ResellerApi(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 add_credits(self, child_id, add_credits, **kwargs):
        """
        Add Email and/or SMS credits to a specific child account
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.add_credits(child_id, add_credits, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param AddCredits add_credits: Values to post to add credit to a specific child account (required)
        :return: RemainingCreditModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.add_credits_with_http_info(child_id, add_credits, **kwargs)
        else:
            (data) = self.add_credits_with_http_info(child_id, add_credits, **kwargs)
            return data

    def add_credits_with_http_info(self, child_id, add_credits, **kwargs):
        """
        Add Email and/or SMS credits to a specific child account
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.add_credits_with_http_info(child_id, add_credits, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param AddCredits add_credits: Values to post to add credit to a specific child account (required)
        :return: RemainingCreditModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        path_params = {}
        if 'child_id' in params:
            path_params['childId'] = params['child_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'add_credits' in params:
            body_params = params['add_credits']
        # 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('/reseller/children/{childId}/credits/add', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='RemainingCreditModel',
                                        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 associate_ip_to_child(self, child_id, ip_id, **kwargs):
        """
        Associate a dedicated IP to the child
        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.associate_ip_to_child(child_id, ip_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param ManageIp ip_id: IP's id (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.associate_ip_to_child_with_http_info(child_id, ip_id, **kwargs)
        else:
            (data) = self.associate_ip_to_child_with_http_info(child_id, ip_id, **kwargs)
            return data

    def associate_ip_to_child_with_http_info(self, child_id, ip_id, **kwargs):
        """
        Associate a dedicated IP to the child
        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.associate_ip_to_child_with_http_info(child_id, ip_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param ManageIp ip_id: IP's id (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        path_params = {}
        if 'child_id' in params:
            path_params['childId'] = params['child_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'ip_id' in params:
            body_params = params['ip_id']
        # 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('/reseller/children/{childId}/ips/associate', '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 create_reseller_child(self, **kwargs):
        """
        Creates a reseller child
        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_reseller_child(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param CreateChild reseller_child: reseller child to add
        :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_reseller_child_with_http_info(**kwargs)
        else:
            (data) = self.create_reseller_child_with_http_info(**kwargs)
            return data

    def create_reseller_child_with_http_info(self, **kwargs):
        """
        Creates a reseller child
        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_reseller_child_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param CreateChild reseller_child: reseller child to add
        :return: CreateModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'reseller_child' in params:
            body_params = params['reseller_child']
        # 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('/reseller/children', '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_reseller_child(self, child_id, **kwargs):
        """
        Deletes a single reseller child based on the childId supplied
        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_reseller_child(child_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (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_reseller_child_with_http_info(child_id, **kwargs)
        else:
            (data) = self.delete_reseller_child_with_http_info(child_id, **kwargs)
            return data

    def delete_reseller_child_with_http_info(self, child_id, **kwargs):
        """
        Deletes a single reseller child based on the childId supplied
        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_reseller_child_with_http_info(child_id, callback=callback_function)

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

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


        collection_formats = {}

        path_params = {}
        if 'child_id' in params:
            path_params['childId'] = params['child_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('/reseller/children/{childId}', '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 dissociate_ip_from_child(self, child_id, ip_id, **kwargs):
        """
        Dissociate a dedicated IP to the child
        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.dissociate_ip_from_child(child_id, ip_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param ManageIp ip_id: IP's id (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.dissociate_ip_from_child_with_http_info(child_id, ip_id, **kwargs)
        else:
            (data) = self.dissociate_ip_from_child_with_http_info(child_id, ip_id, **kwargs)
            return data

    def dissociate_ip_from_child_with_http_info(self, child_id, ip_id, **kwargs):
        """
        Dissociate a dedicated IP to the child
        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.dissociate_ip_from_child_with_http_info(child_id, ip_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param ManageIp ip_id: IP's id (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        path_params = {}
        if 'child_id' in params:
            path_params['childId'] = params['child_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'ip_id' in params:
            body_params = params['ip_id']
        # 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('/reseller/children/{childId}/ips/dissociate', '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 get_child_info(self, child_id, **kwargs):
        """
        Gets the info about a specific child account
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_child_info(child_id, callback=callback_function)

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

    def get_child_info_with_http_info(self, child_id, **kwargs):
        """
        Gets the info about a specific child account
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_child_info_with_http_info(child_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :return: GetChildInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['child_id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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


        collection_formats = {}

        path_params = {}
        if 'child_id' in params:
            path_params['childId'] = params['child_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('/reseller/children/{childId}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetChildInfo',
                                        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_reseller_childs(self, **kwargs):
        """
        Gets the list of all reseller's children accounts
        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_reseller_childs(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: GetChildrenList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_reseller_childs_with_http_info(**kwargs)
        else:
            (data) = self.get_reseller_childs_with_http_info(**kwargs)
            return data

    def get_reseller_childs_with_http_info(self, **kwargs):
        """
        Gets the list of all reseller's children accounts
        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_reseller_childs_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: GetChildrenList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        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('/reseller/children', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GetChildrenList',
                                        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 remove_credits(self, child_id, remove_credits, **kwargs):
        """
        Remove Email and/or SMS credits from a specific child account
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.remove_credits(child_id, remove_credits, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param RemoveCredits remove_credits: Values to post to remove email or SMS credits from a specific child account (required)
        :return: RemainingCreditModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.remove_credits_with_http_info(child_id, remove_credits, **kwargs)
        else:
            (data) = self.remove_credits_with_http_info(child_id, remove_credits, **kwargs)
            return data

    def remove_credits_with_http_info(self, child_id, remove_credits, **kwargs):
        """
        Remove Email and/or SMS credits from a specific child account
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.remove_credits_with_http_info(child_id, remove_credits, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param RemoveCredits remove_credits: Values to post to remove email or SMS credits from a specific child account (required)
        :return: RemainingCreditModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        path_params = {}
        if 'child_id' in params:
            path_params['childId'] = params['child_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'remove_credits' in params:
            body_params = params['remove_credits']
        # 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('/reseller/children/{childId}/credits/remove', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='RemainingCreditModel',
                                        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_reseller_child(self, child_id, reseller_child, **kwargs):
        """
        Updates infos of reseller's child based on the childId supplied
        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_reseller_child(child_id, reseller_child, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param UpdateChild reseller_child: values to update in child profile (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_reseller_child_with_http_info(child_id, reseller_child, **kwargs)
        else:
            (data) = self.update_reseller_child_with_http_info(child_id, reseller_child, **kwargs)
            return data

    def update_reseller_child_with_http_info(self, child_id, reseller_child, **kwargs):
        """
        Updates infos of reseller's child based on the childId supplied
        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_reseller_child_with_http_info(child_id, reseller_child, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int child_id: id of reseller's child (required)
        :param UpdateChild reseller_child: values to update in child profile (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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


        collection_formats = {}

        path_params = {}
        if 'child_id' in params:
            path_params['childId'] = params['child_id']

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'reseller_child' in params:
            body_params = params['reseller_child']
        # 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('/reseller/children/{childId}', '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)
