{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateTrainingJob
-- 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)
--
-- Starts a model training job. After training completes, Amazon SageMaker
-- saves the resulting model artifacts to an Amazon S3 location that you
-- specify.
--
-- If you choose to host your model using Amazon SageMaker hosting
-- services, you can use the resulting model artifacts as part of the
-- model. You can also use the artifacts in a machine learning service
-- other than Amazon SageMaker, provided that you know how to use them for
-- inference.
--
-- In the request body, you provide the following:
--
-- -   @AlgorithmSpecification@ - Identifies the training algorithm to use.
--
-- -   @HyperParameters@ - Specify these algorithm-specific parameters to
--     enable the estimation of model parameters during training.
--     Hyperparameters can be tuned to optimize this learning process. For
--     a list of hyperparameters for each training algorithm provided by
--     Amazon SageMaker, see
--     <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
--
-- -   @InputDataConfig@ - Describes the training dataset and the Amazon
--     S3, EFS, or FSx location where it is stored.
--
-- -   @OutputDataConfig@ - Identifies the Amazon S3 bucket where you want
--     Amazon SageMaker to save the results of model training.
--
-- -   @ResourceConfig@ - Identifies the resources, ML compute instances,
--     and ML storage volumes to deploy for model training. In distributed
--     training, you specify more than one instance.
--
-- -   @EnableManagedSpotTraining@ - Optimize the cost of training machine
--     learning models by up to 80% by using Amazon EC2 Spot instances. For
--     more information, see
--     <https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html Managed Spot Training>.
--
-- -   @RoleArn@ - The Amazon Resource Name (ARN) that Amazon SageMaker
--     assumes to perform tasks on your behalf during model training. You
--     must grant this role the necessary permissions so that Amazon
--     SageMaker can successfully complete model training.
--
-- -   @StoppingCondition@ - To help cap training costs, use
--     @MaxRuntimeInSeconds@ to set a time limit for training. Use
--     @MaxWaitTimeInSeconds@ to specify how long a managed spot training
--     job has to complete.
--
-- -   @Environment@ - The environment variables to set in the Docker
--     container.
--
-- -   @RetryStrategy@ - The number of times to retry the job when the job
--     fails due to an @InternalServerError@.
--
-- For more information about Amazon SageMaker, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works.html How It Works>.
module Amazonka.SageMaker.CreateTrainingJob
  ( -- * Creating a Request
    CreateTrainingJob (..),
    newCreateTrainingJob,

    -- * Request Lenses
    createTrainingJob_environment,
    createTrainingJob_debugHookConfig,
    createTrainingJob_checkpointConfig,
    createTrainingJob_retryStrategy,
    createTrainingJob_profilerConfig,
    createTrainingJob_enableNetworkIsolation,
    createTrainingJob_experimentConfig,
    createTrainingJob_debugRuleConfigurations,
    createTrainingJob_enableManagedSpotTraining,
    createTrainingJob_hyperParameters,
    createTrainingJob_inputDataConfig,
    createTrainingJob_profilerRuleConfigurations,
    createTrainingJob_vpcConfig,
    createTrainingJob_enableInterContainerTrafficEncryption,
    createTrainingJob_tensorBoardOutputConfig,
    createTrainingJob_tags,
    createTrainingJob_trainingJobName,
    createTrainingJob_algorithmSpecification,
    createTrainingJob_roleArn,
    createTrainingJob_outputDataConfig,
    createTrainingJob_resourceConfig,
    createTrainingJob_stoppingCondition,

    -- * Destructuring the Response
    CreateTrainingJobResponse (..),
    newCreateTrainingJobResponse,

    -- * Response Lenses
    createTrainingJobResponse_httpStatus,
    createTrainingJobResponse_trainingJobArn,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newCreateTrainingJob' smart constructor.
data CreateTrainingJob = CreateTrainingJob'
  { -- | The environment variables to set in the Docker container.
    CreateTrainingJob -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    CreateTrainingJob -> Maybe DebugHookConfig
debugHookConfig :: Prelude.Maybe DebugHookConfig,
    -- | Contains information about the output location for managed spot training
    -- checkpoint data.
    CreateTrainingJob -> Maybe CheckpointConfig
checkpointConfig :: Prelude.Maybe CheckpointConfig,
    -- | The number of times to retry the job when the job fails due to an
    -- @InternalServerError@.
    CreateTrainingJob -> Maybe RetryStrategy
retryStrategy :: Prelude.Maybe RetryStrategy,
    CreateTrainingJob -> Maybe ProfilerConfig
profilerConfig :: Prelude.Maybe ProfilerConfig,
    -- | Isolates the training container. No inbound or outbound network calls
    -- can be made, except for calls between peers within a training cluster
    -- for distributed training. If you enable network isolation for training
    -- jobs that are configured to use a VPC, Amazon SageMaker downloads and
    -- uploads customer data and model artifacts through the specified VPC, but
    -- the training container does not have network access.
    CreateTrainingJob -> Maybe Bool
enableNetworkIsolation :: Prelude.Maybe Prelude.Bool,
    CreateTrainingJob -> Maybe ExperimentConfig
experimentConfig :: Prelude.Maybe ExperimentConfig,
    -- | Configuration information for Debugger rules for debugging output
    -- tensors.
    CreateTrainingJob -> Maybe [DebugRuleConfiguration]
debugRuleConfigurations :: Prelude.Maybe [DebugRuleConfiguration],
    -- | To train models using managed spot training, choose @True@. Managed spot
    -- training provides a fully managed and scalable infrastructure for
    -- training machine learning models. this option is useful when training
    -- jobs can be interrupted and when there is flexibility when the training
    -- job is run.
    --
    -- The complete and intermediate results of jobs are stored in an Amazon S3
    -- bucket, and can be used as a starting point to train models
    -- incrementally. Amazon SageMaker provides metrics and logs in CloudWatch.
    -- They can be used to see when managed spot training jobs are running,
    -- interrupted, resumed, or completed.
    CreateTrainingJob -> Maybe Bool
enableManagedSpotTraining :: Prelude.Maybe Prelude.Bool,
    -- | Algorithm-specific parameters that influence the quality of the model.
    -- You set hyperparameters before you start the learning process. For a
    -- list of hyperparameters for each training algorithm provided by Amazon
    -- SageMaker, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
    --
    -- You can specify a maximum of 100 hyperparameters. Each hyperparameter is
    -- a key-value pair. Each key and value is limited to 256 characters, as
    -- specified by the @Length Constraint@.
    CreateTrainingJob -> Maybe (HashMap Text Text)
hyperParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | An array of @Channel@ objects. Each channel is a named input source.
    -- @InputDataConfig@ describes the input data and its location.
    --
    -- Algorithms can accept input data from one or more channels. For example,
    -- an algorithm might have two channels of input data, @training_data@ and
    -- @validation_data@. The configuration for each channel provides the S3,
    -- EFS, or FSx location where the input data is stored. It also provides
    -- information about the stored data: the MIME type, compression method,
    -- and whether the data is wrapped in RecordIO format.
    --
    -- Depending on the input mode that the algorithm supports, Amazon
    -- SageMaker either copies input data files from an S3 bucket to a local
    -- directory in the Docker container, or makes it available as input
    -- streams. For example, if you specify an EFS location, input data files
    -- will be made available as input streams. They do not need to be
    -- downloaded.
    CreateTrainingJob -> Maybe (NonEmpty Channel)
inputDataConfig :: Prelude.Maybe (Prelude.NonEmpty Channel),
    -- | Configuration information for Debugger rules for profiling system and
    -- framework metrics.
    CreateTrainingJob -> Maybe [ProfilerRuleConfiguration]
profilerRuleConfigurations :: Prelude.Maybe [ProfilerRuleConfiguration],
    -- | A VpcConfig object that specifies the VPC that you want your training
    -- job to connect to. Control access to and from your training container by
    -- configuring the VPC. For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html Protect Training Jobs by Using an Amazon Virtual Private Cloud>.
    CreateTrainingJob -> Maybe VpcConfig
vpcConfig :: Prelude.Maybe VpcConfig,
    -- | To encrypt all communications between ML compute instances in
    -- distributed training, choose @True@. Encryption provides greater
    -- security for distributed training, but training might take longer. How
    -- long it takes depends on the amount of communication between compute
    -- instances, especially if you use a deep learning algorithm in
    -- distributed training. For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html Protect Communications Between ML Compute Instances in a Distributed Training Job>.
    CreateTrainingJob -> Maybe Bool
enableInterContainerTrafficEncryption :: Prelude.Maybe Prelude.Bool,
    CreateTrainingJob -> Maybe TensorBoardOutputConfig
tensorBoardOutputConfig :: Prelude.Maybe TensorBoardOutputConfig,
    -- | An array of key-value pairs. You can use tags to categorize your Amazon
    -- Web Services resources in different ways, for example, by purpose,
    -- owner, or environment. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
    CreateTrainingJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the training job. The name must be unique within an Amazon
    -- Web Services Region in an Amazon Web Services account.
    CreateTrainingJob -> Text
trainingJobName :: Prelude.Text,
    -- | The registry path of the Docker image that contains the training
    -- algorithm and algorithm-specific metadata, including the input mode. For
    -- more information about algorithms provided by Amazon SageMaker, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
    -- For information about providing your own algorithms, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
    CreateTrainingJob -> AlgorithmSpecification
algorithmSpecification :: AlgorithmSpecification,
    -- | The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can
    -- assume to perform tasks on your behalf.
    --
    -- During model training, Amazon SageMaker needs your permission to read
    -- input data from an S3 bucket, download a Docker image that contains
    -- training code, write model artifacts to an S3 bucket, write logs to
    -- Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You
    -- grant permissions for all of these tasks to an IAM role. For more
    -- information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html Amazon SageMaker Roles>.
    --
    -- To be able to pass this role to Amazon SageMaker, the caller of this API
    -- must have the @iam:PassRole@ permission.
    CreateTrainingJob -> Text
roleArn :: Prelude.Text,
    -- | Specifies the path to the S3 location where you want to store model
    -- artifacts. Amazon SageMaker creates subfolders for the artifacts.
    CreateTrainingJob -> OutputDataConfig
outputDataConfig :: OutputDataConfig,
    -- | The resources, including the ML compute instances and ML storage
    -- volumes, to use for model training.
    --
    -- ML storage volumes store model artifacts and incremental states.
    -- Training algorithms might also use ML storage volumes for scratch space.
    -- If you want Amazon SageMaker to use the ML storage volume to store the
    -- training data, choose @File@ as the @TrainingInputMode@ in the algorithm
    -- specification. For distributed training algorithms, specify an instance
    -- count greater than 1.
    CreateTrainingJob -> ResourceConfig
resourceConfig :: ResourceConfig,
    -- | Specifies a limit to how long a model training job can run. It also
    -- specifies how long a managed Spot training job has to complete. When the
    -- job reaches the time limit, Amazon SageMaker ends the training job. Use
    -- this API to cap model training costs.
    --
    -- To stop a job, Amazon SageMaker sends the algorithm the @SIGTERM@
    -- signal, which delays job termination for 120 seconds. Algorithms can use
    -- this 120-second window to save the model artifacts, so the results of
    -- training are not lost.
    CreateTrainingJob -> StoppingCondition
stoppingCondition :: StoppingCondition
  }
  deriving (CreateTrainingJob -> CreateTrainingJob -> Bool
(CreateTrainingJob -> CreateTrainingJob -> Bool)
-> (CreateTrainingJob -> CreateTrainingJob -> Bool)
-> Eq CreateTrainingJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrainingJob -> CreateTrainingJob -> Bool
$c/= :: CreateTrainingJob -> CreateTrainingJob -> Bool
== :: CreateTrainingJob -> CreateTrainingJob -> Bool
$c== :: CreateTrainingJob -> CreateTrainingJob -> Bool
Prelude.Eq, ReadPrec [CreateTrainingJob]
ReadPrec CreateTrainingJob
Int -> ReadS CreateTrainingJob
ReadS [CreateTrainingJob]
(Int -> ReadS CreateTrainingJob)
-> ReadS [CreateTrainingJob]
-> ReadPrec CreateTrainingJob
-> ReadPrec [CreateTrainingJob]
-> Read CreateTrainingJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrainingJob]
$creadListPrec :: ReadPrec [CreateTrainingJob]
readPrec :: ReadPrec CreateTrainingJob
$creadPrec :: ReadPrec CreateTrainingJob
readList :: ReadS [CreateTrainingJob]
$creadList :: ReadS [CreateTrainingJob]
readsPrec :: Int -> ReadS CreateTrainingJob
$creadsPrec :: Int -> ReadS CreateTrainingJob
Prelude.Read, Int -> CreateTrainingJob -> ShowS
[CreateTrainingJob] -> ShowS
CreateTrainingJob -> String
(Int -> CreateTrainingJob -> ShowS)
-> (CreateTrainingJob -> String)
-> ([CreateTrainingJob] -> ShowS)
-> Show CreateTrainingJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrainingJob] -> ShowS
$cshowList :: [CreateTrainingJob] -> ShowS
show :: CreateTrainingJob -> String
$cshow :: CreateTrainingJob -> String
showsPrec :: Int -> CreateTrainingJob -> ShowS
$cshowsPrec :: Int -> CreateTrainingJob -> ShowS
Prelude.Show, (forall x. CreateTrainingJob -> Rep CreateTrainingJob x)
-> (forall x. Rep CreateTrainingJob x -> CreateTrainingJob)
-> Generic CreateTrainingJob
forall x. Rep CreateTrainingJob x -> CreateTrainingJob
forall x. CreateTrainingJob -> Rep CreateTrainingJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTrainingJob x -> CreateTrainingJob
$cfrom :: forall x. CreateTrainingJob -> Rep CreateTrainingJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateTrainingJob' 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:
--
-- 'environment', 'createTrainingJob_environment' - The environment variables to set in the Docker container.
--
-- 'debugHookConfig', 'createTrainingJob_debugHookConfig' - Undocumented member.
--
-- 'checkpointConfig', 'createTrainingJob_checkpointConfig' - Contains information about the output location for managed spot training
-- checkpoint data.
--
-- 'retryStrategy', 'createTrainingJob_retryStrategy' - The number of times to retry the job when the job fails due to an
-- @InternalServerError@.
--
-- 'profilerConfig', 'createTrainingJob_profilerConfig' - Undocumented member.
--
-- 'enableNetworkIsolation', 'createTrainingJob_enableNetworkIsolation' - Isolates the training container. No inbound or outbound network calls
-- can be made, except for calls between peers within a training cluster
-- for distributed training. If you enable network isolation for training
-- jobs that are configured to use a VPC, Amazon SageMaker downloads and
-- uploads customer data and model artifacts through the specified VPC, but
-- the training container does not have network access.
--
-- 'experimentConfig', 'createTrainingJob_experimentConfig' - Undocumented member.
--
-- 'debugRuleConfigurations', 'createTrainingJob_debugRuleConfigurations' - Configuration information for Debugger rules for debugging output
-- tensors.
--
-- 'enableManagedSpotTraining', 'createTrainingJob_enableManagedSpotTraining' - To train models using managed spot training, choose @True@. Managed spot
-- training provides a fully managed and scalable infrastructure for
-- training machine learning models. this option is useful when training
-- jobs can be interrupted and when there is flexibility when the training
-- job is run.
--
-- The complete and intermediate results of jobs are stored in an Amazon S3
-- bucket, and can be used as a starting point to train models
-- incrementally. Amazon SageMaker provides metrics and logs in CloudWatch.
-- They can be used to see when managed spot training jobs are running,
-- interrupted, resumed, or completed.
--
-- 'hyperParameters', 'createTrainingJob_hyperParameters' - Algorithm-specific parameters that influence the quality of the model.
-- You set hyperparameters before you start the learning process. For a
-- list of hyperparameters for each training algorithm provided by Amazon
-- SageMaker, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
--
-- You can specify a maximum of 100 hyperparameters. Each hyperparameter is
-- a key-value pair. Each key and value is limited to 256 characters, as
-- specified by the @Length Constraint@.
--
-- 'inputDataConfig', 'createTrainingJob_inputDataConfig' - An array of @Channel@ objects. Each channel is a named input source.
-- @InputDataConfig@ describes the input data and its location.
--
-- Algorithms can accept input data from one or more channels. For example,
-- an algorithm might have two channels of input data, @training_data@ and
-- @validation_data@. The configuration for each channel provides the S3,
-- EFS, or FSx location where the input data is stored. It also provides
-- information about the stored data: the MIME type, compression method,
-- and whether the data is wrapped in RecordIO format.
--
-- Depending on the input mode that the algorithm supports, Amazon
-- SageMaker either copies input data files from an S3 bucket to a local
-- directory in the Docker container, or makes it available as input
-- streams. For example, if you specify an EFS location, input data files
-- will be made available as input streams. They do not need to be
-- downloaded.
--
-- 'profilerRuleConfigurations', 'createTrainingJob_profilerRuleConfigurations' - Configuration information for Debugger rules for profiling system and
-- framework metrics.
--
-- 'vpcConfig', 'createTrainingJob_vpcConfig' - A VpcConfig object that specifies the VPC that you want your training
-- job to connect to. Control access to and from your training container by
-- configuring the VPC. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html Protect Training Jobs by Using an Amazon Virtual Private Cloud>.
--
-- 'enableInterContainerTrafficEncryption', 'createTrainingJob_enableInterContainerTrafficEncryption' - To encrypt all communications between ML compute instances in
-- distributed training, choose @True@. Encryption provides greater
-- security for distributed training, but training might take longer. How
-- long it takes depends on the amount of communication between compute
-- instances, especially if you use a deep learning algorithm in
-- distributed training. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html Protect Communications Between ML Compute Instances in a Distributed Training Job>.
--
-- 'tensorBoardOutputConfig', 'createTrainingJob_tensorBoardOutputConfig' - Undocumented member.
--
-- 'tags', 'createTrainingJob_tags' - An array of key-value pairs. You can use tags to categorize your Amazon
-- Web Services resources in different ways, for example, by purpose,
-- owner, or environment. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
--
-- 'trainingJobName', 'createTrainingJob_trainingJobName' - The name of the training job. The name must be unique within an Amazon
-- Web Services Region in an Amazon Web Services account.
--
-- 'algorithmSpecification', 'createTrainingJob_algorithmSpecification' - The registry path of the Docker image that contains the training
-- algorithm and algorithm-specific metadata, including the input mode. For
-- more information about algorithms provided by Amazon SageMaker, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
-- For information about providing your own algorithms, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
--
-- 'roleArn', 'createTrainingJob_roleArn' - The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can
-- assume to perform tasks on your behalf.
--
-- During model training, Amazon SageMaker needs your permission to read
-- input data from an S3 bucket, download a Docker image that contains
-- training code, write model artifacts to an S3 bucket, write logs to
-- Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You
-- grant permissions for all of these tasks to an IAM role. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html Amazon SageMaker Roles>.
--
-- To be able to pass this role to Amazon SageMaker, the caller of this API
-- must have the @iam:PassRole@ permission.
--
-- 'outputDataConfig', 'createTrainingJob_outputDataConfig' - Specifies the path to the S3 location where you want to store model
-- artifacts. Amazon SageMaker creates subfolders for the artifacts.
--
-- 'resourceConfig', 'createTrainingJob_resourceConfig' - The resources, including the ML compute instances and ML storage
-- volumes, to use for model training.
--
-- ML storage volumes store model artifacts and incremental states.
-- Training algorithms might also use ML storage volumes for scratch space.
-- If you want Amazon SageMaker to use the ML storage volume to store the
-- training data, choose @File@ as the @TrainingInputMode@ in the algorithm
-- specification. For distributed training algorithms, specify an instance
-- count greater than 1.
--
-- 'stoppingCondition', 'createTrainingJob_stoppingCondition' - Specifies a limit to how long a model training job can run. It also
-- specifies how long a managed Spot training job has to complete. When the
-- job reaches the time limit, Amazon SageMaker ends the training job. Use
-- this API to cap model training costs.
--
-- To stop a job, Amazon SageMaker sends the algorithm the @SIGTERM@
-- signal, which delays job termination for 120 seconds. Algorithms can use
-- this 120-second window to save the model artifacts, so the results of
-- training are not lost.
newCreateTrainingJob ::
  -- | 'trainingJobName'
  Prelude.Text ->
  -- | 'algorithmSpecification'
  AlgorithmSpecification ->
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'outputDataConfig'
  OutputDataConfig ->
  -- | 'resourceConfig'
  ResourceConfig ->
  -- | 'stoppingCondition'
  StoppingCondition ->
  CreateTrainingJob
