{-# 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.Algorithm
-- 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.Algorithm where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types.AlgorithmImage
import Amazonka.Personalize.Types.DefaultHyperParameterRanges
import qualified Amazonka.Prelude as Prelude

-- | Describes a custom algorithm.
--
-- /See:/ 'newAlgorithm' smart constructor.
data Algorithm = Algorithm'
  { -- | Specifies the default hyperparameters.
    Algorithm -> Maybe (HashMap Text Text)
defaultHyperParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the algorithm.
    Algorithm -> Maybe Text
algorithmArn :: Prelude.Maybe Prelude.Text,
    -- | The training input mode.
    Algorithm -> Maybe Text
trainingInputMode :: Prelude.Maybe Prelude.Text,
    -- | Specifies the default hyperparameters, their ranges, and whether they
    -- are tunable. A tunable hyperparameter can have its value determined
    -- during hyperparameter optimization (HPO).
    Algorithm -> Maybe DefaultHyperParameterRanges
defaultHyperParameterRanges :: Prelude.Maybe DefaultHyperParameterRanges,
    -- | The URI of the Docker container for the algorithm image.
    Algorithm -> Maybe AlgorithmImage
algorithmImage :: Prelude.Maybe AlgorithmImage,
    -- | The date and time (in Unix time) that the algorithm was last updated.
    Algorithm -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the algorithm.
    Algorithm -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the algorithm was created.
    Algorithm -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
    -- | Specifies the default maximum number of training jobs and parallel
    -- training jobs.
    Algorithm -> Maybe (HashMap Text Text)
defaultResourceConfig :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the role.
    Algorithm -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (Algorithm -> Algorithm -> Bool
(Algorithm -> Algorithm -> Bool)
-> (Algorithm -> Algorithm -> Bool) -> Eq Algorithm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Algorithm -> Algorithm -> Bool
$c/= :: Algorithm -> Algorithm -> Bool
== :: Algorithm -> Algorithm -> Bool
$c== :: Algorithm -> Algorithm -> Bool
Prelude.Eq, ReadPrec [Algorithm]
ReadPrec Algorithm
Int -> ReadS Algorithm
ReadS [Algorithm]
(Int -> ReadS Algorithm)
-> ReadS [Algorithm]
-> ReadPrec Algorithm
-> ReadPrec [Algorithm]
-> Read Algorithm
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Algorithm]
$creadListPrec :: ReadPrec [Algorithm]
readPrec :: ReadPrec Algorithm
$creadPrec :: ReadPrec Algorithm
readList :: ReadS [Algorithm]
$creadList :: ReadS [Algorithm]
readsPrec :: Int -> ReadS Algorithm
$creadsPrec :: Int -> ReadS Algorithm
Prelude.Read, Int -> Algorithm -> ShowS
[Algorithm] -> ShowS
Algorithm -> String
(Int -> Algorithm -> ShowS)
-> (Algorithm -> String)
-> ([Algorithm] -> ShowS)
-> Show Algorithm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Algorithm] -> ShowS
$cshowList :: [Algorithm] -> ShowS
show :: Algorithm -> String
$cshow :: Algorithm -> String
showsPrec :: Int -> Algorithm -> ShowS
$cshowsPrec :: Int -> Algorithm -> ShowS
Prelude.Show, (forall x. Algorithm -> Rep Algorithm x)
-> (forall x. Rep Algorithm x -> Algorithm) -> Generic Algorithm
forall x. Rep Algorithm x -> Algorithm
forall x. Algorithm -> Rep Algorithm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Algorithm x -> Algorithm
$cfrom :: forall x. Algorithm -> Rep Algorithm x
Prelude.Generic)

-- |
-- Create a value of 'Algorithm' 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:
--
-- 'defaultHyperParameters', 'algorithm_defaultHyperParameters' - Specifies the default hyperparameters.
--
-- 'algorithmArn', 'algorithm_algorithmArn' - The Amazon Resource Name (ARN) of the algorithm.
--
-- 'trainingInputMode', 'algorithm_trainingInputMode' - The training input mode.
--
-- 'defaultHyperParameterRanges', 'algorithm_defaultHyperParameterRanges' - Specifies the default hyperparameters, their ranges, and whether they
-- are tunable. A tunable hyperparameter can have its value determined
-- during hyperparameter optimization (HPO).
--
-- 'algorithmImage', 'algorithm_algorithmImage' - The URI of the Docker container for the algorithm image.
--
-- 'lastUpdatedDateTime', 'algorithm_lastUpdatedDateTime' - The date and time (in Unix time) that the algorithm was last updated.
--
-- 'name', 'algorithm_name' - The name of the algorithm.
--
-- 'creationDateTime', 'algorithm_creationDateTime' - The date and time (in Unix time) that the algorithm was created.
--
-- 'defaultResourceConfig', 'algorithm_defaultResourceConfig' - Specifies the default maximum number of training jobs and parallel
-- training jobs.
--
-- 'roleArn', 'algorithm_roleArn' - The Amazon Resource Name (ARN) of the role.
newAlgorithm ::
  Algorithm
