discontinuedPackage thingsboard_pe_client has been discontinued and replaced by thingsboard_client.

EntitiesVersionControlControllerApi class

Constructors

EntitiesVersionControlControllerApi(Dio _dio, [Serializers? _serializers])
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareEntityDataToVersion({required EntityType entityType, required String internalEntityUuid, required String versionId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<EntityDataDiff>>
Compare entity data to version (compareEntityDataToVersion) 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.
getEntityDataInfo({required String versionId, required EntityType entityType, required String externalEntityUuid, String? internalEntityId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<EntityDataInfo>>
Get entity data info (getEntityDataInfo) 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), `hasCredentials` (whether stored device data has credentials), `hasPermissions` (user group data contains group permission list) and `hasGroupEntities` (entity group data contains group entities). Available for users with 'TENANT_ADMIN' authority.
getVersionCreateRequestStatus({required String requestId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<VersionCreationResult>>
Get version create request status (getVersionCreateRequestStatus) 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 { &quot;done&quot;: true, &quot;added&quot;: 10, &quot;modified&quot;: 2, &quot;removed&quot;: 5, &quot;version&quot;: { &quot;timestamp&quot;: 1655198528000, &quot;id&quot;:&quot;8a834dd389ed80e0759ba8ee338b3f1fd160a114&quot;, &quot;name&quot;: &quot;My devices v2.0&quot;, &quot;author&quot;: &quot;John Doe&quot; }, &quot;error&quot;: null } ``` Available for users with 'TENANT_ADMIN' authority.
getVersionLoadRequestStatus({required String requestId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<VersionLoadResult>>
Get version load request status (getVersionLoadRequestStatus) 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; - `groupsCreated` - created entity groups count; - `groupsUpdated` - updated entity groups count; - `groupsDeleted` - removed entity groups 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 { &quot;done&quot;: true, &quot;result&quot;: { \&quot;entityType\&quot;: \&quot;DEVICE\&quot;, \&quot;created\&quot;: 10, \&quot;updated\&quot;: 5, \&quot;deleted\&quot;: 5, \&quot;groupsCreated\&quot;: 1, \&quot;groupsUpdated\&quot;: 1, \&quot;groupsDeleted\&quot;: 1 }, { \&quot;entityType\&quot;: \&quot;ASSET\&quot;, \&quot;created\&quot;: 4, \&quot;updated\&quot;: 0, \&quot;deleted\&quot;: 8, \&quot;groupsCreated\&quot;: 1, \&quot;groupsUpdated\&quot;: 0, \&quot;groupsDeleted\&quot;: 2 } } ``` Available for users with 'TENANT_ADMIN' authority.
listAllEntitiesAtVersion({required String versionId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<BuiltList<VersionedEntityInfo>>>
List all entities at version (listAllEntitiesAtVersion) 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.
listBranches({CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<BuiltList<BranchInfo>>>
List branches (listBranches) Lists branches available in the remote repository. Response example: ```json { \&quot;name\&quot;: \&quot;master\&quot;, \&quot;default\&quot;: true }, { \&quot;name\&quot;: \&quot;dev\&quot;, \&quot;default\&quot;: false }, { \&quot;name\&quot;: \&quot;dev-2\&quot;, \&quot;default\&quot;: false } ```
listEntitiesAtVersion({required EntityType entityType, required String versionId, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<BuiltList<VersionedEntityInfo>>>
List entities at version (listEntitiesAtVersion) 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.
listEntityTypeVersions({required EntityType entityType, required String branch, required int pageSize, required int page, String? textSearch, String? sortProperty, String? sortOrder, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<PageDataEntityVersion>>
List entity type versions (listEntityTypeVersions) 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.
listEntityVersions({required EntityType entityType, required String externalEntityUuid, required String branch, required int pageSize, required int page, String? internalEntityId, String? textSearch, String? sortProperty, String? sortOrder, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<PageDataEntityVersion>>
List entity versions (listEntityVersions) 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 response schema for more details. Response example: ```json { &quot;data&quot;: { \&quot;timestamp\&quot;: 1655198593000, \&quot;id\&quot;: \&quot;fd82625bdd7d6131cf8027b44ee967012ecaf990\&quot;, \&quot;name\&quot;: \&quot;Devices and assets - v2.0\&quot;, \&quot;author\&quot;: \&quot;John Doe (johndoe@gmail.com)\&quot; }, { \&quot;timestamp\&quot;: 1655198528000, \&quot;id\&quot;: \&quot;682adcffa9c8a2f863af6f00c4850323acbd4219\&quot;, \&quot;name\&quot;: \&quot;Update my device\&quot;, \&quot;author\&quot;: \&quot;John Doe (johndoe@gmail.com)\&quot; }, { \&quot;timestamp\&quot;: 1655198280000, \&quot;id\&quot;: \&quot;d2a6087c2b30e18cc55e7cdda345a8d0dfb959a4\&quot;, \&quot;name\&quot;: \&quot;Devices and assets - v1.0\&quot;, \&quot;author\&quot;: \&quot;John Doe (johndoe@gmail.com)\&quot; } , &quot;totalPages&quot;: 1, &quot;totalElements&quot;: 3, &quot;hasNext&quot;: false } ``` Available for users with 'TENANT_ADMIN' authority.
listVersions({required String branch, required int pageSize, required int page, String? textSearch, String? sortProperty, String? sortOrder, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<PageDataEntityVersion>>
List all versions (listVersions) 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.
loadEntitiesVersion({required VersionLoadRequest versionLoadRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<String>>
Load entities version (loadEntitiesVersion) 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, CONVERTER, INTEGRATION, ROLE and USER group. 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`), internal entity id (`internalEntityId`) 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); - `loadPermissions` - when loading user group, to update group permission list; - `loadGroupEntities` - when loading an entity group, to load its entities as well; - `autoGenerateIntegrationKey` - if loading integration version, to autogenerate routing key. An example of such request: ```json { &quot;type&quot;: &quot;SINGLE_ENTITY&quot;, &quot;branch&quot;: &quot;dev&quot;, &quot;versionId&quot;: &quot;b3c28d722d328324c7c15b0b30047b0c40011cf7&quot;, &quot;externalEntityId&quot;: { &quot;entityType&quot;: &quot;DEVICE&quot;, &quot;id&quot;: &quot;b7944123-d4f4-11ec-847b-0f432358ab48&quot; }, &quot;config&quot;: { &quot;loadRelations&quot;: false, &quot;loadAttributes&quot;: true, &quot;loadCredentials&quot;: 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 { &quot;type&quot;: &quot;ENTITY_TYPE&quot;, &quot;branch&quot;: &quot;dev&quot;, &quot;versionId&quot;: &quot;b3c28d722d328324c7c15b0b30047b0c40011cf7&quot;, &quot;entityTypes&quot;: { &quot;DEVICE&quot;: { &quot;removeOtherEntities&quot;: true, &quot;findExistingEntityByName&quot;: false, &quot;loadRelations&quot;: true, &quot;loadAttributes&quot;: true, &quot;loadCredentials&quot;: 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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveEntitiesVersion({required VersionCreateRequest versionCreateRequest, CancelToken? cancelToken, Map<String, dynamic>? headers, Map<String, dynamic>? extra, ValidateStatus? validateStatus, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress}) → Future<Response<String>>
Save entities version (saveEntitiesVersion) 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, CONVERTER, INTEGRATION, ROLE and USER group. 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; - `savePermissions` - when saving a user group - to save group permission list; - `saveGroupEntities` - when saving an entity group - to save its entities as well. An example of a `SINGLE_ENTITY` version create request: ```json { &quot;type&quot;: &quot;SINGLE_ENTITY&quot;, &quot;versionName&quot;: &quot;Version 1.0&quot;, &quot;branch&quot;: &quot;dev&quot;, &quot;entityId&quot;: { &quot;entityType&quot;: &quot;DEVICE&quot;, &quot;id&quot;: &quot;b79448e0-d4f4-11ec-847b-0f432358ab48&quot; }, &quot;config&quot;: { &quot;saveRelations&quot;: true, &quot;saveAttributes&quot;: true, &quot;saveCredentials&quot;: 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 `entityIds` - in case entity type is group entity, list of specific entity groups, or if not - list of entities; - `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 { &quot;type&quot;: &quot;COMPLEX&quot;, &quot;versionName&quot;: &quot;Devices and profiles: release 2&quot;, &quot;branch&quot;: &quot;master&quot;, &quot;syncStrategy&quot;: &quot;OVERWRITE&quot;, &quot;entityTypes&quot;: { &quot;DEVICE&quot;: { &quot;syncStrategy&quot;: null, &quot;allEntities&quot;: true, &quot;saveRelations&quot;: true, &quot;saveAttributes&quot;: true, &quot;saveCredentials&quot;: true }, &quot;DEVICE_PROFILE&quot;: { &quot;syncStrategy&quot;: &quot;MERGE&quot;, &quot;allEntities&quot;: false, &quot;entityIds&quot;: \&quot;b79448e0-d4f4-11ec-847b-0f432358ab48\&quot; , &quot;saveRelations&quot;: 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.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited