getOpsSummary method

Future<GetOpsSummaryResult> getOpsSummary({
  1. List<OpsAggregator>? aggregators,
  2. List<OpsFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
  5. List<OpsResultAttribute>? resultAttributes,
  6. String? syncName,
})

View a summary of OpsItems based on specified filters and aggregators.

May throw InternalServerError. May throw ResourceDataSyncNotFoundException. May throw InvalidFilter. May throw InvalidNextToken. May throw InvalidTypeNameException. May throw InvalidAggregatorException.

Parameter aggregators : Optional aggregators that return counts of OpsItems based on one or more expressions.

Parameter filters : Optional filters used to scope down the returned OpsItems.

Parameter maxResults : The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : A token to start the list. Use this token to get the next set of results.

Parameter resultAttributes : The OpsItem data type to return.

Parameter syncName : Specify the name of a resource data sync to get.

Implementation

Future<GetOpsSummaryResult> getOpsSummary({
  List<OpsAggregator>? aggregators,
  List<OpsFilter>? filters,
  int? maxResults,
  String? nextToken,
  List<OpsResultAttribute>? resultAttributes,
  String? syncName,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  _s.validateStringLength(
    'syncName',
    syncName,
    1,
    64,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.GetOpsSummary'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (aggregators != null) 'Aggregators': aggregators,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (resultAttributes != null) 'ResultAttributes': resultAttributes,
      if (syncName != null) 'SyncName': syncName,
    },
  );

  return GetOpsSummaryResult.fromJson(jsonResponse.body);
}