{-# 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.Forecast.Types.WeightedQuantileLoss where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WeightedQuantileLoss = WeightedQuantileLoss'
{
WeightedQuantileLoss -> Maybe Double
quantile :: Prelude.Maybe Prelude.Double,
WeightedQuantileLoss -> Maybe Double
lossValue :: Prelude.Maybe Prelude.Double
}
deriving (WeightedQuantileLoss -> WeightedQuantileLoss -> Bool
(WeightedQuantileLoss -> WeightedQuantileLoss -> Bool)
-> (WeightedQuantileLoss -> WeightedQuantileLoss -> Bool)
-> Eq WeightedQuantileLoss
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WeightedQuantileLoss -> WeightedQuantileLoss -> Bool
$c/= :: WeightedQuantileLoss -> WeightedQuantileLoss -> Bool
== :: WeightedQuantileLoss -> WeightedQuantileLoss -> Bool
$c== :: WeightedQuantileLoss -> WeightedQuantileLoss -> Bool
Prelude.Eq, ReadPrec [WeightedQuantileLoss]
ReadPrec WeightedQuantileLoss
Int -> ReadS WeightedQuantileLoss
ReadS [WeightedQuantileLoss]
(Int -> ReadS WeightedQuantileLoss)
-> ReadS [WeightedQuantileLoss]
-> ReadPrec WeightedQuantileLoss
-> ReadPrec [WeightedQuantileLoss]
-> Read WeightedQuantileLoss
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WeightedQuantileLoss]
$creadListPrec :: ReadPrec [WeightedQuantileLoss]
readPrec :: ReadPrec WeightedQuantileLoss
$creadPrec :: ReadPrec WeightedQuantileLoss
readList :: ReadS [WeightedQuantileLoss]
$creadList :: ReadS [WeightedQuantileLoss]
readsPrec :: Int -> ReadS WeightedQuantileLoss
$creadsPrec :: Int -> ReadS WeightedQuantileLoss
Prelude.Read, Int -> WeightedQuantileLoss -> ShowS
[WeightedQuantileLoss] -> ShowS
WeightedQuantileLoss -> String
(Int -> WeightedQuantileLoss -> ShowS)
-> (WeightedQuantileLoss -> String)
-> ([WeightedQuantileLoss] -> ShowS)
-> Show WeightedQuantileLoss
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WeightedQuantileLoss] -> ShowS
$cshowList :: [WeightedQuantileLoss] -> ShowS
show :: WeightedQuantileLoss -> String
$cshow :: WeightedQuantileLoss -> String
showsPrec :: Int -> WeightedQuantileLoss -> ShowS
$cshowsPrec :: Int -> WeightedQuantileLoss -> ShowS
Prelude.Show, (forall x. WeightedQuantileLoss -> Rep WeightedQuantileLoss x)
-> (forall x. Rep WeightedQuantileLoss x -> WeightedQuantileLoss)
-> Generic WeightedQuantileLoss
forall x. Rep WeightedQuantileLoss x -> WeightedQuantileLoss
forall x. WeightedQuantileLoss -> Rep WeightedQuantileLoss x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WeightedQuantileLoss x -> WeightedQuantileLoss
$cfrom :: forall x. WeightedQuantileLoss -> Rep WeightedQuantileLoss x
Prelude.Generic)
newWeightedQuantileLoss ::
WeightedQuantileLoss
newWeightedQuantileLoss :: WeightedQuantileLoss
newWeightedQuantileLoss =
WeightedQuantileLoss' :: Maybe Double -> Maybe Double -> WeightedQuantileLoss
WeightedQuantileLoss'
{ $sel:quantile:WeightedQuantileLoss' :: Maybe Double
quantile = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:lossValue:WeightedQuantileLoss' :: Maybe Double
lossValue = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
weightedQuantileLoss_quantile :: Lens.Lens' WeightedQuantileLoss (Prelude.Maybe Prelude.Double)
weightedQuantileLoss_quantile :: (Maybe Double -> f (Maybe Double))
-> WeightedQuantileLoss -> f WeightedQuantileLoss
weightedQuantileLoss_quantile = (WeightedQuantileLoss -> Maybe Double)
-> (WeightedQuantileLoss -> Maybe Double -> WeightedQuantileLoss)
-> Lens
WeightedQuantileLoss
WeightedQuantileLoss
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeightedQuantileLoss' {Maybe Double
quantile :: Maybe Double
$sel:quantile:WeightedQuantileLoss' :: WeightedQuantileLoss -> Maybe Double
quantile} -> Maybe Double
quantile) (\s :: WeightedQuantileLoss
s@WeightedQuantileLoss' {} Maybe Double
a -> WeightedQuantileLoss
s {$sel:quantile:WeightedQuantileLoss' :: Maybe Double
quantile = Maybe Double
a} :: WeightedQuantileLoss)
weightedQuantileLoss_lossValue :: Lens.Lens' WeightedQuantileLoss (Prelude.Maybe Prelude.Double)
weightedQuantileLoss_lossValue :: (Maybe Double -> f (Maybe Double))
-> WeightedQuantileLoss -> f WeightedQuantileLoss
weightedQuantileLoss_lossValue = (WeightedQuantileLoss -> Maybe Double)
-> (WeightedQuantileLoss -> Maybe Double -> WeightedQuantileLoss)
-> Lens
WeightedQuantileLoss
WeightedQuantileLoss
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WeightedQuantileLoss' {Maybe Double
lossValue :: Maybe Double
$sel:lossValue:WeightedQuantileLoss' :: WeightedQuantileLoss -> Maybe Double
lossValue} -> Maybe Double
lossValue) (\s :: WeightedQuantileLoss
s@WeightedQuantileLoss' {} Maybe Double
a -> WeightedQuantileLoss
s {$sel:lossValue:WeightedQuantileLoss' :: Maybe Double
lossValue = Maybe Double
a} :: WeightedQuantileLoss)
instance Core.FromJSON WeightedQuantileLoss where
parseJSON :: Value -> Parser WeightedQuantileLoss
parseJSON =
String
-> (Object -> Parser WeightedQuantileLoss)
-> Value
-> Parser WeightedQuantileLoss
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WeightedQuantileLoss"
( \Object
x ->
Maybe Double -> Maybe Double -> WeightedQuantileLoss
WeightedQuantileLoss'
(Maybe Double -> Maybe Double -> WeightedQuantileLoss)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> WeightedQuantileLoss)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Quantile")
Parser (Maybe Double -> WeightedQuantileLoss)
-> Parser (Maybe Double) -> Parser WeightedQuantileLoss
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LossValue")
)
instance Prelude.Hashable WeightedQuantileLoss
instance Prelude.NFData WeightedQuantileLoss