{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Firehose.Types.RedshiftDestinationUpdate
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Firehose.Types.RedshiftDestinationUpdate where

import qualified Amazonka.Core as Core
import Amazonka.Firehose.Types.CloudWatchLoggingOptions
import Amazonka.Firehose.Types.CopyCommand
import Amazonka.Firehose.Types.ProcessingConfiguration
import Amazonka.Firehose.Types.RedshiftRetryOptions
import Amazonka.Firehose.Types.RedshiftS3BackupMode
import Amazonka.Firehose.Types.S3DestinationUpdate
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an update for a destination in Amazon Redshift.
--
-- /See:/ 'newRedshiftDestinationUpdate' smart constructor.
data RedshiftDestinationUpdate = RedshiftDestinationUpdate'
  { -- | You can update a delivery stream to enable Amazon S3 backup if it is
    -- disabled. If backup is enabled, you can\'t update the delivery stream to
    -- disable it.
    RedshiftDestinationUpdate -> Maybe RedshiftS3BackupMode
s3BackupMode :: Prelude.Maybe RedshiftS3BackupMode,
    -- | The Amazon CloudWatch logging options for your delivery stream.
    RedshiftDestinationUpdate -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Prelude.Maybe CloudWatchLoggingOptions,
    -- | The name of the user.
    RedshiftDestinationUpdate -> Maybe (Sensitive Text)
username :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The Amazon S3 destination.
    --
    -- The compression formats @SNAPPY@ or @ZIP@ cannot be specified in
    -- @RedshiftDestinationUpdate.S3Update@ because the Amazon Redshift @COPY@
    -- operation that reads from the S3 bucket doesn\'t support these
    -- compression formats.
    RedshiftDestinationUpdate -> Maybe S3DestinationUpdate
s3Update :: Prelude.Maybe S3DestinationUpdate,
    -- | The user password.
    RedshiftDestinationUpdate -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The Amazon S3 destination for backup.
    RedshiftDestinationUpdate -> Maybe S3DestinationUpdate
s3BackupUpdate :: Prelude.Maybe S3DestinationUpdate,
    -- | The @COPY@ command.
    RedshiftDestinationUpdate -> Maybe CopyCommand
copyCommand :: Prelude.Maybe CopyCommand,
    -- | The retry behavior in case Kinesis Data Firehose is unable to deliver
    -- documents to Amazon Redshift. Default value is 3600 (60 minutes).
    RedshiftDestinationUpdate -> Maybe RedshiftRetryOptions
retryOptions :: Prelude.Maybe RedshiftRetryOptions,
    -- | The data processing configuration.
    RedshiftDestinationUpdate -> Maybe ProcessingConfiguration
processingConfiguration :: Prelude.Maybe ProcessingConfiguration,
    -- | The database connection string.
    RedshiftDestinationUpdate -> Maybe Text
clusterJDBCURL :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the AWS credentials. For more
    -- information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
    RedshiftDestinationUpdate -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text
  }
  deriving (RedshiftDestinationUpdate -> RedshiftDestinationUpdate -> Bool
(RedshiftDestinationUpdate -> RedshiftDestinationUpdate -> Bool)
-> (RedshiftDestinationUpdate -> RedshiftDestinationUpdate -> Bool)
-> Eq RedshiftDestinationUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftDestinationUpdate -> RedshiftDestinationUpdate -> Bool
$c/= :: RedshiftDestinationUpdate -> RedshiftDestinationUpdate -> Bool
== :: RedshiftDestinationUpdate -> RedshiftDestinationUpdate -> Bool
$c== :: RedshiftDestinationUpdate -> RedshiftDestinationUpdate -> Bool
Prelude.Eq, Int -> RedshiftDestinationUpdate -> ShowS
[RedshiftDestinationUpdate] -> ShowS
RedshiftDestinationUpdate -> String
(Int -> RedshiftDestinationUpdate -> ShowS)
-> (RedshiftDestinationUpdate -> String)
-> ([RedshiftDestinationUpdate] -> ShowS)
-> Show RedshiftDestinationUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftDestinationUpdate] -> ShowS
$cshowList :: [RedshiftDestinationUpdate] -> ShowS
show :: RedshiftDestinationUpdate -> String
$cshow :: RedshiftDestinationUpdate -> String
showsPrec :: Int -> RedshiftDestinationUpdate -> ShowS
$cshowsPrec :: Int -> RedshiftDestinationUpdate -> ShowS
Prelude.Show, (forall x.
 RedshiftDestinationUpdate -> Rep RedshiftDestinationUpdate x)
-> (forall x.
    Rep RedshiftDestinationUpdate x -> RedshiftDestinationUpdate)
-> Generic RedshiftDestinationUpdate
forall x.
Rep RedshiftDestinationUpdate x -> RedshiftDestinationUpdate
forall x.
RedshiftDestinationUpdate -> Rep RedshiftDestinationUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedshiftDestinationUpdate x -> RedshiftDestinationUpdate
$cfrom :: forall x.
RedshiftDestinationUpdate -> Rep RedshiftDestinationUpdate x
Prelude.Generic)

