{-# 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.ParameterRanges where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.CategoricalParameterRange
import Amazonka.SageMaker.Types.ContinuousParameterRange
import Amazonka.SageMaker.Types.IntegerParameterRange
data ParameterRanges = ParameterRanges'
{
ParameterRanges -> Maybe [CategoricalParameterRange]
categoricalParameterRanges :: Prelude.Maybe [CategoricalParameterRange],
ParameterRanges -> Maybe [IntegerParameterRange]
integerParameterRanges :: Prelude.Maybe [IntegerParameterRange],
ParameterRanges -> Maybe [ContinuousParameterRange]
continuousParameterRanges :: Prelude.Maybe [ContinuousParameterRange]
}
deriving (ParameterRanges -> ParameterRanges -> Bool
(ParameterRanges -> ParameterRanges -> Bool)
-> (ParameterRanges -> ParameterRanges -> Bool)
-> Eq ParameterRanges
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterRanges -> ParameterRanges -> Bool
$c/= :: ParameterRanges -> ParameterRanges -> Bool
== :: ParameterRanges -> ParameterRanges -> Bool
$c== :: ParameterRanges -> ParameterRanges -> Bool
Prelude.Eq, ReadPrec [ParameterRanges]
ReadPrec ParameterRanges
Int -> ReadS ParameterRanges
ReadS [ParameterRanges]
(Int -> ReadS ParameterRanges)
-> ReadS [ParameterRanges]
-> ReadPrec ParameterRanges
-> ReadPrec [ParameterRanges]
-> Read ParameterRanges
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterRanges]
$creadListPrec :: ReadPrec [ParameterRanges]
readPrec :: ReadPrec ParameterRanges
$creadPrec :: ReadPrec ParameterRanges
readList :: ReadS [ParameterRanges]
$creadList :: ReadS [ParameterRanges]
readsPrec :: Int -> ReadS ParameterRanges
$creadsPrec :: Int -> ReadS ParameterRanges
Prelude.Read, Int -> ParameterRanges -> ShowS
[ParameterRanges] -> ShowS
ParameterRanges -> String
(Int -> ParameterRanges -> ShowS)
-> (ParameterRanges -> String)
-> ([ParameterRanges] -> ShowS)
-> Show ParameterRanges
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterRanges] -> ShowS
$cshowList :: [ParameterRanges] -> ShowS
show :: ParameterRanges -> String
$cshow :: ParameterRanges -> String
showsPrec :: Int -> ParameterRanges -> ShowS
$cshowsPrec :: Int -> ParameterRanges -> ShowS
Prelude.Show, (forall x. ParameterRanges -> Rep ParameterRanges x)
-> (forall x. Rep ParameterRanges x -> ParameterRanges)
-> Generic ParameterRanges
forall x. Rep ParameterRanges x -> ParameterRanges
forall x. ParameterRanges -> Rep ParameterRanges x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterRanges x -> ParameterRanges
$cfrom :: forall x. ParameterRanges -> Rep ParameterRanges x
Prelude.Generic)
newParameterRanges ::
ParameterRanges
newParameterRanges :: ParameterRanges
newParameterRanges =
ParameterRanges' :: Maybe [CategoricalParameterRange]
-> Maybe [IntegerParameterRange]
-> Maybe [ContinuousParameterRange]
-> ParameterRanges
ParameterRanges'
{ $sel:categoricalParameterRanges:ParameterRanges' :: Maybe [CategoricalParameterRange]
categoricalParameterRanges =
Maybe [CategoricalParameterRange]
forall a. Maybe a
Prelude.Nothing,
$sel:integerParameterRanges:ParameterRanges' :: Maybe [IntegerParameterRange]
integerParameterRanges = Maybe [IntegerParameterRange]
forall a. Maybe a
Prelude.Nothing,
$sel:continuousParameterRanges:ParameterRanges' :: Maybe [ContinuousParameterRange]
continuousParameterRanges = Maybe [ContinuousParameterRange]
forall a. Maybe a
Prelude.Nothing
}
parameterRanges_categoricalParameterRanges :: Lens.Lens' ParameterRanges (Prelude.Maybe [CategoricalParameterRange])
parameterRanges_categoricalParameterRanges :: (Maybe [CategoricalParameterRange]
-> f (Maybe [CategoricalParameterRange]))
-> ParameterRanges -> f ParameterRanges
parameterRanges_categoricalParameterRanges = (ParameterRanges -> Maybe [CategoricalParameterRange])
-> (ParameterRanges
-> Maybe [CategoricalParameterRange] -> ParameterRanges)
-> Lens
ParameterRanges
ParameterRanges
(Maybe [CategoricalParameterRange])
(Maybe [CategoricalParameterRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterRanges' {Maybe [CategoricalParameterRange]
categoricalParameterRanges :: Maybe [CategoricalParameterRange]
$sel:categoricalParameterRanges:ParameterRanges' :: ParameterRanges -> Maybe [CategoricalParameterRange]
categoricalParameterRanges} -> Maybe [CategoricalParameterRange]
categoricalParameterRanges) (\s :: ParameterRanges
s@ParameterRanges' {} Maybe [CategoricalParameterRange]
a -> ParameterRanges
s {$sel:categoricalParameterRanges:ParameterRanges' :: Maybe [CategoricalParameterRange]
categoricalParameterRanges = Maybe [CategoricalParameterRange]
a} :: ParameterRanges) ((Maybe [CategoricalParameterRange]
-> f (Maybe [CategoricalParameterRange]))
-> ParameterRanges -> f ParameterRanges)
-> ((Maybe [CategoricalParameterRange]
-> f (Maybe [CategoricalParameterRange]))
-> Maybe [CategoricalParameterRange]
-> f (Maybe [CategoricalParameterRange]))
-> (Maybe [CategoricalParameterRange]
-> f (Maybe [CategoricalParameterRange]))
-> ParameterRanges
-> f ParameterRanges
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CategoricalParameterRange]
[CategoricalParameterRange]
[CategoricalParameterRange]
[CategoricalParameterRange]
-> Iso
(Maybe [CategoricalParameterRange])
(Maybe [CategoricalParameterRange])
(Maybe [CategoricalParameterRange])
(Maybe [CategoricalParameterRange])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[CategoricalParameterRange]
[CategoricalParameterRange]
[CategoricalParameterRange]
[CategoricalParameterRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
parameterRanges_integerParameterRanges :: Lens.Lens' ParameterRanges (Prelude.Maybe [IntegerParameterRange])
parameterRanges_integerParameterRanges :: (Maybe [IntegerParameterRange]
-> f (Maybe [IntegerParameterRange]))
-> ParameterRanges -> f ParameterRanges
parameterRanges_integerParameterRanges = (ParameterRanges -> Maybe [IntegerParameterRange])
-> (ParameterRanges
-> Maybe [IntegerParameterRange] -> ParameterRanges)
-> Lens
ParameterRanges
ParameterRanges
(Maybe [IntegerParameterRange])
(Maybe [IntegerParameterRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterRanges' {Maybe [IntegerParameterRange]
integerParameterRanges :: Maybe [IntegerParameterRange]
$sel:integerParameterRanges:ParameterRanges' :: ParameterRanges -> Maybe [IntegerParameterRange]
integerParameterRanges} -> Maybe [IntegerParameterRange]
integerParameterRanges) (\s :: ParameterRanges
s@ParameterRanges' {} Maybe [IntegerParameterRange]
a -> ParameterRanges
s {$sel:integerParameterRanges:ParameterRanges' :: Maybe [IntegerParameterRange]
integerParameterRanges = Maybe [IntegerParameterRange]
a} :: ParameterRanges) ((Maybe [IntegerParameterRange]
-> f (Maybe [IntegerParameterRange]))
-> ParameterRanges -> f ParameterRanges)
-> ((Maybe [IntegerParameterRange]
-> f (Maybe [IntegerParameterRange]))
-> Maybe [IntegerParameterRange]
-> f (Maybe [IntegerParameterRange]))
-> (Maybe [IntegerParameterRange]
-> f (Maybe [IntegerParameterRange]))
-> ParameterRanges
-> f ParameterRanges
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[IntegerParameterRange]
[IntegerParameterRange]
[IntegerParameterRange]
[IntegerParameterRange]
-> Iso
(Maybe [IntegerParameterRange])
(Maybe [IntegerParameterRange])
(Maybe [IntegerParameterRange])
(Maybe [IntegerParameterRange])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[IntegerParameterRange]
[IntegerParameterRange]
[IntegerParameterRange]
[IntegerParameterRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
parameterRanges_continuousParameterRanges :: Lens.Lens' ParameterRanges (Prelude.Maybe [ContinuousParameterRange])
parameterRanges_continuousParameterRanges :: (Maybe [ContinuousParameterRange]
-> f (Maybe [ContinuousParameterRange]))
-> ParameterRanges -> f ParameterRanges
parameterRanges_continuousParameterRanges = (ParameterRanges -> Maybe [ContinuousParameterRange])
-> (ParameterRanges
-> Maybe [ContinuousParameterRange] -> ParameterRanges)
-> Lens
ParameterRanges
ParameterRanges
(Maybe [ContinuousParameterRange])
(Maybe [ContinuousParameterRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterRanges' {Maybe [ContinuousParameterRange]
continuousParameterRanges :: Maybe [ContinuousParameterRange]
$sel:continuousParameterRanges:ParameterRanges' :: ParameterRanges -> Maybe [ContinuousParameterRange]
continuousParameterRanges} -> Maybe [ContinuousParameterRange]
continuousParameterRanges) (\s :: ParameterRanges
s@ParameterRanges' {} Maybe [ContinuousParameterRange]
a -> ParameterRanges
s {$sel:continuousParameterRanges:ParameterRanges' :: Maybe [ContinuousParameterRange]
continuousParameterRanges = Maybe [ContinuousParameterRange]
a} :: ParameterRanges) ((Maybe [ContinuousParameterRange]
-> f (Maybe [ContinuousParameterRange]))
-> ParameterRanges -> f ParameterRanges)
-> ((Maybe [ContinuousParameterRange]
-> f (Maybe [ContinuousParameterRange]))
-> Maybe [ContinuousParameterRange]
-> f (Maybe [ContinuousParameterRange]))
-> (Maybe [ContinuousParameterRange]
-> f (Maybe [ContinuousParameterRange]))
-> ParameterRanges
-> f ParameterRanges
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ContinuousParameterRange]
[ContinuousParameterRange]
[ContinuousParameterRange]
[ContinuousParameterRange]
-> Iso
(Maybe [ContinuousParameterRange])
(Maybe [ContinuousParameterRange])
(Maybe [ContinuousParameterRange])
(Maybe [ContinuousParameterRange])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ContinuousParameterRange]
[ContinuousParameterRange]
[ContinuousParameterRange]
[ContinuousParameterRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ParameterRanges where
parseJSON :: Value -> Parser ParameterRanges
parseJSON =
String
-> (Object -> Parser ParameterRanges)
-> Value
-> Parser ParameterRanges
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ParameterRanges"
( \Object
x ->
Maybe [CategoricalParameterRange]
-> Maybe [IntegerParameterRange]
-> Maybe [ContinuousParameterRange]
-> ParameterRanges
ParameterRanges'
(Maybe [CategoricalParameterRange]
-> Maybe [IntegerParameterRange]
-> Maybe [ContinuousParameterRange]
-> ParameterRanges)
-> Parser (Maybe [CategoricalParameterRange])
-> Parser
(Maybe [IntegerParameterRange]
-> Maybe [ContinuousParameterRange] -> ParameterRanges)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [CategoricalParameterRange]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CategoricalParameterRanges"
Parser (Maybe (Maybe [CategoricalParameterRange]))
-> Maybe [CategoricalParameterRange]
-> Parser (Maybe [CategoricalParameterRange])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CategoricalParameterRange]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [IntegerParameterRange]
-> Maybe [ContinuousParameterRange] -> ParameterRanges)
-> Parser (Maybe [IntegerParameterRange])
-> Parser (Maybe [ContinuousParameterRange] -> ParameterRanges)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [IntegerParameterRange]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IntegerParameterRanges"
Parser (Maybe (Maybe [IntegerParameterRange]))
-> Maybe [IntegerParameterRange]
-> Parser (Maybe [IntegerParameterRange])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [IntegerParameterRange]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe [ContinuousParameterRange] -> ParameterRanges)
-> Parser (Maybe [ContinuousParameterRange])
-> Parser ParameterRanges
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ContinuousParameterRange]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContinuousParameterRanges"
Parser (Maybe (Maybe [ContinuousParameterRange]))
-> Maybe [ContinuousParameterRange]
-> Parser (Maybe [ContinuousParameterRange])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ContinuousParameterRange]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ParameterRanges
instance Prelude.NFData ParameterRanges
instance Core.ToJSON ParameterRanges where
toJSON :: ParameterRanges -> Value
toJSON ParameterRanges' {Maybe [CategoricalParameterRange]
Maybe [ContinuousParameterRange]
Maybe [IntegerParameterRange]
continuousParameterRanges :: Maybe [ContinuousParameterRange]
integerParameterRanges :: Maybe [IntegerParameterRange]
categoricalParameterRanges :: Maybe [CategoricalParameterRange]
$sel:continuousParameterRanges:ParameterRanges' :: ParameterRanges -> Maybe [ContinuousParameterRange]
$sel:integerParameterRanges:ParameterRanges' :: ParameterRanges -> Maybe [IntegerParameterRange]
$sel:categoricalParameterRanges:ParameterRanges' :: ParameterRanges -> Maybe [CategoricalParameterRange]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CategoricalParameterRanges" Text -> [CategoricalParameterRange] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([CategoricalParameterRange] -> Pair)
-> Maybe [CategoricalParameterRange] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CategoricalParameterRange]
categoricalParameterRanges,
(Text
"IntegerParameterRanges" Text -> [IntegerParameterRange] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([IntegerParameterRange] -> Pair)
-> Maybe [IntegerParameterRange] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IntegerParameterRange]
integerParameterRanges,
(Text
"ContinuousParameterRanges" Text -> [ContinuousParameterRange] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([ContinuousParameterRange] -> Pair)
-> Maybe [ContinuousParameterRange] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ContinuousParameterRange]
continuousParameterRanges
]
)