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

-- | Describes a destination in Amazon Redshift.
--
-- /See:/ 'newRedshiftDestinationDescription' smart constructor.
data RedshiftDestinationDescription = RedshiftDestinationDescription'
  { -- | The Amazon S3 backup mode.
    RedshiftDestinationDescription -> Maybe RedshiftS3BackupMode
s3BackupMode :: Prelude.Maybe RedshiftS3BackupMode,
    -- | The configuration for backup in Amazon S3.
    RedshiftDestinationDescription -> Maybe S3DestinationDescription
s3BackupDescription :: Prelude.Maybe S3DestinationDescription,
    -- | The Amazon CloudWatch logging options for your delivery stream.
    RedshiftDestinationDescription -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Prelude.Maybe CloudWatchLoggingOptions,
    -- | The retry behavior in case Kinesis Data Firehose is unable to deliver
    -- documents to Amazon Redshift. Default value is 3600 (60 minutes).
    RedshiftDestinationDescription -> Maybe RedshiftRetryOptions
retryOptions :: Prelude.Maybe RedshiftRetryOptions,
    -- | The data processing configuration.
    RedshiftDestinationDescription -> 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>.
    RedshiftDestinationDescription -> Text
roleARN :: Prelude.Text,
    -- | The database connection string.
    RedshiftDestinationDescription -> Text
clusterJDBCURL :: Prelude.Text,
    -- | The @COPY@ command.
    RedshiftDestinationDescription -> CopyCommand
copyCommand :: CopyCommand,
    -- | The name of the user.
    RedshiftDestinationDescription -> Sensitive Text
username :: Core.Sensitive Prelude.Text,
    -- | The Amazon S3 destination.
    RedshiftDestinationDescription -> S3DestinationDescription
s3DestinationDescription :: S3DestinationDescription
  }
  deriving (RedshiftDestinationDescription
-> RedshiftDestinationDescription -> Bool
(RedshiftDestinationDescription
 -> RedshiftDestinationDescription -> Bool)
-> (RedshiftDestinationDescription
    -> RedshiftDestinationDescription -> Bool)
-> Eq RedshiftDestinationDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftDestinationDescription
-> RedshiftDestinationDescription -> Bool
$c/= :: RedshiftDestinationDescription
-> RedshiftDestinationDescription -> Bool
== :: RedshiftDestinationDescription
-> RedshiftDestinationDescription -> Bool
$c== :: RedshiftDestinationDescription
-> RedshiftDestinationDescription -> Bool
Prelude.Eq, Int -> RedshiftDestinationDescription -> ShowS
[RedshiftDestinationDescription] -> ShowS
RedshiftDestinationDescription -> String
(Int -> RedshiftDestinationDescription -> ShowS)
-> (RedshiftDestinationDescription -> String)
-> ([RedshiftDestinationDescription] -> ShowS)
-> Show RedshiftDestinationDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftDestinationDescription] -> ShowS
$cshowList :: [RedshiftDestinationDescription] -> ShowS
show :: RedshiftDestinationDescription -> String
$cshow :: RedshiftDestinationDescription -> String
showsPrec :: Int -> RedshiftDestinationDescription -> ShowS
$cshowsPrec :: Int -> RedshiftDestinationDescription -> ShowS
Prelude.Show, (forall x.
 RedshiftDestinationDescription
 -> Rep RedshiftDestinationDescription x)
-> (forall x.
    Rep RedshiftDestinationDescription x
    -> RedshiftDestinationDescription)
-> Generic RedshiftDestinationDescription
forall x.
Rep RedshiftDestinationDescription x
-> RedshiftDestinationDescription
forall x.
RedshiftDestinationDescription
-> Rep RedshiftDestinationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedshiftDestinationDescription x
-> RedshiftDestinationDescription
$cfrom :: forall x.
RedshiftDestinationDescription
-> Rep RedshiftDestinationDescription x
Prelude.Generic)

-- |
-- Create a value of 'RedshiftDestinationDescription' 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', 'redshiftDestinationDescription_s3BackupMode' - The Amazon S3 backup mode.
--
-- 's3BackupDescription', 'redshiftDestinationDescription_s3BackupDescription' - The configuration for backup in Amazon S3.
--
-- 'cloudWatchLoggingOptions', 'redshiftDestinationDescription_cloudWatchLoggingOptions' - The Amazon CloudWatch logging options for your delivery stream.
--
-- 'retryOptions', 'redshiftDestinationDescription_retryOptions' - The retry behavior in case Kinesis Data Firehose is unable to deliver
-- documents to Amazon Redshift. Default value is 3600 (60 minutes).
--
-- 'processingConfiguration', 'redshiftDestinationDescription_processingConfiguration' - The data processing configuration.
--
-- 'roleARN', 'redshiftDestinationDescription_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', 'redshiftDestinationDescription_clusterJDBCURL' - The database connection string.
--
-- 'copyCommand', 'redshiftDestinationDescription_copyCommand' - The @COPY@ command.
--
-- 'username', 'redshiftDestinationDescription_username' - The name of the user.
--
-- 's3DestinationDescription', 'redshiftDestinationDescription_s3DestinationDescription' - The Amazon S3 destination.
newRedshiftDestinationDescription ::
  -- | 'roleARN'
  Prelude.Text ->
  -- | 'clusterJDBCURL'
  Prelude.Text ->
  -- | 'copyCommand'
  CopyCommand ->
  -- | 'username'
  Prelude.Text ->
  -- | 's3DestinationDescription'
  S3DestinationDescription ->
  RedshiftDestinationDescription
newRedshiftDestinationDescription :: Text
-> Text
-> CopyCommand
-> Text
-> S3DestinationDescription
-> RedshiftDestinationDescription
newRedshiftDestinationDescription
  Text
pRoleARN_
  Text
pClusterJDBCURL_
  CopyCommand
pCopyCommand_
  Text
pUsername_
  S3DestinationDescription
pS3DestinationDescription_ =
    RedshiftDestinationDescription' :: Maybe RedshiftS3BackupMode
-> Maybe S3DestinationDescription
-> Maybe CloudWatchLoggingOptions
-> Maybe RedshiftRetryOptions
-> Maybe ProcessingConfiguration
-> Text
-> Text
-> CopyCommand
-> Sensitive Text
-> S3DestinationDescription
-> RedshiftDestinationDescription
RedshiftDestinationDescription'
      { $sel:s3BackupMode:RedshiftDestinationDescription' :: Maybe RedshiftS3BackupMode
s3BackupMode =
          Maybe RedshiftS3BackupMode
forall a. Maybe a
Prelude.Nothing,
        $sel:s3BackupDescription:RedshiftDestinationDescription' :: Maybe S3DestinationDescription
s3BackupDescription = Maybe S3DestinationDescription
forall a. Maybe a
Prelude.Nothing,
        $sel:cloudWatchLoggingOptions:RedshiftDestinationDescription' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = Maybe CloudWatchLoggingOptions
forall a. Maybe a
Prelude.Nothing,
        $sel:retryOptions:RedshiftDestinationDescription' :: Maybe RedshiftRetryOptions
retryOptions = Maybe RedshiftRetryOptions
forall a. Maybe a
Prelude.Nothing,
        $sel:processingConfiguration:RedshiftDestinationDescription' :: Maybe ProcessingConfiguration
processingConfiguration = Maybe ProcessingConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:roleARN:RedshiftDestinationDescription' :: Text
roleARN = Text
pRoleARN_,
        $sel:clusterJDBCURL:RedshiftDestinationDescription' :: Text
clusterJDBCURL = Text
pClusterJDBCURL_,
        $sel:copyCommand:RedshiftDestinationDescription' :: CopyCommand
copyCommand = CopyCommand
pCopyCommand_,
        $sel:username:RedshiftDestinationDescription' :: 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:s3DestinationDescription:RedshiftDestinationDescription' :: S3DestinationDescription
s3DestinationDescription =
          S3DestinationDescription
pS3DestinationDescription_
      }

-- | The Amazon S3 backup mode.
redshiftDestinationDescription_s3BackupMode :: Lens.Lens' RedshiftDestinationDescription (Prelude.Maybe RedshiftS3BackupMode)
redshiftDestinationDescription_s3BackupMode :: (Maybe RedshiftS3BackupMode -> f (Maybe RedshiftS3BackupMode))
-> RedshiftDestinationDescription
-> f RedshiftDestinationDescription
redshiftDestinationDescription_s3BackupMode = (RedshiftDestinationDescription -> Maybe RedshiftS3BackupMode)
-> (RedshiftDestinationDescription
    -> Maybe RedshiftS3BackupMode -> RedshiftDestinationDescription)
