{-# 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.QLDB.Types.S3ExportConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QLDB.Types.S3EncryptionConfiguration
data S3ExportConfiguration = S3ExportConfiguration'
{
S3ExportConfiguration -> Text
bucket :: Prelude.Text,
S3ExportConfiguration -> Text
prefix :: Prelude.Text,
S3ExportConfiguration -> S3EncryptionConfiguration
encryptionConfiguration :: S3EncryptionConfiguration
}
deriving (S3ExportConfiguration -> S3ExportConfiguration -> Bool
(S3ExportConfiguration -> S3ExportConfiguration -> Bool)
-> (S3ExportConfiguration -> S3ExportConfiguration -> Bool)
-> Eq S3ExportConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
$c/= :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
== :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
$c== :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
Prelude.Eq, ReadPrec [S3ExportConfiguration]
ReadPrec S3ExportConfiguration
Int -> ReadS S3ExportConfiguration
ReadS [S3ExportConfiguration]
(Int -> ReadS S3ExportConfiguration)
-> ReadS [S3ExportConfiguration]
-> ReadPrec S3ExportConfiguration
-> ReadPrec [S3ExportConfiguration]
-> Read S3ExportConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ExportConfiguration]
$creadListPrec :: ReadPrec [S3ExportConfiguration]
readPrec :: ReadPrec S3ExportConfiguration
$creadPrec :: ReadPrec S3ExportConfiguration
readList :: ReadS [S3ExportConfiguration]
$creadList :: ReadS [S3ExportConfiguration]
readsPrec :: Int -> ReadS S3ExportConfiguration
$creadsPrec :: Int -> ReadS S3ExportConfiguration
Prelude.Read, Int -> S3ExportConfiguration -> ShowS
[S3ExportConfiguration] -> ShowS
S3ExportConfiguration -> String
(Int -> S3ExportConfiguration -> ShowS)
-> (S3ExportConfiguration -> String)
-> ([S3ExportConfiguration] -> ShowS)
-> Show S3ExportConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ExportConfiguration] -> ShowS
$cshowList :: [S3ExportConfiguration] -> ShowS
show :: S3ExportConfiguration -> String
$cshow :: S3ExportConfiguration -> String
showsPrec :: Int -> S3ExportConfiguration -> ShowS
$cshowsPrec :: Int -> S3ExportConfiguration -> ShowS
Prelude.Show, (forall x. S3ExportConfiguration -> Rep S3ExportConfiguration x)
-> (forall x. Rep S3ExportConfiguration x -> S3ExportConfiguration)
-> Generic S3ExportConfiguration
forall x. Rep S3ExportConfiguration x -> S3ExportConfiguration
forall x. S3ExportConfiguration -> Rep S3ExportConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3ExportConfiguration x -> S3ExportConfiguration
$cfrom :: forall x. S3ExportConfiguration -> Rep S3ExportConfiguration x
Prelude.Generic)
newS3ExportConfiguration ::
Prelude.Text ->
Prelude.Text ->
S3EncryptionConfiguration ->
S3ExportConfiguration
newS3ExportConfiguration :: Text -> Text -> S3EncryptionConfiguration -> S3ExportConfiguration
newS3ExportConfiguration
Text
pBucket_
Text
pPrefix_
S3EncryptionConfiguration
pEncryptionConfiguration_ =
S3ExportConfiguration' :: Text -> Text -> S3EncryptionConfiguration -> S3ExportConfiguration
S3ExportConfiguration'
{ $sel:bucket:S3ExportConfiguration' :: Text
bucket = Text
pBucket_,
$sel:prefix:S3ExportConfiguration' :: Text
prefix = Text
pPrefix_,
$sel:encryptionConfiguration:S3ExportConfiguration' :: S3EncryptionConfiguration
encryptionConfiguration = S3EncryptionConfiguration
pEncryptionConfiguration_
}
s3ExportConfiguration_bucket :: Lens.Lens' S3ExportConfiguration Prelude.Text
s3ExportConfiguration_bucket :: (Text -> f Text)
-> S3ExportConfiguration -> f S3ExportConfiguration
s3ExportConfiguration_bucket = (S3ExportConfiguration -> Text)
-> (S3ExportConfiguration -> Text -> S3ExportConfiguration)
-> Lens S3ExportConfiguration S3ExportConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ExportConfiguration' {Text
bucket :: Text
$sel:bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
bucket} -> Text
bucket) (\s :: S3ExportConfiguration
s@S3ExportConfiguration' {} Text
a -> S3ExportConfiguration
s {$sel:bucket:S3ExportConfiguration' :: Text
bucket = Text
a} :: S3ExportConfiguration)
s3ExportConfiguration_prefix :: Lens.Lens' S3ExportConfiguration Prelude.Text
s3ExportConfiguration_prefix :: (Text -> f Text)
-> S3ExportConfiguration -> f S3ExportConfiguration
s3ExportConfiguration_prefix = (S3ExportConfiguration -> Text)
-> (S3ExportConfiguration -> Text -> S3ExportConfiguration)
-> Lens S3ExportConfiguration S3ExportConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ExportConfiguration' {Text
prefix :: Text
$sel:prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Text
prefix} -> Text
prefix) (\s :: S3ExportConfiguration
s@S3ExportConfiguration' {} Text
a -> S3ExportConfiguration
s {$sel:prefix:S3ExportConfiguration' :: Text
prefix = Text
a} :: S3ExportConfiguration)
s3ExportConfiguration_encryptionConfiguration :: Lens.Lens' S3ExportConfiguration S3EncryptionConfiguration
s3ExportConfiguration_encryptionConfiguration :: (S3EncryptionConfiguration -> f S3EncryptionConfiguration)
-> S3ExportConfiguration -> f S3ExportConfiguration
s3ExportConfiguration_encryptionConfiguration = (S3ExportConfiguration -> S3EncryptionConfiguration)
-> (S3ExportConfiguration
-> S3EncryptionConfiguration -> S3ExportConfiguration)
-> Lens
S3ExportConfiguration
S3ExportConfiguration
S3EncryptionConfiguration
S3EncryptionConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ExportConfiguration' {S3EncryptionConfiguration
encryptionConfiguration :: S3EncryptionConfiguration
$sel:encryptionConfiguration:S3ExportConfiguration' :: S3ExportConfiguration -> S3EncryptionConfiguration
encryptionConfiguration} -> S3EncryptionConfiguration
encryptionConfiguration) (\s :: S3ExportConfiguration
s@S3ExportConfiguration' {} S3EncryptionConfiguration
a -> S3ExportConfiguration
s {$sel:encryptionConfiguration:S3ExportConfiguration' :: S3EncryptionConfiguration
encryptionConfiguration = S3EncryptionConfiguration
a} :: S3ExportConfiguration)
instance Core.FromJSON S3ExportConfiguration where
parseJSON :: Value -> Parser S3ExportConfiguration
parseJSON =
String
-> (Object -> Parser S3ExportConfiguration)
-> Value
-> Parser S3ExportConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3ExportConfiguration"
( \Object
x ->
Text -> Text -> S3EncryptionConfiguration -> S3ExportConfiguration
S3ExportConfiguration'
(Text
-> Text -> S3EncryptionConfiguration -> S3ExportConfiguration)
-> Parser Text
-> Parser
(Text -> S3EncryptionConfiguration -> S3ExportConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Bucket")
Parser (Text -> S3EncryptionConfiguration -> S3ExportConfiguration)
-> Parser Text
-> Parser (S3EncryptionConfiguration -> S3ExportConfiguration)
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
"Prefix")
Parser (S3EncryptionConfiguration -> S3ExportConfiguration)
-> Parser S3EncryptionConfiguration -> Parser S3ExportConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser S3EncryptionConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EncryptionConfiguration")
)
instance Prelude.Hashable S3ExportConfiguration
instance Prelude.NFData S3ExportConfiguration
instance Core.ToJSON S3ExportConfiguration where
toJSON :: S3ExportConfiguration -> Value
toJSON S3ExportConfiguration' {Text
S3EncryptionConfiguration
encryptionConfiguration :: S3EncryptionConfiguration
prefix :: Text
bucket :: Text
$sel:encryptionConfiguration:S3ExportConfiguration' :: S3ExportConfiguration -> S3EncryptionConfiguration
$sel:prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Bucket" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucket),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Prefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
prefix),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"EncryptionConfiguration"
Text -> S3EncryptionConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3EncryptionConfiguration
encryptionConfiguration
)
]
)