# coding: utf-8

"""
    Dokumenty CITES

    API pro datový řadič dokumentů CITES ### Verze 1.0.0    - public   - developers  ### Verze 1.1.0    - admins   - additional   - statement   - attachments   - registration_cards   - permit   # 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 citesdoc_110.api_client import ApiClient


class AdditionalApi(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 delete_additional_document(self, identifier, **kwargs):  # noqa: E501
        """Odstraní dokument (cruD)  # noqa: E501

        Odstraní dokument CITES  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_additional_document(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (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.delete_additional_document_with_http_info(identifier, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_additional_document_with_http_info(identifier, **kwargs)  # noqa: E501
            return data

    def delete_additional_document_with_http_info(self, identifier, **kwargs):  # noqa: E501
        """Odstraní dokument (cruD)  # noqa: E501

        Odstraní dokument CITES  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_additional_document_with_http_info(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (required)
        :return: bool
                 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 delete_additional_document" % 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 `delete_additional_document`")  # 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', 'text/plain; charset=utf-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/additional/{identifier}', 'DELETE',
            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 get_additional_document(self, identifier, **kwargs):  # noqa: E501
        """Vrací konkrétní dodatečný dokument (cRud)  # noqa: E501

        Vrátí dodatečný dokument CITES  # 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_additional_document(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (required)
        :return: CitesDocumentAdditionalType
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_additional_document_with_http_info(identifier, **kwargs)  # noqa: E501
        else:
            (data) = self.get_additional_document_with_http_info(identifier, **kwargs)  # noqa: E501
            return data

    def get_additional_document_with_http_info(self, identifier, **kwargs):  # noqa: E501
        """Vrací konkrétní dodatečný dokument (cRud)  # noqa: E501

        Vrátí dodatečný dokument CITES  # 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_additional_document_with_http_info(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (required)
        :return: CitesDocumentAdditionalType
                 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 get_additional_document" % 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 `get_additional_document`")  # 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', 'text/plain; charset=utf-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/additional/{identifier}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CitesDocumentAdditionalType',  # 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_additional_list(self, **kwargs):  # noqa: E501
        """Vrací seznam dodatečných dokumentů  # 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_additional_list(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str parent: Identifikátor nařízeného dokument (PID, UUID, UNID)
        :param str doc_code:
        :param str creator: Klíčové slovo pro vyhledání dokumentu podle autora
        :param str key: předává klíčové slovo pro vyhledání dokumentů. Lomítka nahrazovat podtržítkem
        :param str search: předává text pro fulltextové vyhledání dokumentů
        :param int start: První dokument na stránce
        :param int page_size: Velikost stránky při stránkovaném výstupu
        :param int page: Číslo stránky výstupu
        :return: CitesDocumentAdditionalEntryListType
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_additional_list_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_additional_list_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_additional_list_with_http_info(self, **kwargs):  # noqa: E501
        """Vrací seznam dodatečných dokumentů  # 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_additional_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str parent: Identifikátor nařízeného dokument (PID, UUID, UNID)
        :param str doc_code:
        :param str creator: Klíčové slovo pro vyhledání dokumentu podle autora
        :param str key: předává klíčové slovo pro vyhledání dokumentů. Lomítka nahrazovat podtržítkem
        :param str search: předává text pro fulltextové vyhledání dokumentů
        :param int start: První dokument na stránce
        :param int page_size: Velikost stránky při stránkovaném výstupu
        :param int page: Číslo stránky výstupu
        :return: CitesDocumentAdditionalEntryListType
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['parent', 'doc_code', 'creator', 'key', 'search', 'start', 'page_size', 'page']  # 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_additional_list" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'parent' in params:
            query_params.append(('parent', params['parent']))  # noqa: E501
        if 'doc_code' in params:
            query_params.append(('doc_code', params['doc_code']))  # noqa: E501
        if 'creator' in params:
            query_params.append(('creator', params['creator']))  # noqa: E501
        if 'key' in params:
            query_params.append(('key', params['key']))  # noqa: E501
        if 'search' in params:
            query_params.append(('search', params['search']))  # noqa: E501
        if 'start' in params:
            query_params.append(('start', params['start']))  # noqa: E501
        if 'page_size' in params:
            query_params.append(('page_size', params['page_size']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # 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; charset=utf-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/additional', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CitesDocumentAdditionalEntryListType',  # 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_pdf_file_additional(self, identifier, **kwargs):  # noqa: E501
        """Vrací PDF dodatečného dokumentu  # noqa: E501

        Vrátí PDF dokumentu CITES  # 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_pdf_file_additional(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (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.get_pdf_file_additional_with_http_info(identifier, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pdf_file_additional_with_http_info(identifier, **kwargs)  # noqa: E501
            return data

    def get_pdf_file_additional_with_http_info(self, identifier, **kwargs):  # noqa: E501
        """Vrací PDF dodatečného dokumentu  # noqa: E501

        Vrátí PDF dokumentu CITES  # 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_pdf_file_additional_with_http_info(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (required)
        :return: str
                 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 get_pdf_file_additional" % 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 `get_pdf_file_additional`")  # 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/pdf', 'application/json', 'text/plain; charset=utf-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/additional/pdf/{identifier}', '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 post_additional_document(self, **kwargs):  # noqa: E501
        """Vloží nový dodatečný dokument  # noqa: E501

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

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

    def post_additional_document_with_http_info(self, **kwargs):  # noqa: E501
        """Vloží nový dodatečný dokument  # noqa: E501

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

        :param async_req bool
        :param CitesDocumentAdditionalType body:
        :return: CitesDocumentAdditionalType
                 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 post_additional_document" % key
                )
            params[key] = val
        del params['kwargs']

        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', 'text/plain; charset=utf-8'])  # 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 = ['api_key_auth']  # noqa: E501

        return self.api_client.call_api(
            '/additional', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CitesDocumentAdditionalType',  # 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 put_additional_document(self, identifier, **kwargs):  # noqa: E501
        """Aktualizuje dodatečný dokument (crUd)  # noqa: E501

        Aktualizuje dodatečný dokument CITES  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_additional_document(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (required)
        :param CitesDocumentAdditionalType body:
        :return: CitesDocumentAdditionalType
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.put_additional_document_with_http_info(identifier, **kwargs)  # noqa: E501
        else:
            (data) = self.put_additional_document_with_http_info(identifier, **kwargs)  # noqa: E501
            return data

    def put_additional_document_with_http_info(self, identifier, **kwargs):  # noqa: E501
        """Aktualizuje dodatečný dokument (crUd)  # noqa: E501

        Aktualizuje dodatečný dokument CITES  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_additional_document_with_http_info(identifier, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str identifier: Identifikátor dokumentu (PID nebo UNID) (required)
        :param CitesDocumentAdditionalType body:
        :return: CitesDocumentAdditionalType
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['identifier', '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 put_additional_document" % 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 `put_additional_document`")  # 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
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain; charset=utf-8'])  # 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 = ['api_key_auth']  # noqa: E501

        return self.api_client.call_api(
            '/additional/{identifier}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CitesDocumentAdditionalType',  # 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)
