Digital Twins
Enterprise Twin are digital twins that provide multiple essential purposes including: Organizational Modelling and Security, Resource-Based Access Control, physical world modelling, Instrument relations with Telemetry, and Data Cataloguing through Telemetry Twins.
Digital Twins are classified through a Category (Organizational, Spatial, Instrument and Telemetry) and then by a Type and then by a Sub-Type.
Digital Twin Definition Language (DTDL) is leveraged to describe data schemas that unleash the power of the data stored within the Digital Twins.
- class ClientSDK.DigitalTwin
Digital Twin Type Methods
CreateDigitalTwinTypeAsync
Creates a new digital twin type.
See Also: Digital Twins
Required Role(s): Super Admin
- ClientSDK.DigitalTwin.CreateDigitalTwinTypeAsync(DigitalTwinType digitalTwinType)
- Parameters
digitalTwinType (DigitalTwinType) – The DigitalTwin Type Object
- Returns
The created DigitalTwinType.
- Return type
Task<DigitalTwinType>
UpdateDigitalTwinTypeAsync
Updates an existing digital twin type.
See Also: Digital Twins
Required Role(s): Super Admin
- ClientSDK.DigitalTwin.UpdateDigitalTwinTypeAsync(DigitalTwinType digitalTwinType)
- Parameters
digitalTwinType (DigitalTwinType) – The DigitalTwin Type Object
- Returns
The updated DigitalTwinType.
- Return type
Task<DigitalTwinType>
DeleteDigitalTwinTypeAsync
Deletes a digital twin type.
See Also: Digital Twins
Required Role(s): Super Admin
- ClientSDK.DigitalTwin.DeleteDigitalTwinTypeAsync(string id)
- Parameters
id (string) – The GUID of the DigitalTwinType Object
- Returns
Whether the deletion was successful.
- Return type
Task<bool>
GetDigitalTwinTypesAsync
Retrieves all digital twin types.
See Also: Digital Twins
Required Role(s): Any
User must be authenticated
- ClientSDK.DigitalTwin.GetDigitalTwinTypesAsync()
- Returns
A list of all of the DigitalTwinTypes.
- Return type
Task<List<DigitalTwinType>>
Digital Twin Sub-Type Methods
CreateDigitalTwinSubTypeAsync
Creates a new digital twin sub-type.
See Also: Digital Twins
Required Role(s): Super Admin
- ClientSDK.DigitalTwin.CreateDigitalTwinSubTypeAsync(DigitalTwinSubtype digitalTwinSubType)
- Parameters
digitalTwinSubType (DigitalTwinSubtype) – The DigitalTwin Sub-Type Object
- Returns
The created DigitalTwinSubtype.
- Return type
Task<DigitalTwinSubtype>
UpdateDigitalTwinSubTypeAsync
Updates an existing digital twin sub-type.
See Also: Digital Twins
Required Role(s): Super Admin
- ClientSDK.DigitalTwin.UpdateDigitalTwinSubTypeAsync(DigitalTwinSubtype digitalTwinSubType)
- Parameters
digitalTwinSubType (DigitalTwinSubtype) – The DigitalTwinSubtype Type Object
- Returns
The updated DigitalTwinSubtype.
- Return type
Task<DigitalTwinSubtype>
DeleteDigitalTwinSubTypeAsync
Deletes a digital twin sub-type.
See Also: Digital Twins
Required Role(s): Super Admin
- ClientSDK.DigitalTwin.DeleteDigitalTwinSubTypeAsync(string id)
- Parameters
id (string) – The GUID of the DigitalTwinSubtype Object
- Returns
Whether the deletion was successful.
- Return type
Task<bool>
GetDigitalTwinSubTypesAsync
Retrieves all digital twin types.
See Also: Digital Twins
Required Role(s): Any
User must be authenticated
- ClientSDK.DigitalTwin.GetDigitalTwinSubTypesAsync()
- Returns
A list of all of the DigitalTwinSubtypes.
- Return type
Task<List<DigitalTwinSubtype>>
Digital Twin Methods
CreateSpaceAsync
Creates a new space Digital Twin.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the digital twin associated to the operation that the report definition is associated.
- ClientSDK.DigitalTwin.CreateSpaceAsync(string parentId, string name, string twinTypeId = Constants.SpaceCategory.LocationType.RefId, string twinSubTypeId = Constants.SpaceCategory.LocationType.OtherSubType.RefId)
- Parameters
parentId (string) – Reference ID of the Parent Digital Twin.
name (string) – The name of the space.
twinTypeId (string) – The ID of the Type of Twin.
twinSubTypeId (string) – The ID of the SubType.
- Returns
Digital Twin Object.
- Return type
Task<DigitalTwin>
var operationDigitalTwin = await clientSDK.DigitalTwin.CreateSpaceAsync(
_tenant.Id,
"New Operation",
Constants.SpaceCategory.OperationType.RefId,
Constants.SpaceCategory.OperationType.WasterWaterTreatmentPlantSubType.RefId);
CreateAsync
Creates a new Digital Twin.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.CreateAsync(DigitalTwin digitalTwin)
- Parameters
digitalTwin (Digital Twin Object) – Digital Twin Object.
- Returns
Digital Twin Object.
- Return type
Task<DigitalTwin>
DeleteTreeAsync
Deletes a Digital Twin and its descendants.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.DeleteTreeAsync(string id)
- Parameters
id (string) – Unique Reference Id (GUID) of the digital twin.
- Returns
Whether the deletion was successful.
- Return type
Task<bool>
GetAsync
Returns a digital twin based on the digital twin ID.
Required Role(s): Any
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.GetAsync(string twinRefId)
- Parameters
twinRefId (string) – Unique Reference Id (GUID) of the digital twin.
- Returns
Whether the deletion was successful.
- Return type
Task<bool>
GetDescendantsByTypeAsync
Returns a collection of digital twins based on the digital twin ID and Type.
Required Role(s): Any
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.GetDescendantsByTypeAsync(string twinRefId, string twinTypeId)
- Parameters
twinRefId (string) – Unique Reference Id (GUID) of the digital twin.
twinTypeId (string) – Unique Reference Id (GUID) of the digital twin type.
- Returns
List of Digital Twins.
- Return type
Task<List<DigitalTwin>>
GetDescendantsAsync
Returns a collection of digital twins based on the digital twin ID and optional Type.
Required Role(s): Any
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.GetDescendantsAsync(string twinRefId, string twinTypeId)
- Parameters
twinRefId (string) – Unique Reference Id (GUID) of the digital twin.
twinTypeId (string) – (Optional) Unique Reference Id (GUID) of the digital twin type.
- Returns
List of Digital Twins.
- Return type
Task<List<DigitalTwin>>
GetDescendantsBySubTypeAsync
Returns a collection of digital twins based on the digital twin ID and Sub Type.
Required Role(s): Any
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.GetDescendantsBySubTypeAsync(string twinRefId, string twinSubTypeId)
- Parameters
twinRefId (string) – Unique Reference Id (GUID) of the digital twin.
twinSubTypeId (string) – Unique Reference Id (GUID) of the digital twin subtype.
- Returns
List of Digital Twins.
- Return type
Task<List<DigitalTwin>>
GetDescendantsBySubTypeAsync
Returns a collection of digital twins based on the digital twin ID and category Id. See Digital Twins
Required Role(s): Any
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.GetDescendantsByCategoryAsync(string twinRefId, uint categoryId)
- Parameters
twinRefId (string) – Unique Reference Id (GUID) of the digital twin.
categoryId (uint) – Unique category Id of the digital twin category. See Digital Twins
- Returns
List of Digital Twins.
- Return type
Task<List<DigitalTwin>>
MoveAsync
Moves an existing Digital Twin to a new parent.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.MoveAsync(string twinRefId, string parentRefId)
- Parameters
twinRefId (string) – Reference ID of the Digital Twin.
parentRefId (string) – Reference ID of the Parent Digital Twin.
- Returns
Digital Twin Object.
- Return type
Task<DigitalTwin>
UpdateAsync
Updates an existing Digital Twin.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.UpdateAsync(DigitalTwin digitalTwin)
- Parameters
digitalTwin (DigitalTwin) – Digital Twin Object.
- Returns
Digital Twin Object.
- Return type
Task<DigitalTwin>
UpdateTwinDataAsync
Updates the twin data on an existing Digital Twin.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.UpdateTwinDataAsync(string twinReferenceId, JsonPatchDocument twinData)
- Parameters
twinReferenceId (string) – Unique Reference Id (GUID) of the digital twin.
twinData (JsonPatchDocument) – JsonPatchDocument.
- Returns
Digital Twin Object.
- Return type
Task<DigitalTwin>
UpdateTwinDataManyAsync
Updates the twin data on multiple existing Digital Twins.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.UpdateTwinDataManyAsync(Dictionary<string, JsonPatchDocument> twinDataMany)
- Parameters
twinDataMany (Dictionary<string, JsonPatchDocument>) – Dictionary of a collection of twins to be updated.
- Returns
Digital Twin Object.
- Return type
Task<DigitalTwin>
DeleteAsync
Deletes a Digital Twin.
Required Role(s): Admin, Support Admin, Super Admin
Resource Authorization: Access to the parent digital twin.
- ClientSDK.DigitalTwin.DeleteAsync(long twinId)
- Parameters
twinId (long) – The numeric unique id of the twin.
- Returns
Whether the deletion was successful.
- Return type
Task<bool>