-> Lens
     RedshiftDestinationDescription
     RedshiftDestinationDescription
     (Maybe RedshiftS3BackupMode)
     (Maybe RedshiftS3BackupMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationDescription' {Maybe RedshiftS3BackupMode
s3BackupMode :: Maybe RedshiftS3BackupMode
$sel:s3BackupMode:RedshiftDestinationDescription' :: RedshiftDestinationDescription -> Maybe RedshiftS3BackupMode
s3BackupMode} -> Maybe RedshiftS3BackupMode
s3BackupMode) (\s :: RedshiftDestinationDescription
s@RedshiftDestinationDescription' {} Maybe RedshiftS3BackupMode
a -> RedshiftDestinationDescription
s {$sel:s3BackupMode:RedshiftDestinationDescription' :: Maybe RedshiftS3BackupMode
s3BackupMode = Maybe RedshiftS3BackupMode
a} :: RedshiftDestinationDescription)

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

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

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

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

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

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

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

-- | The name of the user.
redshiftDestinationDescription_username :: Lens.Lens' RedshiftDestinationDescription Prelude.Text
redshiftDestinationDescription_username :: (Text -> f Text)
-> RedshiftDestinationDescription
-> f RedshiftDestinationDescription
redshiftDestinationDescription_username = (RedshiftDestinationDescription -> Sensitive Text)
-> (RedshiftDestinationDescription
    -> Sensitive Text -> RedshiftDestinationDescription)
-> Lens
     RedshiftDestinationDescription
     RedshiftDestinationDescription
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationDescription' {Sensitive Text
username :: Sensitive Text
$sel:username:RedshiftDestinationDescription' :: RedshiftDestinationDescription -> Sensitive Text
username} -> Sensitive Text
username) (\s :: RedshiftDestinationDescription
s@RedshiftDestinationDescription' {} Sensitive Text
a -> RedshiftDestinationDescription
s {$sel:username:RedshiftDestinationDescription' :: Sensitive Text
username = Sensitive Text
a} :: RedshiftDestinationDescription) ((Sensitive Text -> f (Sensitive Text))
 -> RedshiftDestinationDescription
 -> f RedshiftDestinationDescription)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> RedshiftDestinationDescription
-> f RedshiftDestinationDescription
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 Amazon S3 destination.
redshiftDestinationDescription_s3DestinationDescription :: Lens.Lens' RedshiftDestinationDescription S3DestinationDescription
redshiftDestinationDescription_s3DestinationDescription :: (S3DestinationDescription -> f S3DestinationDescription)
-> RedshiftDestinationDescription
-> f RedshiftDestinationDescription
redshiftDestinationDescription_s3DestinationDescription = (RedshiftDestinationDescription -> S3DestinationDescription)
-> (RedshiftDestinationDescription
    -> S3DestinationDescription -> RedshiftDestinationDescription)
-> Lens
     RedshiftDestinationDescription
     RedshiftDestinationDescription
     S3DestinationDescription
     S3DestinationDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftDestinationDescription' {S3DestinationDescription
s3DestinationDescription :: S3DestinationDescription
$sel:s3DestinationDescription:RedshiftDestinationDescription' :: RedshiftDestinationDescription -> S3DestinationDescription
s3DestinationDescription} -> S3DestinationDescription
s3DestinationDescription) (\s :: RedshiftDestinationDescription
s@RedshiftDestinationDescription' {} S3DestinationDescription
a -> RedshiftDestinationDescription
s {$sel:s3DestinationDescription:RedshiftDestinationDescription' :: S3DestinationDescription
s3DestinationDescription = S3DestinationDescription
a} :: RedshiftDestinationDescription)

instance Core.FromJSON RedshiftDestinationDescription where
  parseJSON :: Value -> Parser RedshiftDestinationDescription
parseJSON =
    String
