listAssociatedPackages method

Future<ListAssociatedPackagesResult> listAssociatedPackages({
  1. required String domain,
  2. required String packageGroup,
  3. String? domainOwner,
  4. int? maxResults,
  5. String? nextToken,
  6. bool? preview,
})

Returns a list of packages associated with the requested package group. For information package group association and matching, see Package group definition syntax and matching behavior in the CodeArtifact User Guide.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter domain : The name of the domain that contains the package group from which to list associated packages.

Parameter packageGroup : The pattern of the package group from which to list associated packages.

Parameter domainOwner : The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.

Parameter maxResults : The maximum number of results to return per page.

Parameter nextToken : The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Parameter preview : When this flag is included, ListAssociatedPackages will return a list of packages that would be associated with a package group, even if it does not exist.

Implementation

Future<ListAssociatedPackagesResult> listAssociatedPackages({
  required String domain,
  required String packageGroup,
  String? domainOwner,
  int? maxResults,
  String? nextToken,
  bool? preview,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    'domain': [domain],
    'package-group': [packageGroup],
    if (domainOwner != null) 'domain-owner': [domainOwner],
    if (maxResults != null) 'max-results': [maxResults.toString()],
    if (nextToken != null) 'next-token': [nextToken],
    if (preview != null) 'preview': [preview.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v1/list-associated-packages',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListAssociatedPackagesResult.fromJson(response);
}