{-# 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.SageMaker.Types.AlgorithmSpecification
-- 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.SageMaker.Types.AlgorithmSpecification where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.MetricDefinition
import Amazonka.SageMaker.Types.TrainingInputMode

-- | Specifies the training algorithm to use in a CreateTrainingJob request.
--
-- For more information about algorithms provided by Amazon SageMaker, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
-- For information about using your own algorithms, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
--
-- /See:/ 'newAlgorithmSpecification' smart constructor.
data AlgorithmSpecification = AlgorithmSpecification'
  { -- | To generate and save time-series metrics during training, set to @true@.
    -- The default is @false@ and time-series metrics aren\'t generated except
    -- in the following cases:
    --
    -- -   You use one of the Amazon SageMaker built-in algorithms
    --
    -- -   You use one of the following
    --     <https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html Prebuilt Amazon SageMaker Docker Images>:
    --
    --     -   Tensorflow (version >= 1.15)
    --
    --     -   MXNet (version >= 1.6)
    --
    --     -   PyTorch (version >= 1.3)
    --
    -- -   You specify at least one MetricDefinition
    AlgorithmSpecification -> Maybe Bool
enableSageMakerMetricsTimeSeries :: Prelude.Maybe Prelude.Bool,
    -- | The name of the algorithm resource to use for the training job. This
    -- must be an algorithm resource that you created or subscribe to on Amazon
    -- Web Services Marketplace. If you specify a value for this parameter, you
    -- can\'t specify a value for @TrainingImage@.
    AlgorithmSpecification -> Maybe Text
algorithmName :: Prelude.Maybe Prelude.Text,
    -- | The registry path of the Docker image that contains the training
    -- algorithm. For information about docker registry paths for built-in
    -- algorithms, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html Algorithms Provided by Amazon SageMaker: Common Parameters>.
    -- Amazon SageMaker supports both @registry\/repository[:tag]@ and
    -- @registry\/repository[\@digest]@ image path formats. For more
    -- information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
    AlgorithmSpecification -> Maybe Text
trainingImage :: Prelude.Maybe Prelude.Text,
    -- | A list of metric definition objects. Each object specifies the metric
    -- name and regular expressions used to parse algorithm logs. Amazon
    -- SageMaker publishes each metric to Amazon CloudWatch.
    AlgorithmSpecification -> Maybe [MetricDefinition]
metricDefinitions :: Prelude.Maybe [MetricDefinition],
    AlgorithmSpecification -> TrainingInputMode
trainingInputMode :: TrainingInputMode
  }
  deriving (AlgorithmSpecification -> AlgorithmSpecification -> Bool
(AlgorithmSpecification -> AlgorithmSpecification -> Bool)
-> (AlgorithmSpecification -> AlgorithmSpecification -> Bool)
-> Eq AlgorithmSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlgorithmSpecification -> AlgorithmSpecification -> Bool
$c/= :: AlgorithmSpecification -> AlgorithmSpecification -> Bool
== :: AlgorithmSpecification -> AlgorithmSpecification -> Bool
$c== :: AlgorithmSpecification -> AlgorithmSpecification -> Bool
Prelude.Eq, ReadPrec [AlgorithmSpecification]
ReadPrec AlgorithmSpecification
Int -> ReadS AlgorithmSpecification
ReadS [AlgorithmSpecification]
(Int -> ReadS AlgorithmSpecification)
-> ReadS [AlgorithmSpecification]
-> ReadPrec AlgorithmSpecification
-> ReadPrec [AlgorithmSpecification]
-> Read AlgorithmSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AlgorithmSpecification]
$creadListPrec :: ReadPrec [AlgorithmSpecification]
readPrec :: ReadPrec AlgorithmSpecification
$creadPrec :: ReadPrec AlgorithmSpecification
readList :: ReadS [AlgorithmSpecification]
$creadList :: ReadS [AlgorithmSpecification]
readsPrec :: Int -> ReadS AlgorithmSpecification
$creadsPrec :: Int -> ReadS AlgorithmSpecification
Prelude.Read, Int -> AlgorithmSpecification -> ShowS
[AlgorithmSpecification] -> ShowS
AlgorithmSpecification -> String
(Int -> AlgorithmSpecification -> ShowS)
-> (AlgorithmSpecification -> String)
-> ([AlgorithmSpecification] -> ShowS)
-> Show AlgorithmSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlgorithmSpecification] -> ShowS
$cshowList :: [AlgorithmSpecification] -> ShowS
show :: AlgorithmSpecification -> String
$cshow :: AlgorithmSpecification -> String
showsPrec :: Int -> AlgorithmSpecification -> ShowS
$cshowsPrec :: Int -> AlgorithmSpecification -> ShowS
Prelude.Show, (forall x. AlgorithmSpecification -> Rep AlgorithmSpecification x)
-> (forall x.
    Rep AlgorithmSpecification x -> AlgorithmSpecification)
