{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 :: Lens' S3ExportConfiguration Text
s3ExportConfiguration_bucket = 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 :: Lens' S3ExportConfiguration Text
s3ExportConfiguration_prefix = 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 :: Lens' S3ExportConfiguration S3EncryptionConfiguration
s3ExportConfiguration_encryptionConfiguration = 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 Data.FromJSON S3ExportConfiguration where
parseJSON :: Value -> Parser S3ExportConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"S3ExportConfiguration"
( \Object
x ->
Text -> Text -> S3EncryptionConfiguration -> S3ExportConfiguration
S3ExportConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Bucket")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Prefix")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EncryptionConfiguration")
)
instance Prelude.Hashable S3ExportConfiguration where
hashWithSalt :: Int -> S3ExportConfiguration -> Int
hashWithSalt Int
_salt S3ExportConfiguration' {Text
S3EncryptionConfiguration
encryptionConfiguration :: S3EncryptionConfiguration
prefix :: Text
bucket :: Text
$sel:encryptionConfiguration:S3ExportConfiguration' :: S3ExportConfiguration -> S3EncryptionConfiguration
$sel:prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
prefix
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3EncryptionConfiguration
encryptionConfiguration
instance Prelude.NFData S3ExportConfiguration where
rnf :: S3ExportConfiguration -> ()
rnf S3ExportConfiguration' {Text
S3EncryptionConfiguration
encryptionConfiguration :: S3EncryptionConfiguration
prefix :: Text
bucket :: Text
$sel:encryptionConfiguration:S3ExportConfiguration' :: S3ExportConfiguration -> S3EncryptionConfiguration
$sel:prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
bucket
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
prefix
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf S3EncryptionConfiguration
encryptionConfiguration
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Bucket" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
bucket),
forall a. a -> Maybe a
Prelude.Just (Key
"Prefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
prefix),
forall a. a -> Maybe a
Prelude.Just
( Key
"EncryptionConfiguration"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3EncryptionConfiguration
encryptionConfiguration
)
]
)