{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Personalize.Types.DefaultHyperParameterRanges
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Personalize.Types.DefaultHyperParameterRanges where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types.DefaultCategoricalHyperParameterRange
import Amazonka.Personalize.Types.DefaultContinuousHyperParameterRange
import Amazonka.Personalize.Types.DefaultIntegerHyperParameterRange
import qualified Amazonka.Prelude as Prelude

-- | Specifies the hyperparameters and their default ranges. Hyperparameters
-- can be categorical, continuous, or integer-valued.
--
-- /See:/ 'newDefaultHyperParameterRanges' smart constructor.
data DefaultHyperParameterRanges = DefaultHyperParameterRanges'
  { -- | The integer-valued hyperparameters and their default ranges.
    DefaultHyperParameterRanges
-> Maybe [DefaultIntegerHyperParameterRange]
integerHyperParameterRanges :: Prelude.Maybe [DefaultIntegerHyperParameterRange],
    -- | The categorical hyperparameters and their default ranges.
    DefaultHyperParameterRanges
-> Maybe [DefaultCategoricalHyperParameterRange]
categoricalHyperParameterRanges :: Prelude.Maybe [DefaultCategoricalHyperParameterRange],
    -- | The continuous hyperparameters and their default ranges.
    DefaultHyperParameterRanges
-> Maybe [DefaultContinuousHyperParameterRange]
continuousHyperParameterRanges :: Prelude.Maybe [DefaultContinuousHyperParameterRange]
  }
  deriving (DefaultHyperParameterRanges -> DefaultHyperParameterRanges -> Bool
(DefaultHyperParameterRanges
 -> DefaultHyperParameterRanges -> Bool)
-> (DefaultHyperParameterRanges
    -> DefaultHyperParameterRanges -> Bool)
-> Eq DefaultHyperParameterRanges
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DefaultHyperParameterRanges -> DefaultHyperParameterRanges -> Bool
$c/= :: DefaultHyperParameterRanges -> DefaultHyperParameterRanges -> Bool
== :: DefaultHyperParameterRanges -> DefaultHyperParameterRanges -> Bool
$c== :: DefaultHyperParameterRanges -> DefaultHyperParameterRanges -> Bool
Prelude.Eq, ReadPrec [DefaultHyperParameterRanges]
ReadPrec DefaultHyperParameterRanges
Int -> ReadS DefaultHyperParameterRanges
ReadS [DefaultHyperParameterRanges]
(Int -> ReadS DefaultHyperParameterRanges)
-> ReadS [DefaultHyperParameterRanges]
-> ReadPrec DefaultHyperParameterRanges
-> ReadPrec [DefaultHyperParameterRanges]
-> Read DefaultHyperParameterRanges
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DefaultHyperParameterRanges]
$creadListPrec :: ReadPrec [DefaultHyperParameterRanges]
readPrec :: ReadPrec DefaultHyperParameterRanges
$creadPrec :: ReadPrec DefaultHyperParameterRanges
readList :: ReadS [DefaultHyperParameterRanges]
$creadList :: ReadS [DefaultHyperParameterRanges]
readsPrec :: Int -> ReadS DefaultHyperParameterRanges
$creadsPrec :: Int -> ReadS DefaultHyperParameterRanges
Prelude.Read, Int -> DefaultHyperParameterRanges -> ShowS
[DefaultHyperParameterRanges] -> ShowS
DefaultHyperParameterRanges -> String
(Int -> DefaultHyperParameterRanges -> ShowS)
-> (DefaultHyperParameterRanges -> String)
-> ([DefaultHyperParameterRanges] -> ShowS)
-> Show DefaultHyperParameterRanges
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DefaultHyperParameterRanges] -> ShowS
$cshowList :: [DefaultHyperParameterRanges] -> ShowS
show :: DefaultHyperParameterRanges -> String
$cshow :: DefaultHyperParameterRanges -> String
showsPrec :: Int -> DefaultHyperParameterRanges -> ShowS
$cshowsPrec :: Int -> DefaultHyperParameterRanges -> ShowS
Prelude.Show, (forall x.
 DefaultHyperParameterRanges -> Rep DefaultHyperParameterRanges x)