-- |
-- Create a value of 'RedshiftDestinationUpdate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 's3BackupMode', 'redshiftDestinationUpdate_s3BackupMode' - You can update a delivery stream to enable Amazon S3 backup if it is
-- disabled. If backup is enabled, you can\'t update the delivery stream to
-- disable it.
--
-- 'cloudWatchLoggingOptions', 'redshiftDestinationUpdate_cloudWatchLoggingOptions' - The Amazon CloudWatch logging options for your delivery stream.
--
-- 'username', 'redshiftDestinationUpdate_username' - The name of the user.
--
-- 's3Update', 'redshiftDestinationUpdate_s3Update' - The Amazon S3 destination.
--
-- The compression formats @SNAPPY@ or @ZIP@ cannot be specified in
-- @RedshiftDestinationUpdate.S3Update@ because the Amazon Redshift @COPY@
-- operation that reads from the S3 bucket doesn\'t support these
-- compression formats.
--
-- 'password', 'redshiftDestinationUpdate_password' - The user password.
--
-- 's3BackupUpdate', 'redshiftDestinationUpdate_s3BackupUpdate' - The Amazon S3 destination for backup.
--
-- 'copyCommand', 'redshiftDestinationUpdate_copyCommand' - The @COPY@ command.
--
-- 'retryOptions', 'redshiftDestinationUpdate_retryOptions' - The retry behavior in case Kinesis Data Firehose is unable to deliver
-- documents to Amazon Redshift. Default value is 3600 (60 minutes).
--
-- 'processingConfiguration', 'redshiftDestinationUpdate_processingConfiguration' - The data processing configuration.
--
-- 'clusterJDBCURL', 'redshiftDestinationUpdate_clusterJDBCURL' - The database connection string.
--
-- 'roleARN', 'redshiftDestinationUpdate_roleARN' - The Amazon Resource Name (ARN) of the AWS credentials. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
newRedshiftDestinationUpdate ::
  RedshiftDestinationUpdate
newRedshiftDestinationUpdate :: RedshiftDestinationUpdate
newRedshiftDestinationUpdate =
  RedshiftDestinationUpdate' :: Maybe RedshiftS3BackupMode
