deleteEnvironment method
Deletes an Amazon EVS environment.
Amazon EVS environments will only be enabled for deletion once the hosts
are deleted. You can delete hosts using the
DeleteEnvironmentHost action.
Environment deletion also deletes the associated Amazon EVS VLAN subnets and Amazon Web Services Secrets Manager secrets that Amazon EVS created. Amazon Web Services resources that you create are not deleted. These resources may continue to incur costs.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter environmentId :
A unique ID associated with the environment to be deleted.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the environment deletion request. If you do not specify a
client token, a randomly generated token is used for the request to ensure
idempotency.
Implementation
Future<DeleteEnvironmentResponse> deleteEnvironment({
required String environmentId,
String? clientToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AmazonElasticVMwareService.DeleteEnvironment'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'environmentId': environmentId,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
},
);
return DeleteEnvironmentResponse.fromJson(jsonResponse.body);
}