batchGetAssetPropertyAggregates method

Future<BatchGetAssetPropertyAggregatesResponse> batchGetAssetPropertyAggregates({
  1. required List<BatchGetAssetPropertyAggregatesEntry> entries,
  2. int? maxResults,
  3. String? nextToken,
})

Gets aggregated values (for example, average, minimum, and maximum) for one or more asset properties. For more information, see Querying aggregates in the IoT SiteWise User Guide.

May throw InternalFailureException. May throw InvalidRequestException. May throw ServiceUnavailableException. May throw ThrottlingException.

Parameter entries : The list of asset property aggregate entries for the batch get request. You can specify up to 16 entries per request.

Parameter maxResults : The maximum number of results to return for each paginated request. A result set is returned in the two cases, whichever occurs first.

  • The size of the result set is equal to 1 MB.
  • The number of data points in the result set is equal to the value of maxResults. The maximum value of maxResults is 4000.

Parameter nextToken : The token to be used for the next set of paginated results.

Implementation

Future<BatchGetAssetPropertyAggregatesResponse>
    batchGetAssetPropertyAggregates({
  required List<BatchGetAssetPropertyAggregatesEntry> entries,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1152921504606846976,
  );
  final $payload = <String, dynamic>{
    'entries': entries,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/properties/batch/aggregates',
    exceptionFnMap: _exceptionFns,
  );
  return BatchGetAssetPropertyAggregatesResponse.fromJson(response);
}