deleteTimeSeries method

Future<void> deleteTimeSeries({
  1. String? alias,
  2. String? assetId,
  3. String? clientToken,
  4. String? propertyId,
  5. String? workspaceName,
})

Deletes a time series (data stream). If you delete a time series that's associated with an asset property, the asset property still exists, but the time series will no longer be associated with this asset property. You can't delete a time series until all of its data segments have been deleted from session datasets.

To identify a time series, do one of the following:

  • If the time series isn't associated with an asset property, specify the alias of the time series.
  • If the time series is associated with an asset property, specify one of the following:
    • The alias of the time series.
    • The assetId and propertyId that identifies the asset property.

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

Parameter alias : The alias that identifies the time series.

Parameter assetId : The ID of the asset in which the asset property was created. 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.

Parameter propertyId : The ID of the asset property. 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 workspaceName : The name of the workspace.

Implementation

Future<void> deleteTimeSeries({
  String? alias,
  String? assetId,
  String? clientToken,
  String? propertyId,
  String? workspaceName,
}) async {
  final $query = <String, List<String>>{
    if (alias != null) 'alias': [alias],
    if (assetId != null) 'assetId': [assetId],
    if (propertyId != null) 'propertyId': [propertyId],
    if (workspaceName != null) 'workspaceName': [workspaceName],
  };
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/timeseries/delete',
    queryParams: $query,
    hostPrefix: 'api.',
    exceptionFnMap: _exceptionFns,
  );
}