# coding: utf-8

"""
    Trackside Software TeamDB API v2.0

    This API enables you to access TeamDB data  # noqa: E501

    OpenAPI spec version: 2.0
    Contact: support@trackside.fr
    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 teamdbapi.api_client import ApiClient


class ImportExportApi(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 import_export_export_xml_file(self, xml_data_format, source_id, output_file_path, **kwargs):  # noqa: E501
        """[Command] Export the data to an XML file for the current context.  # noqa: E501

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

        :param async_req bool
        :param str xml_data_format: The XML file format (Wintax or TeamDB) (required)
        :param str source_id: The Source ID string for which you want to export the data (required)
        :param str output_file_path: The path to the file to create. You have to provide the file extension for example : C:\\path\\MyFile.xml (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.import_export_export_xml_file_with_http_info(xml_data_format, source_id, output_file_path, **kwargs)  # noqa: E501
        else:
            (data) = self.import_export_export_xml_file_with_http_info(xml_data_format, source_id, output_file_path, **kwargs)  # noqa: E501
            return data

    def import_export_export_xml_file_with_http_info(self, xml_data_format, source_id, output_file_path, **kwargs):  # noqa: E501
        """[Command] Export the data to an XML file for the current context.  # noqa: E501

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

        :param async_req bool
        :param str xml_data_format: The XML file format (Wintax or TeamDB) (required)
        :param str source_id: The Source ID string for which you want to export the data (required)
        :param str output_file_path: The path to the file to create. You have to provide the file extension for example : C:\\path\\MyFile.xml (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['xml_data_format', 'source_id', 'output_file_path']  # 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 import_export_export_xml_file" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'xml_data_format' is set
        if self.api_client.client_side_validation and ('xml_data_format' not in params or
                                                       params['xml_data_format'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `xml_data_format` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'source_id' is set
        if self.api_client.client_side_validation and ('source_id' not in params or
                                                       params['source_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `source_id` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'output_file_path' is set
        if self.api_client.client_side_validation and ('output_file_path' not in params or
                                                       params['output_file_path'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `output_file_path` when calling `import_export_export_xml_file`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'xml_data_format' in params:
            query_params.append(('xmlDataFormat', params['xml_data_format']))  # noqa: E501
        if 'source_id' in params:
            query_params.append(('sourceId', params['source_id']))  # noqa: E501
        if 'output_file_path' in params:
            query_params.append(('outputFilePath', params['output_file_path']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/exportxmlfile', '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 import_export_export_xml_file(self, event_id, car_id, session_id, run_id, lap_id, xml_data_format, source_id, output_file_path, **kwargs):  # noqa: E501
        """[Command] Export the data to an XML file for the given context.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.import_export_export_xml_file(event_id, car_id, session_id, run_id, lap_id, xml_data_format, source_id, output_file_path, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str event_id: The event ID from which perform the export (required)
        :param str car_id: The car ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str session_id: The session ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str run_id: The run ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str lap_id: The lap ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str xml_data_format: The XML file format (Wintax or TeamDB) (required)
        :param str source_id: The Source ID string for which you want to export the data (required)
        :param str output_file_path: The path to the file to create. You have to provide the file extension for example : C:\\path\\MyFile.xml (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.import_export_export_xml_file_with_http_info(event_id, car_id, session_id, run_id, lap_id, xml_data_format, source_id, output_file_path, **kwargs)  # noqa: E501
        else:
            (data) = self.import_export_export_xml_file_with_http_info(event_id, car_id, session_id, run_id, lap_id, xml_data_format, source_id, output_file_path, **kwargs)  # noqa: E501
            return data

    def import_export_export_xml_file_with_http_info(self, event_id, car_id, session_id, run_id, lap_id, xml_data_format, source_id, output_file_path, **kwargs):  # noqa: E501
        """[Command] Export the data to an XML file for the given context.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.import_export_export_xml_file_with_http_info(event_id, car_id, session_id, run_id, lap_id, xml_data_format, source_id, output_file_path, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str event_id: The event ID from which perform the export (required)
        :param str car_id: The car ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str session_id: The session ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str run_id: The run ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str lap_id: The lap ID from which perform the export or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str xml_data_format: The XML file format (Wintax or TeamDB) (required)
        :param str source_id: The Source ID string for which you want to export the data (required)
        :param str output_file_path: The path to the file to create. You have to provide the file extension for example : C:\\path\\MyFile.xml (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['event_id', 'car_id', 'session_id', 'run_id', 'lap_id', 'xml_data_format', 'source_id', 'output_file_path']  # 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 import_export_export_xml_file" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'event_id' is set
        if self.api_client.client_side_validation and ('event_id' not in params or
                                                       params['event_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `event_id` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'car_id' is set
        if self.api_client.client_side_validation and ('car_id' not in params or
                                                       params['car_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `car_id` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'session_id' is set
        if self.api_client.client_side_validation and ('session_id' not in params or
                                                       params['session_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `session_id` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'run_id' is set
        if self.api_client.client_side_validation and ('run_id' not in params or
                                                       params['run_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `run_id` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'lap_id' is set
        if self.api_client.client_side_validation and ('lap_id' not in params or
                                                       params['lap_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `lap_id` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'xml_data_format' is set
        if self.api_client.client_side_validation and ('xml_data_format' not in params or
                                                       params['xml_data_format'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `xml_data_format` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'source_id' is set
        if self.api_client.client_side_validation and ('source_id' not in params or
                                                       params['source_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `source_id` when calling `import_export_export_xml_file`")  # noqa: E501
        # verify the required parameter 'output_file_path' is set
        if self.api_client.client_side_validation and ('output_file_path' not in params or
                                                       params['output_file_path'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `output_file_path` when calling `import_export_export_xml_file`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'event_id' in params:
            path_params['eventId'] = params['event_id']  # noqa: E501
        if 'car_id' in params:
            path_params['carId'] = params['car_id']  # noqa: E501
        if 'session_id' in params:
            path_params['sessionId'] = params['session_id']  # noqa: E501
        if 'run_id' in params:
            path_params['runId'] = params['run_id']  # noqa: E501
        if 'lap_id' in params:
            path_params['lapId'] = params['lap_id']  # noqa: E501

        query_params = []
        if 'xml_data_format' in params:
            query_params.append(('xmlDataFormat', params['xml_data_format']))  # noqa: E501
        if 'source_id' in params:
            query_params.append(('sourceId', params['source_id']))  # noqa: E501
        if 'output_file_path' in params:
            query_params.append(('outputFilePath', params['output_file_path']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/eventId/{eventId}/carId/{carId}/sessionId/{sessionId}/runId/{runId}/lapId/{lapId}/exportxmlfile', '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 import_export_import_excel_file(self, source_path, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an Excel file and a given source Path (sheet name)  # noqa: E501

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

        :param async_req bool
        :param str source_path: The source path configured in the teamdb fields that you want to import (required)
        :param str input_file_path: The Excel file path you want to import. For example : C:\\path\\MyFile.xlsx (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.import_export_import_excel_file_with_http_info(source_path, input_file_path, **kwargs)  # noqa: E501
        else:
            (data) = self.import_export_import_excel_file_with_http_info(source_path, input_file_path, **kwargs)  # noqa: E501
            return data

    def import_export_import_excel_file_with_http_info(self, source_path, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an Excel file and a given source Path (sheet name)  # noqa: E501

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

        :param async_req bool
        :param str source_path: The source path configured in the teamdb fields that you want to import (required)
        :param str input_file_path: The Excel file path you want to import. For example : C:\\path\\MyFile.xlsx (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'source_path' in params:
            query_params.append(('sourcePath', params['source_path']))  # noqa: E501
        if 'input_file_path' in params:
            query_params.append(('inputFilePath', params['input_file_path']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/importexcelfile', '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 import_export_import_excel_file(self, source_path, sheetname, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an Excel file and a given source Path (sheet name)  # noqa: E501

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

        :param async_req bool
        :param str source_path: The source path configured in the teamdb fields that you want to import (required)
        :param str sheetname: The sheet name in the file (required)
        :param str input_file_path: The Excel file path you want to import. For example : C:\\path\\MyFile.xlsx (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.import_export_import_excel_file_with_http_info(source_path, sheetname, input_file_path, **kwargs)  # noqa: E501
        else:
            (data) = self.import_export_import_excel_file_with_http_info(source_path, sheetname, input_file_path, **kwargs)  # noqa: E501
            return data

    def import_export_import_excel_file_with_http_info(self, source_path, sheetname, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an Excel file and a given source Path (sheet name)  # noqa: E501

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

        :param async_req bool
        :param str source_path: The source path configured in the teamdb fields that you want to import (required)
        :param str sheetname: The sheet name in the file (required)
        :param str input_file_path: The Excel file path you want to import. For example : C:\\path\\MyFile.xlsx (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['source_path', 'sheetname', 'input_file_path']  # 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 import_export_import_excel_file" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'source_path' is set
        if self.api_client.client_side_validation and ('source_path' not in params or
                                                       params['source_path'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `source_path` when calling `import_export_import_excel_file`")  # noqa: E501
        # verify the required parameter 'sheetname' is set
        if self.api_client.client_side_validation and ('sheetname' not in params or
                                                       params['sheetname'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `sheetname` when calling `import_export_import_excel_file`")  # noqa: E501
        # verify the required parameter 'input_file_path' is set
        if self.api_client.client_side_validation and ('input_file_path' not in params or
                                                       params['input_file_path'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `input_file_path` when calling `import_export_import_excel_file`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'source_path' in params:
            query_params.append(('sourcePath', params['source_path']))  # noqa: E501
        if 'sheetname' in params:
            query_params.append(('sheetname', params['sheetname']))  # noqa: E501
        if 'input_file_path' in params:
            query_params.append(('inputFilePath', params['input_file_path']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/importexcelsheet', '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 import_export_import_xml_file(self, source_id, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an XM Lfile and a given source Id  # noqa: E501

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

        :param async_req bool
        :param str source_id: The source ID configured in the teamdb fields that you want to import (required)
        :param str input_file_path: The XML file path you want to import. For example : C:\\path\\MyFile.xml (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.import_export_import_xml_file_with_http_info(source_id, input_file_path, **kwargs)  # noqa: E501
        else:
            (data) = self.import_export_import_xml_file_with_http_info(source_id, input_file_path, **kwargs)  # noqa: E501
            return data

    def import_export_import_xml_file_with_http_info(self, source_id, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an XM Lfile and a given source Id  # noqa: E501

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

        :param async_req bool
        :param str source_id: The source ID configured in the teamdb fields that you want to import (required)
        :param str input_file_path: The XML file path you want to import. For example : C:\\path\\MyFile.xml (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'source_id' in params:
            query_params.append(('sourceId', params['source_id']))  # noqa: E501
        if 'input_file_path' in params:
            query_params.append(('inputFilePath', params['input_file_path']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/importxmlfile', '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 import_export_import_xml_file(self, event_id, car_id, session_id, run_id, lap_id, source_id, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an XM Lfile and a given source Id  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.import_export_import_xml_file(event_id, car_id, session_id, run_id, lap_id, source_id, input_file_path, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str event_id: The event ID to which perform the import (required)
        :param str car_id: The car ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str session_id: The session ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str run_id: The run ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str lap_id: The lap ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str source_id: The source ID configured in the teamdb fields that you want to import (required)
        :param str input_file_path: The XML file path you want to import. For example : C:\\path\\MyFile.xml (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.import_export_import_xml_file_with_http_info(event_id, car_id, session_id, run_id, lap_id, source_id, input_file_path, **kwargs)  # noqa: E501
        else:
            (data) = self.import_export_import_xml_file_with_http_info(event_id, car_id, session_id, run_id, lap_id, source_id, input_file_path, **kwargs)  # noqa: E501
            return data

    def import_export_import_xml_file_with_http_info(self, event_id, car_id, session_id, run_id, lap_id, source_id, input_file_path, **kwargs):  # noqa: E501
        """[Command] Import the data from an XM Lfile and a given source Id  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.import_export_import_xml_file_with_http_info(event_id, car_id, session_id, run_id, lap_id, source_id, input_file_path, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str event_id: The event ID to which perform the import (required)
        :param str car_id: The car ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str session_id: The session ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str run_id: The run ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str lap_id: The lap ID to which perform the import or the empty id 00000000-0000-0000-0000-000000000000 (required)
        :param str source_id: The source ID configured in the teamdb fields that you want to import (required)
        :param str input_file_path: The XML file path you want to import. For example : C:\\path\\MyFile.xml (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['event_id', 'car_id', 'session_id', 'run_id', 'lap_id', 'source_id', 'input_file_path']  # 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 import_export_import_xml_file" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'event_id' is set
        if self.api_client.client_side_validation and ('event_id' not in params or
                                                       params['event_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `event_id` when calling `import_export_import_xml_file`")  # noqa: E501
        # verify the required parameter 'car_id' is set
        if self.api_client.client_side_validation and ('car_id' not in params or
                                                       params['car_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `car_id` when calling `import_export_import_xml_file`")  # noqa: E501
        # verify the required parameter 'session_id' is set
        if self.api_client.client_side_validation and ('session_id' not in params or
                                                       params['session_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `session_id` when calling `import_export_import_xml_file`")  # noqa: E501
        # verify the required parameter 'run_id' is set
        if self.api_client.client_side_validation and ('run_id' not in params or
                                                       params['run_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `run_id` when calling `import_export_import_xml_file`")  # noqa: E501
        # verify the required parameter 'lap_id' is set
        if self.api_client.client_side_validation and ('lap_id' not in params or
                                                       params['lap_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `lap_id` when calling `import_export_import_xml_file`")  # noqa: E501
        # verify the required parameter 'source_id' is set
        if self.api_client.client_side_validation and ('source_id' not in params or
                                                       params['source_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `source_id` when calling `import_export_import_xml_file`")  # noqa: E501
        # verify the required parameter 'input_file_path' is set
        if self.api_client.client_side_validation and ('input_file_path' not in params or
                                                       params['input_file_path'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `input_file_path` when calling `import_export_import_xml_file`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'event_id' in params:
            path_params['eventId'] = params['event_id']  # noqa: E501
        if 'car_id' in params:
            path_params['carId'] = params['car_id']  # noqa: E501
        if 'session_id' in params:
            path_params['sessionId'] = params['session_id']  # noqa: E501
        if 'run_id' in params:
            path_params['runId'] = params['run_id']  # noqa: E501
        if 'lap_id' in params:
            path_params['lapId'] = params['lap_id']  # noqa: E501

        query_params = []
        if 'source_id' in params:
            query_params.append(('sourceId', params['source_id']))  # noqa: E501
        if 'input_file_path' in params:
            query_params.append(('inputFilePath', params['input_file_path']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/eventId/{eventId}/carId/{carId}/sessionId/{sessionId}/runId/{runId}/lapId/{lapId}/importxmlfiletocontext', '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)
