describeImageScanFindings method

Future<DescribeImageScanFindingsResponse> describeImageScanFindings({
  1. required ImageIdentifier imageId,
  2. required String repositoryName,
  3. int? maxResults,
  4. String? nextToken,
  5. String? registryId,
})

Returns the scan findings for the specified image.

May throw ServerException. May throw InvalidParameterException. May throw RepositoryNotFoundException. May throw ImageNotFoundException. May throw ScanNotFoundException.

Parameter repositoryName : The repository for the image for which to describe the scan findings.

Parameter maxResults : The maximum number of image scan results returned by DescribeImageScanFindings in paginated output. When this parameter is used, DescribeImageScanFindings only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribeImageScanFindings request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribeImageScanFindings returns up to 100 results and a nextToken value, if applicable.

Parameter nextToken : The nextToken value returned from a previous paginated DescribeImageScanFindings request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.

Parameter registryId : The AWS account ID associated with the registry that contains the repository in which to describe the image scan findings for. If you do not specify a registry, the default registry is assumed.

Implementation

Future<DescribeImageScanFindingsResponse> describeImageScanFindings({
  required ImageIdentifier imageId,
  required String repositoryName,
  int? maxResults,
  String? nextToken,
  String? registryId,
}) async {
  ArgumentError.checkNotNull(imageId, 'imageId');
  ArgumentError.checkNotNull(repositoryName, 'repositoryName');
  _s.validateStringLength(
    'repositoryName',
    repositoryName,
    2,
    256,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AmazonEC2ContainerRegistry_V20150921.DescribeImageScanFindings'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'imageId': imageId,
      'repositoryName': repositoryName,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (registryId != null) 'registryId': registryId,
    },
  );

  return DescribeImageScanFindingsResponse.fromJson(jsonResponse.body);
}