-> Generic AlgorithmSpecification
forall x. Rep AlgorithmSpecification x -> AlgorithmSpecification
forall x. AlgorithmSpecification -> Rep AlgorithmSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlgorithmSpecification x -> AlgorithmSpecification
$cfrom :: forall x. AlgorithmSpecification -> Rep AlgorithmSpecification x
Prelude.Generic)

-- |
-- Create a value of 'AlgorithmSpecification' 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:
--
-- 'enableSageMakerMetricsTimeSeries', 'algorithmSpecification_enableSageMakerMetricsTimeSeries' - To generate and save time-series metrics during training, set to @true@.
-- The default is @false@ and time-series metrics aren\'t generated except
-- in the following cases:
--
-- -   You use one of the Amazon SageMaker built-in algorithms
--
-- -   You use one of the following
--     <https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html Prebuilt Amazon SageMaker Docker Images>:
--
--     -   Tensorflow (version >= 1.15)
--
--     -   MXNet (version >= 1.6)
--
--     -   PyTorch (version >= 1.3)
--
-- -   You specify at least one MetricDefinition
--
-- 'algorithmName', 'algorithmSpecification_algorithmName' - The name of the algorithm resource to use for the training job. This
-- must be an algorithm resource that you created or subscribe to on Amazon
-- Web Services Marketplace. If you specify a value for this parameter, you
-- can\'t specify a value for @TrainingImage@.
--
-- 'trainingImage', 'algorithmSpecification_trainingImage' - The registry path of the Docker image that contains the training
-- algorithm. For information about docker registry paths for built-in
-- algorithms, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html Algorithms Provided by Amazon SageMaker: Common Parameters>.
-- Amazon SageMaker supports both @registry\/repository[:tag]@ and
-- @registry\/repository[\@digest]@ image path formats. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
--
-- 'metricDefinitions', 'algorithmSpecification_metricDefinitions' - A list of metric definition objects. Each object specifies the metric
-- name and regular expressions used to parse algorithm logs. Amazon
-- SageMaker publishes each metric to Amazon CloudWatch.
--
-- 'trainingInputMode', 'algorithmSpecification_trainingInputMode' - Undocumented member.
newAlgorithmSpecification ::
  -- | 'trainingInputMode'
  TrainingInputMode ->
  AlgorithmSpecification
newAlgorithmSpecification :: TrainingInputMode -> AlgorithmSpecification
newAlgorithmSpecification TrainingInputMode
pTrainingInputMode_ =
  AlgorithmSpecification' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [MetricDefinition]
