describeReservedElasticsearchInstances method

Future<DescribeReservedElasticsearchInstancesResponse> describeReservedElasticsearchInstances({
  1. int? maxResults,
  2. String? nextToken,
  3. String? reservedElasticsearchInstanceId,
})

Returns information about reserved Elasticsearch instances for this account.

May throw ResourceNotFoundException. May throw InternalException. May throw ValidationException. May throw DisabledOperationException.

Parameter maxResults : Set this value to limit the number of results returned. If not specified, defaults to 100.

Parameter nextToken : NextToken should be sent in case if earlier API call produced result containing NextToken. It is used for pagination.

Parameter reservedElasticsearchInstanceId : The reserved instance identifier filter value. Use this parameter to show only the reservation that matches the specified reserved Elasticsearch instance ID.

Implementation

Future<DescribeReservedElasticsearchInstancesResponse>
    describeReservedElasticsearchInstances({
  int? maxResults,
  String? nextToken,
  String? reservedElasticsearchInstanceId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (reservedElasticsearchInstanceId != null)
      'reservationId': [reservedElasticsearchInstanceId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/2015-01-01/es/reservedInstances',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeReservedElasticsearchInstancesResponse.fromJson(response);
}