{-# 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.MediaConvert.Types.Timing where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Timing = Timing'
{
Timing -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
Timing -> Maybe POSIX
finishTime :: Prelude.Maybe Core.POSIX,
Timing -> Maybe POSIX
submitTime :: Prelude.Maybe Core.POSIX
}
deriving (Timing -> Timing -> Bool
(Timing -> Timing -> Bool)
-> (Timing -> Timing -> Bool) -> Eq Timing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Timing -> Timing -> Bool
$c/= :: Timing -> Timing -> Bool
== :: Timing -> Timing -> Bool
$c== :: Timing -> Timing -> Bool
Prelude.Eq, ReadPrec [Timing]
ReadPrec Timing
Int -> ReadS Timing
ReadS [Timing]
(Int -> ReadS Timing)
-> ReadS [Timing]
-> ReadPrec Timing
-> ReadPrec [Timing]
-> Read Timing
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Timing]
$creadListPrec :: ReadPrec [Timing]
readPrec :: ReadPrec Timing
$creadPrec :: ReadPrec Timing
readList :: ReadS [Timing]
$creadList :: ReadS [Timing]
readsPrec :: Int -> ReadS Timing
$creadsPrec :: Int -> ReadS Timing
Prelude.Read, Int -> Timing -> ShowS
[Timing] -> ShowS
Timing -> String
(Int -> Timing -> ShowS)
-> (Timing -> String) -> ([Timing] -> ShowS) -> Show Timing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Timing] -> ShowS
$cshowList :: [Timing] -> ShowS
show :: Timing -> String
$cshow :: Timing -> String
showsPrec :: Int -> Timing -> ShowS
$cshowsPrec :: Int -> Timing -> ShowS
Prelude.Show, (forall x. Timing -> Rep Timing x)
-> (forall x. Rep Timing x -> Timing) -> Generic Timing
forall x. Rep Timing x -> Timing
forall x. Timing -> Rep Timing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Timing x -> Timing
$cfrom :: forall x. Timing -> Rep Timing x
Prelude.Generic)
newTiming ::
Timing
newTiming :: Timing
newTiming =
Timing' :: Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> Timing
Timing'
{ $sel:startTime:Timing' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:finishTime:Timing' :: Maybe POSIX
finishTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:submitTime:Timing' :: Maybe POSIX
submitTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
timing_startTime :: Lens.Lens' Timing (Prelude.Maybe Prelude.UTCTime)
timing_startTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Timing -> f Timing
timing_startTime = (Timing -> Maybe POSIX)
-> (Timing -> Maybe POSIX -> Timing)
-> Lens Timing Timing (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Timing' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:Timing' :: Timing -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: Timing
s@Timing' {} Maybe POSIX
a -> Timing
s {$sel:startTime:Timing' :: Maybe POSIX
startTime = Maybe POSIX
a} :: Timing) ((Maybe POSIX -> f (Maybe POSIX)) -> Timing -> f Timing)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Timing
-> f Timing
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
timing_finishTime :: Lens.Lens' Timing (Prelude.Maybe Prelude.UTCTime)
timing_finishTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Timing -> f Timing
timing_finishTime = (Timing -> Maybe POSIX)
-> (Timing -> Maybe POSIX -> Timing)
-> Lens Timing Timing (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Timing' {Maybe POSIX
finishTime :: Maybe POSIX
$sel:finishTime:Timing' :: Timing -> Maybe POSIX
finishTime} -> Maybe POSIX
finishTime) (\s :: Timing
s@Timing' {} Maybe POSIX
a -> Timing
s {$sel:finishTime:Timing' :: Maybe POSIX
finishTime = Maybe POSIX
a} :: Timing) ((Maybe POSIX -> f (Maybe POSIX)) -> Timing -> f Timing)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Timing
-> f Timing
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
timing_submitTime :: Lens.Lens' Timing (Prelude.Maybe Prelude.UTCTime)
timing_submitTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Timing -> f Timing
timing_submitTime = (Timing -> Maybe POSIX)
-> (Timing -> Maybe POSIX -> Timing)
-> Lens Timing Timing (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Timing' {Maybe POSIX
submitTime :: Maybe POSIX
$sel:submitTime:Timing' :: Timing -> Maybe POSIX
submitTime} -> Maybe POSIX
submitTime) (\s :: Timing
s@Timing' {} Maybe POSIX
a -> Timing
s {$sel:submitTime:Timing' :: Maybe POSIX
submitTime = Maybe POSIX
a} :: Timing) ((Maybe POSIX -> f (Maybe POSIX)) -> Timing -> f Timing)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Timing
-> f Timing
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 Timing where
parseJSON :: Value -> Parser Timing
parseJSON =
String -> (Object -> Parser Timing) -> Value -> Parser Timing
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Timing"
( \Object
x ->
Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> Timing
Timing'
(Maybe POSIX -> Maybe POSIX -> Maybe POSIX -> Timing)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe POSIX -> Timing)
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
"startTime")
Parser (Maybe POSIX -> Maybe POSIX -> Timing)
-> Parser (Maybe POSIX) -> Parser (Maybe POSIX -> Timing)
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
"finishTime")
Parser (Maybe POSIX -> Timing)
-> Parser (Maybe POSIX) -> Parser Timing
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
"submitTime")
)
instance Prelude.Hashable Timing
instance Prelude.NFData Timing