disassociateAssets method
Disassociates a child asset from the given parent asset through a hierarchy defined in the parent asset's model.
May throw ConflictingOperationException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter assetId :
The ID of the parent asset from which to disassociate the child asset.
This can be either the actual ID in UUID format, or else
externalId: followed by the external ID, if it has one. For
more information, see Referencing
objects with external IDs in the IoT SiteWise User Guide.
Parameter childAssetId :
The ID of the child asset to disassociate. This can be either the actual
ID in UUID format, or else externalId: followed by the
external ID, if it has one. For more information, see Referencing
objects with external IDs in the IoT SiteWise User Guide.
Parameter hierarchyId :
The ID of a hierarchy in the parent asset's model. (This can be either the
actual ID in UUID format, or else externalId: followed by the
external ID, if it has one. For more information, see Referencing
objects with external IDs in the IoT SiteWise User Guide.)
Hierarchies allow different groupings of assets to be formed that all come
from the same asset model. You can use the hierarchy ID to identify the
correct asset to disassociate. For more information, see Asset
hierarchies in the IoT SiteWise User Guide.
Parameter clientToken :
A unique case-sensitive identifier that you can provide to ensure the
idempotency of the request. Don't reuse this client token if a new
idempotent request is required.
Implementation
Future<void> disassociateAssets({
required String assetId,
required String childAssetId,
required String hierarchyId,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'childAssetId': childAssetId,
'hierarchyId': hierarchyId,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/assets/${Uri.encodeComponent(assetId)}/disassociate',
hostPrefix: 'api.',
exceptionFnMap: _exceptionFns,
);
}