# coding: utf-8

"""
    SYSNET CRZP connector API

    SYSNET CRŽP connector REST API (IPPC & CITES extension)  # noqa: E501

    OpenAPI spec version: 1.1.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 crzp.api_client import ApiClient


class IppcApi(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 irz_facility_api(self, identifier, **kwargs):  # noqa: E501
        """Get IRZ facility detail  # noqa: E501

        Returns IRZ Facility details   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_api(identifier, async_req=True)
        >>> result = thread.get()

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

    def irz_facility_api_with_http_info(self, identifier, **kwargs):  # noqa: E501
        """Get IRZ facility detail  # noqa: E501

        Returns IRZ Facility details   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_api_with_http_info(identifier, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'identifier' in params:
            path_params['identifier'] = params['identifier']  # 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']  # noqa: E501

        return self.api_client.call_api(
            '/irz-facility/{identifier}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='IrzFacilityDetail',  # 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 irz_facility_ft_api(self, query, **kwargs):  # noqa: E501
        """Get all IRZ facilities by FT query  # noqa: E501

        Returns all IRZ facilities by FT query   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_ft_api(query, async_req=True)
        >>> result = thread.get()

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

    def irz_facility_ft_api_with_http_info(self, query, **kwargs):  # noqa: E501
        """Get all IRZ facilities by FT query  # noqa: E501

        Returns all IRZ facilities by FT query   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_ft_api_with_http_info(query, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'query' in params:
            query_params.append(('query', params['query']))  # 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(
            '/irz-facility', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='IrzFacilities',  # 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 irz_facility_ft_paging_api(self, begin, query, **kwargs):  # noqa: E501
        """Get all IRZ facilities by FT query (pagination)  # noqa: E501

        Returns all IRZ facilities from last returned identifier   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_ft_paging_api(begin, query, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str begin: if the previous query did not return all occurrences,  start searching from this identifier  (required)
        :param str query: Fulltext query content (required)
        :return: IrzFacilities
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.irz_facility_ft_paging_api_with_http_info(begin, query, **kwargs)  # noqa: E501
        else:
            (data) = self.irz_facility_ft_paging_api_with_http_info(begin, query, **kwargs)  # noqa: E501
            return data

    def irz_facility_ft_paging_api_with_http_info(self, begin, query, **kwargs):  # noqa: E501
        """Get all IRZ facilities by FT query (pagination)  # noqa: E501

        Returns all IRZ facilities from last returned identifier   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_ft_paging_api_with_http_info(begin, query, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str begin: if the previous query did not return all occurrences,  start searching from this identifier  (required)
        :param str query: Fulltext query content (required)
        :return: IrzFacilities
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'query' in params:
            query_params.append(('query', params['query']))  # 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(
            '/irz-facility/{begin}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='IrzFacilities',  # 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 irz_facility_operation_code_api(self, code, **kwargs):  # noqa: E501
        """Get all IRZ facility operations by facility identifier  # noqa: E501

        Returns all IRZ facility operations by facility identifier   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_operation_code_api(code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str code: IRZ Facility code (IČP) or (CRŽP) identifier (required)
        :return: IrzFacilityOperations
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.irz_facility_operation_code_api_with_http_info(code, **kwargs)  # noqa: E501
        else:
            (data) = self.irz_facility_operation_code_api_with_http_info(code, **kwargs)  # noqa: E501
            return data

    def irz_facility_operation_code_api_with_http_info(self, code, **kwargs):  # noqa: E501
        """Get all IRZ facility operations by facility identifier  # noqa: E501

        Returns all IRZ facility operations by facility identifier   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_operation_code_api_with_http_info(code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str code: IRZ Facility code (IČP) or (CRŽP) identifier (required)
        :return: IrzFacilityOperations
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'code' in params:
            path_params['code'] = params['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']  # noqa: E501

        return self.api_client.call_api(
            '/irz-facility-operation/facility/{code}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='IrzFacilityOperations',  # 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 irz_facility_operation_ft_api(self, query, **kwargs):  # noqa: E501
        """Get all IRZ facility operations by FT query  # noqa: E501

        Returns all IRZ facility operations by FT query   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_operation_ft_api(query, async_req=True)
        >>> result = thread.get()

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

    def irz_facility_operation_ft_api_with_http_info(self, query, **kwargs):  # noqa: E501
        """Get all IRZ facility operations by FT query  # noqa: E501

        Returns all IRZ facility operations by FT query   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_operation_ft_api_with_http_info(query, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'query' in params:
            query_params.append(('query', params['query']))  # 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(
            '/irz-facility-operation', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='IrzFacilityOperations',  # 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 irz_facility_operation_ft_paging_api(self, begin, query, **kwargs):  # noqa: E501
        """Get all IRZ facility operations by FT query (pagination)  # noqa: E501

        Returns all IRZ facility operations from last returned identifier   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_operation_ft_paging_api(begin, query, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str begin: if the previous query did not return all occurrences,  start searching from this identifier  (required)
        :param str query: Fulltext query content (required)
        :return: IrzFacilityOperations
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.irz_facility_operation_ft_paging_api_with_http_info(begin, query, **kwargs)  # noqa: E501
        else:
            (data) = self.irz_facility_operation_ft_paging_api_with_http_info(begin, query, **kwargs)  # noqa: E501
            return data

    def irz_facility_operation_ft_paging_api_with_http_info(self, begin, query, **kwargs):  # noqa: E501
        """Get all IRZ facility operations by FT query (pagination)  # noqa: E501

        Returns all IRZ facility operations from last returned identifier   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_operation_ft_paging_api_with_http_info(begin, query, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str begin: if the previous query did not return all occurrences,  start searching from this identifier  (required)
        :param str query: Fulltext query content (required)
        :return: IrzFacilityOperations
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'query' in params:
            query_params.append(('query', params['query']))  # 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(
            '/irz-facility-operation/{begin}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='IrzFacilityOperations',  # 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 irz_facility_pid_api(self, pid, **kwargs):  # noqa: E501
        """Get all IRZ facilities by IPPC PID  # noqa: E501

        Returns all IRZ facilities queried ba IPPC PID   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_pid_api(pid, async_req=True)
        >>> result = thread.get()

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

    def irz_facility_pid_api_with_http_info(self, pid, **kwargs):  # noqa: E501
        """Get all IRZ facilities by IPPC PID  # noqa: E501

        Returns all IRZ facilities queried ba IPPC PID   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.irz_facility_pid_api_with_http_info(pid, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'pid' in params:
            path_params['pid'] = params['pid']  # 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']  # noqa: E501

        return self.api_client.call_api(
            '/irz-facility/ippc/{pid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='IrzFacilities',  # 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)
