{-# 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.RedshiftDestinationConfiguration
-- 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.RedshiftDestinationConfiguration 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.S3DestinationConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the configuration of a destination in Amazon Redshift.
--
-- /See:/ 'newRedshiftDestinationConfiguration' smart constructor.
data RedshiftDestinationConfiguration = RedshiftDestinationConfiguration'
  { -- | The Amazon S3 backup mode. After you create a delivery stream, you can
    -- update it to enable Amazon S3 backup if it is disabled. If backup is
    -- enabled, you can\'t update the delivery stream to disable it.
    RedshiftDestinationConfiguration -> Maybe RedshiftS3BackupMode
s3BackupMode :: Prelude.Maybe RedshiftS3BackupMode,
    -- | The CloudWatch logging options for your delivery stream.
    RedshiftDestinationConfiguration -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Prelude.Maybe CloudWatchLoggingOptions,
    -- | The configuration for backup in Amazon S3.
    RedshiftDestinationConfiguration
-> Maybe S3DestinationConfiguration
s3BackupConfiguration :: Prelude.Maybe S3DestinationConfiguration,
    -- | The retry behavior in case Kinesis Data Firehose is unable to deliver
    -- documents to Amazon Redshift. Default value is 3600 (60 minutes).
    RedshiftDestinationConfiguration -> Maybe RedshiftRetryOptions
retryOptions :: Prelude.Maybe RedshiftRetryOptions,
    -- | The data processing configuration.
    RedshiftDestinationConfiguration -> Maybe ProcessingConfiguration
processingConfiguration :: Prelude.Maybe ProcessingConfiguration,
    -- | 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>.
    RedshiftDestinationConfiguration -> Text
roleARN :: Prelude.Text,
    -- | The database connection string.
    RedshiftDestinationConfiguration -> Text
clusterJDBCURL :: Prelude.Text,
    -- | The @COPY@ command.
    RedshiftDestinationConfiguration -> CopyCommand
copyCommand :: CopyCommand,
    -- | The name of the user.
    RedshiftDestinationConfiguration -> Sensitive Text
username :: Core.Sensitive Prelude.Text,
    -- | The user password.
    RedshiftDestinationConfiguration -> Sensitive Text
password :: Core.Sensitive Prelude.Text,
    -- | The configuration for the intermediate Amazon S3 location from which
    -- Amazon Redshift obtains data. Restrictions are described in the topic
    -- for CreateDeliveryStream.
    --
    -- The compression formats @SNAPPY@ or @ZIP@ cannot be specified in
    -- @RedshiftDestinationConfiguration.S3Configuration@ because the Amazon
    -- Redshift @COPY@ operation that reads from the S3 bucket doesn\'t support
    -- these compression formats.
    RedshiftDestinationConfiguration -> S3DestinationConfiguration
s3Configuration :: S3DestinationConfiguration
  }
  deriving (RedshiftDestinationConfiguration
-> RedshiftDestinationConfiguration -> Bool
(RedshiftDestinationConfiguration
 -> RedshiftDestinationConfiguration -> Bool)
-> (RedshiftDestinationConfiguration
    -> RedshiftDestinationConfiguration -> Bool)
-> Eq RedshiftDestinationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftDestinationConfiguration
-> RedshiftDestinationConfiguration -> Bool
$c/= :: RedshiftDestinationConfiguration
-> RedshiftDestinationConfiguration -> Bool
== :: RedshiftDestinationConfiguration
-> RedshiftDestinationConfiguration -> Bool
$c== :: RedshiftDestinationConfiguration
-> RedshiftDestinationConfiguration -> Bool
Prelude.Eq, Int -> RedshiftDestinationConfiguration -> ShowS
[RedshiftDestinationConfiguration] -> ShowS
RedshiftDestinationConfiguration -> String
(Int -> RedshiftDestinationConfiguration -> ShowS)
-> (RedshiftDestinationConfiguration -> String)
-> ([RedshiftDestinationConfiguration] -> ShowS)
-> Show RedshiftDestinationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftDestinationConfiguration] -> ShowS
$cshowList :: [RedshiftDestinationConfiguration] -> ShowS
show :: RedshiftDestinationConfiguration -> String
$cshow :: RedshiftDestinationConfiguration -> String
showsPrec :: Int -> RedshiftDestinationConfiguration -> ShowS
$cshowsPrec :: Int -> RedshiftDestinationConfiguration -> ShowS
Prelude.Show, (forall x.
 RedshiftDestinationConfiguration
 -> Rep RedshiftDestinationConfiguration x)
-> (forall x.
    Rep RedshiftDestinationConfiguration x
    -> RedshiftDestinationConfiguration)
-> Generic RedshiftDestinationConfiguration
forall x.
Rep RedshiftDestinationConfiguration x
-> RedshiftDestinationConfiguration
forall x.
RedshiftDestinationConfiguration
-> Rep RedshiftDestinationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedshiftDestinationConfiguration x
-> RedshiftDestinationConfiguration
$cfrom :: forall x.
RedshiftDestinationConfiguration
-> Rep RedshiftDestinationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'RedshiftDestinationConfiguration' 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', 'redshiftDestinationConfiguration_s3BackupMode' - The Amazon S3 backup mode. After you create a delivery stream, you can
-- update it to enable Amazon S3 backup if it is disabled. If backup is
-- enabled, you can\'t update the delivery stream to disable it.
--
-- 'cloudWatchLoggingOptions', 'redshiftDestinationConfiguration_cloudWatchLoggingOptions' - The CloudWatch logging options for your delivery stream.
--
-- 's3BackupConfiguration', 'redshiftDestinationConfiguration_s3BackupConfiguration' - The configuration for backup in Amazon S3.
--
-- 'retryOptions', 'redshiftDestinationConfiguration_retryOptions' - The retry behavior in case Kinesis Data Firehose is unable to deliver
-- documents to Amazon Redshift. Default value is 3600 (60 minutes).
--
-- 'processingConfiguration', 'redshiftDestinationConfiguration_processingConfiguration' - The data processing configuration.
--
-- 'roleARN', 'redshiftDestinationConfiguration_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>.
--
-- 'clusterJDBCURL', 'redshiftDestinationConfiguration_clusterJDBCURL' - The database connection string.
--
-- 'copyCommand', 'redshiftDestinationConfiguration_copyCommand' - The @COPY@ command.
--
-- 'username', 'redshiftDestinationConfiguration_username' - The name of the user.
--
-- 'password', 'redshiftDestinationConfiguration_password' - The user password.
--
-- 's3Configuration', 'redshiftDestinationConfiguration_s3Configuration' - The configuration for the intermediate Amazon S3 location from which
-- Amazon Redshift obtains data. Restrictions are described in the topic
-- for CreateDeliveryStream.
--
-- The compression formats @SNAPPY@ or @ZIP@ cannot be specified in
-- @RedshiftDestinationConfiguration.S3Configuration@ because the Amazon
-- Redshift @COPY@ operation that reads from the S3 bucket doesn\'t support
-- these compression formats.
newRedshiftDestinationConfiguration ::
  -- | 'roleARN'
  Prelude.Text ->
  -- | 'clusterJDBCURL'
  Prelude.Text ->
  -- | 'copyCommand'
  CopyCommand ->
  -- | 'username'
  Prelude.Text ->
  -- | 'password'
  Prelude.Text ->
  -- | 's3Configuration'
  S3DestinationConfiguration ->
  RedshiftDestinationConfiguration
newRedshiftDestinationConfiguration :: Text
-> Text
-> CopyCommand
-> Text
-> Text
-> S3DestinationConfiguration
-> RedshiftDestinationConfiguration
newRedshiftDestinationConfiguration
  Text
pRoleARN_
  Text
pClusterJDBCURL_
  CopyCommand
pCopyCommand_
  Text
pUsername_
  Text
pPassword_
  S3DestinationConfiguration
pS3Configuration_ =
    RedshiftDestinationConfiguration' :: Maybe RedshiftS3BackupMode
-> Maybe CloudWatchLoggingOptions
-> Maybe S3DestinationConfiguration
-> Maybe RedshiftRetryOptions
-> Maybe ProcessingConfiguration
-> Text
-> Text
-> CopyCommand
-> Sensitive Text
-> Sensitive Text
-> S3DestinationConfiguration
-> RedshiftDestinationConfiguration
RedshiftDestinationConfiguration'
      { $sel:s3BackupMode:RedshiftDestinationConfiguration' :: Maybe RedshiftS3BackupMode
s3BackupMode =
          Maybe RedshiftS3BackupMode
forall a. Maybe a
Prelude.Nothing,
        $sel:cloudWatchLoggingOptions:RedshiftDestinationConfiguration' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions =
          Maybe CloudWatchLoggingOptions
forall a. Maybe a
Prelude.Nothing,
        $sel:s3BackupConfiguration:RedshiftDestinationConfiguration' :: Maybe S3DestinationConfiguration
s3BackupConfiguration = Maybe S3DestinationConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:retryOptions:RedshiftDestinationConfiguration' :: Maybe RedshiftRetryOptions
retryOptions = Maybe RedshiftRetryOptions
forall a. Maybe a
Prelude.Nothing,
        $sel:processingConfiguration:RedshiftDestinationConfiguration' :: Maybe ProcessingConfiguration
processingConfiguration = Maybe ProcessingConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:roleARN:RedshiftDestinationConfiguration' :: Text
roleARN = Text
pRoleARN_,
        $sel:clusterJDBCURL:RedshiftDestinationConfiguration' :: Text
clusterJDBCURL = Text
pClusterJDBCURL_,
        $sel:copyCommand:RedshiftDestinationConfiguration' :: CopyCommand
copyCommand = CopyCommand
pCopyCommand_,
        $sel:username:RedshiftDestinationConfiguration' :: Sensitive Text
username =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pUsername_,
        $sel:password:RedshiftDestinationConfiguration' :: Sensitive Text
password =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pPassword_,
        $sel:s3Configuration:RedshiftDestinationConfiguration' :: S3DestinationConfiguration
s3Configuration = S3DestinationConfiguration
pS3Configuration_
      }

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

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

-- | The configuration for backup in Amazon S3.
redshiftDestinationConfiguration_s3BackupConfiguration :: Lens.Lens' RedshiftDestinationConfiguration (Prelude.Maybe S3DestinationConfiguration)
redshiftDestinationConfiguration_s3BackupConfiguration :: (Maybe S3DestinationConfiguration
 -> f (Maybe S3DestinationConfiguration))
-> RedshiftDestinationConfiguration
-> f RedshiftDestinationConfiguration
redshiftDestinationConfiguration_s3BackupConfiguration = (RedshiftDestinationConfiguration
 -> Maybe S3DestinationConfiguration)
-> (RedshiftDestinationConfiguration
    -> Maybe S3DestinationConfiguration
    -> RedshiftDestinationConfiguration)
-> Lens
     RedshiftDestinationConfiguration
     RedshiftDestinationConfiguration
     (Maybe S3DestinationConfiguration)
     (Maybe S3DestinationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationConfiguration' {Maybe S3DestinationConfiguration
s3BackupConfiguration :: Maybe S3DestinationConfiguration
$sel:s3BackupConfiguration:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration
-> Maybe S3DestinationConfiguration
s3BackupConfiguration} -> Maybe S3DestinationConfiguration
s3BackupConfiguration) (\s :: RedshiftDestinationConfiguration
s@RedshiftDestinationConfiguration' {} Maybe S3DestinationConfiguration
a -> RedshiftDestinationConfiguration
s {$sel:s3BackupConfiguration:RedshiftDestinationConfiguration' :: Maybe S3DestinationConfiguration
s3BackupConfiguration = Maybe S3DestinationConfiguration
a} :: RedshiftDestinationConfiguration)

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

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

