updateLedger method

Future<UpdateLedgerResponse> updateLedger({
  1. required String name,
  2. bool? deletionProtection,
})

Updates properties on a ledger.

May throw InvalidParameterException. May throw ResourceNotFoundException.

Parameter name : The name of the ledger.

Parameter deletionProtection : The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled (true) by default.

If deletion protection is enabled, you must first disable it before you can delete the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.

Implementation

Future<UpdateLedgerResponse> updateLedger({
  required String name,
  bool? deletionProtection,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    32,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    if (deletionProtection != null) 'DeletionProtection': deletionProtection,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/ledgers/${Uri.encodeComponent(name)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateLedgerResponse.fromJson(response);
}