updateDistributionBundle method
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 distribution.
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 Amazon Web Services 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 AccessDeniedException.
May throw InvalidInputException.
May throw NotFoundException.
May throw OperationFailureException.
May throw ServiceException.
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);
}