# coding: utf-8

"""
    CartoVista REST API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 2.0.0
    
    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 add_to_cartovista.swagger_client.api_client import ApiClient


class SignUpApi(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 sign_up_confirm_sign_up(self, body, user_id, confirmation_code, **kwargs):  # noqa: E501
        """Finalizes the organization creation.  # noqa: E501

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

        :param async_req bool
        :param ConfirmSignUpParameter body: (required)
        :param str user_id: (required)
        :param str confirmation_code: (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sign_up_confirm_sign_up_with_http_info(body, user_id, confirmation_code, **kwargs)  # noqa: E501
        else:
            (data) = self.sign_up_confirm_sign_up_with_http_info(body, user_id, confirmation_code, **kwargs)  # noqa: E501
            return data

    def sign_up_confirm_sign_up_with_http_info(self, body, user_id, confirmation_code, **kwargs):  # noqa: E501
        """Finalizes the organization creation.  # noqa: E501

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

        :param async_req bool
        :param ConfirmSignUpParameter body: (required)
        :param str user_id: (required)
        :param str confirmation_code: (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501
        if 'confirmation_code' in params:
            path_params['confirmationCode'] = params['confirmation_code']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = ['apiKey', 'bearer', 'secretKey']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/SignUp/{userId}/{confirmationCode}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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)

    def sign_up_get_all_demo_maps(self, **kwargs):  # noqa: E501
        """Get the basic info of all demo maps available.  # noqa: E501

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

        :param async_req bool
        :return: list[DemoMap]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sign_up_get_all_demo_maps_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.sign_up_get_all_demo_maps_with_http_info(**kwargs)  # noqa: E501
            return data

    def sign_up_get_all_demo_maps_with_http_info(self, **kwargs):  # noqa: E501
        """Get the basic info of all demo maps available.  # noqa: E501

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

        :param async_req bool
        :return: list[DemoMap]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # 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 sign_up_get_all_demo_maps" % 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'])  # noqa: E501

        # Authentication setting
        auth_settings = ['apiKey', 'bearer', 'secretKey']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/SignUp/demomaps', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[DemoMap]',  # 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)

    def sign_up_sign_up(self, body, **kwargs):  # noqa: E501
        """Creates a new organization in a pending state.  # noqa: E501

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

        :param async_req bool
        :param SignUpTrialParameter body: (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sign_up_sign_up_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.sign_up_sign_up_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def sign_up_sign_up_with_http_info(self, body, **kwargs):  # noqa: E501
        """Creates a new organization in a pending state.  # noqa: E501

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

        :param async_req bool
        :param SignUpTrialParameter body: (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = ['apiKey', 'bearer', 'secretKey']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/SignUp', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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)

    def sign_up_sign_up_license(self, body, **kwargs):  # noqa: E501
        """Creates a new organization with a license key.  # noqa: E501

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

        :param async_req bool
        :param SignUpLicenseParameter body: (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sign_up_sign_up_license_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.sign_up_sign_up_license_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def sign_up_sign_up_license_with_http_info(self, body, **kwargs):  # noqa: E501
        """Creates a new organization with a license key.  # noqa: E501

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

        :param async_req bool
        :param SignUpLicenseParameter body: (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = ['apiKey', 'bearer', 'secretKey']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/SignUp/license', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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)

    def sign_up_validate_company_name(self, company_name, **kwargs):  # noqa: E501
        """Checks if an organization name is already taken.  # noqa: E501

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

        :param async_req bool
        :param str company_name: (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sign_up_validate_company_name_with_http_info(company_name, **kwargs)  # noqa: E501
        else:
            (data) = self.sign_up_validate_company_name_with_http_info(company_name, **kwargs)  # noqa: E501
            return data

    def sign_up_validate_company_name_with_http_info(self, company_name, **kwargs):  # noqa: E501
        """Checks if an organization name is already taken.  # noqa: E501

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

        :param async_req bool
        :param str company_name: (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'company_name' in params:
            query_params.append(('companyName', params['company_name']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['apiKey', 'bearer', 'secretKey']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/SignUp/validateCompanyName', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='bool',  # 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)

    def sign_up_validate_sign_up_code(self, user_id, confirmation_code, **kwargs):  # noqa: E501
        """Checks if the sign up validation code has not expired.  # noqa: E501

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

        :param async_req bool
        :param str user_id: (required)
        :param str confirmation_code: (required)
        :return: UserReset
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sign_up_validate_sign_up_code_with_http_info(user_id, confirmation_code, **kwargs)  # noqa: E501
        else:
            (data) = self.sign_up_validate_sign_up_code_with_http_info(user_id, confirmation_code, **kwargs)  # noqa: E501
            return data

    def sign_up_validate_sign_up_code_with_http_info(self, user_id, confirmation_code, **kwargs):  # noqa: E501
        """Checks if the sign up validation code has not expired.  # noqa: E501

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

        :param async_req bool
        :param str user_id: (required)
        :param str confirmation_code: (required)
        :return: UserReset
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'user_id' in params:
            path_params['userId'] = params['user_id']  # noqa: E501
        if 'confirmation_code' in params:
            path_params['confirmationCode'] = params['confirmation_code']  # noqa: E501

        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'])  # noqa: E501

        # Authentication setting
        auth_settings = ['apiKey', 'bearer', 'secretKey']  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/SignUp/{userId}/{confirmationCode}/validate', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='UserReset',  # 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)
