deleteHsm method

Future<DeleteHsmResponse> deleteHsm({
  1. required String clusterId,
  2. String? eniId,
  3. String? eniIp,
  4. String? hsmId,
})

Deletes the specified HSM. To specify an HSM, you can use its identifier (ID), the IP address of the HSM's elastic network interface (ENI), or the ID of the HSM's ENI. You need to specify only one of these values. To find these values, use DescribeClusters.

May throw CloudHsmInternalFailureException. May throw CloudHsmServiceException. May throw CloudHsmResourceNotFoundException. May throw CloudHsmInvalidRequestException. May throw CloudHsmAccessDeniedException.

Parameter clusterId : The identifier (ID) of the cluster that contains the HSM that you are deleting.

Parameter eniId : The identifier (ID) of the elastic network interface (ENI) of the HSM that you are deleting.

Parameter eniIp : The IP address of the elastic network interface (ENI) of the HSM that you are deleting.

Parameter hsmId : The identifier (ID) of the HSM that you are deleting.

Implementation

Future<DeleteHsmResponse> deleteHsm({
  required String clusterId,
  String? eniId,
  String? eniIp,
  String? hsmId,
}) async {
  ArgumentError.checkNotNull(clusterId, 'clusterId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'BaldrApiService.DeleteHsm'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClusterId': clusterId,
      if (eniId != null) 'EniId': eniId,
      if (eniIp != null) 'EniIp': eniIp,
      if (hsmId != null) 'HsmId': hsmId,
    },
  );

  return DeleteHsmResponse.fromJson(jsonResponse.body);
}