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