listUltraServersByReservedCapacity method

Future<ListUltraServersByReservedCapacityResponse> listUltraServersByReservedCapacity({
  1. required String reservedCapacityArn,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all UltraServers that are part of a specified reserved capacity.

May throw ResourceNotFound.

Parameter reservedCapacityArn : The ARN of the reserved capacity to list UltraServers for.

Parameter maxResults : The maximum number of UltraServers to return in the response. The default value is 10.

Parameter nextToken : If the previous response was truncated, you receive this token. Use it in your next request to receive the next set of results.

Implementation

Future<ListUltraServersByReservedCapacityResponse>
    listUltraServersByReservedCapacity({
  required String reservedCapacityArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListUltraServersByReservedCapacity'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ReservedCapacityArn': reservedCapacityArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListUltraServersByReservedCapacityResponse.fromJson(
      jsonResponse.body);
}