{-# 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 #-}
module Amazonka.Firehose.Types.S3DestinationConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.Firehose.Types.BufferingHints
import Amazonka.Firehose.Types.CloudWatchLoggingOptions
import Amazonka.Firehose.Types.CompressionFormat
import Amazonka.Firehose.Types.EncryptionConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3DestinationConfiguration = S3DestinationConfiguration'
{
S3DestinationConfiguration -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
S3DestinationConfiguration -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Prelude.Maybe CloudWatchLoggingOptions,
S3DestinationConfiguration -> Maybe Text
errorOutputPrefix :: Prelude.Maybe Prelude.Text,
S3DestinationConfiguration -> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
S3DestinationConfiguration -> Maybe CompressionFormat
compressionFormat :: Prelude.Maybe CompressionFormat,
S3DestinationConfiguration -> Maybe BufferingHints
bufferingHints :: Prelude.Maybe BufferingHints,
S3DestinationConfiguration -> Text
roleARN :: Prelude.Text,
S3DestinationConfiguration -> Text
bucketARN :: Prelude.Text
}
deriving (S3DestinationConfiguration -> S3DestinationConfiguration -> Bool
(S3DestinationConfiguration -> S3DestinationConfiguration -> Bool)
-> (S3DestinationConfiguration
-> S3DestinationConfiguration -> Bool)
-> Eq S3DestinationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3DestinationConfiguration -> S3DestinationConfiguration -> Bool
$c/= :: S3DestinationConfiguration -> S3DestinationConfiguration -> Bool
== :: S3DestinationConfiguration -> S3DestinationConfiguration -> Bool
$c== :: S3DestinationConfiguration -> S3DestinationConfiguration -> Bool
Prelude.Eq, ReadPrec [S3DestinationConfiguration]
ReadPrec S3DestinationConfiguration
Int -> ReadS S3DestinationConfiguration
ReadS [S3DestinationConfiguration]
(Int -> ReadS S3DestinationConfiguration)
-> ReadS [S3DestinationConfiguration]
-> ReadPrec S3DestinationConfiguration
-> ReadPrec [S3DestinationConfiguration]
-> Read S3DestinationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3DestinationConfiguration]
$creadListPrec :: ReadPrec [S3DestinationConfiguration]
readPrec :: ReadPrec S3DestinationConfiguration
$creadPrec :: ReadPrec S3DestinationConfiguration
readList :: ReadS [S3DestinationConfiguration]
$creadList :: ReadS [S3DestinationConfiguration]
readsPrec :: Int -> ReadS S3DestinationConfiguration
$creadsPrec :: Int -> ReadS S3DestinationConfiguration
Prelude.Read, Int -> S3DestinationConfiguration -> ShowS
[S3DestinationConfiguration] -> ShowS
S3DestinationConfiguration -> String
(Int -> S3DestinationConfiguration -> ShowS)
-> (S3DestinationConfiguration -> String)
-> ([S3DestinationConfiguration] -> ShowS)
-> Show S3DestinationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3DestinationConfiguration] -> ShowS
$cshowList :: [S3DestinationConfiguration] -> ShowS
show :: S3DestinationConfiguration -> String
$cshow :: S3DestinationConfiguration -> String
showsPrec :: Int -> S3DestinationConfiguration -> ShowS
$cshowsPrec :: Int -> S3DestinationConfiguration -> ShowS
Prelude.Show, (forall x.
S3DestinationConfiguration -> Rep S3DestinationConfiguration x)
-> (forall x.
Rep S3DestinationConfiguration x -> S3DestinationConfiguration)
-> Generic S3DestinationConfiguration
forall x.
Rep S3DestinationConfiguration x -> S3DestinationConfiguration
forall x.
S3DestinationConfiguration -> Rep S3DestinationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3DestinationConfiguration x -> S3DestinationConfiguration
$cfrom :: forall x.
S3DestinationConfiguration -> Rep S3DestinationConfiguration x
Prelude.Generic)
newS3DestinationConfiguration ::
Prelude.Text ->
Prelude.Text ->
S3DestinationConfiguration
newS3DestinationConfiguration :: Text -> Text -> S3DestinationConfiguration
newS3DestinationConfiguration Text
pRoleARN_ Text
pBucketARN_ =
S3DestinationConfiguration' :: Maybe Text
-> Maybe CloudWatchLoggingOptions
-> Maybe Text
-> Maybe EncryptionConfiguration
-> Maybe CompressionFormat
-> Maybe BufferingHints
-> Text
-> Text
-> S3DestinationConfiguration
S3DestinationConfiguration'
{ $sel:prefix:S3DestinationConfiguration' :: Maybe Text
prefix =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cloudWatchLoggingOptions:S3DestinationConfiguration' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = Maybe CloudWatchLoggingOptions
forall a. Maybe a
Prelude.Nothing,
$sel:errorOutputPrefix:S3DestinationConfiguration' :: Maybe Text
errorOutputPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:encryptionConfiguration:S3DestinationConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:compressionFormat:S3DestinationConfiguration' :: Maybe CompressionFormat
compressionFormat = Maybe CompressionFormat
forall a. Maybe a
Prelude.Nothing,
$sel:bufferingHints:S3DestinationConfiguration' :: Maybe BufferingHints
bufferingHints = Maybe BufferingHints
forall a. Maybe a
Prelude.Nothing,
$sel:roleARN:S3DestinationConfiguration' :: Text
roleARN = Text
pRoleARN_,
$sel:bucketARN:S3DestinationConfiguration' :: Text
bucketARN = Text
pBucketARN_
}
s3DestinationConfiguration_prefix :: Lens.Lens' S3DestinationConfiguration (Prelude.Maybe Prelude.Text)
s3DestinationConfiguration_prefix :: (Maybe Text -> f (Maybe Text))
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_prefix = (S3DestinationConfiguration -> Maybe Text)
-> (S3DestinationConfiguration
-> Maybe Text -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration
S3DestinationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Maybe Text
prefix :: Maybe Text
$sel:prefix:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Maybe Text
a -> S3DestinationConfiguration
s {$sel:prefix:S3DestinationConfiguration' :: Maybe Text
prefix = Maybe Text
a} :: S3DestinationConfiguration)
s3DestinationConfiguration_cloudWatchLoggingOptions :: Lens.Lens' S3DestinationConfiguration (Prelude.Maybe CloudWatchLoggingOptions)
s3DestinationConfiguration_cloudWatchLoggingOptions :: (Maybe CloudWatchLoggingOptions
-> f (Maybe CloudWatchLoggingOptions))
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_cloudWatchLoggingOptions = (S3DestinationConfiguration -> Maybe CloudWatchLoggingOptions)
-> (S3DestinationConfiguration
-> Maybe CloudWatchLoggingOptions -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration
S3DestinationConfiguration
(Maybe CloudWatchLoggingOptions)
(Maybe CloudWatchLoggingOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
$sel:cloudWatchLoggingOptions:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions} -> Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Maybe CloudWatchLoggingOptions
a -> S3DestinationConfiguration
s {$sel:cloudWatchLoggingOptions:S3DestinationConfiguration' :: Maybe CloudWatchLoggingOptions
cloudWatchLoggingOptions = Maybe CloudWatchLoggingOptions
a} :: S3DestinationConfiguration)
s3DestinationConfiguration_errorOutputPrefix :: Lens.Lens' S3DestinationConfiguration (Prelude.Maybe Prelude.Text)
s3DestinationConfiguration_errorOutputPrefix :: (Maybe Text -> f (Maybe Text))
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_errorOutputPrefix = (S3DestinationConfiguration -> Maybe Text)
-> (S3DestinationConfiguration
-> Maybe Text -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration
S3DestinationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Maybe Text
errorOutputPrefix :: Maybe Text
$sel:errorOutputPrefix:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe Text
errorOutputPrefix} -> Maybe Text
errorOutputPrefix) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Maybe Text
a -> S3DestinationConfiguration
s {$sel:errorOutputPrefix:S3DestinationConfiguration' :: Maybe Text
errorOutputPrefix = Maybe Text
a} :: S3DestinationConfiguration)
s3DestinationConfiguration_encryptionConfiguration :: Lens.Lens' S3DestinationConfiguration (Prelude.Maybe EncryptionConfiguration)
s3DestinationConfiguration_encryptionConfiguration :: (Maybe EncryptionConfiguration
-> f (Maybe EncryptionConfiguration))
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_encryptionConfiguration = (S3DestinationConfiguration -> Maybe EncryptionConfiguration)
-> (S3DestinationConfiguration
-> Maybe EncryptionConfiguration -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration
S3DestinationConfiguration
(Maybe EncryptionConfiguration)
(Maybe EncryptionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Maybe EncryptionConfiguration
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:encryptionConfiguration:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe EncryptionConfiguration
encryptionConfiguration} -> Maybe EncryptionConfiguration
encryptionConfiguration) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Maybe EncryptionConfiguration
a -> S3DestinationConfiguration
s {$sel:encryptionConfiguration:S3DestinationConfiguration' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
a} :: S3DestinationConfiguration)
s3DestinationConfiguration_compressionFormat :: Lens.Lens' S3DestinationConfiguration (Prelude.Maybe CompressionFormat)
s3DestinationConfiguration_compressionFormat :: (Maybe CompressionFormat -> f (Maybe CompressionFormat))
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_compressionFormat = (S3DestinationConfiguration -> Maybe CompressionFormat)
-> (S3DestinationConfiguration
-> Maybe CompressionFormat -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration
S3DestinationConfiguration
(Maybe CompressionFormat)
(Maybe CompressionFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Maybe CompressionFormat
compressionFormat :: Maybe CompressionFormat
$sel:compressionFormat:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe CompressionFormat
compressionFormat} -> Maybe CompressionFormat
compressionFormat) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Maybe CompressionFormat
a -> S3DestinationConfiguration
s {$sel:compressionFormat:S3DestinationConfiguration' :: Maybe CompressionFormat
compressionFormat = Maybe CompressionFormat
a} :: S3DestinationConfiguration)
s3DestinationConfiguration_bufferingHints :: Lens.Lens' S3DestinationConfiguration (Prelude.Maybe BufferingHints)
s3DestinationConfiguration_bufferingHints :: (Maybe BufferingHints -> f (Maybe BufferingHints))
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_bufferingHints = (S3DestinationConfiguration -> Maybe BufferingHints)
-> (S3DestinationConfiguration
-> Maybe BufferingHints -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration
S3DestinationConfiguration
(Maybe BufferingHints)
(Maybe BufferingHints)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Maybe BufferingHints
bufferingHints :: Maybe BufferingHints
$sel:bufferingHints:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe BufferingHints
bufferingHints} -> Maybe BufferingHints
bufferingHints) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Maybe BufferingHints
a -> S3DestinationConfiguration
s {$sel:bufferingHints:S3DestinationConfiguration' :: Maybe BufferingHints
bufferingHints = Maybe BufferingHints
a} :: S3DestinationConfiguration)
s3DestinationConfiguration_roleARN :: Lens.Lens' S3DestinationConfiguration Prelude.Text
s3DestinationConfiguration_roleARN :: (Text -> f Text)
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_roleARN = (S3DestinationConfiguration -> Text)
-> (S3DestinationConfiguration
-> Text -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration S3DestinationConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Text
roleARN :: Text
$sel:roleARN:S3DestinationConfiguration' :: S3DestinationConfiguration -> Text
roleARN} -> Text
roleARN) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Text
a -> S3DestinationConfiguration
s {$sel:roleARN:S3DestinationConfiguration' :: Text
roleARN = Text
a} :: S3DestinationConfiguration)
s3DestinationConfiguration_bucketARN :: Lens.Lens' S3DestinationConfiguration Prelude.Text
s3DestinationConfiguration_bucketARN :: (Text -> f Text)
-> S3DestinationConfiguration -> f S3DestinationConfiguration
s3DestinationConfiguration_bucketARN = (S3DestinationConfiguration -> Text)
-> (S3DestinationConfiguration
-> Text -> S3DestinationConfiguration)
-> Lens
S3DestinationConfiguration S3DestinationConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationConfiguration' {Text
bucketARN :: Text
$sel:bucketARN:S3DestinationConfiguration' :: S3DestinationConfiguration -> Text
bucketARN} -> Text
bucketARN) (\s :: S3DestinationConfiguration
s@S3DestinationConfiguration' {} Text
a -> S3DestinationConfiguration
s {$sel:bucketARN:S3DestinationConfiguration' :: Text
bucketARN = Text
a} :: S3DestinationConfiguration)
instance Prelude.Hashable S3DestinationConfiguration
instance Prelude.NFData S3DestinationConfiguration
instance Core.ToJSON S3DestinationConfiguration where
toJSON :: S3DestinationConfiguration -> Value
toJSON S3DestinationConfiguration' {Maybe Text
Maybe BufferingHints
Maybe CloudWatchLoggingOptions
Maybe CompressionFormat
Maybe EncryptionConfiguration
Text
bucketARN :: Text
roleARN :: Text
bufferingHints :: Maybe BufferingHints
compressionFormat :: Maybe CompressionFormat
encryptionConfiguration :: Maybe EncryptionConfiguration
errorOutputPrefix :: Maybe Text
cloudWatchLoggingOptions :: Maybe CloudWatchLoggingOptions
prefix :: Maybe Text
$sel:bucketARN:S3DestinationConfiguration' :: S3DestinationConfiguration -> Text
$sel:roleARN:S3DestinationConfiguration' :: S3DestinationConfiguration -> Text
$sel:bufferingHints:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe BufferingHints
$sel:compressionFormat:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe CompressionFormat
$sel:encryptionConfiguration:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe EncryptionConfiguration
$sel:errorOutputPrefix:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe Text
$sel:cloudWatchLoggingOptions:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe CloudWatchLoggingOptions
$sel:prefix:S3DestinationConfiguration' :: S3DestinationConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Prefix" 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
prefix,
(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
"ErrorOutputPrefix" 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
errorOutputPrefix,
(Text
"EncryptionConfiguration" Text -> EncryptionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EncryptionConfiguration -> Pair)
-> Maybe EncryptionConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionConfiguration
encryptionConfiguration,
(Text
"CompressionFormat" Text -> CompressionFormat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CompressionFormat -> Pair)
-> Maybe CompressionFormat -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CompressionFormat
compressionFormat,
(Text
"BufferingHints" Text -> BufferingHints -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(BufferingHints -> Pair) -> Maybe BufferingHints -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BufferingHints
bufferingHints,
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
"BucketARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucketARN)
]
)