-> Maybe CloudWatchLoggingOptions
-> Maybe (Sensitive Text)
-> Maybe S3DestinationUpdate
-> Maybe (Sensitive Text)
-> Maybe S3DestinationUpdate
-> Maybe CopyCommand
-> Maybe RedshiftRetryOptions
-> Maybe ProcessingConfiguration
-> Maybe Text
-> Maybe Text
-> RedshiftDestinationUpdate
RedshiftDestinationUpdate'
    { $sel:s3BackupMode:RedshiftDestinationUpdate' :: Maybe RedshiftS3BackupMode
s3BackupMode =
        Maybe RedshiftS3BackupMode
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLoggingOptions:RedshiftDestinationUpdate' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = Maybe CloudWatchLoggingOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:username:RedshiftDestinationUpdate' :: Maybe (Sensitive Text)
username = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Update:RedshiftDestinationUpdate' :: Maybe S3DestinationUpdate
s3Update = Maybe S3DestinationUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:password:RedshiftDestinationUpdate' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:s3BackupUpdate:RedshiftDestinationUpdate' :: Maybe S3DestinationUpdate
s3BackupUpdate = Maybe S3DestinationUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:copyCommand:RedshiftDestinationUpdate' :: Maybe CopyCommand
copyCommand = Maybe CopyCommand
forall a. Maybe a
Prelude.Nothing,
      $sel:retryOptions:RedshiftDestinationUpdate' :: Maybe RedshiftRetryOptions
retryOptions = Maybe RedshiftRetryOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:processingConfiguration:RedshiftDestinationUpdate' :: Maybe ProcessingConfiguration
processingConfiguration = Maybe ProcessingConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterJDBCURL:RedshiftDestinationUpdate' :: Maybe Text
clusterJDBCURL = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:RedshiftDestinationUpdate' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | You can update a delivery stream to enable Amazon S3 backup if it is
-- disabled. If backup is enabled, you can\'t update the delivery stream to
-- disable it.
redshiftDestinationUpdate_s3BackupMode :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe RedshiftS3BackupMode)
redshiftDestinationUpdate_s3BackupMode :: (Maybe RedshiftS3BackupMode -> f (Maybe RedshiftS3BackupMode))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_s3BackupMode = (RedshiftDestinationUpdate -> Maybe RedshiftS3BackupMode)
-> (RedshiftDestinationUpdate
    -> Maybe RedshiftS3BackupMode -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe RedshiftS3BackupMode)
     (Maybe RedshiftS3BackupMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe RedshiftS3BackupMode
s3BackupMode :: Maybe RedshiftS3BackupMode
$sel:s3BackupMode:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe RedshiftS3BackupMode
s3BackupMode} -> Maybe RedshiftS3BackupMode
s3BackupMode) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe RedshiftS3BackupMode
a -> RedshiftDestinationUpdate
s {$sel:s3BackupMode:RedshiftDestinationUpdate' :: Maybe RedshiftS3BackupMode
s3BackupMode = Maybe RedshiftS3BackupMode
a} :: RedshiftDestinationUpdate)

-- | The Amazon CloudWatch logging options for your delivery stream.
redshiftDestinationUpdate_cloudWatchLoggingOptions :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe CloudWatchLoggingOptions)
redshiftDestinationUpdate_cloudWatchLoggingOptions :: (Maybe CloudWatchLoggingOptions
 -> f (Maybe CloudWatchLoggingOptions))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_cloudWatchLoggingOptions = (RedshiftDestinationUpdate -> Maybe CloudWatchLoggingOptions)
-> (RedshiftDestinationUpdate
    -> Maybe CloudWatchLoggingOptions -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe CloudWatchLoggingOptions)
     (Maybe CloudWatchLoggingOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
$sel:cloudWatchLoggingOptions:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions} -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe CloudWatchLoggingOptions
a -> RedshiftDestinationUpdate
s {$sel:cloudWatchLoggingOptions:RedshiftDestinationUpdate' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = Maybe CloudWatchLoggingOptions
a} :: RedshiftDestinationUpdate)

