# coding: utf-8

"""
    Mauve Admin API

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

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


class PortalDocumentsApi(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 create_portal_document_payment_request_participantdocuments_document_numberpayments_post(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Create a payment for a specific document for a specific portal participant.  # noqa: E501

        Create a payment for a specific document for a specific portal participant.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_portal_document_payment_request_participantdocuments_document_numberpayments_post(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :param CreatePortalDocumentPaymentRequest body:
        :return: CreatePortalDocumentPaymentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_portal_document_payment_request_participantdocuments_document_numberpayments_post_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
        else:
            (data) = self.create_portal_document_payment_request_participantdocuments_document_numberpayments_post_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
            return data

    def create_portal_document_payment_request_participantdocuments_document_numberpayments_post_with_http_info(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Create a payment for a specific document for a specific portal participant.  # noqa: E501

        Create a payment for a specific document for a specific portal participant.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_portal_document_payment_request_participantdocuments_document_numberpayments_post_with_http_info(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :param CreatePortalDocumentPaymentRequest body:
        :return: CreatePortalDocumentPaymentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'participant' in params:
            path_params['Participant'] = params['participant']  # noqa: E501
        if 'document_number' in params:
            path_params['DocumentNumber'] = params['document_number']  # noqa: E501

        query_params = []

        header_params = {}
        if 'accept' in params:
            header_params['Accept'] = params['accept']  # noqa: E501

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/portal/{Participant}/documents/{DocumentNumber}/payments', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CreatePortalDocumentPaymentResponse',  # 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_portal_document_payment_request_participantdocuments_document_numberpayments_get(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Retrieve the payments of a specific document for a specific portal participant.  # noqa: E501

        Retrieve the payments of a specific document for a specific portal participant.  # 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_portal_document_payment_request_participantdocuments_document_numberpayments_get(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :return: GetPortalDocumentPaymentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_portal_document_payment_request_participantdocuments_document_numberpayments_get_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
        else:
            (data) = self.get_portal_document_payment_request_participantdocuments_document_numberpayments_get_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
            return data

    def get_portal_document_payment_request_participantdocuments_document_numberpayments_get_with_http_info(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Retrieve the payments of a specific document for a specific portal participant.  # noqa: E501

        Retrieve the payments of a specific document for a specific portal participant.  # 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_portal_document_payment_request_participantdocuments_document_numberpayments_get_with_http_info(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :return: GetPortalDocumentPaymentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'participant' in params:
            path_params['Participant'] = params['participant']  # noqa: E501
        if 'document_number' in params:
            path_params['DocumentNumber'] = params['document_number']  # noqa: E501

        query_params = []

        header_params = {}
        if 'accept' in params:
            header_params['Accept'] = params['accept']  # noqa: E501

        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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/portal/{Participant}/documents/{DocumentNumber}/payments', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPortalDocumentPaymentResponse',  # 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_portal_document_request_participantdocuments_document_number_get(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Retrieve a specific document for a specific portal participant.  # noqa: E501

        Retrieve a specific document for a specific portal participant.  # 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_portal_document_request_participantdocuments_document_number_get(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :param str include: Return additional data specified by a comma-separated list of values (current possible values: \"billing_address\", \"shipping_address\", \"document_lines\", \"document_lines\", \"document_lines_abda_artikelstamm\", \"payments\"\", \"parcel_labels\", \"prescription_images\",\"courier_service_delivery_slot\").
        :return: GetPortalDocumentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_portal_document_request_participantdocuments_document_number_get_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
        else:
            (data) = self.get_portal_document_request_participantdocuments_document_number_get_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
            return data

    def get_portal_document_request_participantdocuments_document_number_get_with_http_info(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Retrieve a specific document for a specific portal participant.  # noqa: E501

        Retrieve a specific document for a specific portal participant.  # 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_portal_document_request_participantdocuments_document_number_get_with_http_info(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :param str include: Return additional data specified by a comma-separated list of values (current possible values: \"billing_address\", \"shipping_address\", \"document_lines\", \"document_lines\", \"document_lines_abda_artikelstamm\", \"payments\"\", \"parcel_labels\", \"prescription_images\",\"courier_service_delivery_slot\").
        :return: GetPortalDocumentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'participant' in params:
            path_params['Participant'] = params['participant']  # noqa: E501
        if 'document_number' in params:
            path_params['DocumentNumber'] = params['document_number']  # noqa: E501

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

        header_params = {}
        if 'accept' in params:
            header_params['Accept'] = params['accept']  # noqa: E501

        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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/portal/{Participant}/documents/{DocumentNumber}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPortalDocumentResponse',  # 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 search_portal_document_request_participantdocuments_get(self, accept, participant, **kwargs):  # noqa: E501
        """Retrieve a list of documents for a specific portal participant.  # noqa: E501

        Retrieve a list of documents for a specific portal participant.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_portal_document_request_participantdocuments_get(accept, participant, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.)
        :param str order_number: An alphanumerical order number (in german: Auftrags-Nr.)
        :param list[int] document_typ_ids: A list of document type Ids (e.g. order, delivery note, goods receipt) (in german: Belegtyp) (Deprecated: please use \"DocumentTypeIds\")
        :param list[int] document_type_ids: A list of document type IDs (e.g. order, delivery note, goods receipt) (in german: Belegtyp)
        :param list[str] document_types: A list of document type names (e.g. order, delivery note, goods receipt) (in german: Belegtyp)
        :param list[int] shipment_method_ids: A list of shipment method IDs (e.g. courier service, pickup) (in german: Versandart)
        :param list[str] shipment_methods: A list of shipment method names (e.g. courier service, pickup) (in german: Versandart)
        :param datetime document_date_min: ...
        :param datetime document_date_max: ...
        :param str include: Return additional data specified by a comma-separated list of values (current possible values: \"billing_address\", \"shipping_address\", \"document_lines\", \"document_lines\", \"document_lines_abda_artikelstamm\", \"payments\"\", \"parcel_labels\", \"prescription_images\",\"courier_service_delivery_slot\").
        :param int offset: The (zero-based) offset of the first item in the collection to return (default: 0)
        :param int limit: The maximum number of entries to return. If the value exceeds the maximum, then the maximum value will be used. (default: 1000, maximum: 1000)
        :return: SearchPortalDocumentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.search_portal_document_request_participantdocuments_get_with_http_info(accept, participant, **kwargs)  # noqa: E501
        else:
            (data) = self.search_portal_document_request_participantdocuments_get_with_http_info(accept, participant, **kwargs)  # noqa: E501
            return data

    def search_portal_document_request_participantdocuments_get_with_http_info(self, accept, participant, **kwargs):  # noqa: E501
        """Retrieve a list of documents for a specific portal participant.  # noqa: E501

        Retrieve a list of documents for a specific portal participant.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_portal_document_request_participantdocuments_get_with_http_info(accept, participant, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.)
        :param str order_number: An alphanumerical order number (in german: Auftrags-Nr.)
        :param list[int] document_typ_ids: A list of document type Ids (e.g. order, delivery note, goods receipt) (in german: Belegtyp) (Deprecated: please use \"DocumentTypeIds\")
        :param list[int] document_type_ids: A list of document type IDs (e.g. order, delivery note, goods receipt) (in german: Belegtyp)
        :param list[str] document_types: A list of document type names (e.g. order, delivery note, goods receipt) (in german: Belegtyp)
        :param list[int] shipment_method_ids: A list of shipment method IDs (e.g. courier service, pickup) (in german: Versandart)
        :param list[str] shipment_methods: A list of shipment method names (e.g. courier service, pickup) (in german: Versandart)
        :param datetime document_date_min: ...
        :param datetime document_date_max: ...
        :param str include: Return additional data specified by a comma-separated list of values (current possible values: \"billing_address\", \"shipping_address\", \"document_lines\", \"document_lines\", \"document_lines_abda_artikelstamm\", \"payments\"\", \"parcel_labels\", \"prescription_images\",\"courier_service_delivery_slot\").
        :param int offset: The (zero-based) offset of the first item in the collection to return (default: 0)
        :param int limit: The maximum number of entries to return. If the value exceeds the maximum, then the maximum value will be used. (default: 1000, maximum: 1000)
        :return: SearchPortalDocumentResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['accept', 'participant', 'document_number', 'order_number', 'document_typ_ids', 'document_type_ids', 'document_types', 'shipment_method_ids', 'shipment_methods', 'document_date_min', 'document_date_max', 'include', 'offset', 'limit']  # 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 search_portal_document_request_participantdocuments_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'accept' is set
        if ('accept' not in params or
                params['accept'] is None):
            raise ValueError("Missing the required parameter `accept` when calling `search_portal_document_request_participantdocuments_get`")  # noqa: E501
        # verify the required parameter 'participant' is set
        if ('participant' not in params or
                params['participant'] is None):
            raise ValueError("Missing the required parameter `participant` when calling `search_portal_document_request_participantdocuments_get`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'document_number' in params:
            query_params.append(('DocumentNumber', params['document_number']))  # noqa: E501
        if 'order_number' in params:
            query_params.append(('OrderNumber', params['order_number']))  # noqa: E501
        if 'document_typ_ids' in params:
            query_params.append(('DocumentTypIds', params['document_typ_ids']))  # noqa: E501
            collection_formats['DocumentTypIds'] = 'multi'  # noqa: E501
        if 'document_type_ids' in params:
            query_params.append(('DocumentTypeIds', params['document_type_ids']))  # noqa: E501
            collection_formats['DocumentTypeIds'] = 'multi'  # noqa: E501
        if 'document_types' in params:
            query_params.append(('DocumentTypes', params['document_types']))  # noqa: E501
            collection_formats['DocumentTypes'] = 'multi'  # noqa: E501
        if 'shipment_method_ids' in params:
            query_params.append(('ShipmentMethodIds', params['shipment_method_ids']))  # noqa: E501
            collection_formats['ShipmentMethodIds'] = 'multi'  # noqa: E501
        if 'shipment_methods' in params:
            query_params.append(('ShipmentMethods', params['shipment_methods']))  # noqa: E501
            collection_formats['ShipmentMethods'] = 'multi'  # noqa: E501
        if 'document_date_min' in params:
            query_params.append(('DocumentDateMin', params['document_date_min']))  # noqa: E501
        if 'document_date_max' in params:
            query_params.append(('DocumentDateMax', params['document_date_max']))  # noqa: E501
        if 'include' in params:
            query_params.append(('Include', params['include']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('Offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('Limit', params['limit']))  # noqa: E501

        header_params = {}
        if 'accept' in params:
            header_params['Accept'] = params['accept']  # noqa: E501

        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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/portal/{Participant}/documents/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SearchPortalDocumentResponse',  # 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 update_portal_document_type_request_participantdocuments_document_numberdocument_type_create(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Update the document type of a specific document for a specific portal participant.  # noqa: E501

        Update the document type of a specific document for a specific portal participant.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_portal_document_type_request_participantdocuments_document_numberdocument_type_create(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :param UpdatePortalDocumentTypeRequest body:
        :return: UpdatePortalDocumentTypeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_portal_document_type_request_participantdocuments_document_numberdocument_type_create_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
        else:
            (data) = self.update_portal_document_type_request_participantdocuments_document_numberdocument_type_create_with_http_info(accept, participant, document_number, **kwargs)  # noqa: E501
            return data

    def update_portal_document_type_request_participantdocuments_document_numberdocument_type_create_with_http_info(self, accept, participant, document_number, **kwargs):  # noqa: E501
        """Update the document type of a specific document for a specific portal participant.  # noqa: E501

        Update the document type of a specific document for a specific portal participant.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_portal_document_type_request_participantdocuments_document_numberdocument_type_create_with_http_info(accept, participant, document_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param str document_number: Alphanumerical unique identifier of a document (always end with \"-B\") (in german: Beleg-Nr.) (required)
        :param UpdatePortalDocumentTypeRequest body:
        :return: UpdatePortalDocumentTypeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'participant' in params:
            path_params['Participant'] = params['participant']  # noqa: E501
        if 'document_number' in params:
            path_params['DocumentNumber'] = params['document_number']  # noqa: E501

        query_params = []

        header_params = {}
        if 'accept' in params:
            header_params['Accept'] = params['accept']  # noqa: E501

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/portal/{Participant}/documents/{DocumentNumber}/document_type', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='UpdatePortalDocumentTypeResponse',  # 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)