-> (forall x.
    Rep DefaultHyperParameterRanges x -> DefaultHyperParameterRanges)
-> Generic DefaultHyperParameterRanges
forall x.
Rep DefaultHyperParameterRanges x -> DefaultHyperParameterRanges
forall x.
DefaultHyperParameterRanges -> Rep DefaultHyperParameterRanges x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DefaultHyperParameterRanges x -> DefaultHyperParameterRanges
$cfrom :: forall x.
DefaultHyperParameterRanges -> Rep DefaultHyperParameterRanges x
Prelude.Generic)

-- |
-- Create a value of 'DefaultHyperParameterRanges' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'integerHyperParameterRanges', 'defaultHyperParameterRanges_integerHyperParameterRanges' - The integer-valued hyperparameters and their default ranges.
--
-- 'categoricalHyperParameterRanges', 'defaultHyperParameterRanges_categoricalHyperParameterRanges' - The categorical hyperparameters and their default ranges.
--
-- 'continuousHyperParameterRanges', 'defaultHyperParameterRanges_continuousHyperParameterRanges' - The continuous hyperparameters and their default ranges.
newDefaultHyperParameterRanges ::
  DefaultHyperParameterRanges
newDefaultHyperParameterRanges :: DefaultHyperParameterRanges
newDefaultHyperParameterRanges =
  DefaultHyperParameterRanges' :: Maybe [DefaultIntegerHyperParameterRange]
-> Maybe [DefaultCategoricalHyperParameterRange]
-> Maybe [DefaultContinuousHyperParameterRange]
-> DefaultHyperParameterRanges
DefaultHyperParameterRanges'
    { $sel:integerHyperParameterRanges:DefaultHyperParameterRanges' :: Maybe [DefaultIntegerHyperParameterRange]
integerHyperParameterRanges =
        Maybe [DefaultIntegerHyperParameterRange]
forall a. Maybe a
Prelude.Nothing,
      $sel:categoricalHyperParameterRanges:DefaultHyperParameterRanges' :: Maybe [DefaultCategoricalHyperParameterRange]
categoricalHyperParameterRanges =
        Maybe [DefaultCategoricalHyperParameterRange]
forall a. Maybe a
Prelude.Nothing,
      $sel:continuousHyperParameterRanges:DefaultHyperParameterRanges' :: Maybe [DefaultContinuousHyperParameterRange]
continuousHyperParameterRanges =
        Maybe [DefaultContinuousHyperParameterRange]
forall a. Maybe a
Prelude.Nothing
    }

-- | The integer-valued hyperparameters and their default ranges.
defaultHyperParameterRanges_integerHyperParameterRanges :: Lens.Lens' DefaultHyperParameterRanges (Prelude.Maybe [DefaultIntegerHyperParameterRange])
defaultHyperParameterRanges_integerHyperParameterRanges :: (Maybe [DefaultIntegerHyperParameterRange]
 -> f (Maybe [DefaultIntegerHyperParameterRange]))
-> DefaultHyperParameterRanges -> f DefaultHyperParameterRanges
defaultHyperParameterRanges_integerHyperParameterRanges = (DefaultHyperParameterRanges
 -> Maybe [DefaultIntegerHyperParameterRange])
-> (DefaultHyperParameterRanges
    -> Maybe [DefaultIntegerHyperParameterRange]
    -> DefaultHyperParameterRanges)