-- | The name of the user.
redshiftDestinationUpdate_username :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe Prelude.Text)
redshiftDestinationUpdate_username :: (Maybe Text -> f (Maybe Text))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_username = (RedshiftDestinationUpdate -> Maybe (Sensitive Text))
-> (RedshiftDestinationUpdate
    -> Maybe (Sensitive Text) -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe (Sensitive Text)
username :: Maybe (Sensitive Text)
$sel:username:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe (Sensitive Text)
username} -> Maybe (Sensitive Text)
username) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe (Sensitive Text)
a -> RedshiftDestinationUpdate
s {$sel:username:RedshiftDestinationUpdate' :: Maybe (Sensitive Text)
username = Maybe (Sensitive Text)
a} :: RedshiftDestinationUpdate) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RedshiftDestinationUpdate
-> f RedshiftDestinationUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The Amazon S3 destination.
--
-- The compression formats @SNAPPY@ or @ZIP@ cannot be specified in
-- @RedshiftDestinationUpdate.S3Update@ because the Amazon Redshift @COPY@
-- operation that reads from the S3 bucket doesn\'t support these
-- compression formats.
redshiftDestinationUpdate_s3Update :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe S3DestinationUpdate)
redshiftDestinationUpdate_s3Update :: (Maybe S3DestinationUpdate -> f (Maybe S3DestinationUpdate))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_s3Update = (RedshiftDestinationUpdate -> Maybe S3DestinationUpdate)
-> (RedshiftDestinationUpdate
    -> Maybe S3DestinationUpdate -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe S3DestinationUpdate)
     (Maybe S3DestinationUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe S3DestinationUpdate
s3Update :: Maybe S3DestinationUpdate
$sel:s3Update:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe S3DestinationUpdate
s3Update} -> Maybe S3DestinationUpdate
s3Update) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe S3DestinationUpdate
a -> RedshiftDestinationUpdate
s {$sel:s3Update:RedshiftDestinationUpdate' :: Maybe S3DestinationUpdate
s3Update = Maybe S3DestinationUpdate
a} :: RedshiftDestinationUpdate)

-- | The user password.
redshiftDestinationUpdate_password :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe Prelude.Text)
redshiftDestinationUpdate_password :: (Maybe Text -> f (Maybe Text))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_password = (RedshiftDestinationUpdate -> Maybe (Sensitive Text))
-> (RedshiftDestinationUpdate
    -> Maybe (Sensitive Text) -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe (Sensitive Text)
a -> RedshiftDestinationUpdate
s {$sel:password:RedshiftDestinationUpdate' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: RedshiftDestinationUpdate) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> RedshiftDestinationUpdate
-> f RedshiftDestinationUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The Amazon S3 destination for backup.
redshiftDestinationUpdate_s3BackupUpdate :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe S3DestinationUpdate)
redshiftDestinationUpdate_s3BackupUpdate :: (Maybe S3DestinationUpdate -> f (Maybe S3DestinationUpdate))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_s3BackupUpdate = (RedshiftDestinationUpdate -> Maybe S3DestinationUpdate)
-> (RedshiftDestinationUpdate
    -> Maybe S3DestinationUpdate -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe S3DestinationUpdate)
     (Maybe S3DestinationUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe S3DestinationUpdate
s3BackupUpdate :: Maybe S3DestinationUpdate
$sel:s3BackupUpdate:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe S3DestinationUpdate
s3BackupUpdate} -> Maybe S3DestinationUpdate
s3BackupUpdate) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe S3DestinationUpdate
a -> RedshiftDestinationUpdate
s {$sel:s3BackupUpdate:RedshiftDestinationUpdate' :: Maybe S3DestinationUpdate
s3BackupUpdate = Maybe S3DestinationUpdate
a} :: RedshiftDestinationUpdate)

-- | The @COPY@ command.
redshiftDestinationUpdate_copyCommand :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe CopyCommand)
redshiftDestinationUpdate_copyCommand :: (Maybe CopyCommand -> f (Maybe CopyCommand))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_copyCommand = (RedshiftDestinationUpdate -> Maybe CopyCommand)
-> (RedshiftDestinationUpdate
    -> Maybe CopyCommand -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe CopyCommand)
     (Maybe CopyCommand)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe CopyCommand
