deleteEntitlement method
Deletes a Windows Server License entitlement for virtual machines in an Amazon EVS environment. Deleting an entitlement stops usage tracking for the specified virtual machines.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter connectorId :
A unique ID for the connector associated with the entitlement.
Parameter entitlementType :
The type of entitlement to delete.
Parameter environmentId :
A unique ID for the environment that the entitlement belongs to.
Parameter vmIds :
The list of VMware vSphere virtual machine managed object IDs to delete
entitlements for.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the entitlement deletion request. If you do not specify a
client token, a randomly generated token is used for the request to ensure
idempotency.
Implementation
Future<DeleteEntitlementResponse> deleteEntitlement({
required String connectorId,
required EntitlementType entitlementType,
required String environmentId,
required List<String> vmIds,
String? clientToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AmazonElasticVMwareService.DeleteEntitlement'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'connectorId': connectorId,
'entitlementType': entitlementType.value,
'environmentId': environmentId,
'vmIds': vmIds,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
},
);
return DeleteEntitlementResponse.fromJson(jsonResponse.body);
}