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