newCreateTrainingJob :: Text
-> AlgorithmSpecification
-> Text
-> OutputDataConfig
-> ResourceConfig
-> StoppingCondition
-> CreateTrainingJob
newCreateTrainingJob
  Text
pTrainingJobName_
  AlgorithmSpecification
pAlgorithmSpecification_
  Text
pRoleArn_
  OutputDataConfig
pOutputDataConfig_
  ResourceConfig
pResourceConfig_
  StoppingCondition
pStoppingCondition_ =
    CreateTrainingJob' :: Maybe (HashMap Text Text)
-> Maybe DebugHookConfig
-> Maybe CheckpointConfig
-> Maybe RetryStrategy
-> Maybe ProfilerConfig
-> Maybe Bool
-> Maybe ExperimentConfig
-> Maybe [DebugRuleConfiguration]
-> Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe (NonEmpty Channel)
-> Maybe [ProfilerRuleConfiguration]
-> Maybe VpcConfig
-> Maybe Bool
-> Maybe TensorBoardOutputConfig
-> Maybe [Tag]
-> Text
-> AlgorithmSpecification
-> Text
-> OutputDataConfig
-> ResourceConfig
-> StoppingCondition
-> CreateTrainingJob
CreateTrainingJob'
      { $sel:environment:CreateTrainingJob' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:debugHookConfig:CreateTrainingJob' :: Maybe DebugHookConfig
debugHookConfig = Maybe DebugHookConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:checkpointConfig:CreateTrainingJob' :: Maybe CheckpointConfig
checkpointConfig = Maybe CheckpointConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:retryStrategy:CreateTrainingJob' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
forall a. Maybe a
Prelude.Nothing,
        $sel:profilerConfig:CreateTrainingJob' :: Maybe ProfilerConfig
profilerConfig = Maybe ProfilerConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:enableNetworkIsolation:CreateTrainingJob' :: Maybe Bool
enableNetworkIsolation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:experimentConfig:CreateTrainingJob' :: Maybe ExperimentConfig
experimentConfig = Maybe ExperimentConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:debugRuleConfigurations:CreateTrainingJob' :: Maybe [DebugRuleConfiguration]
debugRuleConfigurations = Maybe [DebugRuleConfiguration]
forall a. Maybe a
Prelude.Nothing,
        $sel:enableManagedSpotTraining:CreateTrainingJob' :: Maybe Bool
enableManagedSpotTraining = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:hyperParameters:CreateTrainingJob' :: Maybe (HashMap Text Text)
hyperParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:inputDataConfig:CreateTrainingJob' :: Maybe (NonEmpty Channel)
inputDataConfig = Maybe (NonEmpty Channel)
forall a. Maybe a
Prelude.Nothing,
        $sel:profilerRuleConfigurations:CreateTrainingJob' :: Maybe [ProfilerRuleConfiguration]
profilerRuleConfigurations = Maybe [ProfilerRuleConfiguration]
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConfig:CreateTrainingJob' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:enableInterContainerTrafficEncryption:CreateTrainingJob' :: Maybe Bool
enableInterContainerTrafficEncryption =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:tensorBoardOutputConfig:CreateTrainingJob' :: Maybe TensorBoardOutputConfig
tensorBoardOutputConfig = Maybe TensorBoardOutputConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateTrainingJob' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:trainingJobName:CreateTrainingJob' :: Text
trainingJobName = Text
pTrainingJobName_,
        $sel:algorithmSpecification:CreateTrainingJob' :: AlgorithmSpecification
algorithmSpecification = AlgorithmSpecification
pAlgorithmSpecification_,
        $sel:roleArn:CreateTrainingJob' :: Text
roleArn = Text
pRoleArn_,
        $sel:outputDataConfig:CreateTrainingJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
pOutputDataConfig_,
        $sel:resourceConfig:CreateTrainingJob' :: ResourceConfig
resourceConfig = ResourceConfig
pResourceConfig_,
        $sel:stoppingCondition:CreateTrainingJob' :: StoppingCondition
stoppingCondition = StoppingCondition
pStoppingCondition_
      }

