# coding: utf-8

"""
    Allegro REST API

    https://developer.allegro.pl/about  # noqa: E501

    OpenAPI spec version: latest
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from allegro_api.api_client import ApiClient


class OrderManagementApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def create_order_shipments_using_post(self, id, checkout_form_add_waybill_request, **kwargs):  # noqa: E501
        """[BETA] Add a parcel tracking number  # noqa: E501

        Add a parcel tracking number (shipment) to given order line items.  # 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_order_shipments_using_post(id, checkout_form_add_waybill_request, async_req=True)
        >>> result = thread.get()

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

    def create_order_shipments_using_post_with_http_info(self, id, checkout_form_add_waybill_request, **kwargs):  # noqa: E501
        """[BETA] Add a parcel tracking number  # noqa: E501

        Add a parcel tracking number (shipment) to given order line items.  # 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_order_shipments_using_post_with_http_info(id, checkout_form_add_waybill_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: Order identifier (required)
        :param CheckoutFormAddWaybillRequest checkout_form_add_waybill_request: request (required)
        :return: CheckoutFormAddWaybillCreated
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['id', 'checkout_form_add_waybill_request']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_order_shipments_using_post" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'id' is set
        if ('id' not in local_var_params or
                local_var_params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `create_order_shipments_using_post`")  # noqa: E501
        # verify the required parameter 'checkout_form_add_waybill_request' is set
        if ('checkout_form_add_waybill_request' not in local_var_params or
                local_var_params['checkout_form_add_waybill_request'] is None):
            raise ValueError("Missing the required parameter `checkout_form_add_waybill_request` when calling `create_order_shipments_using_post`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in local_var_params:
            path_params['id'] = local_var_params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'checkout_form_add_waybill_request' in local_var_params:
            body_params = local_var_params['checkout_form_add_waybill_request']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.beta.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/order/checkout-forms/{id}/shipments', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CheckoutFormAddWaybillCreated',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def find_mapping(self, **kwargs):  # noqa: E501
        """[BETA] Get mapping for line item id  # noqa: E501

        [BETA] Allows mapping identifiers from dealId to lineItemId and vice-versa. One of defined query parameters has to be provided.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.find_mapping(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str line_item_id: line item id
        :param str deal_id: dealId
        :return: LineItemIdMappings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.find_mapping_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.find_mapping_with_http_info(**kwargs)  # noqa: E501
            return data

    def find_mapping_with_http_info(self, **kwargs):  # noqa: E501
        """[BETA] Get mapping for line item id  # noqa: E501

        [BETA] Allows mapping identifiers from dealId to lineItemId and vice-versa. One of defined query parameters has to be provided.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.find_mapping_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str line_item_id: line item id
        :param str deal_id: dealId
        :return: LineItemIdMappings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['line_item_id', 'deal_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method find_mapping" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'line_item_id' in local_var_params:
            query_params.append(('lineItemId', local_var_params['line_item_id']))  # noqa: E501
        if 'deal_id' in local_var_params:
            query_params.append(('dealId', local_var_params['deal_id']))  # 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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/order/line-item-id-mappings', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LineItemIdMappings',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_list_of_orders_using_get(self, **kwargs):  # noqa: E501
        """[BETA] Get the user's orders  # noqa: E501

        [BETA] Use this resource to get an order list. More information about this resource you can find <a href=\"/orders/#03\" target=\"_blank\">here</a>.  # 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_list_of_orders_using_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int offset: Index of first returned checkout-form from all search results.
        :param int limit: Maximum number of checkout-forms in response (acceptable values: from 0 to 100, default is 100).
        :param str status: Specify status value that checkout-forms must have to be included in the output. Allowed values are:   * `BOUGHT`: purchase without checkout form filled in   * `FILLED_IN`: checkout form filled in but payment is not completed yet so data could still change   * `READY_FOR_PROCESSING`: payment completed. Purchase is ready for processing.   * `ALL`: return all checkout-forms 
        :param datetime line_items_bought_at_lte: The upper bound of date time range from which checkout forms will be taken.
        :param datetime line_items_bought_at_gte: The lower bound of date time range from which checkout forms will be taken.
        :return: CheckoutForms
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_list_of_orders_using_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_list_of_orders_using_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_list_of_orders_using_get_with_http_info(self, **kwargs):  # noqa: E501
        """[BETA] Get the user's orders  # noqa: E501

        [BETA] Use this resource to get an order list. More information about this resource you can find <a href=\"/orders/#03\" target=\"_blank\">here</a>.  # 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_list_of_orders_using_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int offset: Index of first returned checkout-form from all search results.
        :param int limit: Maximum number of checkout-forms in response (acceptable values: from 0 to 100, default is 100).
        :param str status: Specify status value that checkout-forms must have to be included in the output. Allowed values are:   * `BOUGHT`: purchase without checkout form filled in   * `FILLED_IN`: checkout form filled in but payment is not completed yet so data could still change   * `READY_FOR_PROCESSING`: payment completed. Purchase is ready for processing.   * `ALL`: return all checkout-forms 
        :param datetime line_items_bought_at_lte: The upper bound of date time range from which checkout forms will be taken.
        :param datetime line_items_bought_at_gte: The lower bound of date time range from which checkout forms will be taken.
        :return: CheckoutForms
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['offset', 'limit', 'status', 'line_items_bought_at_lte', 'line_items_bought_at_gte']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_list_of_orders_using_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'offset' in local_var_params:
            query_params.append(('offset', local_var_params['offset']))  # noqa: E501
        if 'limit' in local_var_params:
            query_params.append(('limit', local_var_params['limit']))  # noqa: E501
        if 'status' in local_var_params:
            query_params.append(('status', local_var_params['status']))  # noqa: E501
        if 'line_items_bought_at_lte' in local_var_params:
            query_params.append(('lineItems.boughtAt.lte', local_var_params['line_items_bought_at_lte']))  # noqa: E501
        if 'line_items_bought_at_gte' in local_var_params:
            query_params.append(('lineItems.boughtAt.gte', local_var_params['line_items_bought_at_gte']))  # 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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/order/checkout-forms', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CheckoutForms',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_order_events_statistics_using_get(self, **kwargs):  # noqa: E501
        """[BETA] Get order events statistics  # noqa: E501

        [BETA] Use this resource to returns object that contains event id and occurrence date of the latest event. It gives you current starting point for reading events. More information about this resource you can find <a href=\"/orders/#02\" target=\"_blank\">here</a>.  # 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_order_events_statistics_using_get(async_req=True)
        >>> result = thread.get()

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

    def get_order_events_statistics_using_get_with_http_info(self, **kwargs):  # noqa: E501
        """[BETA] Get order events statistics  # noqa: E501

        [BETA] Use this resource to returns object that contains event id and occurrence date of the latest event. It gives you current starting point for reading events. More information about this resource you can find <a href=\"/orders/#02\" target=\"_blank\">here</a>.  # 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_order_events_statistics_using_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: OrderEventStats
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_order_events_statistics_using_get" % key
                )
            local_var_params[key] = val
        del local_var_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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/order/event-stats', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrderEventStats',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_order_events_using_get(self, **kwargs):  # noqa: E501
        """[BETA] Get order events  # noqa: E501

        [BETA] Use this resource to return events that allow you to monitor actions which clients perform, i.e. making a purchase, filling in the checkout form (FOD), finishing payment process, making a surcharge. More information about this resource you can find <a href=\"/orders/#02\" target=\"_blank\">here</a>.  # 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_order_events_using_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str _from: You can use the event ID to retrieve subsequent chunks of events
        :param list[str] type: Specify array of event types for filtering. Allowed values are:   * `BOUGHT`: purchase without checkout form filled in   * `FILLED_IN`: checkout form filled in but payment is not completed yet so data could still change   * `READY_FOR_PROCESSING`: payment completed. Purchase is ready for processing.
        :param int limit: Limit in the range of 1-1000
        :return: OrderEventsList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_order_events_using_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_order_events_using_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_order_events_using_get_with_http_info(self, **kwargs):  # noqa: E501
        """[BETA] Get order events  # noqa: E501

        [BETA] Use this resource to return events that allow you to monitor actions which clients perform, i.e. making a purchase, filling in the checkout form (FOD), finishing payment process, making a surcharge. More information about this resource you can find <a href=\"/orders/#02\" target=\"_blank\">here</a>.  # 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_order_events_using_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str _from: You can use the event ID to retrieve subsequent chunks of events
        :param list[str] type: Specify array of event types for filtering. Allowed values are:   * `BOUGHT`: purchase without checkout form filled in   * `FILLED_IN`: checkout form filled in but payment is not completed yet so data could still change   * `READY_FOR_PROCESSING`: payment completed. Purchase is ready for processing.
        :param int limit: Limit in the range of 1-1000
        :return: OrderEventsList
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['_from', 'type', '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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_order_events_using_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if '_from' in local_var_params:
            query_params.append(('from', local_var_params['_from']))  # noqa: E501
        if 'type' in local_var_params:
            query_params.append(('type', local_var_params['type']))  # noqa: E501
            collection_formats['type'] = 'multi'  # noqa: E501
        if 'limit' in local_var_params:
            query_params.append(('limit', local_var_params['limit']))  # 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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/order/events', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrderEventsList',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_order_shipments_using_get(self, id, **kwargs):  # noqa: E501
        """[BETA] Get a list of parcel tracking numbers  # noqa: E501

        Get a list of parcel tracking numbers currently assigned to the order. Orders can be retrieved using REST API resource GET /order/checkout-forms. Please note that the shipment list may contain parcel tracking numbers added through other channels such as Moje Allegro or by the carrier that delivers the parcel.  # 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_order_shipments_using_get(id, async_req=True)
        >>> result = thread.get()

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

    def get_order_shipments_using_get_with_http_info(self, id, **kwargs):  # noqa: E501
        """[BETA] Get a list of parcel tracking numbers  # noqa: E501

        Get a list of parcel tracking numbers currently assigned to the order. Orders can be retrieved using REST API resource GET /order/checkout-forms. Please note that the shipment list may contain parcel tracking numbers added through other channels such as Moje Allegro or by the carrier that delivers the parcel.  # 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_order_shipments_using_get_with_http_info(id, async_req=True)
        >>> result = thread.get()

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

        local_var_params = locals()

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_order_shipments_using_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'id' is set
        if ('id' not in local_var_params or
                local_var_params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `get_order_shipments_using_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in local_var_params:
            path_params['id'] = local_var_params['id']  # 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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/order/checkout-forms/{id}/shipments', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CheckoutFormOrderWaybillResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_orders_details_using_get(self, id, **kwargs):  # noqa: E501
        """[BETA] Get an order's details  # noqa: E501

        [BETA] Use this resource to get an order details. More information about this resource you can find <a href=\"/orders/#04\" target=\"_blank\">here</a>.  # 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_orders_details_using_get(id, async_req=True)
        >>> result = thread.get()

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

    def get_orders_details_using_get_with_http_info(self, id, **kwargs):  # noqa: E501
        """[BETA] Get an order's details  # noqa: E501

        [BETA] Use this resource to get an order details. More information about this resource you can find <a href=\"/orders/#04\" target=\"_blank\">here</a>.  # 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_orders_details_using_get_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: Checkout Form id (required)
        :return: CheckoutForm
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_orders_details_using_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'id' is set
        if ('id' not in local_var_params or
                local_var_params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `get_orders_details_using_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in local_var_params:
            path_params['id'] = local_var_params['id']  # 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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/order/checkout-forms/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CheckoutForm',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
