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