# coding: utf-8

"""
    ThingsBoard REST API

     ThingsBoard open-source IoT platform REST API documentation.  # noqa: E501

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

#  Copyright 2024. 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 EntitiesVersionControlControllerApi(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 compare_entity_data_to_version_using_get(self, entity_type, internal_entity_uuid, version_id, **kwargs):  # noqa: E501
        """Compare entity data to version (compareEntityDataToVersion)  # noqa: E501

        Returns an object with current entity data and the one at a specific version. Entity data structure is the same as stored in a repository.   Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.compare_entity_data_to_version_using_get(entity_type, internal_entity_uuid, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str internal_entity_uuid: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :return: DeferredResultEntityDataDiff
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.compare_entity_data_to_version_using_get_with_http_info(entity_type, internal_entity_uuid, version_id, **kwargs)  # noqa: E501
        else:
            (data) = self.compare_entity_data_to_version_using_get_with_http_info(entity_type, internal_entity_uuid, version_id, **kwargs)  # noqa: E501
            return data

    def compare_entity_data_to_version_using_get_with_http_info(self, entity_type, internal_entity_uuid, version_id, **kwargs):  # noqa: E501
        """Compare entity data to version (compareEntityDataToVersion)  # noqa: E501

        Returns an object with current entity data and the one at a specific version. Entity data structure is the same as stored in a repository.   Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.compare_entity_data_to_version_using_get_with_http_info(entity_type, internal_entity_uuid, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str internal_entity_uuid: A string value representing the entity id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :return: DeferredResultEntityDataDiff
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'entity_type' in params:
            path_params['entityType'] = params['entity_type']  # noqa: E501
        if 'internal_entity_uuid' in params:
            path_params['internalEntityUuid'] = params['internal_entity_uuid']  # noqa: E501

        query_params = []
        if 'version_id' in params:
            query_params.append(('versionId', params['version_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/diff/{entityType}/{internalEntityUuid}{?versionId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultEntityDataDiff',  # 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_entity_data_info_using_get(self, version_id, entity_type, external_entity_uuid, **kwargs):  # noqa: E501
        """Get entity data info (getEntityDataInfo)  # noqa: E501

        Retrieves short info about the remote entity by external id at a concrete version.  Returned entity data info contains following properties: `hasRelations` (whether stored entity data contains relations), `hasAttributes` (contains attributes) and `hasCredentials` (whether stored device data has credentials).  Available for users with 'TENANT_ADMIN' authority.  # 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_entity_data_info_using_get(version_id, entity_type, external_entity_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str external_entity_uuid: A string value representing external entity id (required)
        :return: DeferredResultEntityDataInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_entity_data_info_using_get_with_http_info(version_id, entity_type, external_entity_uuid, **kwargs)  # noqa: E501
        else:
            (data) = self.get_entity_data_info_using_get_with_http_info(version_id, entity_type, external_entity_uuid, **kwargs)  # noqa: E501
            return data

    def get_entity_data_info_using_get_with_http_info(self, version_id, entity_type, external_entity_uuid, **kwargs):  # noqa: E501
        """Get entity data info (getEntityDataInfo)  # noqa: E501

        Retrieves short info about the remote entity by external id at a concrete version.  Returned entity data info contains following properties: `hasRelations` (whether stored entity data contains relations), `hasAttributes` (contains attributes) and `hasCredentials` (whether stored device data has credentials).  Available for users with 'TENANT_ADMIN' authority.  # 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_entity_data_info_using_get_with_http_info(version_id, entity_type, external_entity_uuid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str external_entity_uuid: A string value representing external entity id (required)
        :return: DeferredResultEntityDataInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'version_id' in params:
            path_params['versionId'] = params['version_id']  # noqa: E501
        if 'entity_type' in params:
            path_params['entityType'] = params['entity_type']  # noqa: E501
        if 'external_entity_uuid' in params:
            path_params['externalEntityUuid'] = params['external_entity_uuid']  # 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/entities/vc/info/{versionId}/{entityType}/{externalEntityUuid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultEntityDataInfo',  # 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_version_create_request_status_using_get(self, request_id, **kwargs):  # noqa: E501
        """Get version create request status (getVersionCreateRequestStatus)  # noqa: E501

        Returns the status of previously made version create request.   This status contains following properties: - `done` - whether request processing is finished; - `version` - created version info: timestamp, version id (commit hash), commit name and commit author; - `added` - count of items that were created in the remote repo; - `modified` - modified items count; - `removed` - removed items count; - `error` - error message, if an error occurred while handling the request.  An example of successful status: ```json {   \"done\": true,   \"added\": 10,   \"modified\": 2,   \"removed\": 5,   \"version\": {     \"timestamp\": 1655198528000,     \"id\":\"8a834dd389ed80e0759ba8ee338b3f1fd160a114\",     \"name\": \"My devices v2.0\",     \"author\": \"John Doe\"   },   \"error\": null } ```  Available for users with 'TENANT_ADMIN' authority.  # 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_version_create_request_status_using_get(request_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str request_id: A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
        :return: VersionCreationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_version_create_request_status_using_get_with_http_info(request_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_version_create_request_status_using_get_with_http_info(request_id, **kwargs)  # noqa: E501
            return data

    def get_version_create_request_status_using_get_with_http_info(self, request_id, **kwargs):  # noqa: E501
        """Get version create request status (getVersionCreateRequestStatus)  # noqa: E501

        Returns the status of previously made version create request.   This status contains following properties: - `done` - whether request processing is finished; - `version` - created version info: timestamp, version id (commit hash), commit name and commit author; - `added` - count of items that were created in the remote repo; - `modified` - modified items count; - `removed` - removed items count; - `error` - error message, if an error occurred while handling the request.  An example of successful status: ```json {   \"done\": true,   \"added\": 10,   \"modified\": 2,   \"removed\": 5,   \"version\": {     \"timestamp\": 1655198528000,     \"id\":\"8a834dd389ed80e0759ba8ee338b3f1fd160a114\",     \"name\": \"My devices v2.0\",     \"author\": \"John Doe\"   },   \"error\": null } ```  Available for users with 'TENANT_ADMIN' authority.  # 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_version_create_request_status_using_get_with_http_info(request_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str request_id: A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
        :return: VersionCreationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/version/{requestId}/status', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VersionCreationResult',  # 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_version_load_request_status_using_get(self, request_id, **kwargs):  # noqa: E501
        """Get version load request status (getVersionLoadRequestStatus)  # noqa: E501

        Returns the status of previously made version load request. The structure contains following parameters: - `done` - if the request was successfully processed; - `result` - a list of load results for each entity type:      - `created` - created entities count;      - `updated` - updated entities count;      - `deleted` - removed entities count. - `error` - if an error occurred during processing, error info:      - `type` - error type;      - `source` - an external id of remote entity;      - `target` - if failed to find referenced entity by external id - this external id;      - `message` - error message.  An example of successfully processed request status: ```json {   \"done\": true,   \"result\": [     {       \"entityType\": \"DEVICE\",       \"created\": 10,       \"updated\": 5,       \"deleted\": 5     },      {       \"entityType\": \"ASSET\",       \"created\": 4,       \"updated\": 0,       \"deleted\": 8     }   ] } ```  Available for users with 'TENANT_ADMIN' authority.  # 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_version_load_request_status_using_get(request_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str request_id: A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
        :return: VersionLoadResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_version_load_request_status_using_get_with_http_info(request_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_version_load_request_status_using_get_with_http_info(request_id, **kwargs)  # noqa: E501
            return data

    def get_version_load_request_status_using_get_with_http_info(self, request_id, **kwargs):  # noqa: E501
        """Get version load request status (getVersionLoadRequestStatus)  # noqa: E501

        Returns the status of previously made version load request. The structure contains following parameters: - `done` - if the request was successfully processed; - `result` - a list of load results for each entity type:      - `created` - created entities count;      - `updated` - updated entities count;      - `deleted` - removed entities count. - `error` - if an error occurred during processing, error info:      - `type` - error type;      - `source` - an external id of remote entity;      - `target` - if failed to find referenced entity by external id - this external id;      - `message` - error message.  An example of successfully processed request status: ```json {   \"done\": true,   \"result\": [     {       \"entityType\": \"DEVICE\",       \"created\": 10,       \"updated\": 5,       \"deleted\": 5     },      {       \"entityType\": \"ASSET\",       \"created\": 4,       \"updated\": 0,       \"deleted\": 8     }   ] } ```  Available for users with 'TENANT_ADMIN' authority.  # 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_version_load_request_status_using_get_with_http_info(request_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str request_id: A string value representing the version control request id. For example, '784f394c-42b6-435a-983c-b7beff2784f9' (required)
        :return: VersionLoadResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/entity/{requestId}/status', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VersionLoadResult',  # 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 list_all_entities_at_version_using_get(self, version_id, **kwargs):  # noqa: E501
        """List all entities at version (listAllEntitiesAtVersion)  # noqa: E501

        Returns a list of all remote entities available in a specific version. Response type is the same as for listAllEntitiesAtVersion API method.  Returned entities order will be the same as in the repository.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_all_entities_at_version_using_get(version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :return: DeferredResultListVersionedEntityInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_all_entities_at_version_using_get_with_http_info(version_id, **kwargs)  # noqa: E501
        else:
            (data) = self.list_all_entities_at_version_using_get_with_http_info(version_id, **kwargs)  # noqa: E501
            return data

    def list_all_entities_at_version_using_get_with_http_info(self, version_id, **kwargs):  # noqa: E501
        """List all entities at version (listAllEntitiesAtVersion)  # noqa: E501

        Returns a list of all remote entities available in a specific version. Response type is the same as for listAllEntitiesAtVersion API method.  Returned entities order will be the same as in the repository.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_all_entities_at_version_using_get_with_http_info(version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :return: DeferredResultListVersionedEntityInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/entity/{versionId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultListVersionedEntityInfo',  # 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 list_branches_using_get(self, **kwargs):  # noqa: E501
        """List branches (listBranches)  # noqa: E501

        Lists branches available in the remote repository.   Response example:  ```json [   {     \"name\": \"master\",     \"default\": true   },   {     \"name\": \"dev\",     \"default\": false   },   {     \"name\": \"dev-2\",     \"default\": false   } ] ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_branches_using_get(async_req=True)
        >>> result = thread.get()

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

    def list_branches_using_get_with_http_info(self, **kwargs):  # noqa: E501
        """List branches (listBranches)  # noqa: E501

        Lists branches available in the remote repository.   Response example:  ```json [   {     \"name\": \"master\",     \"default\": true   },   {     \"name\": \"dev\",     \"default\": false   },   {     \"name\": \"dev-2\",     \"default\": false   } ] ```  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_branches_using_get_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/branches', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultListBranchInfo',  # 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 list_entities_at_version_using_get(self, entity_type, version_id, **kwargs):  # noqa: E501
        """List entities at version (listEntitiesAtVersion)  # noqa: E501

        Returns a list of remote entities of a specific entity type that are available at a concrete version.  Each entity item in the result has `externalId` property. Entities order will be the same as in the repository.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_entities_at_version_using_get(entity_type, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :return: DeferredResultListVersionedEntityInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_entities_at_version_using_get_with_http_info(entity_type, version_id, **kwargs)  # noqa: E501
        else:
            (data) = self.list_entities_at_version_using_get_with_http_info(entity_type, version_id, **kwargs)  # noqa: E501
            return data

    def list_entities_at_version_using_get_with_http_info(self, entity_type, version_id, **kwargs):  # noqa: E501
        """List entities at version (listEntitiesAtVersion)  # noqa: E501

        Returns a list of remote entities of a specific entity type that are available at a concrete version.  Each entity item in the result has `externalId` property. Entities order will be the same as in the repository.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_entities_at_version_using_get_with_http_info(entity_type, version_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str version_id: Version id, for example fd82625bdd7d6131cf8027b44ee967012ecaf990. Represents commit hash. (required)
        :return: DeferredResultListVersionedEntityInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'entity_type' in params:
            path_params['entityType'] = params['entity_type']  # noqa: E501
        if 'version_id' in params:
            path_params['versionId'] = params['version_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/entity/{entityType}/{versionId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultListVersionedEntityInfo',  # 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 list_entity_type_versions_using_get(self, entity_type, branch, page_size, page, **kwargs):  # noqa: E501
        """List entity type versions (listEntityTypeVersions)  # noqa: E501

        Returns list of versions of an entity type in a branch. This is a collected list of versions that were created for entities of this type in a remote branch.  If specified branch does not exist - empty page data will be returned. The response structure is the same as for `listEntityVersions` API method.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_entity_type_versions_using_get(entity_type, branch, page_size, page, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str branch: The name of the working branch, for example 'master' (required)
        :param int page_size: Maximum amount of entities in a one page (required)
        :param int page: Sequence number of page starting from 0 (required)
        :param str text_search: The case insensitive 'substring' filter based on the entity version name.
        :param str sort_property: Property of entity to sort by
        :param str sort_order: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        :return: DeferredResultPageDataEntityVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_entity_type_versions_using_get_with_http_info(entity_type, branch, page_size, page, **kwargs)  # noqa: E501
        else:
            (data) = self.list_entity_type_versions_using_get_with_http_info(entity_type, branch, page_size, page, **kwargs)  # noqa: E501
            return data

    def list_entity_type_versions_using_get_with_http_info(self, entity_type, branch, page_size, page, **kwargs):  # noqa: E501
        """List entity type versions (listEntityTypeVersions)  # noqa: E501

        Returns list of versions of an entity type in a branch. This is a collected list of versions that were created for entities of this type in a remote branch.  If specified branch does not exist - empty page data will be returned. The response structure is the same as for `listEntityVersions` API method.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_entity_type_versions_using_get_with_http_info(entity_type, branch, page_size, page, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str branch: The name of the working branch, for example 'master' (required)
        :param int page_size: Maximum amount of entities in a one page (required)
        :param int page: Sequence number of page starting from 0 (required)
        :param str text_search: The case insensitive 'substring' filter based on the entity version name.
        :param str sort_property: Property of entity to sort by
        :param str sort_order: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        :return: DeferredResultPageDataEntityVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'branch' in params:
            query_params.append(('branch', params['branch']))  # noqa: E501
        if 'page_size' in params:
            query_params.append(('pageSize', params['page_size']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'text_search' in params:
            query_params.append(('textSearch', params['text_search']))  # noqa: E501
        if 'sort_property' in params:
            query_params.append(('sortProperty', params['sort_property']))  # noqa: E501
        if 'sort_order' in params:
            query_params.append(('sortOrder', params['sort_order']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/version/{entityType}?sortProperty=timestamp{&branch,page,pageSize,sortOrder,textSearch}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultPageDataEntityVersion',  # 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 list_entity_versions_using_get(self, entity_type, external_entity_uuid, branch, page_size, page, **kwargs):  # noqa: E501
        """List entity versions (listEntityVersions)  # noqa: E501

        Returns list of versions for a specific entity in a concrete branch.  You need to specify external id of an entity to list versions for. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity.  If specified branch does not exist - empty page data will be returned.   Each version info item has timestamp, id, name and author. Version id can then be used to restore the version. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See the 'Model' tab of the Response Class for more details.   Response example:  ```json {   \"data\": [     {       \"timestamp\": 1655198593000,       \"id\": \"fd82625bdd7d6131cf8027b44ee967012ecaf990\",       \"name\": \"Devices and assets - v2.0\",       \"author\": \"John Doe <johndoe@gmail.com>\"     },     {       \"timestamp\": 1655198528000,       \"id\": \"682adcffa9c8a2f863af6f00c4850323acbd4219\",       \"name\": \"Update my device\",       \"author\": \"John Doe <johndoe@gmail.com>\"     },     {       \"timestamp\": 1655198280000,       \"id\": \"d2a6087c2b30e18cc55e7cdda345a8d0dfb959a4\",       \"name\": \"Devices and assets - v1.0\",       \"author\": \"John Doe <johndoe@gmail.com>\"     }   ],   \"totalPages\": 1,   \"totalElements\": 3,   \"hasNext\": false } ```  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_entity_versions_using_get(entity_type, external_entity_uuid, branch, page_size, page, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str external_entity_uuid: A string value representing external entity id. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity. (required)
        :param str branch: The name of the working branch, for example 'master' (required)
        :param int page_size: Maximum amount of entities in a one page (required)
        :param int page: Sequence number of page starting from 0 (required)
        :param str text_search: The case insensitive 'substring' filter based on the entity version name.
        :param str sort_property: Property of entity to sort by
        :param str sort_order: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        :return: DeferredResultPageDataEntityVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_entity_versions_using_get_with_http_info(entity_type, external_entity_uuid, branch, page_size, page, **kwargs)  # noqa: E501
        else:
            (data) = self.list_entity_versions_using_get_with_http_info(entity_type, external_entity_uuid, branch, page_size, page, **kwargs)  # noqa: E501
            return data

    def list_entity_versions_using_get_with_http_info(self, entity_type, external_entity_uuid, branch, page_size, page, **kwargs):  # noqa: E501
        """List entity versions (listEntityVersions)  # noqa: E501

        Returns list of versions for a specific entity in a concrete branch.  You need to specify external id of an entity to list versions for. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity.  If specified branch does not exist - empty page data will be returned.   Each version info item has timestamp, id, name and author. Version id can then be used to restore the version. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See the 'Model' tab of the Response Class for more details.   Response example:  ```json {   \"data\": [     {       \"timestamp\": 1655198593000,       \"id\": \"fd82625bdd7d6131cf8027b44ee967012ecaf990\",       \"name\": \"Devices and assets - v2.0\",       \"author\": \"John Doe <johndoe@gmail.com>\"     },     {       \"timestamp\": 1655198528000,       \"id\": \"682adcffa9c8a2f863af6f00c4850323acbd4219\",       \"name\": \"Update my device\",       \"author\": \"John Doe <johndoe@gmail.com>\"     },     {       \"timestamp\": 1655198280000,       \"id\": \"d2a6087c2b30e18cc55e7cdda345a8d0dfb959a4\",       \"name\": \"Devices and assets - v1.0\",       \"author\": \"John Doe <johndoe@gmail.com>\"     }   ],   \"totalPages\": 1,   \"totalElements\": 3,   \"hasNext\": false } ```  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_entity_versions_using_get_with_http_info(entity_type, external_entity_uuid, branch, page_size, page, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str entity_type: A string value representing the entity type. For example, 'DEVICE' (required)
        :param str external_entity_uuid: A string value representing external entity id. This is `externalId` property of an entity, or otherwise if not set - simply id of this entity. (required)
        :param str branch: The name of the working branch, for example 'master' (required)
        :param int page_size: Maximum amount of entities in a one page (required)
        :param int page: Sequence number of page starting from 0 (required)
        :param str text_search: The case insensitive 'substring' filter based on the entity version name.
        :param str sort_property: Property of entity to sort by
        :param str sort_order: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        :return: DeferredResultPageDataEntityVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['entity_type', 'external_entity_uuid', 'branch', 'page_size', 'page', 'text_search', 'sort_property', 'sort_order']  # 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 list_entity_versions_using_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'entity_type' is set
        if ('entity_type' not in params or
                params['entity_type'] is None):
            raise ValueError("Missing the required parameter `entity_type` when calling `list_entity_versions_using_get`")  # noqa: E501
        # verify the required parameter 'external_entity_uuid' is set
        if ('external_entity_uuid' not in params or
                params['external_entity_uuid'] is None):
            raise ValueError("Missing the required parameter `external_entity_uuid` when calling `list_entity_versions_using_get`")  # noqa: E501
        # verify the required parameter 'branch' is set
        if ('branch' not in params or
                params['branch'] is None):
            raise ValueError("Missing the required parameter `branch` when calling `list_entity_versions_using_get`")  # noqa: E501
        # verify the required parameter 'page_size' is set
        if ('page_size' not in params or
                params['page_size'] is None):
            raise ValueError("Missing the required parameter `page_size` when calling `list_entity_versions_using_get`")  # noqa: E501
        # verify the required parameter 'page' is set
        if ('page' not in params or
                params['page'] is None):
            raise ValueError("Missing the required parameter `page` when calling `list_entity_versions_using_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'entity_type' in params:
            path_params['entityType'] = params['entity_type']  # noqa: E501
        if 'external_entity_uuid' in params:
            path_params['externalEntityUuid'] = params['external_entity_uuid']  # noqa: E501

        query_params = []
        if 'branch' in params:
            query_params.append(('branch', params['branch']))  # noqa: E501
        if 'page_size' in params:
            query_params.append(('pageSize', params['page_size']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'text_search' in params:
            query_params.append(('textSearch', params['text_search']))  # noqa: E501
        if 'sort_property' in params:
            query_params.append(('sortProperty', params['sort_property']))  # noqa: E501
        if 'sort_order' in params:
            query_params.append(('sortOrder', params['sort_order']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/version/{entityType}/{externalEntityUuid}?sortProperty=timestamp{&branch,page,pageSize,sortOrder,textSearch}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultPageDataEntityVersion',  # 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 list_versions_using_get(self, branch, page_size, page, **kwargs):  # noqa: E501
        """List all versions (listVersions)  # noqa: E501

        Lists all available versions in a branch for all entity types.  If specified branch does not exist - empty page data will be returned. The response format is the same as for `listEntityVersions` API method.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_versions_using_get(branch, page_size, page, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str branch: The name of the working branch, for example 'master' (required)
        :param int page_size: Maximum amount of entities in a one page (required)
        :param int page: Sequence number of page starting from 0 (required)
        :param str text_search: The case insensitive 'substring' filter based on the entity version name.
        :param str sort_property: Property of entity to sort by
        :param str sort_order: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        :return: DeferredResultPageDataEntityVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_versions_using_get_with_http_info(branch, page_size, page, **kwargs)  # noqa: E501
        else:
            (data) = self.list_versions_using_get_with_http_info(branch, page_size, page, **kwargs)  # noqa: E501
            return data

    def list_versions_using_get_with_http_info(self, branch, page_size, page, **kwargs):  # noqa: E501
        """List all versions (listVersions)  # noqa: E501

        Lists all available versions in a branch for all entity types.  If specified branch does not exist - empty page data will be returned. The response format is the same as for `listEntityVersions` API method.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_versions_using_get_with_http_info(branch, page_size, page, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str branch: The name of the working branch, for example 'master' (required)
        :param int page_size: Maximum amount of entities in a one page (required)
        :param int page: Sequence number of page starting from 0 (required)
        :param str text_search: The case insensitive 'substring' filter based on the entity version name.
        :param str sort_property: Property of entity to sort by
        :param str sort_order: Sort order. ASC (ASCENDING) or DESC (DESCENDING)
        :return: DeferredResultPageDataEntityVersion
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'branch' in params:
            query_params.append(('branch', params['branch']))  # noqa: E501
        if 'page_size' in params:
            query_params.append(('pageSize', params['page_size']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'text_search' in params:
            query_params.append(('textSearch', params['text_search']))  # noqa: E501
        if 'sort_property' in params:
            query_params.append(('sortProperty', params['sort_property']))  # noqa: E501
        if 'sort_order' in params:
            query_params.append(('sortOrder', params['sort_order']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/entities/vc/version?sortProperty=timestamp{&branch,page,pageSize,sortOrder,textSearch}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultPageDataEntityVersion',  # 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 load_entities_version_using_post(self, **kwargs):  # noqa: E501
        """Load entities version (loadEntitiesVersion)  # noqa: E501

        Loads specific version of remote entities (or single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.  There are multiple types of request. Each of them requires branch name (`branch`) and version id (`versionId`). Request of type `SINGLE_ENTITY` is needed to restore a concrete version of a specific entity. It contains id of a remote entity (`externalEntityId`) and additional configuration (`config`): - `loadRelations` - to update relations list (in case `saveRelations` option was enabled during version creation); - `loadAttributes` - to load entity attributes (if `saveAttributes` config option was enabled); - `loadCredentials` - to update device credentials (if `saveCredentials` option was enabled during version creation).  An example of such request: ```json {   \"type\": \"SINGLE_ENTITY\",      \"branch\": \"dev\",   \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",      \"externalEntityId\": {     \"entityType\": \"DEVICE\",     \"id\": \"b7944123-d4f4-11ec-847b-0f432358ab48\"   },   \"config\": {     \"loadRelations\": false,     \"loadAttributes\": true,     \"loadCredentials\": true   } } ```  Another request type (`ENTITY_TYPE`) is needed to load specific version of the whole entity types. It contains a structure with entity types to load and configs for each entity type (`entityTypes`). For each specified entity type, the method will load all remote entities of this type that are present at the version. A config for each entity type contains the same options as in `SINGLE_ENTITY` request type, and additionally contains following options: - `removeOtherEntities` - to remove local entities that are not present on the remote - basically to    overwrite local entity type with the remote one; - `findExistingEntityByName` - when you are loading some remote entities that are not yet present at this tenant,    try to find existing entity by name and update it rather than create new.  Here is an example of the request to completely restore version of the whole device entity type: ```json {   \"type\": \"ENTITY_TYPE\",    \"branch\": \"dev\",   \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",    \"entityTypes\": {     \"DEVICE\": {       \"removeOtherEntities\": true,       \"findExistingEntityByName\": false,       \"loadRelations\": true,       \"loadAttributes\": true,       \"loadCredentials\": true     }   } } ```  The response will contain generated request UUID that is to be used to check the status of operation via `getVersionLoadRequestStatus`.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.load_entities_version_using_post(async_req=True)
        >>> result = thread.get()

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

    def load_entities_version_using_post_with_http_info(self, **kwargs):  # noqa: E501
        """Load entities version (loadEntitiesVersion)  # noqa: E501

        Loads specific version of remote entities (or single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.  There are multiple types of request. Each of them requires branch name (`branch`) and version id (`versionId`). Request of type `SINGLE_ENTITY` is needed to restore a concrete version of a specific entity. It contains id of a remote entity (`externalEntityId`) and additional configuration (`config`): - `loadRelations` - to update relations list (in case `saveRelations` option was enabled during version creation); - `loadAttributes` - to load entity attributes (if `saveAttributes` config option was enabled); - `loadCredentials` - to update device credentials (if `saveCredentials` option was enabled during version creation).  An example of such request: ```json {   \"type\": \"SINGLE_ENTITY\",      \"branch\": \"dev\",   \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",      \"externalEntityId\": {     \"entityType\": \"DEVICE\",     \"id\": \"b7944123-d4f4-11ec-847b-0f432358ab48\"   },   \"config\": {     \"loadRelations\": false,     \"loadAttributes\": true,     \"loadCredentials\": true   } } ```  Another request type (`ENTITY_TYPE`) is needed to load specific version of the whole entity types. It contains a structure with entity types to load and configs for each entity type (`entityTypes`). For each specified entity type, the method will load all remote entities of this type that are present at the version. A config for each entity type contains the same options as in `SINGLE_ENTITY` request type, and additionally contains following options: - `removeOtherEntities` - to remove local entities that are not present on the remote - basically to    overwrite local entity type with the remote one; - `findExistingEntityByName` - when you are loading some remote entities that are not yet present at this tenant,    try to find existing entity by name and update it rather than create new.  Here is an example of the request to completely restore version of the whole device entity type: ```json {   \"type\": \"ENTITY_TYPE\",    \"branch\": \"dev\",   \"versionId\": \"b3c28d722d328324c7c15b0b30047b0c40011cf7\",    \"entityTypes\": {     \"DEVICE\": {       \"removeOtherEntities\": true,       \"findExistingEntityByName\": false,       \"loadRelations\": true,       \"loadAttributes\": true,       \"loadCredentials\": true     }   } } ```  The response will contain generated request UUID that is to be used to check the status of operation via `getVersionLoadRequestStatus`.  Available for users with 'TENANT_ADMIN' authority.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.load_entities_version_using_post_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}

        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/entities/vc/entity', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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_entities_version_using_post(self, **kwargs):  # noqa: E501
        """Save entities version (saveEntitiesVersion)  # noqa: E501

        Creates a new version of entities (or a single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.  There are two available types of request: `SINGLE_ENTITY` and `COMPLEX`. Each of them contains version name (`versionName`) and name of a branch (`branch`) to create version (commit) in. If specified branch does not exists in a remote repo, then new empty branch will be created. Request of the `SINGLE_ENTITY` type has id of an entity (`entityId`) and additional configuration (`config`) which has following options:  - `saveRelations` - whether to add inbound and outbound relations of type COMMON to created entity version; - `saveAttributes` - to save attributes of server scope (and also shared scope for devices); - `saveCredentials` - when saving a version of a device, to add its credentials to the version.  An example of a `SINGLE_ENTITY` version create request: ```json {   \"type\": \"SINGLE_ENTITY\",    \"versionName\": \"Version 1.0\",   \"branch\": \"dev\",    \"entityId\": {     \"entityType\": \"DEVICE\",     \"id\": \"b79448e0-d4f4-11ec-847b-0f432358ab48\"   },   \"config\": {     \"saveRelations\": true,     \"saveAttributes\": true,     \"saveCredentials\": false   } } ```  Second request type (`COMPLEX`), additionally to `branch` and `versionName`, contains following properties: - `entityTypes` - a structure with entity types to export and configuration for each entity type;    this configuration has all the options available for `SINGLE_ENTITY` and additionally has these ones:       - `allEntities` and `entityIds` - if you want to save the version of all entities of the entity type         then set `allEntities` param to true, otherwise set it to false and specify the list of specific entities (`entityIds`);      - `syncStrategy` - synchronization strategy to use for this entity type: when set to `OVERWRITE`         then the list of remote entities of this type will be overwritten by newly added entities. If set to         `MERGE` - existing remote entities of this entity type will not be removed, new entities will just         be added on top (or existing remote entities will be updated). - `syncStrategy` - default synchronization strategy to use when it is not specified for an entity type.  Example for this type of request: ```json {   \"type\": \"COMPLEX\",    \"versionName\": \"Devices and profiles: release 2\",   \"branch\": \"master\",    \"syncStrategy\": \"OVERWRITE\",   \"entityTypes\": {     \"DEVICE\": {       \"syncStrategy\": null,       \"allEntities\": true,       \"saveRelations\": true,       \"saveAttributes\": true,       \"saveCredentials\": true     },     \"DEVICE_PROFILE\": {       \"syncStrategy\": \"MERGE\",       \"allEntities\": false,       \"entityIds\": [         \"b79448e0-d4f4-11ec-847b-0f432358ab48\"       ],       \"saveRelations\": true     }   } } ```  Response wil contain generated request UUID, that can be then used to retrieve status of operation via `getVersionCreateRequestStatus`.   Available for users with 'TENANT_ADMIN' authority.  # 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_entities_version_using_post(async_req=True)
        >>> result = thread.get()

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

    def save_entities_version_using_post_with_http_info(self, **kwargs):  # noqa: E501
        """Save entities version (saveEntitiesVersion)  # noqa: E501

        Creates a new version of entities (or a single entity) by request. Supported entity types: CUSTOMER, ASSET, RULE_CHAIN, DASHBOARD, DEVICE_PROFILE, DEVICE, ENTITY_VIEW, WIDGETS_BUNDLE.  There are two available types of request: `SINGLE_ENTITY` and `COMPLEX`. Each of them contains version name (`versionName`) and name of a branch (`branch`) to create version (commit) in. If specified branch does not exists in a remote repo, then new empty branch will be created. Request of the `SINGLE_ENTITY` type has id of an entity (`entityId`) and additional configuration (`config`) which has following options:  - `saveRelations` - whether to add inbound and outbound relations of type COMMON to created entity version; - `saveAttributes` - to save attributes of server scope (and also shared scope for devices); - `saveCredentials` - when saving a version of a device, to add its credentials to the version.  An example of a `SINGLE_ENTITY` version create request: ```json {   \"type\": \"SINGLE_ENTITY\",    \"versionName\": \"Version 1.0\",   \"branch\": \"dev\",    \"entityId\": {     \"entityType\": \"DEVICE\",     \"id\": \"b79448e0-d4f4-11ec-847b-0f432358ab48\"   },   \"config\": {     \"saveRelations\": true,     \"saveAttributes\": true,     \"saveCredentials\": false   } } ```  Second request type (`COMPLEX`), additionally to `branch` and `versionName`, contains following properties: - `entityTypes` - a structure with entity types to export and configuration for each entity type;    this configuration has all the options available for `SINGLE_ENTITY` and additionally has these ones:       - `allEntities` and `entityIds` - if you want to save the version of all entities of the entity type         then set `allEntities` param to true, otherwise set it to false and specify the list of specific entities (`entityIds`);      - `syncStrategy` - synchronization strategy to use for this entity type: when set to `OVERWRITE`         then the list of remote entities of this type will be overwritten by newly added entities. If set to         `MERGE` - existing remote entities of this entity type will not be removed, new entities will just         be added on top (or existing remote entities will be updated). - `syncStrategy` - default synchronization strategy to use when it is not specified for an entity type.  Example for this type of request: ```json {   \"type\": \"COMPLEX\",    \"versionName\": \"Devices and profiles: release 2\",   \"branch\": \"master\",    \"syncStrategy\": \"OVERWRITE\",   \"entityTypes\": {     \"DEVICE\": {       \"syncStrategy\": null,       \"allEntities\": true,       \"saveRelations\": true,       \"saveAttributes\": true,       \"saveCredentials\": true     },     \"DEVICE_PROFILE\": {       \"syncStrategy\": \"MERGE\",       \"allEntities\": false,       \"entityIds\": [         \"b79448e0-d4f4-11ec-847b-0f432358ab48\"       ],       \"saveRelations\": true     }   } } ```  Response wil contain generated request UUID, that can be then used to retrieve status of operation via `getVersionCreateRequestStatus`.   Available for users with 'TENANT_ADMIN' authority.  # 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_entities_version_using_post_with_http_info(async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}

        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/entities/vc/version', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeferredResultuuid',  # 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)