-> TrainingInputMode
-> AlgorithmSpecification
AlgorithmSpecification'
    { $sel:enableSageMakerMetricsTimeSeries:AlgorithmSpecification' :: Maybe Bool
enableSageMakerMetricsTimeSeries =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:algorithmName:AlgorithmSpecification' :: Maybe Text
algorithmName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trainingImage:AlgorithmSpecification' :: Maybe Text
trainingImage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:metricDefinitions:AlgorithmSpecification' :: Maybe [MetricDefinition]
metricDefinitions = Maybe [MetricDefinition]
forall a. Maybe a
Prelude.Nothing,
      $sel:trainingInputMode:AlgorithmSpecification' :: TrainingInputMode
trainingInputMode = TrainingInputMode
pTrainingInputMode_
    }

-- | To generate and save time-series metrics during training, set to @true@.
-- The default is @false@ and time-series metrics aren\'t generated except
-- in the following cases:
--
-- -   You use one of the Amazon SageMaker built-in algorithms
--
-- -   You use one of the following
--     <https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html Prebuilt Amazon SageMaker Docker Images>:
--
--     -   Tensorflow (version >= 1.15)
--
--     -   MXNet (version >= 1.6)
--
--     -   PyTorch (version >= 1.3)
--
-- -   You specify at least one MetricDefinition
algorithmSpecification_enableSageMakerMetricsTimeSeries :: Lens.Lens' AlgorithmSpecification (Prelude.Maybe Prelude.Bool)
algorithmSpecification_enableSageMakerMetricsTimeSeries :: (Maybe Bool -> f (Maybe Bool))
-> AlgorithmSpecification -> f AlgorithmSpecification
algorithmSpecification_enableSageMakerMetricsTimeSeries = (AlgorithmSpecification -> Maybe Bool)
-> (AlgorithmSpecification -> Maybe Bool -> AlgorithmSpecification)
-> Lens
     AlgorithmSpecification
     AlgorithmSpecification
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSpecification' {Maybe Bool
enableSageMakerMetricsTimeSeries :: Maybe Bool
$sel:enableSageMakerMetricsTimeSeries:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe Bool
enableSageMakerMetricsTimeSeries} -> Maybe Bool
enableSageMakerMetricsTimeSeries) (\s :: AlgorithmSpecification
s@AlgorithmSpecification' {} Maybe Bool
a -> AlgorithmSpecification
s {$sel:enableSageMakerMetricsTimeSeries:AlgorithmSpecification' :: Maybe Bool
enableSageMakerMetricsTimeSeries = Maybe Bool
a} :: AlgorithmSpecification)

-- | The name of the algorithm resource to use for the training job. This
-- must be an algorithm resource that you created or subscribe to on Amazon
-- Web Services Marketplace. If you specify a value for this parameter, you
-- can\'t specify a value for @TrainingImage@.
algorithmSpecification_algorithmName :: Lens.Lens' AlgorithmSpecification (Prelude.Maybe Prelude.Text)
algorithmSpecification_algorithmName :: (Maybe Text -> f (Maybe Text))
-> AlgorithmSpecification -> f AlgorithmSpecification
algorithmSpecification_algorithmName = (AlgorithmSpecification -> Maybe Text)
-> (AlgorithmSpecification -> Maybe Text -> AlgorithmSpecification)
-> Lens
     AlgorithmSpecification
     AlgorithmSpecification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSpecification' {Maybe Text
algorithmName :: Maybe Text
$sel:algorithmName:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe Text
algorithmName} -> Maybe Text
algorithmName) (\s :: AlgorithmSpecification
s@AlgorithmSpecification' {} Maybe Text
a -> AlgorithmSpecification
s {$sel:algorithmName:AlgorithmSpecification' :: Maybe Text
algorithmName = Maybe Text
a} :: AlgorithmSpecification)

