listImageReferrers method

Future<ListImageReferrersResponse> listImageReferrers({
  1. required String repositoryName,
  2. required SubjectIdentifier subjectId,
  3. ListImageReferrersFilter? filter,
  4. int? maxResults,
  5. String? nextToken,
  6. String? registryId,
})

Lists the artifacts associated with a specified subject image.

May throw InvalidParameterException. May throw RepositoryNotFoundException. May throw ServerException. May throw UnableToListUpstreamImageReferrersException. May throw ValidationException.

Parameter repositoryName : The name of the repository that contains the subject image.

Parameter subjectId : An object containing the image digest of the subject image for which to retrieve associated artifacts.

Parameter filter : The filter key and value with which to filter your ListImageReferrers results. If no filter is specified, only artifacts with ACTIVE status are returned.

Parameter maxResults : The maximum number of image referrer results returned by ListImageReferrers in paginated output. When this parameter is used, ListImageReferrers 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 ListImageReferrers request with the returned nextToken value. This value can be between 1 and 50. If this parameter is not used, then ListImageReferrers returns up to 20 results and a nextToken value, if applicable.

Parameter nextToken : The nextToken value returned from a previous paginated ListImageReferrers 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 Amazon Web Services account ID associated with the registry that contains the repository in which to list image referrers. If you do not specify a registry, the default registry is assumed.

Implementation

Future<ListImageReferrersResponse> listImageReferrers({
  required String repositoryName,
  required SubjectIdentifier subjectId,
  ListImageReferrersFilter? filter,
  int? maxResults,
  String? nextToken,
  String? registryId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonEC2ContainerRegistry_V20150921.ListImageReferrers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'repositoryName': repositoryName,
      'subjectId': subjectId,
      if (filter != null) 'filter': filter,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (registryId != null) 'registryId': registryId,
    },
  );

  return ListImageReferrersResponse.fromJson(jsonResponse.body);
}