createLongTermPricing method
Future<CreateLongTermPricingResult>
createLongTermPricing({
- required LongTermPricingType longTermPricingType,
- required SnowballType snowballType,
- bool? isLongTermPricingAutoRenew,
Creates a job with the long-term usage option for a device. The long-term usage is a 1-year or 3-year long-term pricing type for the device. You are billed upfront, and Amazon Web Services provides discounts for long-term pricing.
May throw InvalidResourceException.
Parameter longTermPricingType :
The type of long-term pricing option you want for the device, either
1-year or 3-year long-term pricing.
Parameter snowballType :
The type of Snow Family devices to use for the long-term pricing job.
Parameter isLongTermPricingAutoRenew :
Specifies whether the current long-term pricing type for the device should
be renewed.
Implementation
Future<CreateLongTermPricingResult> createLongTermPricing({
required LongTermPricingType longTermPricingType,
required SnowballType snowballType,
bool? isLongTermPricingAutoRenew,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSIESnowballJobManagementService.CreateLongTermPricing'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'LongTermPricingType': longTermPricingType.value,
'SnowballType': snowballType.value,
if (isLongTermPricingAutoRenew != null)
'IsLongTermPricingAutoRenew': isLongTermPricingAutoRenew,
},
);
return CreateLongTermPricingResult.fromJson(jsonResponse.body);
}