-- | The environment variables to set in the Docker container.
createTrainingJob_environment :: Lens.Lens' CreateTrainingJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createTrainingJob_environment :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_environment = (CreateTrainingJob -> Maybe (HashMap Text Text))
-> (CreateTrainingJob
    -> Maybe (HashMap Text Text) -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (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 (\CreateTrainingJob' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:CreateTrainingJob' :: CreateTrainingJob -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe (HashMap Text Text)
a -> CreateTrainingJob
s {$sel:environment:CreateTrainingJob' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: CreateTrainingJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateTrainingJob -> f CreateTrainingJob)
-> ((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)))
-> CreateTrainingJob
-> f CreateTrainingJob
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

-- | Undocumented member.
createTrainingJob_debugHookConfig :: Lens.Lens' CreateTrainingJob (Prelude.Maybe DebugHookConfig)
createTrainingJob_debugHookConfig :: (Maybe DebugHookConfig -> f (Maybe DebugHookConfig))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_debugHookConfig = (CreateTrainingJob -> Maybe DebugHookConfig)
-> (CreateTrainingJob
    -> Maybe DebugHookConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe DebugHookConfig)
     (Maybe DebugHookConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe DebugHookConfig
debugHookConfig :: Maybe DebugHookConfig
$sel:debugHookConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe DebugHookConfig
debugHookConfig} -> Maybe DebugHookConfig
debugHookConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe DebugHookConfig
a -> CreateTrainingJob
s {$sel:debugHookConfig:CreateTrainingJob' :: Maybe DebugHookConfig
debugHookConfig = Maybe DebugHookConfig
a} :: CreateTrainingJob)

-- | Contains information about the output location for managed spot training
-- checkpoint data.
createTrainingJob_checkpointConfig :: Lens.Lens' CreateTrainingJob (Prelude.Maybe CheckpointConfig)
createTrainingJob_checkpointConfig :: (Maybe CheckpointConfig -> f (Maybe CheckpointConfig))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_checkpointConfig = (CreateTrainingJob -> Maybe CheckpointConfig)
-> (CreateTrainingJob
    -> Maybe CheckpointConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe CheckpointConfig)
     (Maybe CheckpointConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe CheckpointConfig
checkpointConfig :: Maybe CheckpointConfig
$sel:checkpointConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe CheckpointConfig
checkpointConfig} -> Maybe CheckpointConfig
checkpointConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe CheckpointConfig
a -> CreateTrainingJob
s {$sel:checkpointConfig:CreateTrainingJob' :: Maybe CheckpointConfig
checkpointConfig = Maybe CheckpointConfig
a} :: CreateTrainingJob)

-- | The number of times to retry the job when the job fails due to an
-- @InternalServerError@.
createTrainingJob_retryStrategy :: Lens.Lens' CreateTrainingJob (Prelude.Maybe RetryStrategy)
createTrainingJob_retryStrategy :: (Maybe RetryStrategy -> f (Maybe RetryStrategy))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_retryStrategy = (CreateTrainingJob -> Maybe RetryStrategy)
-> (CreateTrainingJob -> Maybe RetryStrategy -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe RetryStrategy)
     (Maybe RetryStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe RetryStrategy
retryStrategy :: Maybe RetryStrategy
$sel:retryStrategy:CreateTrainingJob' :: CreateTrainingJob -> Maybe RetryStrategy
retryStrategy} -> Maybe RetryStrategy
retryStrategy) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe RetryStrategy
a -> CreateTrainingJob
s {$sel:retryStrategy:CreateTrainingJob' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
a} :: CreateTrainingJob)

