updateGatewayInformation method

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

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

May throw InvalidGatewayRequestException. May throw InternalServerError.

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 gatewayTimezone : A value that indicates the time zone of the gateway.

Implementation

Future<UpdateGatewayInformationOutput> updateGatewayInformation({
  required String gatewayARN,
  String? cloudWatchLogGroupARN,
  String? gatewayName,
  String? gatewayTimezone,
}) async {
  ArgumentError.checkNotNull(gatewayARN, 'gatewayARN');
  _s.validateStringLength(
    'gatewayARN',
    gatewayARN,
    50,
    500,
    isRequired: true,
  );
  _s.validateStringLength(
    'cloudWatchLogGroupARN',
    cloudWatchLogGroupARN,
    0,
    562,
  );
  _s.validateStringLength(
    'gatewayName',
    gatewayName,
    2,
    255,
  );
  _s.validateStringLength(
    'gatewayTimezone',
    gatewayTimezone,
    3,
    10,
  );
  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 (gatewayName != null) 'GatewayName': gatewayName,
      if (gatewayTimezone != null) 'GatewayTimezone': gatewayTimezone,
    },
  );

  return UpdateGatewayInformationOutput.fromJson(jsonResponse.body);
}