-- | 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>.
redshiftDestinationConfiguration_roleARN :: Lens.Lens' RedshiftDestinationConfiguration Prelude.Text
redshiftDestinationConfiguration_roleARN :: (Text -> f Text)
-> RedshiftDestinationConfiguration
-> f RedshiftDestinationConfiguration
redshiftDestinationConfiguration_roleARN = (RedshiftDestinationConfiguration -> Text)
-> (RedshiftDestinationConfiguration
    -> Text -> RedshiftDestinationConfiguration)
-> Lens
     RedshiftDestinationConfiguration
     RedshiftDestinationConfiguration
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationConfiguration' {Text
roleARN :: Text
$sel:roleARN:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Text
roleARN} -> Text
roleARN) (\s :: RedshiftDestinationConfiguration
s@RedshiftDestinationConfiguration' {} Text
a -> RedshiftDestinationConfiguration
s {$sel:roleARN:RedshiftDestinationConfiguration' :: Text
roleARN = Text
a} :: RedshiftDestinationConfiguration)

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

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

-- | The name of the user.
redshiftDestinationConfiguration_username :: Lens.Lens' RedshiftDestinationConfiguration Prelude.Text
redshiftDestinationConfiguration_username :: (Text -> f Text)
-> RedshiftDestinationConfiguration
-> f RedshiftDestinationConfiguration
redshiftDestinationConfiguration_username = (RedshiftDestinationConfiguration -> Sensitive Text)
-> (RedshiftDestinationConfiguration
    -> Sensitive Text -> RedshiftDestinationConfiguration)
