updateDistributionBundle method

Future<UpdateDistributionBundleResult> updateDistributionBundle({
  1. String? bundleId,
  2. String? distributionName,
})

Updates the bundle of your Amazon Lightsail content delivery network (CDN) distribution.

A distribution bundle specifies the monthly network transfer quota and monthly cost of your dsitribution.

Update your distribution's bundle if your distribution is going over its monthly network transfer quota and is incurring an overage fee.

You can update your distribution's bundle only one time within your monthly AWS billing cycle. To determine if you can update your distribution's bundle, use the GetDistributions action. The ableToUpdateBundle parameter in the result will indicate whether you can currently update your distribution's bundle.

May throw ServiceException. May throw InvalidInputException. May throw NotFoundException. May throw OperationFailureException. May throw AccessDeniedException. May throw UnauthenticatedException.

Parameter bundleId : The bundle ID of the new bundle to apply to your distribution.

Use the GetDistributionBundles action to get a list of distribution bundle IDs that you can specify.

Parameter distributionName : The name of the distribution for which to update the bundle.

Use the GetDistributions action to get a list of distribution names that you can specify.

Implementation

Future<UpdateDistributionBundleResult> updateDistributionBundle({
  String? bundleId,
  String? distributionName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Lightsail_20161128.UpdateDistributionBundle'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (bundleId != null) 'bundleId': bundleId,
      if (distributionName != null) 'distributionName': distributionName,
    },
  );

  return UpdateDistributionBundleResult.fromJson(jsonResponse.body);
}