-- | Undocumented member.
createTrainingJob_profilerConfig :: Lens.Lens' CreateTrainingJob (Prelude.Maybe ProfilerConfig)
createTrainingJob_profilerConfig :: (Maybe ProfilerConfig -> f (Maybe ProfilerConfig))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_profilerConfig = (CreateTrainingJob -> Maybe ProfilerConfig)
-> (CreateTrainingJob -> Maybe ProfilerConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe ProfilerConfig)
     (Maybe ProfilerConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe ProfilerConfig
profilerConfig :: Maybe ProfilerConfig
$sel:profilerConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe ProfilerConfig
profilerConfig} -> Maybe ProfilerConfig
profilerConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe ProfilerConfig
a -> CreateTrainingJob
s {$sel:profilerConfig:CreateTrainingJob' :: Maybe ProfilerConfig
profilerConfig = Maybe ProfilerConfig
a} :: CreateTrainingJob)

-- | Isolates the training container. No inbound or outbound network calls
-- can be made, except for calls between peers within a training cluster
-- for distributed training. If you enable network isolation for training
-- jobs that are configured to use a VPC, Amazon SageMaker downloads and
-- uploads customer data and model artifacts through the specified VPC, but
-- the training container does not have network access.
createTrainingJob_enableNetworkIsolation :: Lens.Lens' CreateTrainingJob (Prelude.Maybe Prelude.Bool)
createTrainingJob_enableNetworkIsolation :: (Maybe Bool -> f (Maybe Bool))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_enableNetworkIsolation = (CreateTrainingJob -> Maybe Bool)
-> (CreateTrainingJob -> Maybe Bool -> CreateTrainingJob)
-> Lens
     CreateTrainingJob CreateTrainingJob (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe Bool
enableNetworkIsolation :: Maybe Bool
$sel:enableNetworkIsolation:CreateTrainingJob' :: CreateTrainingJob -> Maybe Bool
enableNetworkIsolation} -> Maybe Bool
enableNetworkIsolation) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe Bool
a -> CreateTrainingJob
s {$sel:enableNetworkIsolation:CreateTrainingJob' :: Maybe Bool
enableNetworkIsolation = Maybe Bool
a} :: CreateTrainingJob)

-- | Undocumented member.
createTrainingJob_experimentConfig :: Lens.Lens' CreateTrainingJob (Prelude.Maybe ExperimentConfig)
createTrainingJob_experimentConfig :: (Maybe ExperimentConfig -> f (Maybe ExperimentConfig))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_experimentConfig = (CreateTrainingJob -> Maybe ExperimentConfig)
-> (CreateTrainingJob
    -> Maybe ExperimentConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe ExperimentConfig)
     (Maybe ExperimentConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe ExperimentConfig
experimentConfig :: Maybe ExperimentConfig
$sel:experimentConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe ExperimentConfig
experimentConfig} -> Maybe ExperimentConfig
experimentConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe ExperimentConfig
a -> CreateTrainingJob
s {$sel:experimentConfig:CreateTrainingJob' :: Maybe ExperimentConfig
experimentConfig = Maybe ExperimentConfig
a} :: CreateTrainingJob)

-- | Configuration information for Debugger rules for debugging output
-- tensors.
createTrainingJob_debugRuleConfigurations :: Lens.Lens' CreateTrainingJob (Prelude.Maybe [DebugRuleConfiguration])
createTrainingJob_debugRuleConfigurations :: (Maybe [DebugRuleConfiguration]
 -> f (Maybe [DebugRuleConfiguration]))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_debugRuleConfigurations = (CreateTrainingJob -> Maybe [DebugRuleConfiguration])
-> (CreateTrainingJob
    -> Maybe [DebugRuleConfiguration] -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe [DebugRuleConfiguration])
     (Maybe [DebugRuleConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe [DebugRuleConfiguration]
debugRuleConfigurations :: Maybe [DebugRuleConfiguration]
$sel:debugRuleConfigurations:CreateTrainingJob' :: CreateTrainingJob -> Maybe [DebugRuleConfiguration]
debugRuleConfigurations} -> Maybe [DebugRuleConfiguration]
debugRuleConfigurations) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe [DebugRuleConfiguration]
a -> CreateTrainingJob
s {$sel:debugRuleConfigurations:CreateTrainingJob' :: Maybe [DebugRuleConfiguration]
debugRuleConfigurations = Maybe [DebugRuleConfiguration]
a} :: CreateTrainingJob) ((Maybe [DebugRuleConfiguration]
  -> f (Maybe [DebugRuleConfiguration]))
 -> CreateTrainingJob -> f CreateTrainingJob)
-> ((Maybe [DebugRuleConfiguration]
     -> f (Maybe [DebugRuleConfiguration]))
    -> Maybe [DebugRuleConfiguration]
    -> f (Maybe [DebugRuleConfiguration]))
-> (Maybe [DebugRuleConfiguration]
    -> f (Maybe [DebugRuleConfiguration]))
-> CreateTrainingJob
-> f CreateTrainingJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DebugRuleConfiguration]
  [DebugRuleConfiguration]
  [DebugRuleConfiguration]
  [DebugRuleConfiguration]
