listPackagesForDomain method

Future<ListPackagesForDomainResponse> listPackagesForDomain({
  1. required String domainName,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all packages associated with the Amazon OpenSearch Service domain.

May throw BaseException. May throw InternalException. May throw ResourceNotFoundException. May throw AccessDeniedException. May throw ValidationException.

Parameter domainName : The name of the domain for which you want to list associated packages.

Parameter maxResults : Limits results to a maximum number of packages.

Parameter nextToken : Used for pagination. Only necessary if a previous API call includes a non-null NextToken value. If provided, returns results for the next page.

Implementation

Future<ListPackagesForDomainResponse> listPackagesForDomain({
  required String domainName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(domainName, 'domainName');
  _s.validateStringLength(
    'domainName',
    domainName,
    3,
    28,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/2021-01-01/domain/${Uri.encodeComponent(domainName)}/packages',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListPackagesForDomainResponse.fromJson(response);
}