# coding: utf-8

"""
    BioT Settings Service

    APIs document description for Settings service

    The version of the OpenAPI document: 2.44.1
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictBytes, StrictStr
from typing import Optional, Tuple, Union
from typing_extensions import Annotated
from biotmed_settings_sdk.models.search_request_v2 import SearchRequestV2
from biotmed_settings_sdk.models.search_response_locale_translations_overview import SearchResponseLocaleTranslationsOverview
from biotmed_settings_sdk.models.update_locale_translations_response import UpdateLocaleTranslationsResponse
from biotmed_settings_sdk.models.validate_locale_translations_response import ValidateLocaleTranslationsResponse

from biotmed_settings_sdk.api_client import ApiClient, RequestSerialized
from biotmed_settings_sdk.api_response import ApiResponse
from biotmed_settings_sdk.rest import RESTResponseType


class TranslationAPIApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

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


    @validate_call
    def delete_locale_translations(
        self,
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Delete all translations for locale

        Delete all translations for locale    The provided locale must be one of the available locales configured in the system via the Locale API. Cannot remove translations of the default locale   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_DELETE_LOCALE_TRANSLATIONS** permission(s).  

        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_locale_translations_serialize(
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '204': None,
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def delete_locale_translations_with_http_info(
        self,
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Delete all translations for locale

        Delete all translations for locale    The provided locale must be one of the available locales configured in the system via the Locale API. Cannot remove translations of the default locale   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_DELETE_LOCALE_TRANSLATIONS** permission(s).  

        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_locale_translations_serialize(
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '204': None,
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def delete_locale_translations_without_preload_content(
        self,
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete all translations for locale

        Delete all translations for locale    The provided locale must be one of the available locales configured in the system via the Locale API. Cannot remove translations of the default locale   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_DELETE_LOCALE_TRANSLATIONS** permission(s).  

        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_locale_translations_serialize(
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '204': None,
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _delete_locale_translations_serialize(
        self,
        locale,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if locale is not None:
            _path_params['locale'] = locale
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/v1/translations/{locale}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def download_locale_translation_file(
        self,
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> bytearray:
        """Download locale translation file

        Download locale translation file    Will return a CSV file with the following headers: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. The provided locale must be one of the available locales configured in the system via the Locale API   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_DOWNLOAD_LOCALE_TRANSLATION_FILE** permission(s).  

        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._download_locale_translation_file_serialize(
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "bytearray",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def download_locale_translation_file_with_http_info(
        self,
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[bytearray]:
        """Download locale translation file

        Download locale translation file    Will return a CSV file with the following headers: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. The provided locale must be one of the available locales configured in the system via the Locale API   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_DOWNLOAD_LOCALE_TRANSLATION_FILE** permission(s).  

        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._download_locale_translation_file_serialize(
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "bytearray",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def download_locale_translation_file_without_preload_content(
        self,
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Download locale translation file

        Download locale translation file    Will return a CSV file with the following headers: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. The provided locale must be one of the available locales configured in the system via the Locale API   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_DOWNLOAD_LOCALE_TRANSLATION_FILE** permission(s).  

        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._download_locale_translation_file_serialize(
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "bytearray",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _download_locale_translation_file_serialize(
        self,
        locale,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if locale is not None:
            _path_params['locale'] = locale
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'text/csv'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/translations/{locale}/download',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def search_locale_translation_overviews(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> SearchResponseLocaleTranslationsOverview:
        """Search Locale translations overview entities by filter

        Search Locale translations overview entities by filter  Returns list of Locale translations overview, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *locale* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *locale* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  coverage.numberOfAvailableKeys is the number of available keys that require a translation (i.e. the number of the system locale en-us translation keys but only those which have a non empty value). coverage.numberOfTranslatedKeys is the number of the translated keys that are a subset of the available keys that require a translation (as defined above)   Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_LOCALE_TRANSLATION_OVERVIEWS** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._search_locale_translation_overviews_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseLocaleTranslationsOverview",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def search_locale_translation_overviews_with_http_info(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[SearchResponseLocaleTranslationsOverview]:
        """Search Locale translations overview entities by filter

        Search Locale translations overview entities by filter  Returns list of Locale translations overview, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *locale* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *locale* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  coverage.numberOfAvailableKeys is the number of available keys that require a translation (i.e. the number of the system locale en-us translation keys but only those which have a non empty value). coverage.numberOfTranslatedKeys is the number of the translated keys that are a subset of the available keys that require a translation (as defined above)   Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_LOCALE_TRANSLATION_OVERVIEWS** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._search_locale_translation_overviews_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseLocaleTranslationsOverview",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def search_locale_translation_overviews_without_preload_content(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Search Locale translations overview entities by filter

        Search Locale translations overview entities by filter  Returns list of Locale translations overview, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *locale* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *locale* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  coverage.numberOfAvailableKeys is the number of available keys that require a translation (i.e. the number of the system locale en-us translation keys but only those which have a non empty value). coverage.numberOfTranslatedKeys is the number of the translated keys that are a subset of the available keys that require a translation (as defined above)   Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_LOCALE_TRANSLATION_OVERVIEWS** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._search_locale_translation_overviews_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseLocaleTranslationsOverview",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _search_locale_translation_overviews_serialize(
        self,
        search_request,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if search_request is not None:
            
            _query_params.append(('searchRequest', search_request))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/translations/overviews',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def update_locale_translations(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> UpdateLocaleTranslationsResponse:
        """Update translations for locale

        Update translations for locale    The file that is being uploaded should be in a csv format, as returned from the /download API. The provided locale must be one of the available locales configured in the system via the Locale API and cannot be the system locale (en-us). Providing only part of the translation keys is allowed. The following headers must be exist, and only once: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. In order to remove a translation for a single key, put an empty string. If all of the translation records are valid, a 200 status code will be returned and the invalidTranslations field will be empty. If one or more of the translation records are invalid, the rest of the valid translations will be saved and a 206 status code will be returned with a list of the invalid translations that were ignored. The following are the cases where a translation record will be considered as invalid: [invalid translation key / the system locale translation value does not match the current value in the system]   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_UPDATE_LOCALE_TRANSLATIONS** permission(s).  

        :param file: (required)
        :type file: bytearray
        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_locale_translations_serialize(
            file=file,
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "UpdateLocaleTranslationsResponse",
            '206': "UpdateLocaleTranslationsResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def update_locale_translations_with_http_info(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[UpdateLocaleTranslationsResponse]:
        """Update translations for locale

        Update translations for locale    The file that is being uploaded should be in a csv format, as returned from the /download API. The provided locale must be one of the available locales configured in the system via the Locale API and cannot be the system locale (en-us). Providing only part of the translation keys is allowed. The following headers must be exist, and only once: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. In order to remove a translation for a single key, put an empty string. If all of the translation records are valid, a 200 status code will be returned and the invalidTranslations field will be empty. If one or more of the translation records are invalid, the rest of the valid translations will be saved and a 206 status code will be returned with a list of the invalid translations that were ignored. The following are the cases where a translation record will be considered as invalid: [invalid translation key / the system locale translation value does not match the current value in the system]   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_UPDATE_LOCALE_TRANSLATIONS** permission(s).  

        :param file: (required)
        :type file: bytearray
        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_locale_translations_serialize(
            file=file,
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "UpdateLocaleTranslationsResponse",
            '206': "UpdateLocaleTranslationsResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def update_locale_translations_without_preload_content(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update translations for locale

        Update translations for locale    The file that is being uploaded should be in a csv format, as returned from the /download API. The provided locale must be one of the available locales configured in the system via the Locale API and cannot be the system locale (en-us). Providing only part of the translation keys is allowed. The following headers must be exist, and only once: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. In order to remove a translation for a single key, put an empty string. If all of the translation records are valid, a 200 status code will be returned and the invalidTranslations field will be empty. If one or more of the translation records are invalid, the rest of the valid translations will be saved and a 206 status code will be returned with a list of the invalid translations that were ignored. The following are the cases where a translation record will be considered as invalid: [invalid translation key / the system locale translation value does not match the current value in the system]   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_UPDATE_LOCALE_TRANSLATIONS** permission(s).  

        :param file: (required)
        :type file: bytearray
        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_locale_translations_serialize(
            file=file,
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "UpdateLocaleTranslationsResponse",
            '206': "UpdateLocaleTranslationsResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _update_locale_translations_serialize(
        self,
        file,
        locale,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if locale is not None:
            _path_params['locale'] = locale
        # process the query parameters
        # process the header parameters
        # process the form parameters
        if file is not None:
            _files['file'] = file
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'multipart/form-data'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PATCH',
            resource_path='/v1/translations/{locale}/update',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def validate_locale_translations(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ValidateLocaleTranslationsResponse:
        """Validate translations for locale

        Validate translations for locale    This API behaves exactly the same as the update API except that this API does not make any actual changes. The purpose of this API is to be able to validate all of the provided translation keys, before calling the update API, and get an error information for each invalid translation key, without ending with a partial success as happens when calling to the update API. The file that is being uploaded should be in a csv format, as returned from the /download API. The provided locale must be one of the available locales configured in the system via the Locale API and cannot be the system locale (en-us). Providing only part of the translation keys is allowed. The following headers must be exist, and only once: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. If all of the translation records are valid, a 200 status code will be returned and the invalidTranslations field will be empty. If one or more of the translation records are invalid, a 206 status code will be returned with a list of the invalid translations. The following are the cases where a translation record will be considered as invalid: [invalid translation key / the system locale translation value does not match the current value in the system]   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_VALIDATE_LOCALE_TRANSLATIONS** permission(s).  

        :param file: (required)
        :type file: bytearray
        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._validate_locale_translations_serialize(
            file=file,
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "ValidateLocaleTranslationsResponse",
            '206': "ValidateLocaleTranslationsResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def validate_locale_translations_with_http_info(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ValidateLocaleTranslationsResponse]:
        """Validate translations for locale

        Validate translations for locale    This API behaves exactly the same as the update API except that this API does not make any actual changes. The purpose of this API is to be able to validate all of the provided translation keys, before calling the update API, and get an error information for each invalid translation key, without ending with a partial success as happens when calling to the update API. The file that is being uploaded should be in a csv format, as returned from the /download API. The provided locale must be one of the available locales configured in the system via the Locale API and cannot be the system locale (en-us). Providing only part of the translation keys is allowed. The following headers must be exist, and only once: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. If all of the translation records are valid, a 200 status code will be returned and the invalidTranslations field will be empty. If one or more of the translation records are invalid, a 206 status code will be returned with a list of the invalid translations. The following are the cases where a translation record will be considered as invalid: [invalid translation key / the system locale translation value does not match the current value in the system]   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_VALIDATE_LOCALE_TRANSLATIONS** permission(s).  

        :param file: (required)
        :type file: bytearray
        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._validate_locale_translations_serialize(
            file=file,
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "ValidateLocaleTranslationsResponse",
            '206': "ValidateLocaleTranslationsResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def validate_locale_translations_without_preload_content(
        self,
        file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
        locale: StrictStr,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Validate translations for locale

        Validate translations for locale    This API behaves exactly the same as the update API except that this API does not make any actual changes. The purpose of this API is to be able to validate all of the provided translation keys, before calling the update API, and get an error information for each invalid translation key, without ending with a partial success as happens when calling to the update API. The file that is being uploaded should be in a csv format, as returned from the /download API. The provided locale must be one of the available locales configured in the system via the Locale API and cannot be the system locale (en-us). Providing only part of the translation keys is allowed. The following headers must be exist, and only once: Translation Key,System Locale (en-us) Translation,{providedLocale} Translation. If all of the translation records are valid, a 200 status code will be returned and the invalidTranslations field will be empty. If one or more of the translation records are invalid, a 206 status code will be returned with a list of the invalid translations. The following are the cases where a translation record will be considered as invalid: [invalid translation key / the system locale translation value does not match the current value in the system]   Path Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |locale|string|true|null||   This API requires **SETTINGS_VALIDATE_LOCALE_TRANSLATIONS** permission(s).  

        :param file: (required)
        :type file: bytearray
        :param locale: (required)
        :type locale: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._validate_locale_translations_serialize(
            file=file,
            locale=locale,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "ValidateLocaleTranslationsResponse",
            '206': "ValidateLocaleTranslationsResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '404': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _validate_locale_translations_serialize(
        self,
        file,
        locale,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if locale is not None:
            _path_params['locale'] = locale
        # process the query parameters
        # process the header parameters
        # process the form parameters
        if file is not None:
            _files['file'] = file
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'multipart/form-data'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/translations/{locale}/validate',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


