# 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 FixedFieldApi(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 fixed_field_get_fixed_field(self, fixed_field_id, **kwargs):  # noqa: E501
        """Get a fixed field via a unique 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.fixed_field_get_fixed_field(fixed_field_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str fixed_field_id: The unique fixed field id for which you want to get the fixed field (required)
        :return: FixedField
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.fixed_field_get_fixed_field_with_http_info(fixed_field_id, **kwargs)  # noqa: E501
        else:
            (data) = self.fixed_field_get_fixed_field_with_http_info(fixed_field_id, **kwargs)  # noqa: E501
            return data

    def fixed_field_get_fixed_field_with_http_info(self, fixed_field_id, **kwargs):  # noqa: E501
        """Get a fixed field via a unique 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.fixed_field_get_fixed_field_with_http_info(fixed_field_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str fixed_field_id: The unique fixed field id for which you want to get the fixed field (required)
        :return: FixedField
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'fixed_field_id' in params:
            path_params['fixedFieldId'] = params['fixed_field_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/json', 'text/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/fixedfield/{fixedFieldId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='FixedField',  # 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 fixed_field_get_fixed_field_value(self, fixed_field_id, parent_item_id, **kwargs):  # noqa: E501
        """Get a fixed field value via its unique id and and a parent entity unique 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.fixed_field_get_fixed_field_value(fixed_field_id, parent_item_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str fixed_field_id: The unique fixed field id for which you want to get the fixed field value (required)
        :param str parent_item_id: The parent item id for which you want to get the fixed field value (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.fixed_field_get_fixed_field_value_with_http_info(fixed_field_id, parent_item_id, **kwargs)  # noqa: E501
        else:
            (data) = self.fixed_field_get_fixed_field_value_with_http_info(fixed_field_id, parent_item_id, **kwargs)  # noqa: E501
            return data

    def fixed_field_get_fixed_field_value_with_http_info(self, fixed_field_id, parent_item_id, **kwargs):  # noqa: E501
        """Get a fixed field value via its unique id and and a parent entity unique 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.fixed_field_get_fixed_field_value_with_http_info(fixed_field_id, parent_item_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str fixed_field_id: The unique fixed field id for which you want to get the fixed field value (required)
        :param str parent_item_id: The parent item id for which you want to get the fixed field value (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'parent_item_id' in params:
            query_params.append(('parentItemId', params['parent_item_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/fixedfield/{fixedFieldId}/value', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # 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 fixed_field_get_fixed_fields(self, field_type, **kwargs):  # noqa: E501
        """Get the list of all fixed fields.  # noqa: E501

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

        :param async_req bool
        :param str field_type: The field type for which to return the fixed fields. (required)
        :return: list[CoupleGuidText]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.fixed_field_get_fixed_fields_with_http_info(field_type, **kwargs)  # noqa: E501
        else:
            (data) = self.fixed_field_get_fixed_fields_with_http_info(field_type, **kwargs)  # noqa: E501
            return data

    def fixed_field_get_fixed_fields_with_http_info(self, field_type, **kwargs):  # noqa: E501
        """Get the list of all fixed fields.  # noqa: E501

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

        :param async_req bool
        :param str field_type: The field type for which to return the fixed fields. (required)
        :return: list[CoupleGuidText]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'field_type' in params:
            path_params['fieldType'] = params['field_type']  # 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/json', 'text/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/teamdbapi/v2.0/fixedfields/{fieldType}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[CoupleGuidText]',  # 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)