-> Iso
     (Maybe [DebugRuleConfiguration])
     (Maybe [DebugRuleConfiguration])
     (Maybe [DebugRuleConfiguration])
     (Maybe [DebugRuleConfiguration])
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
  [DebugRuleConfiguration]
  [DebugRuleConfiguration]
  [DebugRuleConfiguration]
  [DebugRuleConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | To train models using managed spot training, choose @True@. Managed spot
-- training provides a fully managed and scalable infrastructure for
-- training machine learning models. this option is useful when training
-- jobs can be interrupted and when there is flexibility when the training
-- job is run.
--
-- The complete and intermediate results of jobs are stored in an Amazon S3
-- bucket, and can be used as a starting point to train models
-- incrementally. Amazon SageMaker provides metrics and logs in CloudWatch.
-- They can be used to see when managed spot training jobs are running,
-- interrupted, resumed, or completed.
createTrainingJob_enableManagedSpotTraining :: Lens.Lens' CreateTrainingJob (Prelude.Maybe Prelude.Bool)
createTrainingJob_enableManagedSpotTraining :: (Maybe Bool -> f (Maybe Bool))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_enableManagedSpotTraining = (CreateTrainingJob -> Maybe Bool)
-> (CreateTrainingJob -> Maybe Bool -> CreateTrainingJob)
-> Lens
     CreateTrainingJob CreateTrainingJob (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe Bool
enableManagedSpotTraining :: Maybe Bool
$sel:enableManagedSpotTraining:CreateTrainingJob' :: CreateTrainingJob -> Maybe Bool
enableManagedSpotTraining} -> Maybe Bool
enableManagedSpotTraining) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe Bool
a -> CreateTrainingJob
s {$sel:enableManagedSpotTraining:CreateTrainingJob' :: Maybe Bool
enableManagedSpotTraining = Maybe Bool
a} :: CreateTrainingJob)

-- | Algorithm-specific parameters that influence the quality of the model.
-- You set hyperparameters before you start the learning process. For a
-- list of hyperparameters for each training algorithm provided by Amazon
-- SageMaker, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
--
-- You can specify a maximum of 100 hyperparameters. Each hyperparameter is
-- a key-value pair. Each key and value is limited to 256 characters, as
-- specified by the @Length Constraint@.
createTrainingJob_hyperParameters :: Lens.Lens' CreateTrainingJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createTrainingJob_hyperParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_hyperParameters = (CreateTrainingJob -> Maybe (HashMap Text Text))
-> (CreateTrainingJob
    -> Maybe (HashMap Text Text) -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (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 (\CreateTrainingJob' {Maybe (HashMap Text Text)
hyperParameters :: Maybe (HashMap Text Text)
$sel:hyperParameters:CreateTrainingJob' :: CreateTrainingJob -> Maybe (HashMap Text Text)
hyperParameters} -> Maybe (HashMap Text Text)
hyperParameters) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe (HashMap Text Text)
a -> CreateTrainingJob
s {$sel:hyperParameters:CreateTrainingJob' :: Maybe (HashMap Text Text)
hyperParameters = Maybe (HashMap Text Text)
a} :: CreateTrainingJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateTrainingJob -> f CreateTrainingJob)
-> ((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)))
-> CreateTrainingJob
-> f CreateTrainingJob
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

-- | An array of @Channel@ objects. Each channel is a named input source.
-- @InputDataConfig@ describes the input data and its location.
--
-- Algorithms can accept input data from one or more channels. For example,
-- an algorithm might have two channels of input data, @training_data@ and
-- @validation_data@. The configuration for each channel provides the S3,
-- EFS, or FSx location where the input data is stored. It also provides
-- information about the stored data: the MIME type, compression method,
-- and whether the data is wrapped in RecordIO format.
--
-- Depending on the input mode that the algorithm supports, Amazon
-- SageMaker either copies input data files from an S3 bucket to a local
-- directory in the Docker container, or makes it available as input
-- streams. For example, if you specify an EFS location, input data files
-- will be made available as input streams. They do not need to be
-- downloaded.
createTrainingJob_inputDataConfig :: Lens.Lens' CreateTrainingJob (Prelude.Maybe (Prelude.NonEmpty Channel))
createTrainingJob_inputDataConfig :: (Maybe (NonEmpty Channel) -> f (Maybe (NonEmpty Channel)))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_inputDataConfig = (CreateTrainingJob -> Maybe (NonEmpty Channel))
-> (CreateTrainingJob
    -> Maybe (NonEmpty Channel) -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe (NonEmpty Channel))
     (Maybe (NonEmpty Channel))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe (NonEmpty Channel)
inputDataConfig :: Maybe (NonEmpty Channel)
$sel:inputDataConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe (NonEmpty Channel)
inputDataConfig} -> Maybe (NonEmpty Channel)
inputDataConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe (NonEmpty Channel)
a -> CreateTrainingJob
s {$sel:inputDataConfig:CreateTrainingJob' :: Maybe (NonEmpty Channel)
inputDataConfig = Maybe (NonEmpty Channel)
a} :: CreateTrainingJob) ((Maybe (NonEmpty Channel) -> f (Maybe (NonEmpty Channel)))
 -> CreateTrainingJob -> f CreateTrainingJob)
-> ((Maybe (NonEmpty Channel) -> f (Maybe (NonEmpty Channel)))
    -> Maybe (NonEmpty Channel) -> f (Maybe (NonEmpty Channel)))
-> (Maybe (NonEmpty Channel) -> f (Maybe (NonEmpty Channel)))
-> CreateTrainingJob
-> f CreateTrainingJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Channel)
  (NonEmpty Channel)
  (NonEmpty Channel)
  (NonEmpty Channel)
-> Iso
     (Maybe (NonEmpty Channel))
     (Maybe (NonEmpty Channel))
     (Maybe (NonEmpty Channel))
     (Maybe (NonEmpty Channel))
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
  (NonEmpty Channel)
  (NonEmpty Channel)
  (NonEmpty Channel)
  (NonEmpty Channel)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Configuration information for Debugger rules for profiling system and
-- framework metrics.
createTrainingJob_profilerRuleConfigurations :: Lens.Lens' CreateTrainingJob (Prelude.Maybe [ProfilerRuleConfiguration])
createTrainingJob_profilerRuleConfigurations :: (Maybe [ProfilerRuleConfiguration]
 -> f (Maybe [ProfilerRuleConfiguration]))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_profilerRuleConfigurations = (CreateTrainingJob -> Maybe [ProfilerRuleConfiguration])
-> (CreateTrainingJob
    -> Maybe [ProfilerRuleConfiguration] -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe [ProfilerRuleConfiguration])
     (Maybe [ProfilerRuleConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe [ProfilerRuleConfiguration]
profilerRuleConfigurations :: Maybe [ProfilerRuleConfiguration]
$sel:profilerRuleConfigurations:CreateTrainingJob' :: CreateTrainingJob -> Maybe [ProfilerRuleConfiguration]
profilerRuleConfigurations} -> Maybe [ProfilerRuleConfiguration]
profilerRuleConfigurations) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe [ProfilerRuleConfiguration]
a -> CreateTrainingJob
s {$sel:profilerRuleConfigurations:CreateTrainingJob' :: Maybe [ProfilerRuleConfiguration]
profilerRuleConfigurations = Maybe [ProfilerRuleConfiguration]
a} :: CreateTrainingJob) ((Maybe [ProfilerRuleConfiguration]
  -> f (Maybe [ProfilerRuleConfiguration]))
 -> CreateTrainingJob -> f CreateTrainingJob)
-> ((Maybe [ProfilerRuleConfiguration]
     -> f (Maybe [ProfilerRuleConfiguration]))
    -> Maybe [ProfilerRuleConfiguration]
    -> f (Maybe [ProfilerRuleConfiguration]))
-> (Maybe [ProfilerRuleConfiguration]
    -> f (Maybe [ProfilerRuleConfiguration]))
-> CreateTrainingJob
-> f CreateTrainingJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProfilerRuleConfiguration]
  [ProfilerRuleConfiguration]
  [ProfilerRuleConfiguration]
  [ProfilerRuleConfiguration]