-- | The registry path of the Docker image that contains the training
-- algorithm. For information about docker registry paths for built-in
-- algorithms, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html Algorithms Provided by Amazon SageMaker: Common Parameters>.
-- Amazon SageMaker supports both @registry\/repository[:tag]@ and
-- @registry\/repository[\@digest]@ image path formats. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
algorithmSpecification_trainingImage :: Lens.Lens' AlgorithmSpecification (Prelude.Maybe Prelude.Text)
algorithmSpecification_trainingImage :: (Maybe Text -> f (Maybe Text))
-> AlgorithmSpecification -> f AlgorithmSpecification
algorithmSpecification_trainingImage = (AlgorithmSpecification -> Maybe Text)
-> (AlgorithmSpecification -> Maybe Text -> AlgorithmSpecification)
-> Lens
     AlgorithmSpecification
     AlgorithmSpecification
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSpecification' {Maybe Text
trainingImage :: Maybe Text
$sel:trainingImage:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe Text
trainingImage} -> Maybe Text
trainingImage) (\s :: AlgorithmSpecification
s@AlgorithmSpecification' {} Maybe Text
a -> AlgorithmSpecification
s {$sel:trainingImage:AlgorithmSpecification' :: Maybe Text
trainingImage = Maybe Text
a} :: AlgorithmSpecification)

-- | A list of metric definition objects. Each object specifies the metric
-- name and regular expressions used to parse algorithm logs. Amazon
-- SageMaker publishes each metric to Amazon CloudWatch.
algorithmSpecification_metricDefinitions :: Lens.Lens' AlgorithmSpecification (Prelude.Maybe [MetricDefinition])
algorithmSpecification_metricDefinitions :: (Maybe [MetricDefinition] -> f (Maybe [MetricDefinition]))
-> AlgorithmSpecification -> f AlgorithmSpecification
algorithmSpecification_metricDefinitions = (AlgorithmSpecification -> Maybe [MetricDefinition])
-> (AlgorithmSpecification
    -> Maybe [MetricDefinition] -> AlgorithmSpecification)
-> Lens
     AlgorithmSpecification
     AlgorithmSpecification
     (Maybe [MetricDefinition])
     (Maybe [MetricDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSpecification' {Maybe [MetricDefinition]
metricDefinitions :: Maybe [MetricDefinition]
$sel:metricDefinitions:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe [MetricDefinition]
metricDefinitions} -> Maybe [MetricDefinition]
metricDefinitions) (\s :: AlgorithmSpecification
s@AlgorithmSpecification' {} Maybe [MetricDefinition]
a -> AlgorithmSpecification
s {$sel:metricDefinitions:AlgorithmSpecification' :: Maybe [MetricDefinition]
metricDefinitions = Maybe [MetricDefinition]
a} :: AlgorithmSpecification) ((Maybe [MetricDefinition] -> f (Maybe [MetricDefinition]))
 -> AlgorithmSpecification -> f AlgorithmSpecification)
-> ((Maybe [MetricDefinition] -> f (Maybe [MetricDefinition]))
    -> Maybe [MetricDefinition] -> f (Maybe [MetricDefinition]))
-> (Maybe [MetricDefinition] -> f (Maybe [MetricDefinition]))
-> AlgorithmSpecification
-> f AlgorithmSpecification
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricDefinition]
  [MetricDefinition]
  [MetricDefinition]
  [MetricDefinition]
-> Iso
     (Maybe [MetricDefinition])
     (Maybe [MetricDefinition])
     (Maybe [MetricDefinition])
     (Maybe [MetricDefinition])
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
  [MetricDefinition]
  [MetricDefinition]
  [MetricDefinition]
  [MetricDefinition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
algorithmSpecification_trainingInputMode :: Lens.Lens' AlgorithmSpecification TrainingInputMode
algorithmSpecification_trainingInputMode :: (TrainingInputMode -> f TrainingInputMode)
-> AlgorithmSpecification -> f AlgorithmSpecification
algorithmSpecification_trainingInputMode = (AlgorithmSpecification -> TrainingInputMode)
-> (AlgorithmSpecification
    -> TrainingInputMode -> AlgorithmSpecification)
-> Lens
     AlgorithmSpecification
     AlgorithmSpecification
     TrainingInputMode
     TrainingInputMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSpecification' {TrainingInputMode
trainingInputMode :: TrainingInputMode
$sel:trainingInputMode:AlgorithmSpecification' :: AlgorithmSpecification -> TrainingInputMode
trainingInputMode} -> TrainingInputMode
trainingInputMode) (\s :: AlgorithmSpecification
s@AlgorithmSpecification' {} TrainingInputMode
a -> AlgorithmSpecification
s {$sel:trainingInputMode:AlgorithmSpecification' :: TrainingInputMode
trainingInputMode = TrainingInputMode
a} :: AlgorithmSpecification)

