{-# 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.PredictionTimeRange 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 PredictionTimeRange = PredictionTimeRange'
{
PredictionTimeRange -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
PredictionTimeRange -> POSIX
startTime :: Data.POSIX
}
deriving (PredictionTimeRange -> PredictionTimeRange -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PredictionTimeRange -> PredictionTimeRange -> Bool
$c/= :: PredictionTimeRange -> PredictionTimeRange -> Bool
== :: PredictionTimeRange -> PredictionTimeRange -> Bool
$c== :: PredictionTimeRange -> PredictionTimeRange -> Bool
Prelude.Eq, ReadPrec [PredictionTimeRange]
ReadPrec PredictionTimeRange
Int -> ReadS PredictionTimeRange
ReadS [PredictionTimeRange]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PredictionTimeRange]
$creadListPrec :: ReadPrec [PredictionTimeRange]
readPrec :: ReadPrec PredictionTimeRange
$creadPrec :: ReadPrec PredictionTimeRange
readList :: ReadS [PredictionTimeRange]
$creadList :: ReadS [PredictionTimeRange]
readsPrec :: Int -> ReadS PredictionTimeRange
$creadsPrec :: Int -> ReadS PredictionTimeRange
Prelude.Read, Int -> PredictionTimeRange -> ShowS
[PredictionTimeRange] -> ShowS
PredictionTimeRange -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PredictionTimeRange] -> ShowS
$cshowList :: [PredictionTimeRange] -> ShowS
show :: PredictionTimeRange -> String
$cshow :: PredictionTimeRange -> String
showsPrec :: Int -> PredictionTimeRange -> ShowS
$cshowsPrec :: Int -> PredictionTimeRange -> ShowS
Prelude.Show, forall x. Rep PredictionTimeRange x -> PredictionTimeRange
forall x. PredictionTimeRange -> Rep PredictionTimeRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PredictionTimeRange x -> PredictionTimeRange
$cfrom :: forall x. PredictionTimeRange -> Rep PredictionTimeRange x
Prelude.Generic)
newPredictionTimeRange ::
Prelude.UTCTime ->
PredictionTimeRange
newPredictionTimeRange :: UTCTime -> PredictionTimeRange
newPredictionTimeRange UTCTime
pStartTime_ =
PredictionTimeRange'
{ $sel:endTime:PredictionTimeRange' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:PredictionTimeRange' :: POSIX
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
}
predictionTimeRange_endTime :: Lens.Lens' PredictionTimeRange (Prelude.Maybe Prelude.UTCTime)
predictionTimeRange_endTime :: Lens' PredictionTimeRange (Maybe UTCTime)
predictionTimeRange_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictionTimeRange' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:PredictionTimeRange' :: PredictionTimeRange -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: PredictionTimeRange
s@PredictionTimeRange' {} Maybe POSIX
a -> PredictionTimeRange
s {$sel:endTime:PredictionTimeRange' :: Maybe POSIX
endTime = Maybe POSIX
a} :: PredictionTimeRange) 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
predictionTimeRange_startTime :: Lens.Lens' PredictionTimeRange Prelude.UTCTime
predictionTimeRange_startTime :: Lens' PredictionTimeRange UTCTime
predictionTimeRange_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictionTimeRange' {POSIX
startTime :: POSIX
$sel:startTime:PredictionTimeRange' :: PredictionTimeRange -> POSIX
startTime} -> POSIX
startTime) (\s :: PredictionTimeRange
s@PredictionTimeRange' {} POSIX
a -> PredictionTimeRange
s {$sel:startTime:PredictionTimeRange' :: POSIX
startTime = POSIX
a} :: PredictionTimeRange) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON PredictionTimeRange where
parseJSON :: Value -> Parser PredictionTimeRange
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PredictionTimeRange"
( \Object
x ->
Maybe POSIX -> POSIX -> PredictionTimeRange
PredictionTimeRange'
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
"EndTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"StartTime")
)
instance Prelude.Hashable PredictionTimeRange where
hashWithSalt :: Int -> PredictionTimeRange -> Int
hashWithSalt Int
_salt PredictionTimeRange' {Maybe POSIX
POSIX
startTime :: POSIX
endTime :: Maybe POSIX
$sel:startTime:PredictionTimeRange' :: PredictionTimeRange -> POSIX
$sel:endTime:PredictionTimeRange' :: PredictionTimeRange -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
startTime
instance Prelude.NFData PredictionTimeRange where
rnf :: PredictionTimeRange -> ()
rnf PredictionTimeRange' {Maybe POSIX
POSIX
startTime :: POSIX
endTime :: Maybe POSIX
$sel:startTime:PredictionTimeRange' :: PredictionTimeRange -> POSIX
$sel:endTime:PredictionTimeRange' :: PredictionTimeRange -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
startTime