copyCommand :: Maybe CopyCommand
$sel:copyCommand:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe CopyCommand
copyCommand} -> Maybe CopyCommand
copyCommand) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe CopyCommand
a -> RedshiftDestinationUpdate
s {$sel:copyCommand:RedshiftDestinationUpdate' :: Maybe CopyCommand
copyCommand = Maybe CopyCommand
a} :: RedshiftDestinationUpdate)

-- | The retry behavior in case Kinesis Data Firehose is unable to deliver
-- documents to Amazon Redshift. Default value is 3600 (60 minutes).
redshiftDestinationUpdate_retryOptions :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe RedshiftRetryOptions)
redshiftDestinationUpdate_retryOptions :: (Maybe RedshiftRetryOptions -> f (Maybe RedshiftRetryOptions))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_retryOptions = (RedshiftDestinationUpdate -> Maybe RedshiftRetryOptions)
-> (RedshiftDestinationUpdate
    -> Maybe RedshiftRetryOptions -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe RedshiftRetryOptions)
     (Maybe RedshiftRetryOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe RedshiftRetryOptions
retryOptions :: Maybe RedshiftRetryOptions
$sel:retryOptions:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe RedshiftRetryOptions
retryOptions} -> Maybe RedshiftRetryOptions
retryOptions) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe RedshiftRetryOptions
a -> RedshiftDestinationUpdate
s {$sel:retryOptions:RedshiftDestinationUpdate' :: Maybe RedshiftRetryOptions
retryOptions = Maybe RedshiftRetryOptions
a} :: RedshiftDestinationUpdate)

-- | The data processing configuration.
redshiftDestinationUpdate_processingConfiguration :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe ProcessingConfiguration)
redshiftDestinationUpdate_processingConfiguration :: (Maybe ProcessingConfiguration
 -> f (Maybe ProcessingConfiguration))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_processingConfiguration = (RedshiftDestinationUpdate -> Maybe ProcessingConfiguration)
-> (RedshiftDestinationUpdate
    -> Maybe ProcessingConfiguration -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe ProcessingConfiguration)
     (Maybe ProcessingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe ProcessingConfiguration
processingConfiguration :: Maybe ProcessingConfiguration
$sel:processingConfiguration:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe ProcessingConfiguration
processingConfiguration} -> Maybe ProcessingConfiguration
processingConfiguration) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe ProcessingConfiguration
a -> RedshiftDestinationUpdate
s {$sel:processingConfiguration:RedshiftDestinationUpdate' :: Maybe ProcessingConfiguration
processingConfiguration = Maybe ProcessingConfiguration
a} :: RedshiftDestinationUpdate)

-- | The database connection string.
redshiftDestinationUpdate_clusterJDBCURL :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe Prelude.Text)
redshiftDestinationUpdate_clusterJDBCURL :: (Maybe Text -> f (Maybe Text))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_clusterJDBCURL = (RedshiftDestinationUpdate -> Maybe Text)
-> (RedshiftDestinationUpdate
    -> Maybe Text -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe Text
clusterJDBCURL :: Maybe Text
$sel:clusterJDBCURL:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe Text
clusterJDBCURL} -> Maybe Text
clusterJDBCURL) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe Text
a -> RedshiftDestinationUpdate
s {$sel:clusterJDBCURL:RedshiftDestinationUpdate' :: Maybe Text
clusterJDBCURL = Maybe Text
a} :: RedshiftDestinationUpdate)

-- | The Amazon Resource Name (ARN) of the AWS credentials. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>.
redshiftDestinationUpdate_roleARN :: Lens.Lens' RedshiftDestinationUpdate (Prelude.Maybe Prelude.Text)
redshiftDestinationUpdate_roleARN :: (Maybe Text -> f (Maybe Text))
-> RedshiftDestinationUpdate -> f RedshiftDestinationUpdate
redshiftDestinationUpdate_roleARN = (RedshiftDestinationUpdate -> Maybe Text)
-> (RedshiftDestinationUpdate
    -> Maybe Text -> RedshiftDestinationUpdate)
