{-# 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.Glue.Types.MongoDBTarget where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MongoDBTarget = MongoDBTarget'
{
MongoDBTarget -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
MongoDBTarget -> Maybe Text
connectionName :: Prelude.Maybe Prelude.Text,
MongoDBTarget -> Maybe Bool
scanAll :: Prelude.Maybe Prelude.Bool
}
deriving (MongoDBTarget -> MongoDBTarget -> Bool
(MongoDBTarget -> MongoDBTarget -> Bool)
-> (MongoDBTarget -> MongoDBTarget -> Bool) -> Eq MongoDBTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MongoDBTarget -> MongoDBTarget -> Bool
$c/= :: MongoDBTarget -> MongoDBTarget -> Bool
== :: MongoDBTarget -> MongoDBTarget -> Bool
$c== :: MongoDBTarget -> MongoDBTarget -> Bool
Prelude.Eq, ReadPrec [MongoDBTarget]
ReadPrec MongoDBTarget
Int -> ReadS MongoDBTarget
ReadS [MongoDBTarget]
(Int -> ReadS MongoDBTarget)
-> ReadS [MongoDBTarget]
-> ReadPrec MongoDBTarget
-> ReadPrec [MongoDBTarget]
-> Read MongoDBTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MongoDBTarget]
$creadListPrec :: ReadPrec [MongoDBTarget]
readPrec :: ReadPrec MongoDBTarget
$creadPrec :: ReadPrec MongoDBTarget
readList :: ReadS [MongoDBTarget]
$creadList :: ReadS [MongoDBTarget]
readsPrec :: Int -> ReadS MongoDBTarget
$creadsPrec :: Int -> ReadS MongoDBTarget
Prelude.Read, Int -> MongoDBTarget -> ShowS
[MongoDBTarget] -> ShowS
MongoDBTarget -> String
(Int -> MongoDBTarget -> ShowS)
-> (MongoDBTarget -> String)
-> ([MongoDBTarget] -> ShowS)
-> Show MongoDBTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MongoDBTarget] -> ShowS
$cshowList :: [MongoDBTarget] -> ShowS
show :: MongoDBTarget -> String
$cshow :: MongoDBTarget -> String
showsPrec :: Int -> MongoDBTarget -> ShowS
$cshowsPrec :: Int -> MongoDBTarget -> ShowS
Prelude.Show, (forall x. MongoDBTarget -> Rep MongoDBTarget x)
-> (forall x. Rep MongoDBTarget x -> MongoDBTarget)
-> Generic MongoDBTarget
forall x. Rep MongoDBTarget x -> MongoDBTarget
forall x. MongoDBTarget -> Rep MongoDBTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MongoDBTarget x -> MongoDBTarget
$cfrom :: forall x. MongoDBTarget -> Rep MongoDBTarget x
Prelude.Generic)
newMongoDBTarget ::
MongoDBTarget
newMongoDBTarget :: MongoDBTarget
newMongoDBTarget =
MongoDBTarget' :: Maybe Text -> Maybe Text -> Maybe Bool -> MongoDBTarget
MongoDBTarget'
{ $sel:path:MongoDBTarget' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectionName:MongoDBTarget' :: Maybe Text
connectionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scanAll:MongoDBTarget' :: Maybe Bool
scanAll = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
mongoDBTarget_path :: Lens.Lens' MongoDBTarget (Prelude.Maybe Prelude.Text)
mongoDBTarget_path :: (Maybe Text -> f (Maybe Text)) -> MongoDBTarget -> f MongoDBTarget
mongoDBTarget_path = (MongoDBTarget -> Maybe Text)
-> (MongoDBTarget -> Maybe Text -> MongoDBTarget)
-> Lens MongoDBTarget MongoDBTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDBTarget' {Maybe Text
path :: Maybe Text
$sel:path:MongoDBTarget' :: MongoDBTarget -> Maybe Text
path} -> Maybe Text
path) (\s :: MongoDBTarget
s@MongoDBTarget' {} Maybe Text
a -> MongoDBTarget
s {$sel:path:MongoDBTarget' :: Maybe Text
path = Maybe Text
a} :: MongoDBTarget)
mongoDBTarget_connectionName :: Lens.Lens' MongoDBTarget (Prelude.Maybe Prelude.Text)
mongoDBTarget_connectionName :: (Maybe Text -> f (Maybe Text)) -> MongoDBTarget -> f MongoDBTarget
mongoDBTarget_connectionName = (MongoDBTarget -> Maybe Text)
-> (MongoDBTarget -> Maybe Text -> MongoDBTarget)
-> Lens MongoDBTarget MongoDBTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDBTarget' {Maybe Text
connectionName :: Maybe Text
$sel:connectionName:MongoDBTarget' :: MongoDBTarget -> Maybe Text
connectionName} -> Maybe Text
connectionName) (\s :: MongoDBTarget
s@MongoDBTarget' {} Maybe Text
a -> MongoDBTarget
s {$sel:connectionName:MongoDBTarget' :: Maybe Text
connectionName = Maybe Text
a} :: MongoDBTarget)
mongoDBTarget_scanAll :: Lens.Lens' MongoDBTarget (Prelude.Maybe Prelude.Bool)
mongoDBTarget_scanAll :: (Maybe Bool -> f (Maybe Bool)) -> MongoDBTarget -> f MongoDBTarget
mongoDBTarget_scanAll = (MongoDBTarget -> Maybe Bool)
-> (MongoDBTarget -> Maybe Bool -> MongoDBTarget)
-> Lens MongoDBTarget MongoDBTarget (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDBTarget' {Maybe Bool
scanAll :: Maybe Bool
$sel:scanAll:MongoDBTarget' :: MongoDBTarget -> Maybe Bool
scanAll} -> Maybe Bool
scanAll) (\s :: MongoDBTarget
s@MongoDBTarget' {} Maybe Bool
a -> MongoDBTarget
s {$sel:scanAll:MongoDBTarget' :: Maybe Bool
scanAll = Maybe Bool
a} :: MongoDBTarget)
instance Core.FromJSON MongoDBTarget where
parseJSON :: Value -> Parser MongoDBTarget
parseJSON =
String
-> (Object -> Parser MongoDBTarget)
-> Value
-> Parser MongoDBTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MongoDBTarget"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Bool -> MongoDBTarget
MongoDBTarget'
(Maybe Text -> Maybe Text -> Maybe Bool -> MongoDBTarget)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> MongoDBTarget)
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
"Path")
Parser (Maybe Text -> Maybe Bool -> MongoDBTarget)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> MongoDBTarget)
forall (f :: * -> *) a b. Applicative f => 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
"ConnectionName")
Parser (Maybe Bool -> MongoDBTarget)
-> Parser (Maybe Bool) -> Parser MongoDBTarget
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScanAll")
)
instance Prelude.Hashable MongoDBTarget
instance Prelude.NFData MongoDBTarget
instance Core.ToJSON MongoDBTarget where
toJSON :: MongoDBTarget -> Value
toJSON MongoDBTarget' {Maybe Bool
Maybe Text
scanAll :: Maybe Bool
connectionName :: Maybe Text
path :: Maybe Text
$sel:scanAll:MongoDBTarget' :: MongoDBTarget -> Maybe Bool
$sel:connectionName:MongoDBTarget' :: MongoDBTarget -> Maybe Text
$sel:path:MongoDBTarget' :: MongoDBTarget -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Path" 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
path,
(Text
"ConnectionName" 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
connectionName,
(Text
"ScanAll" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
scanAll
]
)