{-# 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.SageMaker.Types.ContinuousParameterRange 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
import Amazonka.SageMaker.Types.HyperParameterScalingType
data ContinuousParameterRange = ContinuousParameterRange'
{
ContinuousParameterRange -> Maybe HyperParameterScalingType
scalingType :: Prelude.Maybe HyperParameterScalingType,
ContinuousParameterRange -> Text
name :: Prelude.Text,
ContinuousParameterRange -> Text
minValue :: Prelude.Text,
ContinuousParameterRange -> Text
maxValue :: Prelude.Text
}
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.Text ->
Prelude.Text ->
ContinuousParameterRange
newContinuousParameterRange :: Text -> Text -> Text -> ContinuousParameterRange
newContinuousParameterRange
Text
pName_
Text
pMinValue_
Text
pMaxValue_ =
ContinuousParameterRange'
{ $sel:scalingType:ContinuousParameterRange' :: Maybe HyperParameterScalingType
scalingType =
forall a. Maybe a
Prelude.Nothing,
$sel:name:ContinuousParameterRange' :: Text
name = Text
pName_,
$sel:minValue:ContinuousParameterRange' :: Text
minValue = Text
pMinValue_,
$sel:maxValue:ContinuousParameterRange' :: Text
maxValue = Text
pMaxValue_
}
continuousParameterRange_scalingType :: Lens.Lens' ContinuousParameterRange (Prelude.Maybe HyperParameterScalingType)
continuousParameterRange_scalingType :: Lens' ContinuousParameterRange (Maybe HyperParameterScalingType)
continuousParameterRange_scalingType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousParameterRange' {Maybe HyperParameterScalingType
scalingType :: Maybe HyperParameterScalingType
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe HyperParameterScalingType
scalingType} -> Maybe HyperParameterScalingType
scalingType) (\s :: ContinuousParameterRange
s@ContinuousParameterRange' {} Maybe HyperParameterScalingType
a -> ContinuousParameterRange
s {$sel:scalingType:ContinuousParameterRange' :: Maybe HyperParameterScalingType
scalingType = Maybe HyperParameterScalingType
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_minValue :: Lens.Lens' ContinuousParameterRange Prelude.Text
continuousParameterRange_minValue :: Lens' ContinuousParameterRange Text
continuousParameterRange_minValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousParameterRange' {Text
minValue :: Text
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
minValue} -> Text
minValue) (\s :: ContinuousParameterRange
s@ContinuousParameterRange' {} Text
a -> ContinuousParameterRange
s {$sel:minValue:ContinuousParameterRange' :: Text
minValue = Text
a} :: ContinuousParameterRange)
continuousParameterRange_maxValue :: Lens.Lens' ContinuousParameterRange Prelude.Text
continuousParameterRange_maxValue :: Lens' ContinuousParameterRange Text
continuousParameterRange_maxValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinuousParameterRange' {Text
maxValue :: Text
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
maxValue} -> Text
maxValue) (\s :: ContinuousParameterRange
s@ContinuousParameterRange' {} Text
a -> ContinuousParameterRange
s {$sel:maxValue:ContinuousParameterRange' :: Text
maxValue = Text
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 HyperParameterScalingType
-> Text -> Text -> Text -> 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
"MinValue")
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")
)
instance Prelude.Hashable ContinuousParameterRange where
hashWithSalt :: Int -> ContinuousParameterRange -> Int
hashWithSalt Int
_salt ContinuousParameterRange' {Maybe HyperParameterScalingType
Text
maxValue :: Text
minValue :: Text
name :: Text
scalingType :: Maybe HyperParameterScalingType
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:name:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe HyperParameterScalingType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HyperParameterScalingType
scalingType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
minValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
maxValue
instance Prelude.NFData ContinuousParameterRange where
rnf :: ContinuousParameterRange -> ()
rnf ContinuousParameterRange' {Maybe HyperParameterScalingType
Text
maxValue :: Text
minValue :: Text
name :: Text
scalingType :: Maybe HyperParameterScalingType
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:name:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe HyperParameterScalingType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe HyperParameterScalingType
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 Text
minValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
maxValue
instance Data.ToJSON ContinuousParameterRange where
toJSON :: ContinuousParameterRange -> Value
toJSON ContinuousParameterRange' {Maybe HyperParameterScalingType
Text
maxValue :: Text
minValue :: Text
name :: Text
scalingType :: Maybe HyperParameterScalingType
$sel:maxValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:minValue:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:name:ContinuousParameterRange' :: ContinuousParameterRange -> Text
$sel:scalingType:ContinuousParameterRange' :: ContinuousParameterRange -> Maybe HyperParameterScalingType
..} =
[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 HyperParameterScalingType
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
"MinValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
minValue),
forall a. a -> Maybe a
Prelude.Just (Key
"MaxValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
maxValue)
]
)