updateSnapshotCopyConfiguration method

Future<UpdateSnapshotCopyConfigurationResponse> updateSnapshotCopyConfiguration({
  1. required String snapshotCopyConfigurationId,
  2. int? snapshotRetentionPeriod,
})

Updates a snapshot copy configuration.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter snapshotCopyConfigurationId : The ID of the snapshot copy configuration to update.

Parameter snapshotRetentionPeriod : The new retention period of how long to keep a snapshot in the destination Amazon Web Services Region.

Implementation

Future<UpdateSnapshotCopyConfigurationResponse>
    updateSnapshotCopyConfiguration({
  required String snapshotCopyConfigurationId,
  int? snapshotRetentionPeriod,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'RedshiftServerless.UpdateSnapshotCopyConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'snapshotCopyConfigurationId': snapshotCopyConfigurationId,
      if (snapshotRetentionPeriod != null)
        'snapshotRetentionPeriod': snapshotRetentionPeriod,
    },
  );

  return UpdateSnapshotCopyConfigurationResponse.fromJson(jsonResponse.body);
}