newAlgorithm :: Algorithm
newAlgorithm =
  Algorithm' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe DefaultHyperParameterRanges
-> Maybe AlgorithmImage
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Algorithm
Algorithm'
    { $sel:defaultHyperParameters:Algorithm' :: Maybe (HashMap Text Text)
defaultHyperParameters =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:algorithmArn:Algorithm' :: Maybe Text
algorithmArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trainingInputMode:Algorithm' :: Maybe Text
trainingInputMode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultHyperParameterRanges:Algorithm' :: Maybe DefaultHyperParameterRanges
defaultHyperParameterRanges = Maybe DefaultHyperParameterRanges
forall a. Maybe a
Prelude.Nothing,
      $sel:algorithmImage:Algorithm' :: Maybe AlgorithmImage
algorithmImage = Maybe AlgorithmImage
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:Algorithm' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Algorithm' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:Algorithm' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultResourceConfig:Algorithm' :: Maybe (HashMap Text Text)
defaultResourceConfig = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:Algorithm' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the default hyperparameters.
algorithm_defaultHyperParameters :: Lens.Lens' Algorithm (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
algorithm_defaultHyperParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Algorithm -> f Algorithm
algorithm_defaultHyperParameters = (Algorithm -> Maybe (HashMap Text Text))
-> (Algorithm -> Maybe (HashMap Text Text) -> Algorithm)
-> Lens
     Algorithm
     Algorithm
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe (HashMap Text Text)
defaultHyperParameters :: Maybe (HashMap Text Text)
$sel:defaultHyperParameters:Algorithm' :: Algorithm -> Maybe (HashMap Text Text)
defaultHyperParameters} -> Maybe (HashMap Text Text)
defaultHyperParameters) (\s :: Algorithm
s@Algorithm' {} Maybe (HashMap Text Text)
a -> Algorithm
s {$sel:defaultHyperParameters:Algorithm' :: Maybe (HashMap Text Text)
defaultHyperParameters = Maybe (HashMap Text Text)
a} :: Algorithm) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Algorithm -> f Algorithm)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Algorithm
-> f Algorithm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the algorithm.
algorithm_algorithmArn :: Lens.Lens' Algorithm (Prelude.Maybe Prelude.Text)
algorithm_algorithmArn :: (Maybe Text -> f (Maybe Text)) -> Algorithm -> f Algorithm
algorithm_algorithmArn = (Algorithm -> Maybe Text)
-> (Algorithm -> Maybe Text -> Algorithm)
-> Lens Algorithm Algorithm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe Text
algorithmArn :: Maybe Text
$sel:algorithmArn:Algorithm' :: Algorithm -> Maybe Text
algorithmArn} -> Maybe Text
algorithmArn) (\s :: Algorithm
s@Algorithm' {} Maybe Text
a -> Algorithm
s {$sel:algorithmArn:Algorithm' :: Maybe Text
algorithmArn = Maybe Text
a} :: Algorithm)

-- | The training input mode.
algorithm_trainingInputMode :: Lens.Lens' Algorithm (Prelude.Maybe Prelude.Text)
algorithm_trainingInputMode :: (Maybe Text -> f (Maybe Text)) -> Algorithm -> f Algorithm
algorithm_trainingInputMode = (Algorithm -> Maybe Text)
-> (Algorithm -> Maybe Text -> Algorithm)
-> Lens Algorithm Algorithm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe Text
trainingInputMode :: Maybe Text
$sel:trainingInputMode:Algorithm' :: Algorithm -> Maybe Text
trainingInputMode} -> Maybe Text
trainingInputMode) (\s :: Algorithm
s@Algorithm' {} Maybe Text
a -> Algorithm
s {$sel:trainingInputMode:Algorithm' :: Maybe Text
trainingInputMode = Maybe Text
a} :: Algorithm)

