associateTimeSeriesToAssetProperty method

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

Associates a time series (data stream) with an 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 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 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> associateTimeSeriesToAssetProperty({
  required String alias,
  required String assetId,
  required String propertyId,
  String? clientToken,
}) async {
  final $query = <String, List<String>>{
    'alias': [alias],
    'assetId': [assetId],
    'propertyId': [propertyId],
  };
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/timeseries/associate',
    queryParams: $query,
    hostPrefix: 'api.',
    exceptionFnMap: _exceptionFns,
  );
}