describeInstancePatchStatesForPatchGroup method

Future<DescribeInstancePatchStatesForPatchGroupResult> describeInstancePatchStatesForPatchGroup({
  1. required String patchGroup,
  2. List<InstancePatchStateFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Retrieves the high-level patch state for the instances in the specified patch group.

May throw InternalServerError. May throw InvalidFilter. May throw InvalidNextToken.

Parameter patchGroup : The name of the patch group for which the patch state information should be retrieved.

Parameter filters : Each entry in the array is a structure containing:

Key (string between 1 and 200 characters)

Values (array containing a single string)

Type (string "Equal", "NotEqual", "LessThan", "GreaterThan")

Parameter maxResults : The maximum number of patches to return (per page).

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<DescribeInstancePatchStatesForPatchGroupResult>
    describeInstancePatchStatesForPatchGroup({
  required String patchGroup,
  List<InstancePatchStateFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(patchGroup, 'patchGroup');
  _s.validateStringLength(
    'patchGroup',
    patchGroup,
    1,
    256,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    10,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeInstancePatchStatesForPatchGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'PatchGroup': patchGroup,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeInstancePatchStatesForPatchGroupResult.fromJson(
      jsonResponse.body);
}