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