# 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 AdminsApi(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_template(self, doc_code, **kwargs):  # noqa: E501
        """Odstraní položku šablony PDF včetně všech souborů (cruD)  # 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_template(doc_code, async_req=True)
        >>> result = thread.get()

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

    def delete_template_with_http_info(self, doc_code, **kwargs):  # noqa: E501
        """Odstraní položku šablony PDF včetně všech souborů (cruD)  # 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_template_with_http_info(doc_code, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'doc_code' in params:
            path_params['doc_code'] = params['doc_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', 'text/plain; charset=utf-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/template/{doc_code}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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_template(self, doc_code, **kwargs):  # noqa: E501
        """Vrátí popis šablony (cRud)  # 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_template(doc_code, async_req=True)
        >>> result = thread.get()

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

    def get_template_with_http_info(self, doc_code, **kwargs):  # noqa: E501
        """Vrátí popis šablony (cRud)  # 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_template_with_http_info(doc_code, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'doc_code' in params:
            path_params['doc_code'] = params['doc_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', 'text/plain; charset=utf-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/template/{doc_code}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CitesDocumentTemplateType',  # 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_template_list(self, **kwargs):  # noqa: E501
        """Vrací seznam šablon  # 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_template_list(async_req=True)
        >>> result = thread.get()

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

    def get_template_list_with_http_info(self, **kwargs):  # noqa: E501
        """Vrací seznam šablon  # 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_template_list_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[CitesDocumentTemplateType]
                 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_template_list" % 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', 'text/plain; charset=utf-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/template', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[CitesDocumentTemplateType]',  # 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_template_item(self, **kwargs):  # noqa: E501
        """Zavede novou položku šablony (Crud)  # 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_template_item(async_req=True)
        >>> result = thread.get()

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

    def post_template_item_with_http_info(self, **kwargs):  # noqa: E501
        """Zavede novou položku šablony (Crud)  # 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_template_item_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CitesDocumentTemplateType body: Definice šablony
        :return: None
                 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_template_item" % 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(
            '/template', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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_template(self, doc_code, **kwargs):  # noqa: E501
        """Aktualizuje popis šablony (crUd)  # 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_template(doc_code, async_req=True)
        >>> result = thread.get()

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

    def put_template_with_http_info(self, doc_code, **kwargs):  # noqa: E501
        """Aktualizuje popis šablony (crUd)  # 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_template_with_http_info(doc_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str doc_code: (required)
        :param CitesDocumentTemplateType body: Definice šablony
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'doc_code' in params:
            path_params['doc_code'] = params['doc_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', '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(
            '/template/{doc_code}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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 upload_template_file_binary(self, doc_code, **kwargs):  # noqa: E501
        """Nahraje soubor se šablonou jiný formát (nař. zip))  # noqa: E501

        Toto je jediný způsob, jak uplodovat soubory se šablonami  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_template_file_binary(doc_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str doc_code: (required)
        :param Object body: Upload soubor
        :param bool enclosure: Indikátor, zda se jedná o šablonu přílohy nebo první stránky
        :param str filename: Nový název souboru. Pokud není zadáno, použije se název uložený v systému
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.upload_template_file_binary_with_http_info(doc_code, **kwargs)  # noqa: E501
        else:
            (data) = self.upload_template_file_binary_with_http_info(doc_code, **kwargs)  # noqa: E501
            return data

    def upload_template_file_binary_with_http_info(self, doc_code, **kwargs):  # noqa: E501
        """Nahraje soubor se šablonou jiný formát (nař. zip))  # noqa: E501

        Toto je jediný způsob, jak uplodovat soubory se šablonami  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_template_file_binary_with_http_info(doc_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str doc_code: (required)
        :param Object body: Upload soubor
        :param bool enclosure: Indikátor, zda se jedná o šablonu přílohy nebo první stránky
        :param str filename: Nový název souboru. Pokud není zadáno, použije se název uložený v systému
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

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

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

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

        return self.api_client.call_api(
            '/template/upload/binary/{doc_code}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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 upload_template_file_pdf(self, doc_code, **kwargs):  # noqa: E501
        """Nahraje soubor se šablonou PDF  # noqa: E501

        Toto je jediný způsob, jak uplodovat soubory se šablonami  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_template_file_pdf(doc_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str doc_code: (required)
        :param Object body: Upload soubor PDF
        :param bool enclosure: Indikátor, zda se jedná o šablonu přílohy nebo první stránky
        :param str filename: Nový název souboru. Pokud není zadáno, použije se název uložený v systému
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.upload_template_file_pdf_with_http_info(doc_code, **kwargs)  # noqa: E501
        else:
            (data) = self.upload_template_file_pdf_with_http_info(doc_code, **kwargs)  # noqa: E501
            return data

    def upload_template_file_pdf_with_http_info(self, doc_code, **kwargs):  # noqa: E501
        """Nahraje soubor se šablonou PDF  # noqa: E501

        Toto je jediný způsob, jak uplodovat soubory se šablonami  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_template_file_pdf_with_http_info(doc_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str doc_code: (required)
        :param Object body: Upload soubor PDF
        :param bool enclosure: Indikátor, zda se jedná o šablonu přílohy nebo první stránky
        :param str filename: Nový název souboru. Pokud není zadáno, použije se název uložený v systému
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

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

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

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

        return self.api_client.call_api(
            '/template/upload/pdf/{doc_code}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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 upload_template_file_xml(self, doc_code, **kwargs):  # noqa: E501
        """Nahraje soubor se šablonou XML  # noqa: E501

        Toto je jediný způsob, jak uplodovat soubory se šablonami  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_template_file_xml(doc_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str doc_code: (required)
        :param Object body: Upload soubor JRXML nebo jiné XML
        :param bool enclosure: Indikátor, zda se jedná o šablonu přílohy nebo první stránky
        :param str filename: Nový název souboru. Pokud není zadáno, použije se název uložený v systému
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.upload_template_file_xml_with_http_info(doc_code, **kwargs)  # noqa: E501
        else:
            (data) = self.upload_template_file_xml_with_http_info(doc_code, **kwargs)  # noqa: E501
            return data

    def upload_template_file_xml_with_http_info(self, doc_code, **kwargs):  # noqa: E501
        """Nahraje soubor se šablonou XML  # noqa: E501

        Toto je jediný způsob, jak uplodovat soubory se šablonami  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_template_file_xml_with_http_info(doc_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str doc_code: (required)
        :param Object body: Upload soubor JRXML nebo jiné XML
        :param bool enclosure: Indikátor, zda se jedná o šablonu přílohy nebo první stránky
        :param str filename: Nový název souboru. Pokud není zadáno, použije se název uložený v systému
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

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

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

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

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