{-# 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.GluePolicy where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GluePolicy = GluePolicy'
{
GluePolicy -> Maybe Text
policyInJson :: Prelude.Maybe Prelude.Text,
GluePolicy -> Maybe POSIX
updateTime :: Prelude.Maybe Core.POSIX,
GluePolicy -> Maybe Text
policyHash :: Prelude.Maybe Prelude.Text,
GluePolicy -> Maybe POSIX
createTime :: Prelude.Maybe Core.POSIX
}
deriving (GluePolicy -> GluePolicy -> Bool
(GluePolicy -> GluePolicy -> Bool)
-> (GluePolicy -> GluePolicy -> Bool) -> Eq GluePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GluePolicy -> GluePolicy -> Bool
$c/= :: GluePolicy -> GluePolicy -> Bool
== :: GluePolicy -> GluePolicy -> Bool
$c== :: GluePolicy -> GluePolicy -> Bool
Prelude.Eq, ReadPrec [GluePolicy]
ReadPrec GluePolicy
Int -> ReadS GluePolicy
ReadS [GluePolicy]
(Int -> ReadS GluePolicy)
-> ReadS [GluePolicy]
-> ReadPrec GluePolicy
-> ReadPrec [GluePolicy]
-> Read GluePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GluePolicy]
$creadListPrec :: ReadPrec [GluePolicy]
readPrec :: ReadPrec GluePolicy
$creadPrec :: ReadPrec GluePolicy
readList :: ReadS [GluePolicy]
$creadList :: ReadS [GluePolicy]
readsPrec :: Int -> ReadS GluePolicy
$creadsPrec :: Int -> ReadS GluePolicy
Prelude.Read, Int -> GluePolicy -> ShowS
[GluePolicy] -> ShowS
GluePolicy -> String
(Int -> GluePolicy -> ShowS)
-> (GluePolicy -> String)
-> ([GluePolicy] -> ShowS)
-> Show GluePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GluePolicy] -> ShowS
$cshowList :: [GluePolicy] -> ShowS
show :: GluePolicy -> String
$cshow :: GluePolicy -> String
showsPrec :: Int -> GluePolicy -> ShowS
$cshowsPrec :: Int -> GluePolicy -> ShowS
Prelude.Show, (forall x. GluePolicy -> Rep GluePolicy x)
-> (forall x. Rep GluePolicy x -> GluePolicy) -> Generic GluePolicy
forall x. Rep GluePolicy x -> GluePolicy
forall x. GluePolicy -> Rep GluePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GluePolicy x -> GluePolicy
$cfrom :: forall x. GluePolicy -> Rep GluePolicy x
Prelude.Generic)
newGluePolicy ::
GluePolicy
newGluePolicy :: GluePolicy
newGluePolicy =
GluePolicy' :: Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe POSIX -> GluePolicy
GluePolicy'
{ $sel:policyInJson:GluePolicy' :: Maybe Text
policyInJson = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:updateTime:GluePolicy' :: Maybe POSIX
updateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:policyHash:GluePolicy' :: Maybe Text
policyHash = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createTime:GluePolicy' :: Maybe POSIX
createTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
gluePolicy_policyInJson :: Lens.Lens' GluePolicy (Prelude.Maybe Prelude.Text)
gluePolicy_policyInJson :: (Maybe Text -> f (Maybe Text)) -> GluePolicy -> f GluePolicy
gluePolicy_policyInJson = (GluePolicy -> Maybe Text)
-> (GluePolicy -> Maybe Text -> GluePolicy)
-> Lens GluePolicy GluePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GluePolicy' {Maybe Text
policyInJson :: Maybe Text
$sel:policyInJson:GluePolicy' :: GluePolicy -> Maybe Text
policyInJson} -> Maybe Text
policyInJson) (\s :: GluePolicy
s@GluePolicy' {} Maybe Text
a -> GluePolicy
s {$sel:policyInJson:GluePolicy' :: Maybe Text
policyInJson = Maybe Text
a} :: GluePolicy)
gluePolicy_updateTime :: Lens.Lens' GluePolicy (Prelude.Maybe Prelude.UTCTime)
gluePolicy_updateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> GluePolicy -> f GluePolicy
gluePolicy_updateTime = (GluePolicy -> Maybe POSIX)
-> (GluePolicy -> Maybe POSIX -> GluePolicy)
-> Lens GluePolicy GluePolicy (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GluePolicy' {Maybe POSIX
updateTime :: Maybe POSIX
$sel:updateTime:GluePolicy' :: GluePolicy -> Maybe POSIX
updateTime} -> Maybe POSIX
updateTime) (\s :: GluePolicy
s@GluePolicy' {} Maybe POSIX
a -> GluePolicy
s {$sel:updateTime:GluePolicy' :: Maybe POSIX
updateTime = Maybe POSIX
a} :: GluePolicy) ((Maybe POSIX -> f (Maybe POSIX)) -> GluePolicy -> f GluePolicy)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GluePolicy
-> f GluePolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
gluePolicy_policyHash :: Lens.Lens' GluePolicy (Prelude.Maybe Prelude.Text)
gluePolicy_policyHash :: (Maybe Text -> f (Maybe Text)) -> GluePolicy -> f GluePolicy
gluePolicy_policyHash = (GluePolicy -> Maybe Text)
-> (GluePolicy -> Maybe Text -> GluePolicy)
-> Lens GluePolicy GluePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GluePolicy' {Maybe Text
policyHash :: Maybe Text
$sel:policyHash:GluePolicy' :: GluePolicy -> Maybe Text
policyHash} -> Maybe Text
policyHash) (\s :: GluePolicy
s@GluePolicy' {} Maybe Text
a -> GluePolicy
s {$sel:policyHash:GluePolicy' :: Maybe Text
policyHash = Maybe Text
a} :: GluePolicy)
gluePolicy_createTime :: Lens.Lens' GluePolicy (Prelude.Maybe Prelude.UTCTime)
gluePolicy_createTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> GluePolicy -> f GluePolicy
gluePolicy_createTime = (GluePolicy -> Maybe POSIX)
-> (GluePolicy -> Maybe POSIX -> GluePolicy)
-> Lens GluePolicy GluePolicy (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GluePolicy' {Maybe POSIX
createTime :: Maybe POSIX
$sel:createTime:GluePolicy' :: GluePolicy -> Maybe POSIX
createTime} -> Maybe POSIX
createTime) (\s :: GluePolicy
s@GluePolicy' {} Maybe POSIX
a -> GluePolicy
s {$sel:createTime:GluePolicy' :: Maybe POSIX
createTime = Maybe POSIX
a} :: GluePolicy) ((Maybe POSIX -> f (Maybe POSIX)) -> GluePolicy -> f GluePolicy)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GluePolicy
-> f GluePolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON GluePolicy where
parseJSON :: Value -> Parser GluePolicy
parseJSON =
String
-> (Object -> Parser GluePolicy) -> Value -> Parser GluePolicy
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GluePolicy"
( \Object
x ->
Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe POSIX -> GluePolicy
GluePolicy'
(Maybe Text
-> Maybe POSIX -> Maybe Text -> Maybe POSIX -> GluePolicy)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe POSIX -> GluePolicy)
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
"PolicyInJson")
Parser (Maybe POSIX -> Maybe Text -> Maybe POSIX -> GluePolicy)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe POSIX -> GluePolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UpdateTime")
Parser (Maybe Text -> Maybe POSIX -> GluePolicy)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> GluePolicy)
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
"PolicyHash")
Parser (Maybe POSIX -> GluePolicy)
-> Parser (Maybe POSIX) -> Parser GluePolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateTime")
)
instance Prelude.Hashable GluePolicy
instance Prelude.NFData GluePolicy