-- | Specifies the default hyperparameters, their ranges, and whether they
-- are tunable. A tunable hyperparameter can have its value determined
-- during hyperparameter optimization (HPO).
algorithm_defaultHyperParameterRanges :: Lens.Lens' Algorithm (Prelude.Maybe DefaultHyperParameterRanges)
algorithm_defaultHyperParameterRanges :: (Maybe DefaultHyperParameterRanges
 -> f (Maybe DefaultHyperParameterRanges))
-> Algorithm -> f Algorithm
algorithm_defaultHyperParameterRanges = (Algorithm -> Maybe DefaultHyperParameterRanges)
-> (Algorithm -> Maybe DefaultHyperParameterRanges -> Algorithm)
-> Lens
     Algorithm
     Algorithm
     (Maybe DefaultHyperParameterRanges)
     (Maybe DefaultHyperParameterRanges)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe DefaultHyperParameterRanges
defaultHyperParameterRanges :: Maybe DefaultHyperParameterRanges
$sel:defaultHyperParameterRanges:Algorithm' :: Algorithm -> Maybe DefaultHyperParameterRanges
defaultHyperParameterRanges} -> Maybe DefaultHyperParameterRanges
defaultHyperParameterRanges) (\s :: Algorithm
s@Algorithm' {} Maybe DefaultHyperParameterRanges
a -> Algorithm
s {$sel:defaultHyperParameterRanges:Algorithm' :: Maybe DefaultHyperParameterRanges
defaultHyperParameterRanges = Maybe DefaultHyperParameterRanges
a} :: Algorithm)

-- | The URI of the Docker container for the algorithm image.
algorithm_algorithmImage :: Lens.Lens' Algorithm (Prelude.Maybe AlgorithmImage)
algorithm_algorithmImage :: (Maybe AlgorithmImage -> f (Maybe AlgorithmImage))
-> Algorithm -> f Algorithm
algorithm_algorithmImage = (Algorithm -> Maybe AlgorithmImage)
-> (Algorithm -> Maybe AlgorithmImage -> Algorithm)
-> Lens
     Algorithm Algorithm (Maybe AlgorithmImage) (Maybe AlgorithmImage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe AlgorithmImage
algorithmImage :: Maybe AlgorithmImage
$sel:algorithmImage:Algorithm' :: Algorithm -> Maybe AlgorithmImage
algorithmImage} -> Maybe AlgorithmImage
algorithmImage) (\s :: Algorithm
s@Algorithm' {} Maybe AlgorithmImage
a -> Algorithm
s {$sel:algorithmImage:Algorithm' :: Maybe AlgorithmImage
algorithmImage = Maybe AlgorithmImage
a} :: Algorithm)

-- | The date and time (in Unix time) that the algorithm was last updated.
algorithm_lastUpdatedDateTime :: Lens.Lens' Algorithm (Prelude.Maybe Prelude.UTCTime)
algorithm_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Algorithm -> f Algorithm
algorithm_lastUpdatedDateTime = (Algorithm -> Maybe POSIX)
-> (Algorithm -> Maybe POSIX -> Algorithm)
-> Lens Algorithm Algorithm (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:Algorithm' :: Algorithm -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: Algorithm
s@Algorithm' {} Maybe POSIX
a -> Algorithm
s {$sel:lastUpdatedDateTime:Algorithm' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: Algorithm) ((Maybe POSIX -> f (Maybe POSIX)) -> Algorithm -> f Algorithm)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Algorithm
-> f Algorithm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the algorithm.
algorithm_name :: Lens.Lens' Algorithm (Prelude.Maybe Prelude.Text)
algorithm_name :: (Maybe Text -> f (Maybe Text)) -> Algorithm -> f Algorithm
algorithm_name = (Algorithm -> Maybe Text)
-> (Algorithm -> Maybe Text -> Algorithm)
-> Lens Algorithm Algorithm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe Text
name :: Maybe Text
$sel:name:Algorithm' :: Algorithm -> Maybe Text
name} -> Maybe Text
name) (\s :: Algorithm
s@Algorithm' {} Maybe Text
a -> Algorithm
s {$sel:name:Algorithm' :: Maybe Text
name = Maybe Text
a} :: Algorithm)