-> Iso
     (Maybe [ProfilerRuleConfiguration])
     (Maybe [ProfilerRuleConfiguration])
     (Maybe [ProfilerRuleConfiguration])
     (Maybe [ProfilerRuleConfiguration])
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
  [ProfilerRuleConfiguration]
  [ProfilerRuleConfiguration]
  [ProfilerRuleConfiguration]
  [ProfilerRuleConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A VpcConfig object that specifies the VPC that you want your training
-- job to connect to. Control access to and from your training container by
-- configuring the VPC. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html Protect Training Jobs by Using an Amazon Virtual Private Cloud>.
createTrainingJob_vpcConfig :: Lens.Lens' CreateTrainingJob (Prelude.Maybe VpcConfig)
createTrainingJob_vpcConfig :: (Maybe VpcConfig -> f (Maybe VpcConfig))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_vpcConfig = (CreateTrainingJob -> Maybe VpcConfig)
-> (CreateTrainingJob -> Maybe VpcConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe VpcConfig)
     (Maybe VpcConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe VpcConfig
vpcConfig :: Maybe VpcConfig
$sel:vpcConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe VpcConfig
vpcConfig} -> Maybe VpcConfig
vpcConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe VpcConfig
a -> CreateTrainingJob
s {$sel:vpcConfig:CreateTrainingJob' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
a} :: CreateTrainingJob)

-- | To encrypt all communications between ML compute instances in
-- distributed training, choose @True@. Encryption provides greater
-- security for distributed training, but training might take longer. How
-- long it takes depends on the amount of communication between compute
-- instances, especially if you use a deep learning algorithm in
-- distributed training. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html Protect Communications Between ML Compute Instances in a Distributed Training Job>.
createTrainingJob_enableInterContainerTrafficEncryption :: Lens.Lens' CreateTrainingJob (Prelude.Maybe Prelude.Bool)
createTrainingJob_enableInterContainerTrafficEncryption :: (Maybe Bool -> f (Maybe Bool))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_enableInterContainerTrafficEncryption = (CreateTrainingJob -> Maybe Bool)
-> (CreateTrainingJob -> Maybe Bool -> CreateTrainingJob)
-> Lens
     CreateTrainingJob CreateTrainingJob (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe Bool
enableInterContainerTrafficEncryption :: Maybe Bool
$sel:enableInterContainerTrafficEncryption:CreateTrainingJob' :: CreateTrainingJob -> Maybe Bool
enableInterContainerTrafficEncryption} -> Maybe Bool
enableInterContainerTrafficEncryption) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe Bool
a -> CreateTrainingJob
s {$sel:enableInterContainerTrafficEncryption:CreateTrainingJob' :: Maybe Bool
enableInterContainerTrafficEncryption = Maybe Bool
a} :: CreateTrainingJob)

-- | Undocumented member.
createTrainingJob_tensorBoardOutputConfig :: Lens.Lens' CreateTrainingJob (Prelude.Maybe TensorBoardOutputConfig)
createTrainingJob_tensorBoardOutputConfig :: (Maybe TensorBoardOutputConfig
 -> f (Maybe TensorBoardOutputConfig))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_tensorBoardOutputConfig = (CreateTrainingJob -> Maybe TensorBoardOutputConfig)
-> (CreateTrainingJob
    -> Maybe TensorBoardOutputConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     (Maybe TensorBoardOutputConfig)
     (Maybe TensorBoardOutputConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe TensorBoardOutputConfig
tensorBoardOutputConfig :: Maybe TensorBoardOutputConfig
$sel:tensorBoardOutputConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe TensorBoardOutputConfig
tensorBoardOutputConfig} -> Maybe TensorBoardOutputConfig
tensorBoardOutputConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe TensorBoardOutputConfig
a -> CreateTrainingJob
s {$sel:tensorBoardOutputConfig:CreateTrainingJob' :: Maybe TensorBoardOutputConfig
tensorBoardOutputConfig = Maybe TensorBoardOutputConfig
a} :: CreateTrainingJob)

-- | An array of key-value pairs. You can use tags to categorize your Amazon
-- Web Services resources in different ways, for example, by purpose,
-- owner, or environment. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
createTrainingJob_tags :: Lens.Lens' CreateTrainingJob (Prelude.Maybe [Tag])
createTrainingJob_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_tags = (CreateTrainingJob -> Maybe [Tag])
-> (CreateTrainingJob -> Maybe [Tag] -> CreateTrainingJob)
-> Lens
     CreateTrainingJob CreateTrainingJob (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateTrainingJob' :: CreateTrainingJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Maybe [Tag]
a -> CreateTrainingJob
s {$sel:tags:CreateTrainingJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateTrainingJob) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateTrainingJob -> f CreateTrainingJob)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateTrainingJob
-> f CreateTrainingJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the training job. The name must be unique within an Amazon
-- Web Services Region in an Amazon Web Services account.
createTrainingJob_trainingJobName :: Lens.Lens' CreateTrainingJob Prelude.Text
createTrainingJob_trainingJobName :: (Text -> f Text) -> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_trainingJobName = (CreateTrainingJob -> Text)
-> (CreateTrainingJob -> Text -> CreateTrainingJob)
-> Lens CreateTrainingJob CreateTrainingJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Text
trainingJobName :: Text
$sel:trainingJobName:CreateTrainingJob' :: CreateTrainingJob -> Text
trainingJobName} -> Text
trainingJobName) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Text
a -> CreateTrainingJob
s {$sel:trainingJobName:CreateTrainingJob' :: Text
trainingJobName = Text
a} :: CreateTrainingJob)

-- | The registry path of the Docker image that contains the training
-- algorithm and algorithm-specific metadata, including the input mode. For
-- more information about algorithms provided by Amazon SageMaker, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html Algorithms>.
-- For information about providing your own algorithms, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html Using Your Own Algorithms with Amazon SageMaker>.
createTrainingJob_algorithmSpecification :: Lens.Lens' CreateTrainingJob AlgorithmSpecification
createTrainingJob_algorithmSpecification :: (AlgorithmSpecification -> f AlgorithmSpecification)
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_algorithmSpecification = (CreateTrainingJob -> AlgorithmSpecification)
-> (CreateTrainingJob
    -> AlgorithmSpecification -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     AlgorithmSpecification
     AlgorithmSpecification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {AlgorithmSpecification
algorithmSpecification :: AlgorithmSpecification
$sel:algorithmSpecification:CreateTrainingJob' :: CreateTrainingJob -> AlgorithmSpecification
algorithmSpecification} -> AlgorithmSpecification
algorithmSpecification) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} AlgorithmSpecification
a -> CreateTrainingJob
s {$sel:algorithmSpecification:CreateTrainingJob' :: AlgorithmSpecification
algorithmSpecification = AlgorithmSpecification
a} :: CreateTrainingJob)

-- | The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can
-- assume to perform tasks on your behalf.
--
-- During model training, Amazon SageMaker needs your permission to read
-- input data from an S3 bucket, download a Docker image that contains
-- training code, write model artifacts to an S3 bucket, write logs to
-- Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You
-- grant permissions for all of these tasks to an IAM role. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html Amazon SageMaker Roles>.
--
-- To be able to pass this role to Amazon SageMaker, the caller of this API
-- must have the @iam:PassRole@ permission.
createTrainingJob_roleArn :: Lens.Lens' CreateTrainingJob Prelude.Text
createTrainingJob_roleArn :: (Text -> f Text) -> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_roleArn = (CreateTrainingJob -> Text)
-> (CreateTrainingJob -> Text -> CreateTrainingJob)
-> Lens CreateTrainingJob CreateTrainingJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {Text
roleArn :: Text
$sel:roleArn:CreateTrainingJob' :: CreateTrainingJob -> Text
roleArn} -> Text
roleArn) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} Text
a -> CreateTrainingJob
s {$sel:roleArn:CreateTrainingJob' :: Text
roleArn = Text
a} :: CreateTrainingJob)

-- | Specifies the path to the S3 location where you want to store model
-- artifacts. Amazon SageMaker creates subfolders for the artifacts.
createTrainingJob_outputDataConfig :: Lens.Lens' CreateTrainingJob OutputDataConfig
createTrainingJob_outputDataConfig :: (OutputDataConfig -> f OutputDataConfig)
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_outputDataConfig = (CreateTrainingJob -> OutputDataConfig)
-> (CreateTrainingJob -> OutputDataConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     OutputDataConfig
     OutputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {OutputDataConfig
outputDataConfig :: OutputDataConfig
$sel:outputDataConfig:CreateTrainingJob' :: CreateTrainingJob -> OutputDataConfig
outputDataConfig} -> OutputDataConfig
outputDataConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} OutputDataConfig
a -> CreateTrainingJob
s {$sel:outputDataConfig:CreateTrainingJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
a} :: CreateTrainingJob)