instance Core.FromJSON AlgorithmSpecification where
  parseJSON :: Value -> Parser AlgorithmSpecification
parseJSON =
    String
-> (Object -> Parser AlgorithmSpecification)
-> Value
-> Parser AlgorithmSpecification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AlgorithmSpecification"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [MetricDefinition]
-> TrainingInputMode
-> AlgorithmSpecification
AlgorithmSpecification'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe [MetricDefinition]
 -> TrainingInputMode
 -> AlgorithmSpecification)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [MetricDefinition]
      -> TrainingInputMode
      -> AlgorithmSpecification)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnableSageMakerMetricsTimeSeries")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [MetricDefinition]
   -> TrainingInputMode
   -> AlgorithmSpecification)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [MetricDefinition]
      -> TrainingInputMode
      -> AlgorithmSpecification)
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
"AlgorithmName")
            Parser
  (Maybe Text
   -> Maybe [MetricDefinition]
   -> TrainingInputMode
   -> AlgorithmSpecification)
-> Parser (Maybe Text)
-> Parser
     (Maybe [MetricDefinition]
      -> TrainingInputMode -> AlgorithmSpecification)
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
"TrainingImage")
            Parser
  (Maybe [MetricDefinition]
   -> TrainingInputMode -> AlgorithmSpecification)
-> Parser (Maybe [MetricDefinition])
-> Parser (TrainingInputMode -> AlgorithmSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [MetricDefinition]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MetricDefinitions"
                            Parser (Maybe (Maybe [MetricDefinition]))
-> Maybe [MetricDefinition] -> Parser (Maybe [MetricDefinition])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MetricDefinition]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (TrainingInputMode -> AlgorithmSpecification)
-> Parser TrainingInputMode -> Parser AlgorithmSpecification
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TrainingInputMode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TrainingInputMode")
      )

instance Prelude.Hashable AlgorithmSpecification

instance Prelude.NFData AlgorithmSpecification

instance Core.ToJSON AlgorithmSpecification where
  toJSON :: AlgorithmSpecification -> Value
toJSON AlgorithmSpecification' {Maybe Bool
Maybe [MetricDefinition]
Maybe Text
TrainingInputMode
trainingInputMode :: TrainingInputMode
metricDefinitions :: Maybe [MetricDefinition]
trainingImage :: Maybe Text
algorithmName :: Maybe Text
enableSageMakerMetricsTimeSeries :: Maybe Bool
$sel:trainingInputMode:AlgorithmSpecification' :: AlgorithmSpecification -> TrainingInputMode
$sel:metricDefinitions:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe [MetricDefinition]
$sel:trainingImage:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe Text
$sel:algorithmName:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe Text
$sel:enableSageMakerMetricsTimeSeries:AlgorithmSpecification' :: AlgorithmSpecification -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"EnableSageMakerMetricsTimeSeries" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableSageMakerMetricsTimeSeries,
            (Text
"AlgorithmName" 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
algorithmName,
            (Text
"TrainingImage" 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
trainingImage,
            (Text
"MetricDefinitions" Text -> [MetricDefinition] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([MetricDefinition] -> Pair)
-> Maybe [MetricDefinition] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDefinition]
metricDefinitions,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TrainingInputMode" Text -> TrainingInputMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TrainingInputMode
trainingInputMode)
          ]
      )