modifyCluster method

Future<ModifyClusterResponse> modifyCluster({
  1. required BackupRetentionPolicy backupRetentionPolicy,
  2. required String clusterId,
})

Modifies AWS CloudHSM cluster.

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

Parameter backupRetentionPolicy : A policy that defines how the service retains backups.

Parameter clusterId : The identifier (ID) of the cluster that you want to modify. To find the cluster ID, use DescribeClusters.

Implementation

Future<ModifyClusterResponse> modifyCluster({
  required BackupRetentionPolicy backupRetentionPolicy,
  required String clusterId,
}) async {
  ArgumentError.checkNotNull(backupRetentionPolicy, 'backupRetentionPolicy');
  ArgumentError.checkNotNull(clusterId, 'clusterId');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'BaldrApiService.ModifyCluster'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BackupRetentionPolicy': backupRetentionPolicy,
      'ClusterId': clusterId,
    },
  );

  return ModifyClusterResponse.fromJson(jsonResponse.body);
}