# coding: utf-8

"""
    ThingsBoard REST API

     ThingsBoard Professional Edition IoT platform REST API documentation.  # noqa: E501

    OpenAPI spec version: 3.9.0PE
    Contact: info@thingsboard.io
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

#  Copyright 2025. ThingsBoard
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from tb_rest_client.api_client import ApiClient


class CustomTranslationControllerApi(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 get_custom_translation_using_get(self, **kwargs):  # noqa: E501
        """Get end-user Custom Translation configuration (getCustomTranslation)  # noqa: E501

        Fetch the Custom Translation map for the end user. The custom translation is configured in the white labeling parameters. If custom translation translation is defined on the tenant level, it overrides the custom translation of the system level. Similar, if the custom translation is defined on the customer level, it overrides the translation configuration of the tenant level.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_custom_translation_using_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: CustomTranslation
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_custom_translation_using_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_custom_translation_using_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_custom_translation_using_get_with_http_info(self, **kwargs):  # noqa: E501
        """Get end-user Custom Translation configuration (getCustomTranslation)  # noqa: E501

        Fetch the Custom Translation map for the end user. The custom translation is configured in the white labeling parameters. If custom translation translation is defined on the tenant level, it overrides the custom translation of the system level. Similar, if the custom translation is defined on the customer level, it overrides the translation configuration of the tenant level.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_custom_translation_using_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: CustomTranslation
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'locale_code' in params:
            path_params['localeCode'] = params['locale_code']  # 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'])  # noqa: E501

        # Authentication setting
        auth_settings = ['X-Authorization']  # noqa: E501

        return self.api_client.call_api(
            '/api/customTranslation/customTranslation', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomTranslation',  # 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 save_custom_translation_using_post(self, **kwargs):  # noqa: E501
        """Create Or Update Custom Translation (saveCustomTranslation)  # noqa: E501

        Creates or Updates the Custom Translation map.   Request example:   ```json {\"translationMap\":{\"es_ES\":\"{\\\"home\\\":\\\"MyHome\\\"}\"}} ```  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.save_custom_translation_using_post(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CustomTranslation body:
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: CustomTranslation
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.save_custom_translation_using_post_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.save_custom_translation_using_post_with_http_info(**kwargs)  # noqa: E501
            return data

    def save_custom_translation_using_post_with_http_info(self, **kwargs):  # noqa: E501
        """Create Or Update Custom Translation (saveCustomTranslation)  # noqa: E501

        Creates or Updates the Custom Translation map.   Request example:   ```json {\"translationMap\":{\"es_ES\":\"{\\\"home\\\":\\\"MyHome\\\"}\"}} ```  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.save_custom_translation_using_post_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CustomTranslation body:
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: CustomTranslation
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'locale_code']  # 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 save_custom_translation_using_post" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # verify the required parameter 'locale_code' is set
        if ('locale_code' not in params or
                params['locale_code'] is None):
            raise ValueError(
                "Missing the required parameter `locale_code` when calling `save_custom_translation`")  # noqa: E501
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['X-Authorization']  # noqa: E501

        return self.api_client.call_api(
            '/api/customTranslation/customTranslation', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomTranslation',  # 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 delete_custom_translation(self, locale_code, **kwargs):  # noqa: E501
        """Delete Custom Translation for specified locale (deleteCustomTranslation)  # noqa: E501

        Delete entire custom translation settings for end-user  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_custom_translation(locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (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.delete_custom_translation_with_http_info(locale_code, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_custom_translation_with_http_info(locale_code, **kwargs)  # noqa: E501
            return data

    def delete_custom_translation_with_http_info(self, locale_code, **kwargs):  # noqa: E501
        """Delete Custom Translation for specified locale (deleteCustomTranslation)  # noqa: E501

        Delete entire custom translation settings for end-user  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_custom_translation_with_http_info(locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'locale_code' in params:
            path_params['localeCode'] = params['locale_code']  # 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'])  # noqa: E501

        # Authentication setting
        auth_settings = ['X-Authorization']  # noqa: E501

        return self.api_client.call_api(
            '/api/translation/custom/{localeCode}', 'DELETE',
            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 delete_custom_translation_key(self, locale_code, key_path, **kwargs):  # noqa: E501
        """Delete specified key of Custom Translation (deleteCustomTranslationKey)   # noqa: E501

        The API call is designed to delete specified key of the custom translation and return as a result parent translation.(e.g. if tenant translation for key is 'value1' and customer translation is 'value2' then by deletinf key onn customer level you will get 'value1' in response)   Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_custom_translation_key(locale_code, key_path, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :param str key_path: A string value representing key of the custom translation (e.g. 'notification.active'). (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.delete_custom_translation_key_with_http_info(locale_code, key_path, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_custom_translation_key_with_http_info(locale_code, key_path, **kwargs)  # noqa: E501
            return data

    def delete_custom_translation_key_with_http_info(self, locale_code, key_path, **kwargs):  # noqa: E501
        """Delete specified key of Custom Translation (deleteCustomTranslationKey)   # noqa: E501

        The API call is designed to delete specified key of the custom translation and return as a result parent translation.(e.g. if tenant translation for key is 'value1' and customer translation is 'value2' then by deletinf key onn customer level you will get 'value1' in response)   Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_custom_translation_key_with_http_info(locale_code, key_path, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :param str key_path: A string value representing key of the custom translation (e.g. 'notification.active'). (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_custom_translation_key" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'locale_code' is set
        if ('locale_code' not in params or
                params['locale_code'] is None):
            raise ValueError(
                "Missing the required parameter `locale_code` when calling `delete_custom_translation_key`")  # noqa: E501
        # verify the required parameter 'key_path' is set
        if ('key_path' not in params or
                params['key_path'] is None):
            raise ValueError(
                "Missing the required parameter `key_path` when calling `delete_custom_translation_key`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'locale_code' in params:
            path_params['localeCode'] = params['locale_code']  # noqa: E501
        if 'key_path' in params:
            path_params['keyPath'] = params['key_path']  # 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'])  # noqa: E501

        # Authentication setting
        auth_settings = ['X-Authorization']  # noqa: E501

        return self.api_client.call_api(
            '/api/translation/custom/{localeCode}/{keyPath}', 'DELETE',
            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 patch_custom_translation(self, body, locale_code, **kwargs):  # noqa: E501
        """Update Custom Translation for specified translation keys only (patchCustomTranslation)  # noqa: E501

        The API call is designed to update the custom translation for specified key only.    Request example:   ```json {\"notification.active\":\"active\"} ```  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.patch_custom_translation(body, locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object body: (required)
        :param str locale_code: Locale code (e.g. 'en_US'). (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.patch_custom_translation_with_http_info(body, locale_code, **kwargs)  # noqa: E501
        else:
            (data) = self.patch_custom_translation_with_http_info(body, locale_code, **kwargs)  # noqa: E501
            return data

    def patch_custom_translation_with_http_info(self, body, locale_code, **kwargs):  # noqa: E501
        """Update Custom Translation for specified translation keys only (patchCustomTranslation)  # noqa: E501

        The API call is designed to update the custom translation for specified key only.    Request example:   ```json {\"notification.active\":\"active\"} ```  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.patch_custom_translation_with_http_info(body, locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object body: (required)
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = ['X-Authorization']  # noqa: E501

        return self.api_client.call_api(
            '/api/translation/custom/{localeCode}', 'PATCH',
            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 upload_custom_translation(self, locale_code, **kwargs):  # noqa: E501
        """Upload Custom Translation (uploadCustomTranslation)  # noqa: E501

        Upload the Custom Translation for specified locale.   Request example:   ```json {\"home\":\"MyHome\"} ```  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_custom_translation(locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :param str file:
        :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.upload_custom_translation_with_http_info(locale_code, **kwargs)  # noqa: E501
        else:
            (data) = self.upload_custom_translation_with_http_info(locale_code, **kwargs)  # noqa: E501
            return data

    def upload_custom_translation_with_http_info(self, locale_code, **kwargs):  # noqa: E501
        """Upload Custom Translation (uploadCustomTranslation)  # noqa: E501

        Upload the Custom Translation for specified locale.   Request example:   ```json {\"home\":\"MyHome\"} ```  Security check is performed to verify that the user has 'WRITE' permission for the white labeling resource.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_custom_translation_with_http_info(locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :param str file:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['X-Authorization']  # noqa: E501

        return self.api_client.call_api(
            '/api/translation/custom/{localeCode}/upload', '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 get_merged_custom_translation(self, locale_code, **kwargs):  # noqa: E501
        """Get end-user Custom Translation configuration (getMergedCustomTranslation)  # noqa: E501

        Fetch end-user Custom Translation for specified locale. The custom translation is configured in the white labeling parameters. If custom translation translation is defined on the tenant level, it overrides the custom translation of the system level. Similar, if the custom translation is defined on the customer level, it overrides the translation configuration of the tenant level.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_merged_custom_translation(locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: CustomTranslation
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_merged_custom_translation_with_http_info(locale_code, **kwargs)  # noqa: E501
        else:
            (data) = self.get_merged_custom_translation_with_http_info(locale_code, **kwargs)  # noqa: E501
            return data

    def get_merged_custom_translation_with_http_info(self, locale_code, **kwargs):  # noqa: E501
        """Get end-user Custom Translation configuration (getMergedCustomTranslation)  # noqa: E501

        Fetch end-user Custom Translation for specified locale. The custom translation is configured in the white labeling parameters. If custom translation translation is defined on the tenant level, it overrides the custom translation of the system level. Similar, if the custom translation is defined on the customer level, it overrides the translation configuration of the tenant level.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_merged_custom_translation_with_http_info(locale_code, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str locale_code: Locale code (e.g. 'en_US'). (required)
        :return: CustomTranslation
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'locale_code' in params:
            path_params['localeCode'] = params['locale_code']  # 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'])  # noqa: E501

        # Authentication setting
        auth_settings = ['X-Authorization']  # noqa: E501

        return self.api_client.call_api(
            '/api/translation/custom/merged/{localeCode}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CustomTranslation',  # 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)
