createLicenseVersion method
- required String clientToken,
- required ConsumptionConfiguration consumptionConfiguration,
- required List<
Entitlement> entitlements, - required String homeRegion,
- required Issuer issuer,
- required String licenseArn,
- required String licenseName,
- required String productName,
- required LicenseStatus status,
- required DatetimeRange validity,
- List<
Metadata> ? licenseMetadata, - String? sourceVersion,
Creates a new version of the specified license.
May throw ValidationException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw RedirectException. May throw ConflictException. May throw ServerInternalException. May throw AuthorizationException. May throw RateLimitExceededException.
Parameter clientToken
:
Unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter consumptionConfiguration
:
Configuration for consumption of the license. Choose a provisional
configuration for workloads running with continuous connectivity. Choose a
borrow configuration for workloads with offline usage.
Parameter entitlements
:
License entitlements.
Parameter homeRegion
:
Home Region of the license.
Parameter issuer
:
License issuer.
Parameter licenseArn
:
Amazon Resource Name (ARN) of the license.
Parameter licenseName
:
License name.
Parameter productName
:
Product name.
Parameter status
:
License status.
Parameter validity
:
Date and time range during which the license is valid, in ISO8601-UTC
format.
Parameter licenseMetadata
:
Information about the license.
Parameter sourceVersion
:
Current version of the license.
Implementation
Future<CreateLicenseVersionResponse> createLicenseVersion({
required String clientToken,
required ConsumptionConfiguration consumptionConfiguration,
required List<Entitlement> entitlements,
required String homeRegion,
required Issuer issuer,
required String licenseArn,
required String licenseName,
required String productName,
required LicenseStatus status,
required DatetimeRange validity,
List<Metadata>? licenseMetadata,
String? sourceVersion,
}) async {
ArgumentError.checkNotNull(clientToken, 'clientToken');
ArgumentError.checkNotNull(
consumptionConfiguration, 'consumptionConfiguration');
ArgumentError.checkNotNull(entitlements, 'entitlements');
ArgumentError.checkNotNull(homeRegion, 'homeRegion');
ArgumentError.checkNotNull(issuer, 'issuer');
ArgumentError.checkNotNull(licenseArn, 'licenseArn');
_s.validateStringLength(
'licenseArn',
licenseArn,
0,
2048,
isRequired: true,
);
ArgumentError.checkNotNull(licenseName, 'licenseName');
ArgumentError.checkNotNull(productName, 'productName');
ArgumentError.checkNotNull(status, 'status');
ArgumentError.checkNotNull(validity, 'validity');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSLicenseManager.CreateLicenseVersion'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ClientToken': clientToken,
'ConsumptionConfiguration': consumptionConfiguration,
'Entitlements': entitlements,
'HomeRegion': homeRegion,
'Issuer': issuer,
'LicenseArn': licenseArn,
'LicenseName': licenseName,
'ProductName': productName,
'Status': status.toValue(),
'Validity': validity,
if (licenseMetadata != null) 'LicenseMetadata': licenseMetadata,
if (sourceVersion != null) 'SourceVersion': sourceVersion,
},
);
return CreateLicenseVersionResponse.fromJson(jsonResponse.body);
}