listVersions method

Future<ListVersionsResponse> listVersions({
  1. int? maxResults,
  2. String? nextToken,
})

Lists all versions of OpenSearch and Elasticsearch that Amazon OpenSearch Service supports.

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

Parameter maxResults : An optional parameter that specifies the maximum number of results to return. You can use nextToken to get the next page of results.

Parameter nextToken : If your initial ListVersions operation returns a nextToken, you can include the returned nextToken in subsequent ListVersions operations, which returns results in the next page.

Implementation

Future<ListVersionsResponse> listVersions({
  int? maxResults,
  String? nextToken,
}) async {
  _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/opensearch/versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListVersionsResponse.fromJson(response);
}