-> Lens
     RedshiftDestinationConfiguration
     RedshiftDestinationConfiguration
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationConfiguration' {Sensitive Text
username :: Sensitive Text
$sel:username:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Sensitive Text
username} -> Sensitive Text
username) (\s :: RedshiftDestinationConfiguration
s@RedshiftDestinationConfiguration' {} Sensitive Text
a -> RedshiftDestinationConfiguration
s {$sel:username:RedshiftDestinationConfiguration' :: Sensitive Text
username = Sensitive Text
a} :: RedshiftDestinationConfiguration) ((Sensitive Text -> f (Sensitive Text))
 -> RedshiftDestinationConfiguration
 -> f RedshiftDestinationConfiguration)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> RedshiftDestinationConfiguration
-> f RedshiftDestinationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The user password.
redshiftDestinationConfiguration_password :: Lens.Lens' RedshiftDestinationConfiguration Prelude.Text
redshiftDestinationConfiguration_password :: (Text -> f Text)
-> RedshiftDestinationConfiguration
-> f RedshiftDestinationConfiguration
redshiftDestinationConfiguration_password = (RedshiftDestinationConfiguration -> Sensitive Text)
-> (RedshiftDestinationConfiguration
    -> Sensitive Text -> RedshiftDestinationConfiguration)
