# 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 EditApi(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 edit_copy_from_tag(self, tag, copy_from_tags_args, **kwargs):  # noqa: E501
        """[Command] Copy values corresponding to the given Tag from a context to another  # noqa: E501

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

        :param async_req bool
        :param str tag: The tag corresponding to the values you want to copy (required)
        :param CopyFromTagsArgs copy_from_tags_args: The source and target context (event, car, session, run, lap) from which you want to copy the values (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.edit_copy_from_tag_with_http_info(tag, copy_from_tags_args, **kwargs)  # noqa: E501
        else:
            (data) = self.edit_copy_from_tag_with_http_info(tag, copy_from_tags_args, **kwargs)  # noqa: E501
            return data

    def edit_copy_from_tag_with_http_info(self, tag, copy_from_tags_args, **kwargs):  # noqa: E501
        """[Command] Copy values corresponding to the given Tag from a context to another  # noqa: E501

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

        :param async_req bool
        :param str tag: The tag corresponding to the values you want to copy (required)
        :param CopyFromTagsArgs copy_from_tags_args: The source and target context (event, car, session, run, lap) from which you want to copy the values (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'copy_from_tags_args' in params:
            body_params = params['copy_from_tags_args']
        # 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/tag/{tag}/copy', '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 edit_get_current_car_parameters_selected_context(self, **kwargs):  # noqa: E501
        """Get the current Car Parameters selected context in Parameters Editor view  # noqa: E501

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

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

    def edit_get_current_car_parameters_selected_context_with_http_info(self, **kwargs):  # noqa: E501
        """Get the current Car Parameters selected context in Parameters Editor view  # noqa: E501

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

        :param async_req bool
        :return: CarParametersContext
                 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 edit_get_current_car_parameters_selected_context" % 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/currentCarParametersContext', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CarParametersContext',  # 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 edit_get_current_selected_context(self, **kwargs):  # noqa: E501
        """Get the current selected notes 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.edit_get_current_selected_context(async_req=True)
        >>> result = thread.get()

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

    def edit_get_current_selected_context_with_http_info(self, **kwargs):  # noqa: E501
        """Get the current selected notes 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.edit_get_current_selected_context_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: NotesContext
                 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 edit_get_current_selected_context" % 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/currentcontext', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='NotesContext',  # 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 edit_set_current_context(self, event_id, car_id, session_id, run_id, lap_id, **kwargs):  # noqa: E501
        """[Command] Set the current Event, Car, Session, Run, Lap selected.  Enter the empty unique identifier value 00000000-0000-0000-0000-000000000000 to select the default value.  # noqa: E501

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

        :param async_req bool
        :param str event_id: The event unique id to select (required)
        :param str car_id: The car unique id to select (required)
        :param str session_id: The session unique id to select (required)
        :param str run_id: The run unique id to select (required)
        :param str lap_id: The lap unique id to select (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.edit_set_current_context_with_http_info(event_id, car_id, session_id, run_id, lap_id, **kwargs)  # noqa: E501
        else:
            (data) = self.edit_set_current_context_with_http_info(event_id, car_id, session_id, run_id, lap_id, **kwargs)  # noqa: E501
            return data

    def edit_set_current_context_with_http_info(self, event_id, car_id, session_id, run_id, lap_id, **kwargs):  # noqa: E501
        """[Command] Set the current Event, Car, Session, Run, Lap selected.  Enter the empty unique identifier value 00000000-0000-0000-0000-000000000000 to select the default value.  # noqa: E501

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

        :param async_req bool
        :param str event_id: The event unique id to select (required)
        :param str car_id: The car unique id to select (required)
        :param str session_id: The session unique id to select (required)
        :param str run_id: The run unique id to select (required)
        :param str lap_id: The lap unique id to select (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']  # 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 edit_set_current_context" % 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 `edit_set_current_context`")  # 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 `edit_set_current_context`")  # 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 `edit_set_current_context`")  # 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 `edit_set_current_context`")  # 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 `edit_set_current_context`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'event_id' in params:
            query_params.append(('eventId', params['event_id']))  # noqa: E501
        if 'car_id' in params:
            query_params.append(('carId', params['car_id']))  # noqa: E501
        if 'session_id' in params:
            query_params.append(('sessionId', params['session_id']))  # noqa: E501
        if 'run_id' in params:
            query_params.append(('runId', params['run_id']))  # noqa: E501
        if 'lap_id' in params:
            query_params.append(('lapId', params['lap_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/json', 'text/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

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