# coding: utf-8

"""
    Kodexa

    Content Intelligence  # noqa: E501

    OpenAPI spec version: 2.0.132
    Contact: suppot@kodexa.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from kodexa_cloud.api_client import ApiClient


class EmailSubscriberControllerApi(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):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def add_using_post(self, **kwargs):  # noqa: E501
        """add  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_using_post(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str created_by:
        :param int created_on_date:
        :param int created_on_day:
        :param int created_on_hours:
        :param int created_on_minutes:
        :param int created_on_month:
        :param int created_on_nanos:
        :param int created_on_seconds:
        :param int created_on_time:
        :param int created_on_timezone_offset:
        :param int created_on_year:
        :param str email:
        :param str id:
        :param str updated_by:
        :param int updated_on_date:
        :param int updated_on_day:
        :param int updated_on_hours:
        :param int updated_on_minutes:
        :param int updated_on_month:
        :param int updated_on_nanos:
        :param int updated_on_seconds:
        :param int updated_on_time:
        :param int updated_on_timezone_offset:
        :param int updated_on_year:
        :param str uuid:
        :return: SubscriptionResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.add_using_post_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.add_using_post_with_http_info(**kwargs)  # noqa: E501
            return data

    def add_using_post_with_http_info(self, **kwargs):  # noqa: E501
        """add  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_using_post_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str created_by:
        :param int created_on_date:
        :param int created_on_day:
        :param int created_on_hours:
        :param int created_on_minutes:
        :param int created_on_month:
        :param int created_on_nanos:
        :param int created_on_seconds:
        :param int created_on_time:
        :param int created_on_timezone_offset:
        :param int created_on_year:
        :param str email:
        :param str id:
        :param str updated_by:
        :param int updated_on_date:
        :param int updated_on_day:
        :param int updated_on_hours:
        :param int updated_on_minutes:
        :param int updated_on_month:
        :param int updated_on_nanos:
        :param int updated_on_seconds:
        :param int updated_on_time:
        :param int updated_on_timezone_offset:
        :param int updated_on_year:
        :param str uuid:
        :return: SubscriptionResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['created_by', 'created_on_date', 'created_on_day', 'created_on_hours', 'created_on_minutes', 'created_on_month', 'created_on_nanos', 'created_on_seconds', 'created_on_time', 'created_on_timezone_offset', 'created_on_year', 'email', 'id', 'updated_by', 'updated_on_date', 'updated_on_day', 'updated_on_hours', 'updated_on_minutes', 'updated_on_month', 'updated_on_nanos', 'updated_on_seconds', 'updated_on_time', 'updated_on_timezone_offset', 'updated_on_year', 'uuid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method add_using_post" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'created_by' in params:
            query_params.append(('createdBy', params['created_by']))  # noqa: E501
        if 'created_on_date' in params:
            query_params.append(('createdOn.date', params['created_on_date']))  # noqa: E501
        if 'created_on_day' in params:
            query_params.append(('createdOn.day', params['created_on_day']))  # noqa: E501
        if 'created_on_hours' in params:
            query_params.append(('createdOn.hours', params['created_on_hours']))  # noqa: E501
        if 'created_on_minutes' in params:
            query_params.append(('createdOn.minutes', params['created_on_minutes']))  # noqa: E501
        if 'created_on_month' in params:
            query_params.append(('createdOn.month', params['created_on_month']))  # noqa: E501
        if 'created_on_nanos' in params:
            query_params.append(('createdOn.nanos', params['created_on_nanos']))  # noqa: E501
        if 'created_on_seconds' in params:
            query_params.append(('createdOn.seconds', params['created_on_seconds']))  # noqa: E501
        if 'created_on_time' in params:
            query_params.append(('createdOn.time', params['created_on_time']))  # noqa: E501
        if 'created_on_timezone_offset' in params:
            query_params.append(('createdOn.timezoneOffset', params['created_on_timezone_offset']))  # noqa: E501
        if 'created_on_year' in params:
            query_params.append(('createdOn.year', params['created_on_year']))  # noqa: E501
        if 'email' in params:
            query_params.append(('email', params['email']))  # noqa: E501
        if 'id' in params:
            query_params.append(('id', params['id']))  # noqa: E501
        if 'updated_by' in params:
            query_params.append(('updatedBy', params['updated_by']))  # noqa: E501
        if 'updated_on_date' in params:
            query_params.append(('updatedOn.date', params['updated_on_date']))  # noqa: E501
        if 'updated_on_day' in params:
            query_params.append(('updatedOn.day', params['updated_on_day']))  # noqa: E501
        if 'updated_on_hours' in params:
            query_params.append(('updatedOn.hours', params['updated_on_hours']))  # noqa: E501
        if 'updated_on_minutes' in params:
            query_params.append(('updatedOn.minutes', params['updated_on_minutes']))  # noqa: E501
        if 'updated_on_month' in params:
            query_params.append(('updatedOn.month', params['updated_on_month']))  # noqa: E501
        if 'updated_on_nanos' in params:
            query_params.append(('updatedOn.nanos', params['updated_on_nanos']))  # noqa: E501
        if 'updated_on_seconds' in params:
            query_params.append(('updatedOn.seconds', params['updated_on_seconds']))  # noqa: E501
        if 'updated_on_time' in params:
            query_params.append(('updatedOn.time', params['updated_on_time']))  # noqa: E501
        if 'updated_on_timezone_offset' in params:
            query_params.append(('updatedOn.timezoneOffset', params['updated_on_timezone_offset']))  # noqa: E501
        if 'updated_on_year' in params:
            query_params.append(('updatedOn.year', params['updated_on_year']))  # noqa: E501
        if 'uuid' in params:
            query_params.append(('uuid', params['uuid']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['*/*'])  # noqa: E501

        # Authentication setting
        auth_settings = ['basicAuth']  # noqa: E501

        return self.api_client.call_api(
            '/api/emailSubscriber', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriptionResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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)
