updateAlias method

Future<UpdateAliasOutput> updateAlias({
  1. required String aliasId,
  2. String? description,
  3. String? name,
  4. RoutingStrategy? routingStrategy,
})

This API works with the following fleet types: EC2, Anywhere, Container

Updates properties for an alias. Specify the unique identifier of the alias to be updated and the new property values.

When reassigning an alias to a new fleet, provide an updated routing strategy. If successful, the updated alias record is returned.

Related actions

All APIs by task

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

Parameter aliasId : A unique identifier for the alias that you want to update. You can use either the alias ID or ARN value.

Parameter description : A human-readable description of the alias.

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

Parameter routingStrategy : The routing configuration, including routing type and fleet target, for the alias.

Implementation

Future<UpdateAliasOutput> updateAlias({
  required String aliasId,
  String? description,
  String? name,
  RoutingStrategy? routingStrategy,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.UpdateAlias'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AliasId': aliasId,
      if (description != null) 'Description': description,
      if (name != null) 'Name': name,
      if (routingStrategy != null) 'RoutingStrategy': routingStrategy,
    },
  );

  return UpdateAliasOutput.fromJson(jsonResponse.body);
}