-> Lens
     RedshiftDestinationConfiguration
     RedshiftDestinationConfiguration
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationConfiguration' {Sensitive Text
password :: Sensitive Text
$sel:password:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Sensitive Text
password} -> Sensitive Text
password) (\s :: RedshiftDestinationConfiguration
s@RedshiftDestinationConfiguration' {} Sensitive Text
a -> RedshiftDestinationConfiguration
s {$sel:password:RedshiftDestinationConfiguration' :: Sensitive Text
password = Sensitive Text
a} :: RedshiftDestinationConfiguration) ((Sensitive Text -> f (Sensitive Text))
 -> RedshiftDestinationConfiguration
 -> f RedshiftDestinationConfiguration)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> RedshiftDestinationConfiguration
-> f RedshiftDestinationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The configuration for the intermediate Amazon S3 location from which
-- Amazon Redshift obtains data. Restrictions are described in the topic
-- for CreateDeliveryStream.
--
-- The compression formats @SNAPPY@ or @ZIP@ cannot be specified in
-- @RedshiftDestinationConfiguration.S3Configuration@ because the Amazon
-- Redshift @COPY@ operation that reads from the S3 bucket doesn\'t support
-- these compression formats.
redshiftDestinationConfiguration_s3Configuration :: Lens.Lens' RedshiftDestinationConfiguration S3DestinationConfiguration
redshiftDestinationConfiguration_s3Configuration :: (S3DestinationConfiguration -> f S3DestinationConfiguration)
-> RedshiftDestinationConfiguration
-> f RedshiftDestinationConfiguration
redshiftDestinationConfiguration_s3Configuration = (RedshiftDestinationConfiguration -> S3DestinationConfiguration)
-> (RedshiftDestinationConfiguration
    -> S3DestinationConfiguration -> RedshiftDestinationConfiguration)
