updateGatewayInformation method

Future<UpdateGatewayInformationOutput> updateGatewayInformation({
  1. required String gatewayARN,
  2. String? cloudWatchLogGroupARN,
  3. GatewayCapacity? gatewayCapacity,
  4. String? gatewayName,
  5. String? gatewayTimezone,
})

Updates a gateway's metadata, which includes the gateway's name, time zone, and metadata cache size. To specify which gateway to update, use the Amazon Resource Name (ARN) of the gateway in your request.

May throw InternalServerError. May throw InvalidGatewayRequestException.

Parameter cloudWatchLogGroupARN : The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that you want to use to monitor and log events in the gateway.

For more information, see What is Amazon CloudWatch Logs?

Parameter gatewayCapacity : Specifies the size of the gateway's metadata cache. This setting impacts gateway performance and hardware recommendations. For more information, see Performance guidance for gateways with multiple file shares in the Amazon S3 File Gateway User Guide.

Parameter gatewayTimezone : A value that indicates the time zone of the gateway.

Implementation

Future<UpdateGatewayInformationOutput> updateGatewayInformation({
  required String gatewayARN,
  String? cloudWatchLogGroupARN,
  GatewayCapacity? gatewayCapacity,
  String? gatewayName,
  String? gatewayTimezone,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.UpdateGatewayInformation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GatewayARN': gatewayARN,
      if (cloudWatchLogGroupARN != null)
        'CloudWatchLogGroupARN': cloudWatchLogGroupARN,
      if (gatewayCapacity != null) 'GatewayCapacity': gatewayCapacity.value,
      if (gatewayName != null) 'GatewayName': gatewayName,
      if (gatewayTimezone != null) 'GatewayTimezone': gatewayTimezone,
    },
  );

  return UpdateGatewayInformationOutput.fromJson(jsonResponse.body);
}