deleteEnvironmentHost method

Future<DeleteEnvironmentHostResponse> deleteEnvironmentHost({
  1. required String environmentId,
  2. required String hostName,
  3. String? clientToken,
})

Deletes a host from an Amazon EVS environment.

May throw ResourceNotFoundException. May throw ValidationException.

Parameter environmentId : A unique ID for the host's environment.

Parameter hostName : The DNS hostname associated with the host to be deleted.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the host deletion request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.

Implementation

Future<DeleteEnvironmentHostResponse> deleteEnvironmentHost({
  required String environmentId,
  required String hostName,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonElasticVMwareService.DeleteEnvironmentHost'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'environmentId': environmentId,
      'hostName': hostName,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );

  return DeleteEnvironmentHostResponse.fromJson(jsonResponse.body);
}