{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AnomalyScore = AnomalyScore'
{
AnomalyScore -> Double
maxScore :: Prelude.Double,
AnomalyScore -> Double
currentScore :: Prelude.Double
}
deriving (AnomalyScore -> AnomalyScore -> Bool
(AnomalyScore -> AnomalyScore -> Bool)
-> (AnomalyScore -> AnomalyScore -> Bool) -> Eq AnomalyScore
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]
(Int -> ReadS AnomalyScore)
-> ReadS [AnomalyScore]
-> ReadPrec AnomalyScore
-> ReadPrec [AnomalyScore]
-> Read 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
(Int -> AnomalyScore -> ShowS)
-> (AnomalyScore -> String)
-> ([AnomalyScore] -> ShowS)
-> Show AnomalyScore
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. AnomalyScore -> Rep AnomalyScore x)
-> (forall x. Rep AnomalyScore x -> AnomalyScore)
-> Generic AnomalyScore
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' :: Double -> Double -> AnomalyScore
AnomalyScore'
{ $sel:maxScore:AnomalyScore' :: Double
maxScore = Double
pMaxScore_,
$sel:currentScore:AnomalyScore' :: Double
currentScore = Double
pCurrentScore_
}
anomalyScore_maxScore :: Lens.Lens' AnomalyScore Prelude.Double
anomalyScore_maxScore :: (Double -> f Double) -> AnomalyScore -> f AnomalyScore
anomalyScore_maxScore = (AnomalyScore -> Double)
-> (AnomalyScore -> Double -> AnomalyScore)
-> Lens AnomalyScore AnomalyScore Double Double
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 :: (Double -> f Double) -> AnomalyScore -> f AnomalyScore
anomalyScore_currentScore = (AnomalyScore -> Double)
-> (AnomalyScore -> Double -> AnomalyScore)
-> Lens AnomalyScore AnomalyScore Double Double
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 Core.FromJSON AnomalyScore where
parseJSON :: Value -> Parser AnomalyScore
parseJSON =
String
-> (Object -> Parser AnomalyScore) -> Value -> Parser AnomalyScore
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AnomalyScore"
( \Object
x ->
Double -> Double -> AnomalyScore
AnomalyScore'
(Double -> Double -> AnomalyScore)
-> Parser Double -> Parser (Double -> AnomalyScore)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MaxScore")
Parser (Double -> AnomalyScore)
-> Parser Double -> Parser AnomalyScore
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CurrentScore")
)
instance Prelude.Hashable AnomalyScore
instance Prelude.NFData AnomalyScore