describeInstancePatchStates method

Future<DescribeInstancePatchStatesResult> describeInstancePatchStates({
  1. required List<String> instanceIds,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves the high-level patch state of one or more instances.

May throw InternalServerError. May throw InvalidNextToken.

Parameter instanceIds : The ID of the instance whose patch state information should be retrieved.

Parameter maxResults : The maximum number of instances 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<DescribeInstancePatchStatesResult> describeInstancePatchStates({
  required List<String> instanceIds,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(instanceIds, 'instanceIds');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    10,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeInstancePatchStates'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceIds': instanceIds,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeInstancePatchStatesResult.fromJson(jsonResponse.body);
}