{-# 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.ParameterRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.CategoricalParameterRangeSpecification
import Amazonka.SageMaker.Types.ContinuousParameterRangeSpecification
import Amazonka.SageMaker.Types.IntegerParameterRangeSpecification
data ParameterRange = ParameterRange'
{
ParameterRange -> Maybe CategoricalParameterRangeSpecification
categoricalParameterRangeSpecification :: Prelude.Maybe CategoricalParameterRangeSpecification,
ParameterRange -> Maybe IntegerParameterRangeSpecification
integerParameterRangeSpecification :: Prelude.Maybe IntegerParameterRangeSpecification,
ParameterRange -> Maybe ContinuousParameterRangeSpecification
continuousParameterRangeSpecification :: Prelude.Maybe ContinuousParameterRangeSpecification
}
deriving (ParameterRange -> ParameterRange -> Bool
(ParameterRange -> ParameterRange -> Bool)
-> (ParameterRange -> ParameterRange -> Bool) -> Eq ParameterRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterRange -> ParameterRange -> Bool
$c/= :: ParameterRange -> ParameterRange -> Bool
== :: ParameterRange -> ParameterRange -> Bool
$c== :: ParameterRange -> ParameterRange -> Bool
Prelude.Eq, ReadPrec [ParameterRange]
ReadPrec ParameterRange
Int -> ReadS ParameterRange
ReadS [ParameterRange]
(Int -> ReadS ParameterRange)
-> ReadS [ParameterRange]
-> ReadPrec ParameterRange
-> ReadPrec [ParameterRange]
-> Read ParameterRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterRange]
$creadListPrec :: ReadPrec [ParameterRange]
readPrec :: ReadPrec ParameterRange
$creadPrec :: ReadPrec ParameterRange
readList :: ReadS [ParameterRange]
$creadList :: ReadS [ParameterRange]
readsPrec :: Int -> ReadS ParameterRange
$creadsPrec :: Int -> ReadS ParameterRange
Prelude.Read, Int -> ParameterRange -> ShowS
[ParameterRange] -> ShowS
ParameterRange -> String
(Int -> ParameterRange -> ShowS)
-> (ParameterRange -> String)
-> ([ParameterRange] -> ShowS)
-> Show ParameterRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterRange] -> ShowS
$cshowList :: [ParameterRange] -> ShowS
show :: ParameterRange -> String
$cshow :: ParameterRange -> String
showsPrec :: Int -> ParameterRange -> ShowS
$cshowsPrec :: Int -> ParameterRange -> ShowS
Prelude.Show, (forall x. ParameterRange -> Rep ParameterRange x)
-> (forall x. Rep ParameterRange x -> ParameterRange)
-> Generic ParameterRange
forall x. Rep ParameterRange x -> ParameterRange
forall x. ParameterRange -> Rep ParameterRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterRange x -> ParameterRange
$cfrom :: forall x. ParameterRange -> Rep ParameterRange x
Prelude.Generic)
newParameterRange ::
ParameterRange
newParameterRange :: ParameterRange
newParameterRange =
ParameterRange' :: Maybe CategoricalParameterRangeSpecification
-> Maybe IntegerParameterRangeSpecification
-> Maybe ContinuousParameterRangeSpecification
-> ParameterRange
ParameterRange'
{ $sel:categoricalParameterRangeSpecification:ParameterRange' :: Maybe CategoricalParameterRangeSpecification
categoricalParameterRangeSpecification =
Maybe CategoricalParameterRangeSpecification
forall a. Maybe a
Prelude.Nothing,
$sel:integerParameterRangeSpecification:ParameterRange' :: Maybe IntegerParameterRangeSpecification
integerParameterRangeSpecification = Maybe IntegerParameterRangeSpecification
forall a. Maybe a
Prelude.Nothing,
$sel:continuousParameterRangeSpecification:ParameterRange' :: Maybe ContinuousParameterRangeSpecification
continuousParameterRangeSpecification =
Maybe ContinuousParameterRangeSpecification
forall a. Maybe a
Prelude.Nothing
}
parameterRange_categoricalParameterRangeSpecification :: Lens.Lens' ParameterRange (Prelude.Maybe CategoricalParameterRangeSpecification)
parameterRange_categoricalParameterRangeSpecification :: (Maybe CategoricalParameterRangeSpecification
-> f (Maybe CategoricalParameterRangeSpecification))
-> ParameterRange -> f ParameterRange
parameterRange_categoricalParameterRangeSpecification = (ParameterRange -> Maybe CategoricalParameterRangeSpecification)
-> (ParameterRange
-> Maybe CategoricalParameterRangeSpecification -> ParameterRange)
-> Lens
ParameterRange
ParameterRange
(Maybe CategoricalParameterRangeSpecification)
(Maybe CategoricalParameterRangeSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterRange' {Maybe CategoricalParameterRangeSpecification
categoricalParameterRangeSpecification :: Maybe CategoricalParameterRangeSpecification
$sel:categoricalParameterRangeSpecification:ParameterRange' :: ParameterRange -> Maybe CategoricalParameterRangeSpecification
categoricalParameterRangeSpecification} -> Maybe CategoricalParameterRangeSpecification
categoricalParameterRangeSpecification) (\s :: ParameterRange
s@ParameterRange' {} Maybe CategoricalParameterRangeSpecification
a -> ParameterRange
s {$sel:categoricalParameterRangeSpecification:ParameterRange' :: Maybe CategoricalParameterRangeSpecification
categoricalParameterRangeSpecification = Maybe CategoricalParameterRangeSpecification
a} :: ParameterRange)
parameterRange_integerParameterRangeSpecification :: Lens.Lens' ParameterRange (Prelude.Maybe IntegerParameterRangeSpecification)
parameterRange_integerParameterRangeSpecification :: (Maybe IntegerParameterRangeSpecification
-> f (Maybe IntegerParameterRangeSpecification))
-> ParameterRange -> f ParameterRange
parameterRange_integerParameterRangeSpecification = (ParameterRange -> Maybe IntegerParameterRangeSpecification)
-> (ParameterRange
-> Maybe IntegerParameterRangeSpecification -> ParameterRange)
-> Lens
ParameterRange
ParameterRange
(Maybe IntegerParameterRangeSpecification)
(Maybe IntegerParameterRangeSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterRange' {Maybe IntegerParameterRangeSpecification
integerParameterRangeSpecification :: Maybe IntegerParameterRangeSpecification
$sel:integerParameterRangeSpecification:ParameterRange' :: ParameterRange -> Maybe IntegerParameterRangeSpecification
integerParameterRangeSpecification} -> Maybe IntegerParameterRangeSpecification
integerParameterRangeSpecification) (\s :: ParameterRange
s@ParameterRange' {} Maybe IntegerParameterRangeSpecification
a -> ParameterRange
s {$sel:integerParameterRangeSpecification:ParameterRange' :: Maybe IntegerParameterRangeSpecification
integerParameterRangeSpecification = Maybe IntegerParameterRangeSpecification
a} :: ParameterRange)
parameterRange_continuousParameterRangeSpecification :: Lens.Lens' ParameterRange (Prelude.Maybe ContinuousParameterRangeSpecification)
parameterRange_continuousParameterRangeSpecification :: (Maybe ContinuousParameterRangeSpecification
-> f (Maybe ContinuousParameterRangeSpecification))
-> ParameterRange -> f ParameterRange
parameterRange_continuousParameterRangeSpecification = (ParameterRange -> Maybe ContinuousParameterRangeSpecification)
-> (ParameterRange
-> Maybe ContinuousParameterRangeSpecification -> ParameterRange)
-> Lens
ParameterRange
ParameterRange
(Maybe ContinuousParameterRangeSpecification)
(Maybe ContinuousParameterRangeSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterRange' {Maybe ContinuousParameterRangeSpecification
continuousParameterRangeSpecification :: Maybe ContinuousParameterRangeSpecification
$sel:continuousParameterRangeSpecification:ParameterRange' :: ParameterRange -> Maybe ContinuousParameterRangeSpecification
continuousParameterRangeSpecification} -> Maybe ContinuousParameterRangeSpecification
continuousParameterRangeSpecification) (\s :: ParameterRange
s@ParameterRange' {} Maybe ContinuousParameterRangeSpecification
a -> ParameterRange
s {$sel:continuousParameterRangeSpecification:ParameterRange' :: Maybe ContinuousParameterRangeSpecification
continuousParameterRangeSpecification = Maybe ContinuousParameterRangeSpecification
a} :: ParameterRange)
instance Core.FromJSON ParameterRange where
parseJSON :: Value -> Parser ParameterRange
parseJSON =
String
-> (Object -> Parser ParameterRange)
-> Value
-> Parser ParameterRange
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ParameterRange"
( \Object
x ->
Maybe CategoricalParameterRangeSpecification
-> Maybe IntegerParameterRangeSpecification
-> Maybe ContinuousParameterRangeSpecification
-> ParameterRange
ParameterRange'
(Maybe CategoricalParameterRangeSpecification
-> Maybe IntegerParameterRangeSpecification
-> Maybe ContinuousParameterRangeSpecification
-> ParameterRange)
-> Parser (Maybe CategoricalParameterRangeSpecification)
-> Parser
(Maybe IntegerParameterRangeSpecification
-> Maybe ContinuousParameterRangeSpecification -> ParameterRange)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe CategoricalParameterRangeSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CategoricalParameterRangeSpecification")
Parser
(Maybe IntegerParameterRangeSpecification
-> Maybe ContinuousParameterRangeSpecification -> ParameterRange)
-> Parser (Maybe IntegerParameterRangeSpecification)
-> Parser
(Maybe ContinuousParameterRangeSpecification -> ParameterRange)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IntegerParameterRangeSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IntegerParameterRangeSpecification")
Parser
(Maybe ContinuousParameterRangeSpecification -> ParameterRange)
-> Parser (Maybe ContinuousParameterRangeSpecification)
-> Parser ParameterRange
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe ContinuousParameterRangeSpecification)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContinuousParameterRangeSpecification")
)
instance Prelude.Hashable ParameterRange
instance Prelude.NFData ParameterRange
instance Core.ToJSON ParameterRange where
toJSON :: ParameterRange -> Value
toJSON ParameterRange' {Maybe CategoricalParameterRangeSpecification
Maybe ContinuousParameterRangeSpecification
Maybe IntegerParameterRangeSpecification
continuousParameterRangeSpecification :: Maybe ContinuousParameterRangeSpecification
integerParameterRangeSpecification :: Maybe IntegerParameterRangeSpecification
categoricalParameterRangeSpecification :: Maybe CategoricalParameterRangeSpecification
$sel:continuousParameterRangeSpecification:ParameterRange' :: ParameterRange -> Maybe ContinuousParameterRangeSpecification
$sel:integerParameterRangeSpecification:ParameterRange' :: ParameterRange -> Maybe IntegerParameterRangeSpecification
$sel:categoricalParameterRangeSpecification:ParameterRange' :: ParameterRange -> Maybe CategoricalParameterRangeSpecification
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CategoricalParameterRangeSpecification" Text -> CategoricalParameterRangeSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CategoricalParameterRangeSpecification -> Pair)
-> Maybe CategoricalParameterRangeSpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CategoricalParameterRangeSpecification
categoricalParameterRangeSpecification,
(Text
"IntegerParameterRangeSpecification" Text -> IntegerParameterRangeSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(IntegerParameterRangeSpecification -> Pair)
-> Maybe IntegerParameterRangeSpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IntegerParameterRangeSpecification
integerParameterRangeSpecification,
(Text
"ContinuousParameterRangeSpecification" Text -> ContinuousParameterRangeSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ContinuousParameterRangeSpecification -> Pair)
-> Maybe ContinuousParameterRangeSpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContinuousParameterRangeSpecification
continuousParameterRangeSpecification
]
)