{-# 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.CostExplorer.Types.AnomalyScore 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 AnomalyScore = AnomalyScore'
{
AnomalyScore -> Double
maxScore :: Prelude.Double,
AnomalyScore -> Double
currentScore :: Prelude.Double
}
deriving (AnomalyScore -> AnomalyScore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnomalyScore -> AnomalyScore -> Bool
$c/= :: AnomalyScore -> AnomalyScore -> Bool
== :: AnomalyScore -> AnomalyScore -> Bool
$c== :: AnomalyScore -> AnomalyScore -> Bool
Prelude.Eq, ReadPrec [AnomalyScore]
ReadPrec AnomalyScore
Int -> ReadS AnomalyScore
ReadS [AnomalyScore]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnomalyScore]
$creadListPrec :: ReadPrec [AnomalyScore]
readPrec :: ReadPrec AnomalyScore
$creadPrec :: ReadPrec AnomalyScore
readList :: ReadS [AnomalyScore]
$creadList :: ReadS [AnomalyScore]
readsPrec :: Int -> ReadS AnomalyScore
$creadsPrec :: Int -> ReadS AnomalyScore
Prelude.Read, Int -> AnomalyScore -> ShowS
[AnomalyScore] -> ShowS
AnomalyScore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnomalyScore] -> ShowS
$cshowList :: [AnomalyScore] -> ShowS
show :: AnomalyScore -> String
$cshow :: AnomalyScore -> String
showsPrec :: Int -> AnomalyScore -> ShowS
$cshowsPrec :: Int -> AnomalyScore -> ShowS
Prelude.Show, forall x. Rep AnomalyScore x -> AnomalyScore
forall x. AnomalyScore -> Rep AnomalyScore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnomalyScore x -> AnomalyScore
$cfrom :: forall x. AnomalyScore -> Rep AnomalyScore x
Prelude.Generic)
newAnomalyScore ::
Prelude.Double ->
Prelude.Double ->
AnomalyScore
newAnomalyScore :: Double -> Double -> AnomalyScore
newAnomalyScore Double
pMaxScore_ Double
pCurrentScore_ =
AnomalyScore'
{ $sel:maxScore:AnomalyScore' :: Double
maxScore = Double
pMaxScore_,
$sel:currentScore:AnomalyScore' :: Double
currentScore = Double
pCurrentScore_
}
anomalyScore_maxScore :: Lens.Lens' AnomalyScore Prelude.Double
anomalyScore_maxScore :: Lens' AnomalyScore Double
anomalyScore_maxScore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyScore' {Double
maxScore :: Double
$sel:maxScore:AnomalyScore' :: AnomalyScore -> Double
maxScore} -> Double
maxScore) (\s :: AnomalyScore
s@AnomalyScore' {} Double
a -> AnomalyScore
s {$sel:maxScore:AnomalyScore' :: Double
maxScore = Double
a} :: AnomalyScore)
anomalyScore_currentScore :: Lens.Lens' AnomalyScore Prelude.Double
anomalyScore_currentScore :: Lens' AnomalyScore Double
anomalyScore_currentScore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnomalyScore' {Double
currentScore :: Double
$sel:currentScore:AnomalyScore' :: AnomalyScore -> Double
currentScore} -> Double
currentScore) (\s :: AnomalyScore
s@AnomalyScore' {} Double
a -> AnomalyScore
s {$sel:currentScore:AnomalyScore' :: Double
currentScore = Double
a} :: AnomalyScore)
instance Data.FromJSON AnomalyScore where
parseJSON :: Value -> Parser AnomalyScore
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AnomalyScore"
( \Object
x ->
Double -> Double -> AnomalyScore
AnomalyScore'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MaxScore")
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
"CurrentScore")
)
instance Prelude.Hashable AnomalyScore where
hashWithSalt :: Int -> AnomalyScore -> Int
hashWithSalt Int
_salt AnomalyScore' {Double
currentScore :: Double
maxScore :: Double
$sel:currentScore:AnomalyScore' :: AnomalyScore -> Double
$sel:maxScore:AnomalyScore' :: AnomalyScore -> Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
maxScore
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
currentScore
instance Prelude.NFData AnomalyScore where
rnf :: AnomalyScore -> ()
rnf AnomalyScore' {Double
currentScore :: Double
maxScore :: Double
$sel:currentScore:AnomalyScore' :: AnomalyScore -> Double
$sel:maxScore:AnomalyScore' :: AnomalyScore -> Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Double
maxScore
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
currentScore