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