-- | The date and time (in Unix time) that the algorithm was created.
algorithm_creationDateTime :: Lens.Lens' Algorithm (Prelude.Maybe Prelude.UTCTime)
algorithm_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Algorithm -> f Algorithm
algorithm_creationDateTime = (Algorithm -> Maybe POSIX)
-> (Algorithm -> Maybe POSIX -> Algorithm)
-> Lens Algorithm Algorithm (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:Algorithm' :: Algorithm -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: Algorithm
s@Algorithm' {} Maybe POSIX
a -> Algorithm
s {$sel:creationDateTime:Algorithm' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: Algorithm) ((Maybe POSIX -> f (Maybe POSIX)) -> Algorithm -> f Algorithm)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Algorithm
-> f Algorithm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the default maximum number of training jobs and parallel
-- training jobs.
algorithm_defaultResourceConfig :: Lens.Lens' Algorithm (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
algorithm_defaultResourceConfig :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Algorithm -> f Algorithm
algorithm_defaultResourceConfig = (Algorithm -> Maybe (HashMap Text Text))
-> (Algorithm -> Maybe (HashMap Text Text) -> Algorithm)
-> Lens
     Algorithm
     Algorithm
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe (HashMap Text Text)
defaultResourceConfig :: Maybe (HashMap Text Text)
$sel:defaultResourceConfig:Algorithm' :: Algorithm -> Maybe (HashMap Text Text)
defaultResourceConfig} -> Maybe (HashMap Text Text)
defaultResourceConfig) (\s :: Algorithm
s@Algorithm' {} Maybe (HashMap Text Text)
a -> Algorithm
s {$sel:defaultResourceConfig:Algorithm' :: Maybe (HashMap Text Text)
defaultResourceConfig = Maybe (HashMap Text Text)
a} :: Algorithm) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Algorithm -> f Algorithm)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Algorithm
-> f Algorithm
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the role.
algorithm_roleArn :: Lens.Lens' Algorithm (Prelude.Maybe Prelude.Text)
algorithm_roleArn :: (Maybe Text -> f (Maybe Text)) -> Algorithm -> f Algorithm
algorithm_roleArn = (Algorithm -> Maybe Text)
-> (Algorithm -> Maybe Text -> Algorithm)
-> Lens Algorithm Algorithm (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Algorithm' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:Algorithm' :: Algorithm -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: Algorithm
s@Algorithm' {} Maybe Text
a -> Algorithm
s {$sel:roleArn:Algorithm' :: Maybe Text
roleArn = Maybe Text
a} :: Algorithm)

instance Core.FromJSON Algorithm where
  parseJSON :: Value -> Parser Algorithm
parseJSON =
    String -> (Object -> Parser Algorithm) -> Value -> Parser Algorithm
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Algorithm"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe DefaultHyperParameterRanges
-> Maybe AlgorithmImage
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Algorithm
Algorithm'
            (Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe DefaultHyperParameterRanges
 -> Maybe AlgorithmImage
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Algorithm)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe DefaultHyperParameterRanges
      -> Maybe AlgorithmImage
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Algorithm)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultHyperParameters"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe DefaultHyperParameterRanges
   -> Maybe AlgorithmImage
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Algorithm)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe DefaultHyperParameterRanges
      -> Maybe AlgorithmImage
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Algorithm)
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
"algorithmArn")
            Parser
  (Maybe Text
   -> Maybe DefaultHyperParameterRanges
   -> Maybe AlgorithmImage
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Algorithm)
-> Parser (Maybe Text)
-> Parser
     (Maybe DefaultHyperParameterRanges
      -> Maybe AlgorithmImage
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Algorithm)
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
"trainingInputMode")
            Parser
  (Maybe DefaultHyperParameterRanges
   -> Maybe AlgorithmImage
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Algorithm)
-> Parser (Maybe DefaultHyperParameterRanges)
-> Parser
     (Maybe AlgorithmImage
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Algorithm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DefaultHyperParameterRanges)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultHyperParameterRanges")
            Parser
  (Maybe AlgorithmImage
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Algorithm)
-> Parser (Maybe AlgorithmImage)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Algorithm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AlgorithmImage)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"algorithmImage")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Algorithm)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Algorithm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedDateTime")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Algorithm)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe (HashMap Text Text) -> Maybe Text -> Algorithm)
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 POSIX
   -> Maybe (HashMap Text Text) -> Maybe Text -> Algorithm)
-> Parser (Maybe POSIX)
-> Parser (Maybe (HashMap Text Text) -> Maybe Text -> Algorithm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationDateTime")
            Parser (Maybe (HashMap Text Text) -> Maybe Text -> Algorithm)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> Algorithm)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultResourceConfig"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> Algorithm)
-> Parser (Maybe Text) -> Parser Algorithm
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
"roleArn")
      )

instance Prelude.Hashable Algorithm

instance Prelude.NFData Algorithm