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