{-# 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.EMR.Types.ClusterTimeline where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClusterTimeline = ClusterTimeline'
{
ClusterTimeline -> Maybe POSIX
readyDateTime :: Prelude.Maybe Core.POSIX,
ClusterTimeline -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
ClusterTimeline -> Maybe POSIX
endDateTime :: Prelude.Maybe Core.POSIX
}
deriving (ClusterTimeline -> ClusterTimeline -> Bool
(ClusterTimeline -> ClusterTimeline -> Bool)
-> (ClusterTimeline -> ClusterTimeline -> Bool)
-> Eq ClusterTimeline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterTimeline -> ClusterTimeline -> Bool
$c/= :: ClusterTimeline -> ClusterTimeline -> Bool
== :: ClusterTimeline -> ClusterTimeline -> Bool
$c== :: ClusterTimeline -> ClusterTimeline -> Bool
Prelude.Eq, ReadPrec [ClusterTimeline]
ReadPrec ClusterTimeline
Int -> ReadS ClusterTimeline
ReadS [ClusterTimeline]
(Int -> ReadS ClusterTimeline)
-> ReadS [ClusterTimeline]
-> ReadPrec ClusterTimeline
-> ReadPrec [ClusterTimeline]
-> Read ClusterTimeline
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterTimeline]
$creadListPrec :: ReadPrec [ClusterTimeline]
readPrec :: ReadPrec ClusterTimeline
$creadPrec :: ReadPrec ClusterTimeline
readList :: ReadS [ClusterTimeline]
$creadList :: ReadS [ClusterTimeline]
readsPrec :: Int -> ReadS ClusterTimeline
$creadsPrec :: Int -> ReadS ClusterTimeline
Prelude.Read, Int -> ClusterTimeline -> ShowS
[ClusterTimeline] -> ShowS
ClusterTimeline -> String
(Int -> ClusterTimeline -> ShowS)
-> (ClusterTimeline -> String)
-> ([ClusterTimeline] -> ShowS)
-> Show ClusterTimeline
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterTimeline] -> ShowS
$cshowList :: [ClusterTimeline] -> ShowS
show :: ClusterTimeline -> String
$cshow :: ClusterTimeline -> String
showsPrec :: Int -> ClusterTimeline -> ShowS
$cshowsPrec :: Int -> ClusterTimeline -> ShowS
Prelude.Show, (forall x. ClusterTimeline -> Rep ClusterTimeline x)
-> (forall x. Rep ClusterTimeline x -> ClusterTimeline)
-> Generic ClusterTimeline
forall x. Rep ClusterTimeline x -> ClusterTimeline
forall x. ClusterTimeline -> Rep ClusterTimeline x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterTimeline x -> ClusterTimeline
$cfrom :: forall x. ClusterTimeline -> Rep ClusterTimeline x
Prelude.Generic)
newClusterTimeline ::
ClusterTimeline
newClusterTimeline :: ClusterTimeline
newClusterTimeline =
ClusterTimeline' :: Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> ClusterTimeline
ClusterTimeline'
{ $sel:readyDateTime:ClusterTimeline' :: Maybe POSIX
readyDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:creationDateTime:ClusterTimeline' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:endDateTime:ClusterTimeline' :: Maybe POSIX
endDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
clusterTimeline_readyDateTime :: Lens.Lens' ClusterTimeline (Prelude.Maybe Prelude.UTCTime)
clusterTimeline_readyDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ClusterTimeline -> f ClusterTimeline
clusterTimeline_readyDateTime = (ClusterTimeline -> Maybe POSIX)
-> (ClusterTimeline -> Maybe POSIX -> ClusterTimeline)
-> Lens ClusterTimeline ClusterTimeline (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterTimeline' {Maybe POSIX
readyDateTime :: Maybe POSIX
$sel:readyDateTime:ClusterTimeline' :: ClusterTimeline -> Maybe POSIX
readyDateTime} -> Maybe POSIX
readyDateTime) (\s :: ClusterTimeline
s@ClusterTimeline' {} Maybe POSIX
a -> ClusterTimeline
s {$sel:readyDateTime:ClusterTimeline' :: Maybe POSIX
readyDateTime = Maybe POSIX
a} :: ClusterTimeline) ((Maybe POSIX -> f (Maybe POSIX))
-> ClusterTimeline -> f ClusterTimeline)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ClusterTimeline
-> f ClusterTimeline
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
clusterTimeline_creationDateTime :: Lens.Lens' ClusterTimeline (Prelude.Maybe Prelude.UTCTime)
clusterTimeline_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ClusterTimeline -> f ClusterTimeline
clusterTimeline_creationDateTime = (ClusterTimeline -> Maybe POSIX)
-> (ClusterTimeline -> Maybe POSIX -> ClusterTimeline)
-> Lens ClusterTimeline ClusterTimeline (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterTimeline' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:ClusterTimeline' :: ClusterTimeline -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: ClusterTimeline
s@ClusterTimeline' {} Maybe POSIX
a -> ClusterTimeline
s {$sel:creationDateTime:ClusterTimeline' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: ClusterTimeline) ((Maybe POSIX -> f (Maybe POSIX))
-> ClusterTimeline -> f ClusterTimeline)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ClusterTimeline
-> f ClusterTimeline
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
clusterTimeline_endDateTime :: Lens.Lens' ClusterTimeline (Prelude.Maybe Prelude.UTCTime)
clusterTimeline_endDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ClusterTimeline -> f ClusterTimeline
clusterTimeline_endDateTime = (ClusterTimeline -> Maybe POSIX)
-> (ClusterTimeline -> Maybe POSIX -> ClusterTimeline)
-> Lens ClusterTimeline ClusterTimeline (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterTimeline' {Maybe POSIX
endDateTime :: Maybe POSIX
$sel:endDateTime:ClusterTimeline' :: ClusterTimeline -> Maybe POSIX
endDateTime} -> Maybe POSIX
endDateTime) (\s :: ClusterTimeline
s@ClusterTimeline' {} Maybe POSIX
a -> ClusterTimeline
s {$sel:endDateTime:ClusterTimeline' :: Maybe POSIX
endDateTime = Maybe POSIX
a} :: ClusterTimeline) ((Maybe POSIX -> f (Maybe POSIX))
-> ClusterTimeline -> f ClusterTimeline)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ClusterTimeline
-> f ClusterTimeline
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 ClusterTimeline where
parseJSON :: Value -> Parser ClusterTimeline
parseJSON =
String
-> (Object -> Parser ClusterTimeline)
-> Value
-> Parser ClusterTimeline
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClusterTimeline"
( \Object
x ->
Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> ClusterTimeline
ClusterTimeline'
(Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> ClusterTimeline)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe POSIX -> ClusterTimeline)
forall (f :: * -> *) a b. Functor 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
"ReadyDateTime")
Parser (Maybe POSIX -> Maybe POSIX -> ClusterTimeline)
-> Parser (Maybe POSIX) -> Parser (Maybe POSIX -> ClusterTimeline)
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
"CreationDateTime")
Parser (Maybe POSIX -> ClusterTimeline)
-> Parser (Maybe POSIX) -> Parser ClusterTimeline
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
"EndDateTime")
)
instance Prelude.Hashable ClusterTimeline
instance Prelude.NFData ClusterTimeline