listPackageVersions method

Future<ListPackageVersionsResponse> listPackageVersions({
  1. required String packageName,
  2. int? maxResults,
  3. String? nextToken,
  4. PackageVersionStatus? status,
})

Lists the software package versions associated to the account.

Requires permission to access the ListPackageVersions action.

May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter packageName : The name of the target software package.

Parameter maxResults : The maximum number of results to return at one time.

Parameter nextToken : The token for the next set of results.

Parameter status : The status of the package version. For more information, see Package version lifecycle.

Implementation

Future<ListPackageVersionsResponse> listPackageVersions({
  required String packageName,
  int? maxResults,
  String? nextToken,
  PackageVersionStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (status != null) 'status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/packages/${Uri.encodeComponent(packageName)}/versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListPackageVersionsResponse.fromJson(response);
}