# 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 LapReportApi(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 lap_report_disable_lap_report_reading(self, **kwargs):  # noqa: E501
        """[Command] Disables the lap report reading  # noqa: E501

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

        :param async_req bool
        :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.lap_report_disable_lap_report_reading_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.lap_report_disable_lap_report_reading_with_http_info(**kwargs)  # noqa: E501
            return data

    def lap_report_disable_lap_report_reading_with_http_info(self, **kwargs):  # noqa: E501
        """[Command] Disables the lap report reading  # noqa: E501

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

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/disablelapreportreading', '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 lap_report_enable_lap_report_reading(self, **kwargs):  # noqa: E501
        """[Command] Enables the lap report reading  # noqa: E501

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

        :param async_req bool
        :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.lap_report_enable_lap_report_reading_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.lap_report_enable_lap_report_reading_with_http_info(**kwargs)  # noqa: E501
            return data

    def lap_report_enable_lap_report_reading_with_http_info(self, **kwargs):  # noqa: E501
        """[Command] Enables the lap report reading  # noqa: E501

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

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/enablelapreportreading', '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 lap_report_get_lap_report_options(self, **kwargs):  # noqa: E501
        """Get the current lap report options  # noqa: E501

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

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

    def lap_report_get_lap_report_options_with_http_info(self, **kwargs):  # noqa: E501
        """Get the current lap report options  # noqa: E501

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

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/LapReportOptions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LapReportOptions',  # 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 lap_report_load_lap_report(self, file_path, lap_report_file_format, **kwargs):  # noqa: E501
        """Load a full lap report  # noqa: E501

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

        :param async_req bool
        :param str file_path: The lap report path (required)
        :param str lap_report_file_format: The lap report file format: Wintax or Atlas (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.lap_report_load_lap_report_with_http_info(file_path, lap_report_file_format, **kwargs)  # noqa: E501
        else:
            (data) = self.lap_report_load_lap_report_with_http_info(file_path, lap_report_file_format, **kwargs)  # noqa: E501
            return data

    def lap_report_load_lap_report_with_http_info(self, file_path, lap_report_file_format, **kwargs):  # noqa: E501
        """Load a full lap report  # noqa: E501

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

        :param async_req bool
        :param str file_path: The lap report path (required)
        :param str lap_report_file_format: The lap report file format: Wintax or Atlas (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'file_path' in params:
            query_params.append(('filePath', params['file_path']))  # noqa: E501
        if 'lap_report_file_format' in params:
            query_params.append(('lapReportFileFormat', params['lap_report_file_format']))  # 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/loadlapreport', '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 lap_report_set_lap_report_options(self, options, **kwargs):  # noqa: E501
        """[Command] Set the lap report options  # noqa: E501

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

        :param async_req bool
        :param LapReportOptions options: The lap report options (isSingleMode, file format, file path) (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.lap_report_set_lap_report_options_with_http_info(options, **kwargs)  # noqa: E501
        else:
            (data) = self.lap_report_set_lap_report_options_with_http_info(options, **kwargs)  # noqa: E501
            return data

    def lap_report_set_lap_report_options_with_http_info(self, options, **kwargs):  # noqa: E501
        """[Command] Set the lap report options  # noqa: E501

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

        :param async_req bool
        :param LapReportOptions options: The lap report options (isSingleMode, file format, file path) (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/lapreportoptions', '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)