-> Lens
     DefaultHyperParameterRanges
     DefaultHyperParameterRanges
     (Maybe [DefaultIntegerHyperParameterRange])
     (Maybe [DefaultIntegerHyperParameterRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultHyperParameterRanges' {Maybe [DefaultIntegerHyperParameterRange]
integerHyperParameterRanges :: Maybe [DefaultIntegerHyperParameterRange]
$sel:integerHyperParameterRanges:DefaultHyperParameterRanges' :: DefaultHyperParameterRanges
-> Maybe [DefaultIntegerHyperParameterRange]
integerHyperParameterRanges} -> Maybe [DefaultIntegerHyperParameterRange]
integerHyperParameterRanges) (\s :: DefaultHyperParameterRanges
s@DefaultHyperParameterRanges' {} Maybe [DefaultIntegerHyperParameterRange]
a -> DefaultHyperParameterRanges
s {$sel:integerHyperParameterRanges:DefaultHyperParameterRanges' :: Maybe [DefaultIntegerHyperParameterRange]
integerHyperParameterRanges = Maybe [DefaultIntegerHyperParameterRange]
a} :: DefaultHyperParameterRanges) ((Maybe [DefaultIntegerHyperParameterRange]
  -> f (Maybe [DefaultIntegerHyperParameterRange]))
 -> DefaultHyperParameterRanges -> f DefaultHyperParameterRanges)
-> ((Maybe [DefaultIntegerHyperParameterRange]
     -> f (Maybe [DefaultIntegerHyperParameterRange]))
    -> Maybe [DefaultIntegerHyperParameterRange]
    -> f (Maybe [DefaultIntegerHyperParameterRange]))
-> (Maybe [DefaultIntegerHyperParameterRange]
    -> f (Maybe [DefaultIntegerHyperParameterRange]))
-> DefaultHyperParameterRanges
-> f DefaultHyperParameterRanges
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DefaultIntegerHyperParameterRange]
  [DefaultIntegerHyperParameterRange]
  [DefaultIntegerHyperParameterRange]
  [DefaultIntegerHyperParameterRange]
-> Iso
     (Maybe [DefaultIntegerHyperParameterRange])
     (Maybe [DefaultIntegerHyperParameterRange])
     (Maybe [DefaultIntegerHyperParameterRange])
     (Maybe [DefaultIntegerHyperParameterRange])
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
  [DefaultIntegerHyperParameterRange]
  [DefaultIntegerHyperParameterRange]
  [DefaultIntegerHyperParameterRange]
  [DefaultIntegerHyperParameterRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The categorical hyperparameters and their default ranges.
defaultHyperParameterRanges_categoricalHyperParameterRanges :: Lens.Lens' DefaultHyperParameterRanges (Prelude.Maybe [DefaultCategoricalHyperParameterRange])
defaultHyperParameterRanges_categoricalHyperParameterRanges :: (Maybe [DefaultCategoricalHyperParameterRange]
 -> f (Maybe [DefaultCategoricalHyperParameterRange]))
-> DefaultHyperParameterRanges -> f DefaultHyperParameterRanges
defaultHyperParameterRanges_categoricalHyperParameterRanges = (DefaultHyperParameterRanges
 -> Maybe [DefaultCategoricalHyperParameterRange])
-> (DefaultHyperParameterRanges
    -> Maybe [DefaultCategoricalHyperParameterRange]
    -> DefaultHyperParameterRanges)
-> Lens
     DefaultHyperParameterRanges
     DefaultHyperParameterRanges
     (Maybe [DefaultCategoricalHyperParameterRange])
     (Maybe [DefaultCategoricalHyperParameterRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultHyperParameterRanges' {Maybe [DefaultCategoricalHyperParameterRange]
categoricalHyperParameterRanges :: Maybe [DefaultCategoricalHyperParameterRange]
$sel:categoricalHyperParameterRanges:DefaultHyperParameterRanges' :: DefaultHyperParameterRanges
-> Maybe [DefaultCategoricalHyperParameterRange]
categoricalHyperParameterRanges} -> Maybe [DefaultCategoricalHyperParameterRange]
categoricalHyperParameterRanges) (\s :: DefaultHyperParameterRanges
s@DefaultHyperParameterRanges' {} Maybe [DefaultCategoricalHyperParameterRange]
a -> DefaultHyperParameterRanges
s {$sel:categoricalHyperParameterRanges:DefaultHyperParameterRanges' :: Maybe [DefaultCategoricalHyperParameterRange]
categoricalHyperParameterRanges = Maybe [DefaultCategoricalHyperParameterRange]
a} :: DefaultHyperParameterRanges) ((Maybe [DefaultCategoricalHyperParameterRange]
  -> f (Maybe [DefaultCategoricalHyperParameterRange]))
 -> DefaultHyperParameterRanges -> f DefaultHyperParameterRanges)
-> ((Maybe [DefaultCategoricalHyperParameterRange]
     -> f (Maybe [DefaultCategoricalHyperParameterRange]))
    -> Maybe [DefaultCategoricalHyperParameterRange]
    -> f (Maybe [DefaultCategoricalHyperParameterRange]))
-> (Maybe [DefaultCategoricalHyperParameterRange]
    -> f (Maybe [DefaultCategoricalHyperParameterRange]))
-> DefaultHyperParameterRanges
-> f DefaultHyperParameterRanges
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DefaultCategoricalHyperParameterRange]
  [DefaultCategoricalHyperParameterRange]
  [DefaultCategoricalHyperParameterRange]
  [DefaultCategoricalHyperParameterRange]
