{-# 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.DataExchange.Types.AutoExportRevisionDestinationEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoExportRevisionDestinationEntry = AutoExportRevisionDestinationEntry'
{
AutoExportRevisionDestinationEntry -> Maybe Text
keyPattern :: Prelude.Maybe Prelude.Text,
AutoExportRevisionDestinationEntry -> Text
bucket :: Prelude.Text
}
deriving (AutoExportRevisionDestinationEntry
-> AutoExportRevisionDestinationEntry -> Bool
(AutoExportRevisionDestinationEntry
-> AutoExportRevisionDestinationEntry -> Bool)
-> (AutoExportRevisionDestinationEntry
-> AutoExportRevisionDestinationEntry -> Bool)
-> Eq AutoExportRevisionDestinationEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoExportRevisionDestinationEntry
-> AutoExportRevisionDestinationEntry -> Bool
$c/= :: AutoExportRevisionDestinationEntry
-> AutoExportRevisionDestinationEntry -> Bool
== :: AutoExportRevisionDestinationEntry
-> AutoExportRevisionDestinationEntry -> Bool
$c== :: AutoExportRevisionDestinationEntry
-> AutoExportRevisionDestinationEntry -> Bool
Prelude.Eq, ReadPrec [AutoExportRevisionDestinationEntry]
ReadPrec AutoExportRevisionDestinationEntry
Int -> ReadS AutoExportRevisionDestinationEntry
ReadS [AutoExportRevisionDestinationEntry]
(Int -> ReadS AutoExportRevisionDestinationEntry)
-> ReadS [AutoExportRevisionDestinationEntry]
-> ReadPrec AutoExportRevisionDestinationEntry
-> ReadPrec [AutoExportRevisionDestinationEntry]
-> Read AutoExportRevisionDestinationEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoExportRevisionDestinationEntry]
$creadListPrec :: ReadPrec [AutoExportRevisionDestinationEntry]
readPrec :: ReadPrec AutoExportRevisionDestinationEntry
$creadPrec :: ReadPrec AutoExportRevisionDestinationEntry
readList :: ReadS [AutoExportRevisionDestinationEntry]
$creadList :: ReadS [AutoExportRevisionDestinationEntry]
readsPrec :: Int -> ReadS AutoExportRevisionDestinationEntry
$creadsPrec :: Int -> ReadS AutoExportRevisionDestinationEntry
Prelude.Read, Int -> AutoExportRevisionDestinationEntry -> ShowS
[AutoExportRevisionDestinationEntry] -> ShowS
AutoExportRevisionDestinationEntry -> String
(Int -> AutoExportRevisionDestinationEntry -> ShowS)
-> (AutoExportRevisionDestinationEntry -> String)
-> ([AutoExportRevisionDestinationEntry] -> ShowS)
-> Show AutoExportRevisionDestinationEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoExportRevisionDestinationEntry] -> ShowS
$cshowList :: [AutoExportRevisionDestinationEntry] -> ShowS
show :: AutoExportRevisionDestinationEntry -> String
$cshow :: AutoExportRevisionDestinationEntry -> String
showsPrec :: Int -> AutoExportRevisionDestinationEntry -> ShowS
$cshowsPrec :: Int -> AutoExportRevisionDestinationEntry -> ShowS
Prelude.Show, (forall x.
AutoExportRevisionDestinationEntry
-> Rep AutoExportRevisionDestinationEntry x)
-> (forall x.
Rep AutoExportRevisionDestinationEntry x
-> AutoExportRevisionDestinationEntry)
-> Generic AutoExportRevisionDestinationEntry
forall x.
Rep AutoExportRevisionDestinationEntry x
-> AutoExportRevisionDestinationEntry
forall x.
AutoExportRevisionDestinationEntry
-> Rep AutoExportRevisionDestinationEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoExportRevisionDestinationEntry x
-> AutoExportRevisionDestinationEntry
$cfrom :: forall x.
AutoExportRevisionDestinationEntry
-> Rep AutoExportRevisionDestinationEntry x
Prelude.Generic)
newAutoExportRevisionDestinationEntry ::
Prelude.Text ->
AutoExportRevisionDestinationEntry
newAutoExportRevisionDestinationEntry :: Text -> AutoExportRevisionDestinationEntry
newAutoExportRevisionDestinationEntry Text
pBucket_ =
AutoExportRevisionDestinationEntry' :: Maybe Text -> Text -> AutoExportRevisionDestinationEntry
AutoExportRevisionDestinationEntry'
{ $sel:keyPattern:AutoExportRevisionDestinationEntry' :: Maybe Text
keyPattern =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:AutoExportRevisionDestinationEntry' :: Text
bucket = Text
pBucket_
}
autoExportRevisionDestinationEntry_keyPattern :: Lens.Lens' AutoExportRevisionDestinationEntry (Prelude.Maybe Prelude.Text)
autoExportRevisionDestinationEntry_keyPattern :: (Maybe Text -> f (Maybe Text))
-> AutoExportRevisionDestinationEntry
-> f AutoExportRevisionDestinationEntry
autoExportRevisionDestinationEntry_keyPattern = (AutoExportRevisionDestinationEntry -> Maybe Text)
-> (AutoExportRevisionDestinationEntry
-> Maybe Text -> AutoExportRevisionDestinationEntry)
-> Lens
AutoExportRevisionDestinationEntry
AutoExportRevisionDestinationEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoExportRevisionDestinationEntry' {Maybe Text
keyPattern :: Maybe Text
$sel:keyPattern:AutoExportRevisionDestinationEntry' :: AutoExportRevisionDestinationEntry -> Maybe Text
keyPattern} -> Maybe Text
keyPattern) (\s :: AutoExportRevisionDestinationEntry
s@AutoExportRevisionDestinationEntry' {} Maybe Text
a -> AutoExportRevisionDestinationEntry
s {$sel:keyPattern:AutoExportRevisionDestinationEntry' :: Maybe Text
keyPattern = Maybe Text
a} :: AutoExportRevisionDestinationEntry)
autoExportRevisionDestinationEntry_bucket :: Lens.Lens' AutoExportRevisionDestinationEntry Prelude.Text
autoExportRevisionDestinationEntry_bucket :: (Text -> f Text)
-> AutoExportRevisionDestinationEntry
-> f AutoExportRevisionDestinationEntry
autoExportRevisionDestinationEntry_bucket = (AutoExportRevisionDestinationEntry -> Text)
-> (AutoExportRevisionDestinationEntry
-> Text -> AutoExportRevisionDestinationEntry)
-> Lens
AutoExportRevisionDestinationEntry
AutoExportRevisionDestinationEntry
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoExportRevisionDestinationEntry' {Text
bucket :: Text
$sel:bucket:AutoExportRevisionDestinationEntry' :: AutoExportRevisionDestinationEntry -> Text
bucket} -> Text
bucket) (\s :: AutoExportRevisionDestinationEntry
s@AutoExportRevisionDestinationEntry' {} Text
a -> AutoExportRevisionDestinationEntry
s {$sel:bucket:AutoExportRevisionDestinationEntry' :: Text
bucket = Text
a} :: AutoExportRevisionDestinationEntry)
instance
Core.FromJSON
AutoExportRevisionDestinationEntry
where
parseJSON :: Value -> Parser AutoExportRevisionDestinationEntry
parseJSON =
String
-> (Object -> Parser AutoExportRevisionDestinationEntry)
-> Value
-> Parser AutoExportRevisionDestinationEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AutoExportRevisionDestinationEntry"
( \Object
x ->
Maybe Text -> Text -> AutoExportRevisionDestinationEntry
AutoExportRevisionDestinationEntry'
(Maybe Text -> Text -> AutoExportRevisionDestinationEntry)
-> Parser (Maybe Text)
-> Parser (Text -> AutoExportRevisionDestinationEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeyPattern")
Parser (Text -> AutoExportRevisionDestinationEntry)
-> Parser Text -> Parser AutoExportRevisionDestinationEntry
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
"Bucket")
)
instance
Prelude.Hashable
AutoExportRevisionDestinationEntry
instance
Prelude.NFData
AutoExportRevisionDestinationEntry
instance
Core.ToJSON
AutoExportRevisionDestinationEntry
where
toJSON :: AutoExportRevisionDestinationEntry -> Value
toJSON AutoExportRevisionDestinationEntry' {Maybe Text
Text
bucket :: Text
keyPattern :: Maybe Text
$sel:bucket:AutoExportRevisionDestinationEntry' :: AutoExportRevisionDestinationEntry -> Text
$sel:keyPattern:AutoExportRevisionDestinationEntry' :: AutoExportRevisionDestinationEntry -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"KeyPattern" 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
keyPattern,
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)
]
)