updateAlias method

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

Updates properties for an alias. To update properties, specify the alias ID to be updated and provide the information to be changed. To reassign an alias to another fleet, provide an updated routing strategy. If successful, the updated alias record is returned.

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

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 {
  ArgumentError.checkNotNull(aliasId, 'aliasId');
  _s.validateStringLength(
    'description',
    description,
    1,
    1024,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    1024,
  );
  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);
}