updateBandwidthRateLimitSchedule method

Future<UpdateBandwidthRateLimitScheduleOutput> updateBandwidthRateLimitSchedule({
  1. required List<BandwidthRateLimitInterval> bandwidthRateLimitIntervals,
  2. required String gatewayARN,
})

Updates the bandwidth rate limit schedule for a specified gateway. By default, gateways do not have bandwidth rate limit schedules, which means no bandwidth rate limiting is in effect. Use this to initiate or update a gateway's bandwidth rate limit schedule. This operation is supported in the volume and tape gateway types.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Parameter bandwidthRateLimitIntervals : An array containing bandwidth rate limit schedule intervals for a gateway. When no bandwidth rate limit intervals have been scheduled, the array is empty.

Implementation

Future<UpdateBandwidthRateLimitScheduleOutput>
    updateBandwidthRateLimitSchedule({
  required List<BandwidthRateLimitInterval> bandwidthRateLimitIntervals,
  required String gatewayARN,
}) async {
  ArgumentError.checkNotNull(
      bandwidthRateLimitIntervals, 'bandwidthRateLimitIntervals');
  ArgumentError.checkNotNull(gatewayARN, 'gatewayARN');
  _s.validateStringLength(
    'gatewayARN',
    gatewayARN,
    50,
    500,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StorageGateway_20130630.UpdateBandwidthRateLimitSchedule'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BandwidthRateLimitIntervals': bandwidthRateLimitIntervals,
      'GatewayARN': gatewayARN,
    },
  );

  return UpdateBandwidthRateLimitScheduleOutput.fromJson(jsonResponse.body);
}