listAliases method

Future<ListAliasesOutput> listAliases({
  1. int? limit,
  2. String? name,
  3. String? nextToken,
  4. RoutingStrategyType? routingStrategyType,
})

Retrieves all aliases for this AWS account. You can filter the result set by alias name and/or routing strategy type. Use the pagination parameters to retrieve results in sequential pages.

May throw UnauthorizedException. May throw InvalidRequestException. May throw InternalServiceException.

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

Parameter name : A descriptive label that is associated with an alias. Alias names do not need to be unique.

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.

Parameter routingStrategyType : The routing type to filter results on. Use this parameter to retrieve only aliases with a certain routing type. To retrieve all aliases, leave this parameter empty.

Possible routing types include the following:

  • SIMPLE -- The alias resolves to one specific fleet. Use this type when routing to active fleets.
  • TERMINAL -- The alias does not resolve to a fleet but instead can be used to display a message to the user. A terminal alias throws a TerminalRoutingStrategyException with the RoutingStrategy message embedded.

Implementation

Future<ListAliasesOutput> listAliases({
  int? limit,
  String? name,
  String? nextToken,
  RoutingStrategyType? routingStrategyType,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.ListAliases'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (limit != null) 'Limit': limit,
      if (name != null) 'Name': name,
      if (nextToken != null) 'NextToken': nextToken,
      if (routingStrategyType != null)
        'RoutingStrategyType': routingStrategyType.toValue(),
    },
  );

  return ListAliasesOutput.fromJson(jsonResponse.body);
}