-- | The resources, including the ML compute instances and ML storage
-- volumes, to use for model training.
--
-- ML storage volumes store model artifacts and incremental states.
-- Training algorithms might also use ML storage volumes for scratch space.
-- If you want Amazon SageMaker to use the ML storage volume to store the
-- training data, choose @File@ as the @TrainingInputMode@ in the algorithm
-- specification. For distributed training algorithms, specify an instance
-- count greater than 1.
createTrainingJob_resourceConfig :: Lens.Lens' CreateTrainingJob ResourceConfig
createTrainingJob_resourceConfig :: (ResourceConfig -> f ResourceConfig)
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_resourceConfig = (CreateTrainingJob -> ResourceConfig)
-> (CreateTrainingJob -> ResourceConfig -> CreateTrainingJob)
-> Lens
     CreateTrainingJob CreateTrainingJob ResourceConfig ResourceConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {ResourceConfig
resourceConfig :: ResourceConfig
$sel:resourceConfig:CreateTrainingJob' :: CreateTrainingJob -> ResourceConfig
resourceConfig} -> ResourceConfig
resourceConfig) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} ResourceConfig
a -> CreateTrainingJob
s {$sel:resourceConfig:CreateTrainingJob' :: ResourceConfig
resourceConfig = ResourceConfig
a} :: CreateTrainingJob)

-- | Specifies a limit to how long a model training job can run. It also
-- specifies how long a managed Spot training job has to complete. When the
-- job reaches the time limit, Amazon SageMaker ends the training job. Use
-- this API to cap model training costs.
--
-- To stop a job, Amazon SageMaker sends the algorithm the @SIGTERM@
-- signal, which delays job termination for 120 seconds. Algorithms can use
-- this 120-second window to save the model artifacts, so the results of
-- training are not lost.
createTrainingJob_stoppingCondition :: Lens.Lens' CreateTrainingJob StoppingCondition
createTrainingJob_stoppingCondition :: (StoppingCondition -> f StoppingCondition)
-> CreateTrainingJob -> f CreateTrainingJob
createTrainingJob_stoppingCondition = (CreateTrainingJob -> StoppingCondition)
-> (CreateTrainingJob -> StoppingCondition -> CreateTrainingJob)
-> Lens
     CreateTrainingJob
     CreateTrainingJob
     StoppingCondition
     StoppingCondition
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJob' {StoppingCondition
stoppingCondition :: StoppingCondition
$sel:stoppingCondition:CreateTrainingJob' :: CreateTrainingJob -> StoppingCondition
stoppingCondition} -> StoppingCondition
stoppingCondition) (\s :: CreateTrainingJob
s@CreateTrainingJob' {} StoppingCondition
a -> CreateTrainingJob
s {$sel:stoppingCondition:CreateTrainingJob' :: StoppingCondition
stoppingCondition = StoppingCondition
a} :: CreateTrainingJob)

instance Core.AWSRequest CreateTrainingJob where
  type
    AWSResponse CreateTrainingJob =
      CreateTrainingJobResponse
  request :: CreateTrainingJob -> Request CreateTrainingJob
request = Service -> CreateTrainingJob -> Request CreateTrainingJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateTrainingJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateTrainingJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateTrainingJob))
-> Logger
-> Service
-> Proxy CreateTrainingJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateTrainingJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> CreateTrainingJobResponse
CreateTrainingJobResponse'
            (Int -> Text -> CreateTrainingJobResponse)
-> Either String Int
-> Either String (Text -> CreateTrainingJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (Text -> CreateTrainingJobResponse)
-> Either String Text -> Either String CreateTrainingJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"TrainingJobArn")
      )

instance Prelude.Hashable CreateTrainingJob

instance Prelude.NFData CreateTrainingJob

instance Core.ToHeaders CreateTrainingJob where
  toHeaders :: CreateTrainingJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateTrainingJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SageMaker.CreateTrainingJob" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateTrainingJob where
  toJSON :: CreateTrainingJob -> Value
