updateMaintenanceStartTime method

Future<UpdateMaintenanceStartTimeOutput> updateMaintenanceStartTime({
  1. required String gatewayARN,
  2. required int hourOfDay,
  3. required int minuteOfHour,
  4. int? dayOfMonth,
  5. int? dayOfWeek,
})

Updates a gateway's weekly maintenance start time information, including day and time of the week. The maintenance time is the time in your gateway's time zone.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Parameter hourOfDay : The hour component of the maintenance start time represented as hh, where hh is the hour (00 to 23). The hour of the day is in the time zone of the gateway.

Parameter minuteOfHour : The minute component of the maintenance start time represented as mm, where mm is the minute (00 to 59). The minute of the hour is in the time zone of the gateway.

Parameter dayOfMonth : The day of the month component of the maintenance start time represented as an ordinal number from 1 to 28, where 1 represents the first day of the month and 28 represents the last day of the month.

Parameter dayOfWeek : The day of the week component of the maintenance start time week represented as an ordinal number from 0 to 6, where 0 represents Sunday and 6 Saturday.

Implementation

Future<UpdateMaintenanceStartTimeOutput> updateMaintenanceStartTime({
  required String gatewayARN,
  required int hourOfDay,
  required int minuteOfHour,
  int? dayOfMonth,
  int? dayOfWeek,
}) async {
  ArgumentError.checkNotNull(gatewayARN, 'gatewayARN');
  _s.validateStringLength(
    'gatewayARN',
    gatewayARN,
    50,
    500,
    isRequired: true,
  );
  ArgumentError.checkNotNull(hourOfDay, 'hourOfDay');
  _s.validateNumRange(
    'hourOfDay',
    hourOfDay,
    0,
    23,
    isRequired: true,
  );
  ArgumentError.checkNotNull(minuteOfHour, 'minuteOfHour');
  _s.validateNumRange(
    'minuteOfHour',
    minuteOfHour,
    0,
    59,
    isRequired: true,
  );
  _s.validateNumRange(
    'dayOfMonth',
    dayOfMonth,
    1,
    28,
  );
  _s.validateNumRange(
    'dayOfWeek',
    dayOfWeek,
    0,
    6,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.UpdateMaintenanceStartTime'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GatewayARN': gatewayARN,
      'HourOfDay': hourOfDay,
      'MinuteOfHour': minuteOfHour,
      if (dayOfMonth != null) 'DayOfMonth': dayOfMonth,
      if (dayOfWeek != null) 'DayOfWeek': dayOfWeek,
    },
  );

  return UpdateMaintenanceStartTimeOutput.fromJson(jsonResponse.body);
}