checkoutLicense method
Checks out the specified license.
May throw AccessDeniedException.
May throw AuthorizationException.
May throw InvalidParameterValueException.
May throw NoEntitlementsAllowedException.
May throw RateLimitExceededException.
May throw RedirectException.
May throw ResourceNotFoundException.
May throw ServerInternalException.
May throw UnsupportedDigitalSignatureMethodException.
May throw ValidationException.
Parameter checkoutType :
Checkout type.
Parameter clientToken :
Unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter entitlements :
License entitlements.
Parameter keyFingerprint :
Key fingerprint identifying the license.
Parameter productSKU :
Product SKU.
Parameter beneficiary :
License beneficiary.
Parameter nodeId :
Node ID.
Implementation
Future<CheckoutLicenseResponse> checkoutLicense({
required CheckoutType checkoutType,
required String clientToken,
required List<EntitlementData> entitlements,
required String keyFingerprint,
required String productSKU,
String? beneficiary,
String? nodeId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSLicenseManager.CheckoutLicense'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'CheckoutType': checkoutType.value,
'ClientToken': clientToken,
'Entitlements': entitlements,
'KeyFingerprint': keyFingerprint,
'ProductSKU': productSKU,
if (beneficiary != null) 'Beneficiary': beneficiary,
if (nodeId != null) 'NodeId': nodeId,
},
);
return CheckoutLicenseResponse.fromJson(jsonResponse.body);
}