listFleetDeployments method

Future<ListFleetDeploymentsOutput> listFleetDeployments({
  1. String? fleetId,
  2. int? limit,
  3. String? nextToken,
})

This API works with the following fleet types: Container

Retrieves a collection of container fleet deployments in an Amazon Web Services Region. Use the pagination parameters to retrieve results as a set of sequential pages.

Request options

  • Get a list of all deployments. Call this operation without specifying a fleet ID.
  • Get a list of all deployments for a fleet. Specify the container fleet ID or ARN value.
Results

If successful, this operation returns a list of deployments that match the request parameters. A NextToken value is also returned if there are more result pages to retrieve.

May throw InternalServiceException. May throw InvalidRequestException. May throw NotFoundException. May throw UnauthorizedException. May throw UnsupportedRegionException.

Parameter fleetId : A unique identifier for the container fleet. You can use either the fleet ID or ARN value.

Parameter limit : The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

Parameter nextToken : A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.

Implementation

Future<ListFleetDeploymentsOutput> listFleetDeployments({
  String? fleetId,
  int? limit,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.ListFleetDeployments'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (fleetId != null) 'FleetId': fleetId,
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListFleetDeploymentsOutput.fromJson(jsonResponse.body);
}