{-# 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.AnomalyInstance where
import Amazonka.CodeGuruProfiler.Types.UserFeedback
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 AnomalyInstance = AnomalyInstance'
{
AnomalyInstance -> Maybe ISO8601
endTime :: Prelude.Maybe Data.ISO8601,
AnomalyInstance -> Maybe UserFeedback
userFeedback :: Prelude.Maybe UserFeedback,
AnomalyInstance -> Text
id :: Prelude.Text,
AnomalyInstance -> ISO8601
startTime :: Data.ISO8601
}
deriving (AnomalyInstance -> AnomalyInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnomalyInstance -> AnomalyInstance -> Bool
$c/= :: AnomalyInstance -> AnomalyInstance -> Bool
== :: AnomalyInstance -> AnomalyInstance -> Bool
$c== :: AnomalyInstance -> AnomalyInstance -> Bool
Prelude.Eq, ReadPrec [AnomalyInstance]
ReadPrec AnomalyInstance
Int -> ReadS AnomalyInstance
ReadS [AnomalyInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnomalyInstance]
$creadListPrec :: ReadPrec [AnomalyInstance]
readPrec :: ReadPrec AnomalyInstance
$creadPrec :: ReadPrec AnomalyInstance
readList :: ReadS [AnomalyInstance]
$creadList :: ReadS [AnomalyInstance]
readsPrec :: Int -> ReadS AnomalyInstance
$creadsPrec :: Int -> ReadS AnomalyInstance
Prelude.Read, Int -> AnomalyInstance -> ShowS
[AnomalyInstance] -> ShowS
AnomalyInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnomalyInstance] -> ShowS
$cshowList :: [AnomalyInstance] -> ShowS
show :: AnomalyInstance -> String
$cshow :: AnomalyInstance -> String
showsPrec :: Int -> AnomalyInstance -> ShowS
$cshowsPrec :: Int -> AnomalyInstance -> ShowS
Prelude.Show, forall x. Rep AnomalyInstance x -> AnomalyInstance
forall x. AnomalyInstance -> Rep AnomalyInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnomalyInstance x -> AnomalyInstance
$cfrom :: forall x. AnomalyInstance -> Rep AnomalyInstance x
Prelude.Generic)
newAnomalyInstance ::
Prelude.Text ->
Prelude.UTCTime ->
AnomalyInstance
newAnomalyInstance :: Text -> UTCTime -> AnomalyInstance
newAnomalyInstance Text
pId_ UTCTime
pStartTime_ =
AnomalyInstance'
{ $sel:endTime:AnomalyInstance' :: Maybe ISO8601
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:userFeedback:AnomalyInstance' :: Maybe UserFeedback
userFeedback = forall a. Maybe a
Prelude.Nothing,
$sel:id:AnomalyInstance' :: Text
id = Text
pId_,
$sel:startTime:AnomalyInstance' :: ISO8601
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
}
anomalyInstance_endTime :: Lens.Lens' AnomalyInstance (Prelude.Maybe Prelude.UTCTime)
anomalyInstance_endTime :: Lens' AnomalyInstance (Maybe UTCTime)
anomalyInstance_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyInstance' {Maybe ISO8601
endTime :: Maybe ISO8601
$sel:endTime:AnomalyInstance' :: AnomalyInstance -> Maybe ISO8601
endTime} -> Maybe ISO8601
endTime) (\s :: AnomalyInstance
s@AnomalyInstance' {} Maybe ISO8601
a -> AnomalyInstance
s {$sel:endTime:AnomalyInstance' :: Maybe ISO8601
endTime = Maybe ISO8601
a} :: AnomalyInstance) 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
anomalyInstance_userFeedback :: Lens.Lens' AnomalyInstance (Prelude.Maybe UserFeedback)
anomalyInstance_userFeedback :: Lens' AnomalyInstance (Maybe UserFeedback)
anomalyInstance_userFeedback = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyInstance' {Maybe UserFeedback
userFeedback :: Maybe UserFeedback
$sel:userFeedback:AnomalyInstance' :: AnomalyInstance -> Maybe UserFeedback
userFeedback} -> Maybe UserFeedback
userFeedback) (\s :: AnomalyInstance
s@AnomalyInstance' {} Maybe UserFeedback
a -> AnomalyInstance
s {$sel:userFeedback:AnomalyInstance' :: Maybe UserFeedback
userFeedback = Maybe UserFeedback
a} :: AnomalyInstance)
anomalyInstance_id :: Lens.Lens' AnomalyInstance Prelude.Text
anomalyInstance_id :: Lens' AnomalyInstance Text
anomalyInstance_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyInstance' {Text
id :: Text
$sel:id:AnomalyInstance' :: AnomalyInstance -> Text
id} -> Text
id) (\s :: AnomalyInstance
s@AnomalyInstance' {} Text
a -> AnomalyInstance
s {$sel:id:AnomalyInstance' :: Text
id = Text
a} :: AnomalyInstance)
anomalyInstance_startTime :: Lens.Lens' AnomalyInstance Prelude.UTCTime
anomalyInstance_startTime :: Lens' AnomalyInstance UTCTime
anomalyInstance_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyInstance' {ISO8601
startTime :: ISO8601
$sel:startTime:AnomalyInstance' :: AnomalyInstance -> ISO8601
startTime} -> ISO8601
startTime) (\s :: AnomalyInstance
s@AnomalyInstance' {} ISO8601
a -> AnomalyInstance
s {$sel:startTime:AnomalyInstance' :: ISO8601
startTime = ISO8601
a} :: AnomalyInstance) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON AnomalyInstance where
parseJSON :: Value -> Parser AnomalyInstance
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AnomalyInstance"
( \Object
x ->
Maybe ISO8601
-> Maybe UserFeedback -> Text -> ISO8601 -> AnomalyInstance
AnomalyInstance'
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 (Maybe a)
Data..:? Key
"userFeedback")
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
"id")
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 AnomalyInstance where
hashWithSalt :: Int -> AnomalyInstance -> Int
hashWithSalt Int
_salt AnomalyInstance' {Maybe ISO8601
Maybe UserFeedback
Text
ISO8601
startTime :: ISO8601
id :: Text
userFeedback :: Maybe UserFeedback
endTime :: Maybe ISO8601
$sel:startTime:AnomalyInstance' :: AnomalyInstance -> ISO8601
$sel:id:AnomalyInstance' :: AnomalyInstance -> Text
$sel:userFeedback:AnomalyInstance' :: AnomalyInstance -> Maybe UserFeedback
$sel:endTime:AnomalyInstance' :: AnomalyInstance -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserFeedback
userFeedback
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startTime
instance Prelude.NFData AnomalyInstance where
rnf :: AnomalyInstance -> ()
rnf AnomalyInstance' {Maybe ISO8601
Maybe UserFeedback
Text
ISO8601
startTime :: ISO8601
id :: Text
userFeedback :: Maybe UserFeedback
endTime :: Maybe ISO8601
$sel:startTime:AnomalyInstance' :: AnomalyInstance -> ISO8601
$sel:id:AnomalyInstance' :: AnomalyInstance -> Text
$sel:userFeedback:AnomalyInstance' :: AnomalyInstance -> Maybe UserFeedback
$sel:endTime:AnomalyInstance' :: AnomalyInstance -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserFeedback
userFeedback
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startTime