-> Lens
     RedshiftDestinationConfiguration
     RedshiftDestinationConfiguration
     S3DestinationConfiguration
     S3DestinationConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationConfiguration' {S3DestinationConfiguration
s3Configuration :: S3DestinationConfiguration
$sel:s3Configuration:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> S3DestinationConfiguration
s3Configuration} -> S3DestinationConfiguration
s3Configuration) (\s :: RedshiftDestinationConfiguration
s@RedshiftDestinationConfiguration' {} S3DestinationConfiguration
a -> RedshiftDestinationConfiguration
s {$sel:s3Configuration:RedshiftDestinationConfiguration' :: S3DestinationConfiguration
s3Configuration = S3DestinationConfiguration
a} :: RedshiftDestinationConfiguration)

instance
  Prelude.Hashable
    RedshiftDestinationConfiguration

instance
  Prelude.NFData
    RedshiftDestinationConfiguration

instance Core.ToJSON RedshiftDestinationConfiguration where
  toJSON :: RedshiftDestinationConfiguration -> Value
toJSON RedshiftDestinationConfiguration' {Maybe CloudWatchLoggingOptions
Maybe ProcessingConfiguration
Maybe RedshiftRetryOptions
Maybe RedshiftS3BackupMode
Maybe S3DestinationConfiguration
Text
Sensitive Text
CopyCommand
S3DestinationConfiguration
s3Configuration :: S3DestinationConfiguration
password :: Sensitive Text
username :: Sensitive Text
copyCommand :: CopyCommand
clusterJDBCURL :: Text
roleARN :: Text
processingConfiguration :: Maybe ProcessingConfiguration
retryOptions :: Maybe RedshiftRetryOptions
s3BackupConfiguration :: Maybe S3DestinationConfiguration
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
s3BackupMode :: Maybe RedshiftS3BackupMode
$sel:s3Configuration:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> S3DestinationConfiguration
$sel:password:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Sensitive Text
$sel:username:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Sensitive Text
$sel:copyCommand:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> CopyCommand
$sel:clusterJDBCURL:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Text
$sel:roleARN:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Text
$sel:processingConfiguration:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Maybe ProcessingConfiguration
$sel:retryOptions:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Maybe RedshiftRetryOptions
$sel:s3BackupConfiguration:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration
-> Maybe S3DestinationConfiguration
$sel:cloudWatchLoggingOptions:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> Maybe CloudWatchLoggingOptions
$sel:s3BackupMode:RedshiftDestinationConfiguration' :: RedshiftDestinationConfiguration -> 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
"S3BackupConfiguration" Text -> S3DestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (S3DestinationConfiguration -> Pair)
-> Maybe S3DestinationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3DestinationConfiguration
s3BackupConfiguration,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleARN),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ClusterJDBCURL" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterJDBCURL),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CopyCommand" Text -> CopyCommand -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CopyCommand
copyCommand),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Username" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
username),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Password" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
password),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"S3Configuration" Text -> S3DestinationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3DestinationConfiguration
s3Configuration)
          ]
      )