{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ProfileTime = ProfileTime'
{
ProfileTime -> Maybe ISO8601
start :: Prelude.Maybe Data.ISO8601
}
deriving (ProfileTime -> ProfileTime -> Bool
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]
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
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. 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' {$sel:start:ProfileTime' :: Maybe ISO8601
start = forall a. Maybe a
Prelude.Nothing}
profileTime_start :: Lens.Lens' ProfileTime (Prelude.Maybe Prelude.UTCTime)
profileTime_start :: Lens' ProfileTime (Maybe UTCTime)
profileTime_start = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileTime' {Maybe ISO8601
start :: Maybe ISO8601
$sel:start:ProfileTime' :: ProfileTime -> Maybe ISO8601
start} -> Maybe ISO8601
start) (\s :: ProfileTime
s@ProfileTime' {} Maybe ISO8601
a -> ProfileTime
s {$sel:start:ProfileTime' :: Maybe ISO8601
start = Maybe ISO8601
a} :: ProfileTime) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON ProfileTime where
parseJSON :: Value -> Parser ProfileTime
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProfileTime"
( \Object
x ->
Maybe ISO8601 -> ProfileTime
ProfileTime' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"start")
)
instance Prelude.Hashable ProfileTime where
hashWithSalt :: Int -> ProfileTime -> Int
hashWithSalt Int
_salt ProfileTime' {Maybe ISO8601
start :: Maybe ISO8601
$sel:start:ProfileTime' :: ProfileTime -> Maybe ISO8601
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
start
instance Prelude.NFData ProfileTime where
rnf :: ProfileTime -> ()
rnf ProfileTime' {Maybe ISO8601
start :: Maybe ISO8601
$sel:start:ProfileTime' :: ProfileTime -> Maybe ISO8601
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
start