cancelLegalHold method

Future<void> cancelLegalHold({
  1. required String cancelDescription,
  2. required String legalHoldId,
  3. int? retainRecordInDays,
})

Removes the specified legal hold on a recovery point. This action can only be performed by a user with sufficient permissions.

May throw InvalidParameterValueException. May throw InvalidResourceStateException. May throw MissingParameterValueException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter cancelDescription : A string the describes the reason for removing the legal hold.

Parameter legalHoldId : The ID of the legal hold.

Parameter retainRecordInDays : The integer amount, in days, after which to remove legal hold.

Implementation

Future<void> cancelLegalHold({
  required String cancelDescription,
  required String legalHoldId,
  int? retainRecordInDays,
}) async {
  final $query = <String, List<String>>{
    'cancelDescription': [cancelDescription],
    if (retainRecordInDays != null)
      'retainRecordInDays': [retainRecordInDays.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/legal-holds/${Uri.encodeComponent(legalHoldId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}