{-# 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.ContinuousParameterRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Forecast.Types.ScalingType
import qualified Amazonka.Prelude as Prelude
data ContinuousParameterRange = ContinuousParameterRange'
{
ContinuousParameterRange -> Maybe ScalingType
scalingType :: Prelude.Maybe ScalingType,
ContinuousParameterRange -> Text
name :: Prelude.Text,
ContinuousParameterRange -> Double
maxValue :: Prelude.Double,
ContinuousParameterRange -> Double
minValue :: Prelude.Double
}
deriving (ContinuousParameterRange -> ContinuousParameterRange -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContinuousParameterRange -> ContinuousParameterRange -> Bool
$c/= :: ContinuousParameterRange -> ContinuousParameterRange -> Bool
== :: ContinuousParameterRange -> ContinuousParameterRange -> Bool
$c== :: ContinuousParameterRange -> ContinuousParameterRange -> Bool
Prelude.Eq, ReadPrec [ContinuousParameterRange]
ReadPrec ContinuousParameterRange
Int -> ReadS ContinuousParameterRange
ReadS [ContinuousParameterRange]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContinuousParameterRange]
$creadListPrec :: ReadPrec [ContinuousParameterRange]
readPrec :: ReadPrec ContinuousParameterRange
$creadPrec :: ReadPrec ContinuousParameterRange
readList :: ReadS [ContinuousParameterRange]
$creadList :: ReadS [ContinuousParameterRange]
readsPrec :: Int -> ReadS ContinuousParameterRange
$creadsPrec :: Int -> ReadS ContinuousParameterRange
Prelude.Read, Int -> ContinuousParameterRange -> ShowS
[ContinuousParameterRange] -> ShowS
ContinuousParameterRange -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContinuousParameterRange] -> ShowS
$cshowList :: [ContinuousParameterRange] -> ShowS
show :: ContinuousParameterRange -> String
$cshow :: ContinuousParameterRange -> String
showsPrec :: Int -> ContinuousParameterRange -> ShowS
$cshowsPrec :: Int -> ContinuousParameterRange -> ShowS
Prelude.Show, forall x.
Rep ContinuousParameterRange x -> ContinuousParameterRange
forall x.
ContinuousParameterRange -> Rep ContinuousParameterRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContinuousParameterRange x -> ContinuousParameterRange
$cfrom :: forall x.
ContinuousParameterRange -> Rep ContinuousParameterRange x
Prelude.Generic)
newContinuousParameterRange ::
Prelude.Text ->
Prelude.Double ->
Prelude.Double ->
ContinuousParameterRange
newContinuousParameterRange :: Text -> Double -> Double -> ContinuousParameterRange
newContinuousParameterRange
Text
pName_
Double
pMaxValue_
Double
pMinValue_ =
ContinuousParameterRange'
{ $sel:scalingType:ContinuousParameterRange' :: Maybe ScalingType
scalingType =
forall a. Maybe a
Prelude.Nothing,
$sel:name:ContinuousParameterRange' :: Text
name = Text
pName_,
$sel:maxValue:ContinuousParameterRange' :: Double
maxValue = Double
pMaxValue_,
$sel:minValue:ContinuousParameterRange' :: Double
minValue = Double
pMinValue_
}
continuousParameterRange_scalingType :: Lens.Lens' ContinuousParameterRange (Prelude.Maybe ScalingType)
continuousParameterRange_scalingType :: Lens' ContinuousParameterRange (Maybe ScalingType)
continuousParameterRange_scalingType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousParameterRange' {Maybe ScalingType
scalingType :: Maybe ScalingType
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe ScalingType
scalingType} -> Maybe ScalingType
scalingType) (\s :: ContinuousParameterRange
s@ContinuousParameterRange' {} Maybe ScalingType
a -> ContinuousParameterRange
s {$sel:scalingType:ContinuousParameterRange' :: Maybe ScalingType
scalingType = Maybe ScalingType
a} :: ContinuousParameterRange)
continuousParameterRange_name :: Lens.Lens' ContinuousParameterRange Prelude.Text
continuousParameterRange_name :: Lens' ContinuousParameterRange Text
continuousParameterRange_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousParameterRange' {Text
name :: Text
$sel:name:ContinuousParameterRange' :: ContinuousParameterRange -> Text
name} -> Text
name) (\s :: ContinuousParameterRange
s@ContinuousParameterRange' {} Text
a -> ContinuousParameterRange
s {$sel:name:ContinuousParameterRange' :: Text
name = Text
a} :: ContinuousParameterRange)
continuousParameterRange_maxValue :: Lens.Lens' ContinuousParameterRange Prelude.Double
continuousParameterRange_maxValue :: Lens' ContinuousParameterRange Double
continuousParameterRange_maxValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousParameterRange' {Double
maxValue :: Double
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
maxValue} -> Double
maxValue) (\s :: ContinuousParameterRange
s@ContinuousParameterRange' {} Double
a -> ContinuousParameterRange
s {$sel:maxValue:ContinuousParameterRange' :: Double
maxValue = Double
a} :: ContinuousParameterRange)
continuousParameterRange_minValue :: Lens.Lens' ContinuousParameterRange Prelude.Double
continuousParameterRange_minValue :: Lens' ContinuousParameterRange Double
continuousParameterRange_minValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousParameterRange' {Double
minValue :: Double
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
minValue} -> Double
minValue) (\s :: ContinuousParameterRange
s@ContinuousParameterRange' {} Double
a -> ContinuousParameterRange
s {$sel:minValue:ContinuousParameterRange' :: Double
minValue = Double
a} :: ContinuousParameterRange)
instance Data.FromJSON ContinuousParameterRange where
parseJSON :: Value -> Parser ContinuousParameterRange
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ContinuousParameterRange"
( \Object
x ->
Maybe ScalingType
-> Text -> Double -> Double -> ContinuousParameterRange
ContinuousParameterRange'
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
"ScalingType")
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
"Name")
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
"MaxValue")
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
"MinValue")
)
instance Prelude.Hashable ContinuousParameterRange where
hashWithSalt :: Int -> ContinuousParameterRange -> Int
hashWithSalt Int
_salt ContinuousParameterRange' {Double
Maybe ScalingType
Text
minValue :: Double
maxValue :: Double
name :: Text
scalingType :: Maybe ScalingType
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
$sel:name:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe ScalingType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScalingType
scalingType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
maxValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
minValue
instance Prelude.NFData ContinuousParameterRange where
rnf :: ContinuousParameterRange -> ()
rnf ContinuousParameterRange' {Double
Maybe ScalingType
Text
minValue :: Double
maxValue :: Double
name :: Text
scalingType :: Maybe ScalingType
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
$sel:name:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe ScalingType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ScalingType
scalingType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
maxValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
minValue
instance Data.ToJSON ContinuousParameterRange where
toJSON :: ContinuousParameterRange -> Value
toJSON ContinuousParameterRange' {Double
Maybe ScalingType
Text
minValue :: Double
maxValue :: Double
name :: Text
scalingType :: Maybe ScalingType
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Double
$sel:name:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe ScalingType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ScalingType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScalingType
scalingType,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"MaxValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
maxValue),
forall a. a -> Maybe a
Prelude.Just (Key
"MinValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
minValue)
]
)