listPackageGroups method

Future<ListPackageGroupsResult> listPackageGroups({
  1. required String domain,
  2. String? domainOwner,
  3. int? maxResults,
  4. String? nextToken,
  5. String? prefix,
})

Returns a list of package groups in the requested domain.

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

Parameter domain : The domain for which you want to list package groups.

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 prefix : A prefix for which to search package groups. When included, ListPackageGroups will return only package groups with patterns that match the prefix.

Implementation

Future<ListPackageGroupsResult> listPackageGroups({
  required String domain,
  String? domainOwner,
  int? maxResults,
  String? nextToken,
  String? prefix,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    'domain': [domain],
    if (domainOwner != null) 'domain-owner': [domainOwner],
    if (maxResults != null) 'max-results': [maxResults.toString()],
    if (nextToken != null) 'next-token': [nextToken],
    if (prefix != null) 'prefix': [prefix],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'POST',
    requestUri: '/v1/package-groups',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListPackageGroupsResult.fromJson(response);
}