-> (Object -> Parser RedshiftDestinationDescription)
-> Value
-> Parser RedshiftDestinationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RedshiftDestinationDescription"
      ( \Object
x ->
          Maybe RedshiftS3BackupMode
-> Maybe S3DestinationDescription
-> Maybe CloudWatchLoggingOptions
-> Maybe RedshiftRetryOptions
-> Maybe ProcessingConfiguration
-> Text
-> Text
-> CopyCommand
-> Sensitive Text
-> S3DestinationDescription
-> RedshiftDestinationDescription
RedshiftDestinationDescription'
            (Maybe RedshiftS3BackupMode
 -> Maybe S3DestinationDescription
 -> Maybe CloudWatchLoggingOptions
 -> Maybe RedshiftRetryOptions
 -> Maybe ProcessingConfiguration
 -> Text
 -> Text
 -> CopyCommand
 -> Sensitive Text
 -> S3DestinationDescription
 -> RedshiftDestinationDescription)
-> Parser (Maybe RedshiftS3BackupMode)
-> Parser
     (Maybe S3DestinationDescription
      -> Maybe CloudWatchLoggingOptions
      -> Maybe RedshiftRetryOptions
      -> Maybe ProcessingConfiguration
      -> Text
      -> Text
      -> CopyCommand
      -> Sensitive Text
      -> S3DestinationDescription
      -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RedshiftS3BackupMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3BackupMode")
            Parser
  (Maybe S3DestinationDescription
   -> Maybe CloudWatchLoggingOptions
   -> Maybe RedshiftRetryOptions
   -> Maybe ProcessingConfiguration
   -> Text
   -> Text
   -> CopyCommand
   -> Sensitive Text
   -> S3DestinationDescription
   -> RedshiftDestinationDescription)
-> Parser (Maybe S3DestinationDescription)
-> Parser
     (Maybe CloudWatchLoggingOptions
      -> Maybe RedshiftRetryOptions
      -> Maybe ProcessingConfiguration
      -> Text
      -> Text
      -> CopyCommand
      -> Sensitive Text
      -> S3DestinationDescription
      -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3DestinationDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3BackupDescription")
            Parser
  (Maybe CloudWatchLoggingOptions
   -> Maybe RedshiftRetryOptions
   -> Maybe ProcessingConfiguration
   -> Text
   -> Text
   -> CopyCommand
   -> Sensitive Text
   -> S3DestinationDescription
   -> RedshiftDestinationDescription)
-> Parser (Maybe CloudWatchLoggingOptions)
-> Parser
     (Maybe RedshiftRetryOptions
      -> Maybe ProcessingConfiguration
      -> Text
      -> Text
      -> CopyCommand
      -> Sensitive Text
      -> S3DestinationDescription
      -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CloudWatchLoggingOptions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CloudWatchLoggingOptions")
            Parser
  (Maybe RedshiftRetryOptions
   -> Maybe ProcessingConfiguration
   -> Text
   -> Text
   -> CopyCommand
   -> Sensitive Text
   -> S3DestinationDescription
   -> RedshiftDestinationDescription)
-> Parser (Maybe RedshiftRetryOptions)
-> Parser
     (Maybe ProcessingConfiguration
      -> Text
      -> Text
      -> CopyCommand
      -> Sensitive Text
      -> S3DestinationDescription
      -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RedshiftRetryOptions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RetryOptions")
            Parser
  (Maybe ProcessingConfiguration
   -> Text
   -> Text
   -> CopyCommand
   -> Sensitive Text
   -> S3DestinationDescription
   -> RedshiftDestinationDescription)
-> Parser (Maybe ProcessingConfiguration)
-> Parser
     (Text
      -> Text
      -> CopyCommand
      -> Sensitive Text
      -> S3DestinationDescription
      -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProcessingConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProcessingConfiguration")
            Parser
  (Text
   -> Text
   -> CopyCommand
   -> Sensitive Text
   -> S3DestinationDescription
   -> RedshiftDestinationDescription)
-> Parser Text
-> Parser
     (Text
      -> CopyCommand
      -> Sensitive Text
      -> S3DestinationDescription
      -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RoleARN")
            Parser
  (Text
   -> CopyCommand
   -> Sensitive Text
   -> S3DestinationDescription
   -> RedshiftDestinationDescription)
-> Parser Text
-> Parser
     (CopyCommand
      -> Sensitive Text
      -> S3DestinationDescription
      -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ClusterJDBCURL")
            Parser
  (CopyCommand
   -> Sensitive Text
   -> S3DestinationDescription
   -> RedshiftDestinationDescription)
-> Parser CopyCommand
-> Parser
     (Sensitive Text
      -> S3DestinationDescription -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser CopyCommand
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CopyCommand")
            Parser
  (Sensitive Text
   -> S3DestinationDescription -> RedshiftDestinationDescription)
-> Parser (Sensitive Text)
-> Parser
     (S3DestinationDescription -> RedshiftDestinationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Sensitive Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Username")
            Parser (S3DestinationDescription -> RedshiftDestinationDescription)
-> Parser S3DestinationDescription
-> Parser RedshiftDestinationDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser S3DestinationDescription
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3DestinationDescription")
      )

instance
  Prelude.Hashable
    RedshiftDestinationDescription

instance
  Prelude.NFData
    RedshiftDestinationDescription