# coding: utf-8

"""
    SEKM analytical data API

    SEKM analytical data API  # noqa: E501

    OpenAPI spec version: 1.0.0
    Contact: info@sysnet.cz
    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 sekm_pump.api_client import ApiClient


class PublicApi(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 get_location(self, out_format, **kwargs):  # noqa: E501
        """Získá analytická data lokalit  # noqa: E501

        Na základě výběrových kritérií vrátí dataset analytických dat lokalit  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_location(out_format, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str out_format: Formát výstupního datasetu (required)
        :param bool a3p4: Lokality s prioritou pro průzkum a pro sanaci
        :param bool sa: Lokality poškozené Sovětskou armádou
        :param bool excluded: Vyloučené lokality
        :param bool indications: Indicie
        :param str name: Název lokality
        :param str territory: katastrální území (cadastral territory)
        :param str region: Kraj (VÚSC)
        :param str municipality: Obec s rozšířenou působností (ORP)
        :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.get_location_with_http_info(out_format, **kwargs)  # noqa: E501
        else:
            (data) = self.get_location_with_http_info(out_format, **kwargs)  # noqa: E501
            return data

    def get_location_with_http_info(self, out_format, **kwargs):  # noqa: E501
        """Získá analytická data lokalit  # noqa: E501

        Na základě výběrových kritérií vrátí dataset analytických dat lokalit  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_location_with_http_info(out_format, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str out_format: Formát výstupního datasetu (required)
        :param bool a3p4: Lokality s prioritou pro průzkum a pro sanaci
        :param bool sa: Lokality poškozené Sovětskou armádou
        :param bool excluded: Vyloučené lokality
        :param bool indications: Indicie
        :param str name: Název lokality
        :param str territory: katastrální území (cadastral territory)
        :param str region: Kraj (VÚSC)
        :param str municipality: Obec s rozšířenou působností (ORP)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['out_format', 'a3p4', 'sa', 'excluded', 'indications', 'name', 'territory', 'region', 'municipality']  # 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 get_location" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'out_format' is set
        if ('out_format' not in params or
                params['out_format'] is None):
            raise ValueError("Missing the required parameter `out_format` when calling `get_location`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'out_format' in params:
            path_params['out_format'] = params['out_format']  # noqa: E501

        query_params = []
        if 'a3p4' in params:
            query_params.append(('a3p4', params['a3p4']))  # noqa: E501
        if 'sa' in params:
            query_params.append(('sa', params['sa']))  # noqa: E501
        if 'excluded' in params:
            query_params.append(('excluded', params['excluded']))  # noqa: E501
        if 'indications' in params:
            query_params.append(('indications', params['indications']))  # noqa: E501
        if 'name' in params:
            query_params.append(('name', params['name']))  # noqa: E501
        if 'territory' in params:
            query_params.append(('territory', params['territory']))  # noqa: E501
        if 'region' in params:
            query_params.append(('region', params['region']))  # noqa: E501
        if 'municipality' in params:
            query_params.append(('municipality', params['municipality']))  # 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', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/x-zip-compressed'])  # noqa: E501

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

        return self.api_client.call_api(
            '/location/{out_format}', 'GET',
            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 get_location_geo_json(self, geom, **kwargs):  # noqa: E501
        """Získá vrstvu lokalit v GeoJson  # noqa: E501

        Na základě výběrových kritérií vrátí GeoJson vrstvu lokalit  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_location_geo_json(geom, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str geom: geometrie vrstvy (bod/polygon) (required)
        :param bool a3p4: Lokality s prioritou pro průzkum a pro sanaci
        :param bool sa: Lokality poškozené Sovětskou armádou
        :param bool excluded: Vyloučené lokality
        :param bool indications: Indicie
        :param str name: Název lokality
        :param str territory: katastrální území (cadastral territory)
        :param str region: Kraj (VÚSC)
        :param str municipality: Obec s rozšířenou působností (ORP)
        :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.get_location_geo_json_with_http_info(geom, **kwargs)  # noqa: E501
        else:
            (data) = self.get_location_geo_json_with_http_info(geom, **kwargs)  # noqa: E501
            return data

    def get_location_geo_json_with_http_info(self, geom, **kwargs):  # noqa: E501
        """Získá vrstvu lokalit v GeoJson  # noqa: E501

        Na základě výběrových kritérií vrátí GeoJson vrstvu lokalit  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_location_geo_json_with_http_info(geom, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str geom: geometrie vrstvy (bod/polygon) (required)
        :param bool a3p4: Lokality s prioritou pro průzkum a pro sanaci
        :param bool sa: Lokality poškozené Sovětskou armádou
        :param bool excluded: Vyloučené lokality
        :param bool indications: Indicie
        :param str name: Název lokality
        :param str territory: katastrální území (cadastral territory)
        :param str region: Kraj (VÚSC)
        :param str municipality: Obec s rozšířenou působností (ORP)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['geom', 'a3p4', 'sa', 'excluded', 'indications', 'name', 'territory', 'region', 'municipality']  # 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 get_location_geo_json" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'geom' is set
        if ('geom' not in params or
                params['geom'] is None):
            raise ValueError("Missing the required parameter `geom` when calling `get_location_geo_json`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'geom' in params:
            path_params['geom'] = params['geom']  # noqa: E501

        query_params = []
        if 'a3p4' in params:
            query_params.append(('a3p4', params['a3p4']))  # noqa: E501
        if 'sa' in params:
            query_params.append(('sa', params['sa']))  # noqa: E501
        if 'excluded' in params:
            query_params.append(('excluded', params['excluded']))  # noqa: E501
        if 'indications' in params:
            query_params.append(('indications', params['indications']))  # noqa: E501
        if 'name' in params:
            query_params.append(('name', params['name']))  # noqa: E501
        if 'territory' in params:
            query_params.append(('territory', params['territory']))  # noqa: E501
        if 'region' in params:
            query_params.append(('region', params['region']))  # noqa: E501
        if 'municipality' in params:
            query_params.append(('municipality', params['municipality']))  # 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']  # noqa: E501

        return self.api_client.call_api(
            '/location_layer/{geom}', 'GET',
            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 get_status(self, **kwargs):  # noqa: E501
        """Získá status klienta  # noqa: E501

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

        :param async_req bool
        :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.get_status_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_status_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_status_with_http_info(self, **kwargs):  # noqa: E501
        """Získá status klienta  # noqa: E501

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

        :param async_req bool
        :return: str
                 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 get_status" % 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/status', 'GET',
            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)
