describeEffectivePatchesForPatchBaseline method

Future<DescribeEffectivePatchesForPatchBaselineResult> describeEffectivePatchesForPatchBaseline({
  1. required String baselineId,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves the current effective patches (the patch and the approval state) for the specified patch baseline. Note that this API applies only to Windows patch baselines.

May throw InvalidResourceId. May throw DoesNotExistException. May throw UnsupportedOperatingSystem. May throw InternalServerError.

Parameter baselineId : The ID of the patch baseline to retrieve the effective patches for.

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<DescribeEffectivePatchesForPatchBaselineResult>
    describeEffectivePatchesForPatchBaseline({
  required String baselineId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(baselineId, 'baselineId');
  _s.validateStringLength(
    'baselineId',
    baselineId,
    20,
    128,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeEffectivePatchesForPatchBaseline'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BaselineId': baselineId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeEffectivePatchesForPatchBaselineResult.fromJson(
      jsonResponse.body);
}