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