-> Iso
     (Maybe [DefaultCategoricalHyperParameterRange])
     (Maybe [DefaultCategoricalHyperParameterRange])
     (Maybe [DefaultCategoricalHyperParameterRange])
     (Maybe [DefaultCategoricalHyperParameterRange])
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
  [DefaultCategoricalHyperParameterRange]
  [DefaultCategoricalHyperParameterRange]
  [DefaultCategoricalHyperParameterRange]
  [DefaultCategoricalHyperParameterRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The continuous hyperparameters and their default ranges.
defaultHyperParameterRanges_continuousHyperParameterRanges :: Lens.Lens' DefaultHyperParameterRanges (Prelude.Maybe [DefaultContinuousHyperParameterRange])
defaultHyperParameterRanges_continuousHyperParameterRanges :: (Maybe [DefaultContinuousHyperParameterRange]
 -> f (Maybe [DefaultContinuousHyperParameterRange]))
-> DefaultHyperParameterRanges -> f DefaultHyperParameterRanges
defaultHyperParameterRanges_continuousHyperParameterRanges = (DefaultHyperParameterRanges
 -> Maybe [DefaultContinuousHyperParameterRange])
-> (DefaultHyperParameterRanges
    -> Maybe [DefaultContinuousHyperParameterRange]
    -> DefaultHyperParameterRanges)
-> Lens
     DefaultHyperParameterRanges
     DefaultHyperParameterRanges
     (Maybe [DefaultContinuousHyperParameterRange])
     (Maybe [DefaultContinuousHyperParameterRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DefaultHyperParameterRanges' {Maybe [DefaultContinuousHyperParameterRange]
continuousHyperParameterRanges :: Maybe [DefaultContinuousHyperParameterRange]
$sel:continuousHyperParameterRanges:DefaultHyperParameterRanges' :: DefaultHyperParameterRanges
-> Maybe [DefaultContinuousHyperParameterRange]
continuousHyperParameterRanges} -> Maybe [DefaultContinuousHyperParameterRange]
continuousHyperParameterRanges) (\s :: DefaultHyperParameterRanges
s@DefaultHyperParameterRanges' {} Maybe [DefaultContinuousHyperParameterRange]
a -> DefaultHyperParameterRanges
s {$sel:continuousHyperParameterRanges:DefaultHyperParameterRanges' :: Maybe [DefaultContinuousHyperParameterRange]
continuousHyperParameterRanges = Maybe [DefaultContinuousHyperParameterRange]
a} :: DefaultHyperParameterRanges) ((Maybe [DefaultContinuousHyperParameterRange]
  -> f (Maybe [DefaultContinuousHyperParameterRange]))
 -> DefaultHyperParameterRanges -> f DefaultHyperParameterRanges)
-> ((Maybe [DefaultContinuousHyperParameterRange]
     -> f (Maybe [DefaultContinuousHyperParameterRange]))
    -> Maybe [DefaultContinuousHyperParameterRange]
    -> f (Maybe [DefaultContinuousHyperParameterRange]))
-> (Maybe [DefaultContinuousHyperParameterRange]
    -> f (Maybe [DefaultContinuousHyperParameterRange]))
-> DefaultHyperParameterRanges
-> f DefaultHyperParameterRanges
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DefaultContinuousHyperParameterRange]
  [DefaultContinuousHyperParameterRange]
  [DefaultContinuousHyperParameterRange]
  [DefaultContinuousHyperParameterRange]