-> Lens
     RedshiftDestinationUpdate
     RedshiftDestinationUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationUpdate' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: RedshiftDestinationUpdate
s@RedshiftDestinationUpdate' {} Maybe Text
a -> RedshiftDestinationUpdate
s {$sel:roleARN:RedshiftDestinationUpdate' :: Maybe Text
roleARN = Maybe Text
a} :: RedshiftDestinationUpdate)

instance Prelude.Hashable RedshiftDestinationUpdate

instance Prelude.NFData RedshiftDestinationUpdate

instance Core.ToJSON RedshiftDestinationUpdate where
  toJSON :: RedshiftDestinationUpdate -> Value
toJSON RedshiftDestinationUpdate' {Maybe Text
Maybe (Sensitive Text)
Maybe CloudWatchLoggingOptions
Maybe CopyCommand
Maybe ProcessingConfiguration
Maybe RedshiftRetryOptions
Maybe RedshiftS3BackupMode
Maybe S3DestinationUpdate
roleARN :: Maybe Text
clusterJDBCURL :: Maybe Text
processingConfiguration :: Maybe ProcessingConfiguration
retryOptions :: Maybe RedshiftRetryOptions
copyCommand :: Maybe CopyCommand
s3BackupUpdate :: Maybe S3DestinationUpdate
password :: Maybe (Sensitive Text)
s3Update :: Maybe S3DestinationUpdate
username :: Maybe (Sensitive Text)
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
s3BackupMode :: Maybe RedshiftS3BackupMode
$sel:roleARN:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe Text
$sel:clusterJDBCURL:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe Text
$sel:processingConfiguration:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe ProcessingConfiguration
$sel:retryOptions:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe RedshiftRetryOptions
$sel:copyCommand:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe CopyCommand
$sel:s3BackupUpdate:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe S3DestinationUpdate
$sel:password:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe (Sensitive Text)
$sel:s3Update:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe S3DestinationUpdate
$sel:username:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe (Sensitive Text)
$sel:cloudWatchLoggingOptions:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe CloudWatchLoggingOptions
$sel:s3BackupMode:RedshiftDestinationUpdate' :: RedshiftDestinationUpdate -> Maybe RedshiftS3BackupMode
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"S3BackupMode" Text -> RedshiftS3BackupMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RedshiftS3BackupMode -> Pair)
-> Maybe RedshiftS3BackupMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RedshiftS3BackupMode
s3BackupMode,
            (Text
"CloudWatchLoggingOptions" Text -> CloudWatchLoggingOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CloudWatchLoggingOptions -> Pair)
-> Maybe CloudWatchLoggingOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions,
            (Text
"Username" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
username,
            (Text
"S3Update" Text -> S3DestinationUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3DestinationUpdate -> Pair)
-> Maybe S3DestinationUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3DestinationUpdate
s3Update,
            (Text
"Password" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
password,
            (Text
"S3BackupUpdate" Text -> S3DestinationUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (S3DestinationUpdate -> Pair)
-> Maybe S3DestinationUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3DestinationUpdate
s3BackupUpdate,
            (Text
"CopyCommand" Text -> CopyCommand -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CopyCommand -> Pair) -> Maybe CopyCommand -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CopyCommand
copyCommand,
            (Text
"RetryOptions" Text -> RedshiftRetryOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RedshiftRetryOptions -> Pair)
-> Maybe RedshiftRetryOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RedshiftRetryOptions
retryOptions,
            (Text
"ProcessingConfiguration" Text -> ProcessingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProcessingConfiguration -> Pair)
-> Maybe ProcessingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProcessingConfiguration
processingConfiguration,
            (Text
"ClusterJDBCURL" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clusterJDBCURL,
            (Text
"RoleARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
roleARN
          ]
      )