updateLicenseSpecificationsForResource method
Adds or removes the specified license configurations for the specified Amazon Web Services resource.
You can update the license specifications of AMIs, instances, and hosts. You cannot update the license specifications for launch templates and CloudFormation templates, as they send license configurations to the operation that creates the resource.
May throw AccessDeniedException.
May throw AuthorizationException.
May throw ConflictException.
May throw InvalidParameterValueException.
May throw InvalidResourceStateException.
May throw LicenseUsageException.
May throw RateLimitExceededException.
May throw ServerInternalException.
Parameter resourceArn :
Amazon Resource Name (ARN) of the Amazon Web Services resource.
Parameter addLicenseSpecifications :
ARNs of the license configurations to add.
Parameter removeLicenseSpecifications :
ARNs of the license configurations to remove.
Implementation
Future<void> updateLicenseSpecificationsForResource({
required String resourceArn,
List<LicenseSpecification>? addLicenseSpecifications,
List<LicenseSpecification>? removeLicenseSpecifications,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSLicenseManager.UpdateLicenseSpecificationsForResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ResourceArn': resourceArn,
if (addLicenseSpecifications != null)
'AddLicenseSpecifications': addLicenseSpecifications,
if (removeLicenseSpecifications != null)
'RemoveLicenseSpecifications': removeLicenseSpecifications,
},
);
}