-> Iso
     (Maybe [DefaultContinuousHyperParameterRange])
     (Maybe [DefaultContinuousHyperParameterRange])
     (Maybe [DefaultContinuousHyperParameterRange])
     (Maybe [DefaultContinuousHyperParameterRange])
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
  [DefaultContinuousHyperParameterRange]
  [DefaultContinuousHyperParameterRange]
  [DefaultContinuousHyperParameterRange]
  [DefaultContinuousHyperParameterRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON DefaultHyperParameterRanges where
  parseJSON :: Value -> Parser DefaultHyperParameterRanges
parseJSON =
    String
-> (Object -> Parser DefaultHyperParameterRanges)
-> Value
-> Parser DefaultHyperParameterRanges
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DefaultHyperParameterRanges"
      ( \Object
x ->
          Maybe [DefaultIntegerHyperParameterRange]
-> Maybe [DefaultCategoricalHyperParameterRange]
-> Maybe [DefaultContinuousHyperParameterRange]
-> DefaultHyperParameterRanges
DefaultHyperParameterRanges'
            (Maybe [DefaultIntegerHyperParameterRange]
 -> Maybe [DefaultCategoricalHyperParameterRange]
 -> Maybe [DefaultContinuousHyperParameterRange]
 -> DefaultHyperParameterRanges)
-> Parser (Maybe [DefaultIntegerHyperParameterRange])
-> Parser
     (Maybe [DefaultCategoricalHyperParameterRange]
      -> Maybe [DefaultContinuousHyperParameterRange]
      -> DefaultHyperParameterRanges)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [DefaultIntegerHyperParameterRange]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"integerHyperParameterRanges"
                            Parser (Maybe (Maybe [DefaultIntegerHyperParameterRange]))
-> Maybe [DefaultIntegerHyperParameterRange]
-> Parser (Maybe [DefaultIntegerHyperParameterRange])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DefaultIntegerHyperParameterRange]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [DefaultCategoricalHyperParameterRange]
   -> Maybe [DefaultContinuousHyperParameterRange]
   -> DefaultHyperParameterRanges)
-> Parser (Maybe [DefaultCategoricalHyperParameterRange])
-> Parser
     (Maybe [DefaultContinuousHyperParameterRange]
      -> DefaultHyperParameterRanges)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [DefaultCategoricalHyperParameterRange]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"categoricalHyperParameterRanges"
                            Parser (Maybe (Maybe [DefaultCategoricalHyperParameterRange]))
-> Maybe [DefaultCategoricalHyperParameterRange]
-> Parser (Maybe [DefaultCategoricalHyperParameterRange])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DefaultCategoricalHyperParameterRange]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [DefaultContinuousHyperParameterRange]
   -> DefaultHyperParameterRanges)
-> Parser (Maybe [DefaultContinuousHyperParameterRange])
-> Parser DefaultHyperParameterRanges
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe [DefaultContinuousHyperParameterRange]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"continuousHyperParameterRanges"
                            Parser (Maybe (Maybe [DefaultContinuousHyperParameterRange]))
-> Maybe [DefaultContinuousHyperParameterRange]
-> Parser (Maybe [DefaultContinuousHyperParameterRange])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DefaultContinuousHyperParameterRange]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable DefaultHyperParameterRanges

instance Prelude.NFData DefaultHyperParameterRanges