deleteAsset method

Future<DeleteAssetResponse> deleteAsset({
  1. required String assetId,
  2. String? clientToken,
})

Deletes an asset. This action can't be undone. For more information, see Deleting assets and models in the IoT SiteWise User Guide.

May throw ConflictingOperationException. May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter assetId : The ID of the asset to delete. 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 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<DeleteAssetResponse> deleteAsset({
  required String assetId,
  String? clientToken,
}) async {
  final $query = <String, List<String>>{
    if (clientToken != null) 'clientToken': [clientToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/assets/${Uri.encodeComponent(assetId)}',
    queryParams: $query,
    hostPrefix: 'api.',
    exceptionFnMap: _exceptionFns,
  );
  return DeleteAssetResponse.fromJson(response);
}