toJSON CreateTrainingJob' {Maybe Bool
Maybe [DebugRuleConfiguration]
Maybe [ProfilerRuleConfiguration]
Maybe [Tag]
Maybe (NonEmpty Channel)
Maybe (HashMap Text Text)
Maybe CheckpointConfig
Maybe DebugHookConfig
Maybe ExperimentConfig
Maybe ProfilerConfig
Maybe RetryStrategy
Maybe TensorBoardOutputConfig
Maybe VpcConfig
Text
OutputDataConfig
StoppingCondition
AlgorithmSpecification
ResourceConfig
stoppingCondition :: StoppingCondition
resourceConfig :: ResourceConfig
outputDataConfig :: OutputDataConfig
roleArn :: Text
algorithmSpecification :: AlgorithmSpecification
trainingJobName :: Text
tags :: Maybe [Tag]
tensorBoardOutputConfig :: Maybe TensorBoardOutputConfig
enableInterContainerTrafficEncryption :: Maybe Bool
vpcConfig :: Maybe VpcConfig
profilerRuleConfigurations :: Maybe [ProfilerRuleConfiguration]
inputDataConfig :: Maybe (NonEmpty Channel)
hyperParameters :: Maybe (HashMap Text Text)
enableManagedSpotTraining :: Maybe Bool
debugRuleConfigurations :: Maybe [DebugRuleConfiguration]
experimentConfig :: Maybe ExperimentConfig
enableNetworkIsolation :: Maybe Bool
profilerConfig :: Maybe ProfilerConfig
retryStrategy :: Maybe RetryStrategy
checkpointConfig :: Maybe CheckpointConfig
debugHookConfig :: Maybe DebugHookConfig
environment :: Maybe (HashMap Text Text)
$sel:stoppingCondition:CreateTrainingJob' :: CreateTrainingJob -> StoppingCondition
$sel:resourceConfig:CreateTrainingJob' :: CreateTrainingJob -> ResourceConfig
$sel:outputDataConfig:CreateTrainingJob' :: CreateTrainingJob -> OutputDataConfig
$sel:roleArn:CreateTrainingJob' :: CreateTrainingJob -> Text
$sel:algorithmSpecification:CreateTrainingJob' :: CreateTrainingJob -> AlgorithmSpecification
$sel:trainingJobName:CreateTrainingJob' :: CreateTrainingJob -> Text
$sel:tags:CreateTrainingJob' :: CreateTrainingJob -> Maybe [Tag]
$sel:tensorBoardOutputConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe TensorBoardOutputConfig
$sel:enableInterContainerTrafficEncryption:CreateTrainingJob' :: CreateTrainingJob -> Maybe Bool
$sel:vpcConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe VpcConfig
$sel:profilerRuleConfigurations:CreateTrainingJob' :: CreateTrainingJob -> Maybe [ProfilerRuleConfiguration]
$sel:inputDataConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe (NonEmpty Channel)
$sel:hyperParameters:CreateTrainingJob' :: CreateTrainingJob -> Maybe (HashMap Text Text)
$sel:enableManagedSpotTraining:CreateTrainingJob' :: CreateTrainingJob -> Maybe Bool
$sel:debugRuleConfigurations:CreateTrainingJob' :: CreateTrainingJob -> Maybe [DebugRuleConfiguration]
$sel:experimentConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe ExperimentConfig
$sel:enableNetworkIsolation:CreateTrainingJob' :: CreateTrainingJob -> Maybe Bool
$sel:profilerConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe ProfilerConfig
$sel:retryStrategy:CreateTrainingJob' :: CreateTrainingJob -> Maybe RetryStrategy
$sel:checkpointConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe CheckpointConfig
$sel:debugHookConfig:CreateTrainingJob' :: CreateTrainingJob -> Maybe DebugHookConfig
$sel:environment:CreateTrainingJob' :: CreateTrainingJob -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Environment" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environment,
            (Text
"DebugHookConfig" Text -> DebugHookConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DebugHookConfig -> Pair) -> Maybe DebugHookConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DebugHookConfig
debugHookConfig,
            (Text
"CheckpointConfig" Text -> CheckpointConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CheckpointConfig -> Pair) -> Maybe CheckpointConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CheckpointConfig
checkpointConfig,
            (Text
"RetryStrategy" Text -> RetryStrategy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RetryStrategy -> Pair) -> Maybe RetryStrategy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RetryStrategy
retryStrategy,
            (Text
"ProfilerConfig" Text -> ProfilerConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProfilerConfig -> Pair) -> Maybe ProfilerConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProfilerConfig
profilerConfig,
            (Text
"EnableNetworkIsolation" 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
enableNetworkIsolation,
            (Text
"ExperimentConfig" Text -> ExperimentConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ExperimentConfig -> Pair) -> Maybe ExperimentConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ExperimentConfig
experimentConfig,
            (Text
"DebugRuleConfigurations" Text -> [DebugRuleConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([DebugRuleConfiguration] -> Pair)
-> Maybe [DebugRuleConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DebugRuleConfiguration]
debugRuleConfigurations,
            (Text
"EnableManagedSpotTraining" 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
enableManagedSpotTraining,
            (Text
"HyperParameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
hyperParameters,
            (Text
"InputDataConfig" Text -> NonEmpty Channel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Channel -> Pair)
-> Maybe (NonEmpty Channel) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Channel)
inputDataConfig,
            (Text
"ProfilerRuleConfigurations" Text -> [ProfilerRuleConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ProfilerRuleConfiguration] -> Pair)
-> Maybe [ProfilerRuleConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ProfilerRuleConfiguration]
profilerRuleConfigurations,
            (Text
"VpcConfig" Text -> VpcConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VpcConfig -> Pair) -> Maybe VpcConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfig
vpcConfig,
            (Text
"EnableInterContainerTrafficEncryption" 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
enableInterContainerTrafficEncryption,
            (Text
"TensorBoardOutputConfig" Text -> TensorBoardOutputConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TensorBoardOutputConfig -> Pair)
-> Maybe TensorBoardOutputConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TensorBoardOutputConfig
tensorBoardOutputConfig,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TrainingJobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
trainingJobName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"AlgorithmSpecification"
                  Text -> AlgorithmSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AlgorithmSpecification
algorithmSpecification
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OutputDataConfig" Text -> OutputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputDataConfig
outputDataConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ResourceConfig" Text -> ResourceConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ResourceConfig
resourceConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"StoppingCondition" Text -> StoppingCondition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StoppingCondition
stoppingCondition)
          ]
      )

instance Core.ToPath CreateTrainingJob where
  toPath :: CreateTrainingJob -> ByteString
toPath = ByteString -> CreateTrainingJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreateTrainingJob where
  toQuery :: CreateTrainingJob -> QueryString
toQuery = QueryString -> CreateTrainingJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateTrainingJobResponse' smart constructor.
data CreateTrainingJobResponse = CreateTrainingJobResponse'
  { -- | The response's http status code.
    CreateTrainingJobResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the training job.
    CreateTrainingJobResponse -> Text
trainingJobArn :: Prelude.Text
  }
  deriving (CreateTrainingJobResponse -> CreateTrainingJobResponse -> Bool
(CreateTrainingJobResponse -> CreateTrainingJobResponse -> Bool)
-> (CreateTrainingJobResponse -> CreateTrainingJobResponse -> Bool)
-> Eq CreateTrainingJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrainingJobResponse -> CreateTrainingJobResponse -> Bool
$c/= :: CreateTrainingJobResponse -> CreateTrainingJobResponse -> Bool
== :: CreateTrainingJobResponse -> CreateTrainingJobResponse -> Bool
$c== :: CreateTrainingJobResponse -> CreateTrainingJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateTrainingJobResponse]
ReadPrec CreateTrainingJobResponse
Int -> ReadS CreateTrainingJobResponse
ReadS [CreateTrainingJobResponse]
(Int -> ReadS CreateTrainingJobResponse)
-> ReadS [CreateTrainingJobResponse]
-> ReadPrec CreateTrainingJobResponse
-> ReadPrec [CreateTrainingJobResponse]
-> Read CreateTrainingJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrainingJobResponse]
$creadListPrec :: ReadPrec [CreateTrainingJobResponse]
readPrec :: ReadPrec CreateTrainingJobResponse
$creadPrec :: ReadPrec CreateTrainingJobResponse
readList :: ReadS [CreateTrainingJobResponse]
$creadList :: ReadS [CreateTrainingJobResponse]
readsPrec :: Int -> ReadS CreateTrainingJobResponse
$creadsPrec :: Int -> ReadS CreateTrainingJobResponse
Prelude.Read, Int -> CreateTrainingJobResponse -> ShowS
[CreateTrainingJobResponse] -> ShowS
CreateTrainingJobResponse -> String
(Int -> CreateTrainingJobResponse -> ShowS)
-> (CreateTrainingJobResponse -> String)
-> ([CreateTrainingJobResponse] -> ShowS)
-> Show CreateTrainingJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrainingJobResponse] -> ShowS
$cshowList :: [CreateTrainingJobResponse] -> ShowS
show :: CreateTrainingJobResponse -> String
$cshow :: CreateTrainingJobResponse -> String
showsPrec :: Int -> CreateTrainingJobResponse -> ShowS
$cshowsPrec :: Int -> CreateTrainingJobResponse -> ShowS
Prelude.Show, (forall x.
 CreateTrainingJobResponse -> Rep CreateTrainingJobResponse x)
-> (forall x.
    Rep CreateTrainingJobResponse x -> CreateTrainingJobResponse)
-> Generic CreateTrainingJobResponse
forall x.
Rep CreateTrainingJobResponse x -> CreateTrainingJobResponse
forall x.
CreateTrainingJobResponse -> Rep CreateTrainingJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTrainingJobResponse x -> CreateTrainingJobResponse
$cfrom :: forall x.
CreateTrainingJobResponse -> Rep CreateTrainingJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateTrainingJobResponse' 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:
--
-- 'httpStatus', 'createTrainingJobResponse_httpStatus' - The response's http status code.
--
-- 'trainingJobArn', 'createTrainingJobResponse_trainingJobArn' - The Amazon Resource Name (ARN) of the training job.
newCreateTrainingJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'trainingJobArn'
  Prelude.Text ->
  CreateTrainingJobResponse
newCreateTrainingJobResponse :: Int -> Text -> CreateTrainingJobResponse
newCreateTrainingJobResponse
  Int
pHttpStatus_
  Text
pTrainingJobArn_ =
    CreateTrainingJobResponse' :: Int -> Text -> CreateTrainingJobResponse
CreateTrainingJobResponse'
      { $sel:httpStatus:CreateTrainingJobResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:trainingJobArn:CreateTrainingJobResponse' :: Text
trainingJobArn = Text
pTrainingJobArn_
      }

-- | The response's http status code.
createTrainingJobResponse_httpStatus :: Lens.Lens' CreateTrainingJobResponse Prelude.Int
createTrainingJobResponse_httpStatus :: (Int -> f Int)
-> CreateTrainingJobResponse -> f CreateTrainingJobResponse
createTrainingJobResponse_httpStatus = (CreateTrainingJobResponse -> Int)
-> (CreateTrainingJobResponse -> Int -> CreateTrainingJobResponse)
-> Lens CreateTrainingJobResponse CreateTrainingJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateTrainingJobResponse' :: CreateTrainingJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateTrainingJobResponse
s@CreateTrainingJobResponse' {} Int
a -> CreateTrainingJobResponse
s {$sel:httpStatus:CreateTrainingJobResponse' :: Int
httpStatus = Int
a} :: CreateTrainingJobResponse)

-- | The Amazon Resource Name (ARN) of the training job.
createTrainingJobResponse_trainingJobArn :: Lens.Lens' CreateTrainingJobResponse Prelude.Text
createTrainingJobResponse_trainingJobArn :: (Text -> f Text)
-> CreateTrainingJobResponse -> f CreateTrainingJobResponse
createTrainingJobResponse_trainingJobArn = (CreateTrainingJobResponse -> Text)
-> (CreateTrainingJobResponse -> Text -> CreateTrainingJobResponse)
-> Lens
     CreateTrainingJobResponse CreateTrainingJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrainingJobResponse' {Text
trainingJobArn :: Text
$sel:trainingJobArn:CreateTrainingJobResponse' :: CreateTrainingJobResponse -> Text
trainingJobArn} -> Text
trainingJobArn) (\s :: CreateTrainingJobResponse
s@CreateTrainingJobResponse' {} Text
a -> CreateTrainingJobResponse
s {$sel:trainingJobArn:CreateTrainingJobResponse' :: Text
trainingJobArn = Text
a} :: CreateTrainingJobResponse)

instance Prelude.NFData CreateTrainingJobResponse