{-# 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.DevOpsGuru.Types.InsightTimeRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InsightTimeRange = InsightTimeRange'
{
InsightTimeRange -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
InsightTimeRange -> POSIX
startTime :: Core.POSIX
}
deriving (InsightTimeRange -> InsightTimeRange -> Bool
(InsightTimeRange -> InsightTimeRange -> Bool)
-> (InsightTimeRange -> InsightTimeRange -> Bool)
-> Eq InsightTimeRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InsightTimeRange -> InsightTimeRange -> Bool
$c/= :: InsightTimeRange -> InsightTimeRange -> Bool
== :: InsightTimeRange -> InsightTimeRange -> Bool
$c== :: InsightTimeRange -> InsightTimeRange -> Bool
Prelude.Eq, ReadPrec [InsightTimeRange]
ReadPrec InsightTimeRange
Int -> ReadS InsightTimeRange
ReadS [InsightTimeRange]
(Int -> ReadS InsightTimeRange)
-> ReadS [InsightTimeRange]
-> ReadPrec InsightTimeRange
-> ReadPrec [InsightTimeRange]
-> Read InsightTimeRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InsightTimeRange]
$creadListPrec :: ReadPrec [InsightTimeRange]
readPrec :: ReadPrec InsightTimeRange
$creadPrec :: ReadPrec InsightTimeRange
readList :: ReadS [InsightTimeRange]
$creadList :: ReadS [InsightTimeRange]
readsPrec :: Int -> ReadS InsightTimeRange
$creadsPrec :: Int -> ReadS InsightTimeRange
Prelude.Read, Int -> InsightTimeRange -> ShowS
[InsightTimeRange] -> ShowS
InsightTimeRange -> String
(Int -> InsightTimeRange -> ShowS)
-> (InsightTimeRange -> String)
-> ([InsightTimeRange] -> ShowS)
-> Show InsightTimeRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InsightTimeRange] -> ShowS
$cshowList :: [InsightTimeRange] -> ShowS
show :: InsightTimeRange -> String
$cshow :: InsightTimeRange -> String
showsPrec :: Int -> InsightTimeRange -> ShowS
$cshowsPrec :: Int -> InsightTimeRange -> ShowS
Prelude.Show, (forall x. InsightTimeRange -> Rep InsightTimeRange x)
-> (forall x. Rep InsightTimeRange x -> InsightTimeRange)
-> Generic InsightTimeRange
forall x. Rep InsightTimeRange x -> InsightTimeRange
forall x. InsightTimeRange -> Rep InsightTimeRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InsightTimeRange x -> InsightTimeRange
$cfrom :: forall x. InsightTimeRange -> Rep InsightTimeRange x
Prelude.Generic)
newInsightTimeRange ::
Prelude.UTCTime ->
InsightTimeRange
newInsightTimeRange :: UTCTime -> InsightTimeRange
newInsightTimeRange UTCTime
pStartTime_ =
InsightTimeRange' :: Maybe POSIX -> POSIX -> InsightTimeRange
InsightTimeRange'
{ $sel:endTime:InsightTimeRange' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:InsightTimeRange' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
}
insightTimeRange_endTime :: Lens.Lens' InsightTimeRange (Prelude.Maybe Prelude.UTCTime)
insightTimeRange_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightTimeRange -> f InsightTimeRange
insightTimeRange_endTime = (InsightTimeRange -> Maybe POSIX)
-> (InsightTimeRange -> Maybe POSIX -> InsightTimeRange)
-> Lens
InsightTimeRange InsightTimeRange (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightTimeRange' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:InsightTimeRange' :: InsightTimeRange -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: InsightTimeRange
s@InsightTimeRange' {} Maybe POSIX
a -> InsightTimeRange
s {$sel:endTime:InsightTimeRange' :: Maybe POSIX
endTime = Maybe POSIX
a} :: InsightTimeRange) ((Maybe POSIX -> f (Maybe POSIX))
-> InsightTimeRange -> f InsightTimeRange)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> InsightTimeRange
-> f InsightTimeRange
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
insightTimeRange_startTime :: Lens.Lens' InsightTimeRange Prelude.UTCTime
insightTimeRange_startTime :: (UTCTime -> f UTCTime) -> InsightTimeRange -> f InsightTimeRange
insightTimeRange_startTime = (InsightTimeRange -> POSIX)
-> (InsightTimeRange -> POSIX -> InsightTimeRange)
-> Lens InsightTimeRange InsightTimeRange POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InsightTimeRange' {POSIX
startTime :: POSIX
$sel:startTime:InsightTimeRange' :: InsightTimeRange -> POSIX
startTime} -> POSIX
startTime) (\s :: InsightTimeRange
s@InsightTimeRange' {} POSIX
a -> InsightTimeRange
s {$sel:startTime:InsightTimeRange' :: POSIX
startTime = POSIX
a} :: InsightTimeRange) ((POSIX -> f POSIX) -> InsightTimeRange -> f InsightTimeRange)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> InsightTimeRange
-> f InsightTimeRange
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON InsightTimeRange where
parseJSON :: Value -> Parser InsightTimeRange
parseJSON =
String
-> (Object -> Parser InsightTimeRange)
-> Value
-> Parser InsightTimeRange
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InsightTimeRange"
( \Object
x ->
Maybe POSIX -> POSIX -> InsightTimeRange
InsightTimeRange'
(Maybe POSIX -> POSIX -> InsightTimeRange)
-> Parser (Maybe POSIX) -> Parser (POSIX -> InsightTimeRange)
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
"EndTime")
Parser (POSIX -> InsightTimeRange)
-> Parser POSIX -> Parser InsightTimeRange
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StartTime")
)
instance Prelude.Hashable InsightTimeRange
instance Prelude.NFData InsightTimeRange