modifyClusterSnapshot method

Future<ModifyClusterSnapshotResult> modifyClusterSnapshot({
  1. required String snapshotIdentifier,
  2. bool? force,
  3. int? manualSnapshotRetentionPeriod,
})

Modifies the settings for a snapshot.

This exanmple modifies the manual retention period setting for a cluster snapshot.

May throw InvalidClusterSnapshotStateFault. May throw ClusterSnapshotNotFoundFault. May throw InvalidRetentionPeriodFault.

Parameter snapshotIdentifier : The identifier of the snapshot whose setting you want to modify.

Parameter force : A Boolean option to override an exception if the retention period has already passed.

Parameter manualSnapshotRetentionPeriod : The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely.

If the manual snapshot falls outside of the new retention period, you can specify the force option to immediately delete the snapshot.

The value must be either -1 or an integer between 1 and 3,653.

Implementation

Future<ModifyClusterSnapshotResult> modifyClusterSnapshot({
  required String snapshotIdentifier,
  bool? force,
  int? manualSnapshotRetentionPeriod,
}) async {
  ArgumentError.checkNotNull(snapshotIdentifier, 'snapshotIdentifier');
  _s.validateStringLength(
    'snapshotIdentifier',
    snapshotIdentifier,
    0,
    2147483647,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['SnapshotIdentifier'] = snapshotIdentifier;
  force?.also((arg) => $request['Force'] = arg);
  manualSnapshotRetentionPeriod
      ?.also((arg) => $request['ManualSnapshotRetentionPeriod'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ModifyClusterSnapshot',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ModifyClusterSnapshotMessage'],
    shapes: shapes,
    resultWrapper: 'ModifyClusterSnapshotResult',
  );
  return ModifyClusterSnapshotResult.fromXml($result);
}