{-# 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.CreateAutoMLJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Autopilot job.
--
-- Find the best-performing model after you run an Autopilot job by calling
-- .
--
-- For information about how to use Autopilot, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development.html Automate Model Development with Amazon SageMaker Autopilot>.
module Amazonka.SageMaker.CreateAutoMLJob
  ( -- * Creating a Request
    CreateAutoMLJob (..),
    newCreateAutoMLJob,

    -- * Request Lenses
    createAutoMLJob_autoMLJobConfig,
    createAutoMLJob_autoMLJobObjective,
    createAutoMLJob_generateCandidateDefinitionsOnly,
    createAutoMLJob_modelDeployConfig,
    createAutoMLJob_problemType,
    createAutoMLJob_tags,
    createAutoMLJob_autoMLJobName,
    createAutoMLJob_inputDataConfig,
    createAutoMLJob_outputDataConfig,
    createAutoMLJob_roleArn,

    -- * Destructuring the Response
    CreateAutoMLJobResponse (..),
    newCreateAutoMLJobResponse,

    -- * Response Lenses
    createAutoMLJobResponse_httpStatus,
    createAutoMLJobResponse_autoMLJobArn,
  )
where

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

-- | /See:/ 'newCreateAutoMLJob' smart constructor.
data CreateAutoMLJob = CreateAutoMLJob'
  { -- | A collection of settings used to configure an AutoML job.
    CreateAutoMLJob -> Maybe AutoMLJobConfig
autoMLJobConfig :: Prelude.Maybe AutoMLJobConfig,
    -- | Defines the objective metric used to measure the predictive quality of
    -- an AutoML job. You provide an AutoMLJobObjective$MetricName and
    -- Autopilot infers whether to minimize or maximize it.
    CreateAutoMLJob -> Maybe AutoMLJobObjective
autoMLJobObjective :: Prelude.Maybe AutoMLJobObjective,
    -- | Generates possible candidates without training the models. A candidate
    -- is a combination of data preprocessors, algorithms, and algorithm
    -- parameter settings.
    CreateAutoMLJob -> Maybe Bool
generateCandidateDefinitionsOnly :: Prelude.Maybe Prelude.Bool,
    -- | Specifies how to generate the endpoint name for an automatic one-click
    -- Autopilot model deployment.
    CreateAutoMLJob -> Maybe ModelDeployConfig
modelDeployConfig :: Prelude.Maybe ModelDeployConfig,
    -- | Defines the type of supervised learning available for the candidates.
    -- For more information, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development-problem-types.html Amazon SageMaker Autopilot problem types and algorithm support>.
    CreateAutoMLJob -> Maybe ProblemType
problemType :: Prelude.Maybe ProblemType,
    -- | Each tag consists of a key and an optional value. Tag keys must be
    -- unique per resource.
    CreateAutoMLJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Identifies an Autopilot job. The name must be unique to your account and
    -- is case-insensitive.
    CreateAutoMLJob -> Text
autoMLJobName :: Prelude.Text,
    -- | An array of channel objects that describes the input data and its
    -- location. Each channel is a named input source. Similar to
    -- @InputDataConfig@ supported by . Format(s) supported: CSV, Parquet. A
    -- minimum of 500 rows is required for the training dataset. There is not a
    -- minimum number of rows required for the validation dataset.
    CreateAutoMLJob -> NonEmpty AutoMLChannel
inputDataConfig :: Prelude.NonEmpty AutoMLChannel,
    -- | Provides information about encryption and the Amazon S3 output path
    -- needed to store artifacts from an AutoML job. Format(s) supported: CSV.
    CreateAutoMLJob -> AutoMLOutputDataConfig
outputDataConfig :: AutoMLOutputDataConfig,
    -- | The ARN of the role that is used to access the data.
    CreateAutoMLJob -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateAutoMLJob -> CreateAutoMLJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAutoMLJob -> CreateAutoMLJob -> Bool
$c/= :: CreateAutoMLJob -> CreateAutoMLJob -> Bool
== :: CreateAutoMLJob -> CreateAutoMLJob -> Bool
$c== :: CreateAutoMLJob -> CreateAutoMLJob -> Bool
Prelude.Eq, ReadPrec [CreateAutoMLJob]
ReadPrec CreateAutoMLJob
Int -> ReadS CreateAutoMLJob
ReadS [CreateAutoMLJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAutoMLJob]
$creadListPrec :: ReadPrec [CreateAutoMLJob]
readPrec :: ReadPrec CreateAutoMLJob
$creadPrec :: ReadPrec CreateAutoMLJob
readList :: ReadS [CreateAutoMLJob]
$creadList :: ReadS [CreateAutoMLJob]
readsPrec :: Int -> ReadS CreateAutoMLJob
$creadsPrec :: Int -> ReadS CreateAutoMLJob
Prelude.Read, Int -> CreateAutoMLJob -> ShowS
[CreateAutoMLJob] -> ShowS
CreateAutoMLJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAutoMLJob] -> ShowS
$cshowList :: [CreateAutoMLJob] -> ShowS
show :: CreateAutoMLJob -> String
$cshow :: CreateAutoMLJob -> String
showsPrec :: Int -> CreateAutoMLJob -> ShowS
$cshowsPrec :: Int -> CreateAutoMLJob -> ShowS
Prelude.Show, forall x. Rep CreateAutoMLJob x -> CreateAutoMLJob
forall x. CreateAutoMLJob -> Rep CreateAutoMLJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAutoMLJob x -> CreateAutoMLJob
$cfrom :: forall x. CreateAutoMLJob -> Rep CreateAutoMLJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateAutoMLJob' 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:
--
-- 'autoMLJobConfig', 'createAutoMLJob_autoMLJobConfig' - A collection of settings used to configure an AutoML job.
--
-- 'autoMLJobObjective', 'createAutoMLJob_autoMLJobObjective' - Defines the objective metric used to measure the predictive quality of
-- an AutoML job. You provide an AutoMLJobObjective$MetricName and
-- Autopilot infers whether to minimize or maximize it.
--
-- 'generateCandidateDefinitionsOnly', 'createAutoMLJob_generateCandidateDefinitionsOnly' - Generates possible candidates without training the models. A candidate
-- is a combination of data preprocessors, algorithms, and algorithm
-- parameter settings.
--
-- 'modelDeployConfig', 'createAutoMLJob_modelDeployConfig' - Specifies how to generate the endpoint name for an automatic one-click
-- Autopilot model deployment.
--
-- 'problemType', 'createAutoMLJob_problemType' - Defines the type of supervised learning available for the candidates.
-- For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development-problem-types.html Amazon SageMaker Autopilot problem types and algorithm support>.
--
-- 'tags', 'createAutoMLJob_tags' - Each tag consists of a key and an optional value. Tag keys must be
-- unique per resource.
--
-- 'autoMLJobName', 'createAutoMLJob_autoMLJobName' - Identifies an Autopilot job. The name must be unique to your account and
-- is case-insensitive.
--
-- 'inputDataConfig', 'createAutoMLJob_inputDataConfig' - An array of channel objects that describes the input data and its
-- location. Each channel is a named input source. Similar to
-- @InputDataConfig@ supported by . Format(s) supported: CSV, Parquet. A
-- minimum of 500 rows is required for the training dataset. There is not a
-- minimum number of rows required for the validation dataset.
--
-- 'outputDataConfig', 'createAutoMLJob_outputDataConfig' - Provides information about encryption and the Amazon S3 output path
-- needed to store artifacts from an AutoML job. Format(s) supported: CSV.
--
-- 'roleArn', 'createAutoMLJob_roleArn' - The ARN of the role that is used to access the data.
newCreateAutoMLJob ::
  -- | 'autoMLJobName'
  Prelude.Text ->
  -- | 'inputDataConfig'
  Prelude.NonEmpty AutoMLChannel ->
  -- | 'outputDataConfig'
  AutoMLOutputDataConfig ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateAutoMLJob
newCreateAutoMLJob :: Text
-> NonEmpty AutoMLChannel
-> AutoMLOutputDataConfig
-> Text
-> CreateAutoMLJob
newCreateAutoMLJob
  Text
pAutoMLJobName_
  NonEmpty AutoMLChannel
pInputDataConfig_
  AutoMLOutputDataConfig
pOutputDataConfig_
  Text
pRoleArn_ =
    CreateAutoMLJob'
      { $sel:autoMLJobConfig:CreateAutoMLJob' :: Maybe AutoMLJobConfig
autoMLJobConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:autoMLJobObjective:CreateAutoMLJob' :: Maybe AutoMLJobObjective
autoMLJobObjective = forall a. Maybe a
Prelude.Nothing,
        $sel:generateCandidateDefinitionsOnly:CreateAutoMLJob' :: Maybe Bool
generateCandidateDefinitionsOnly = forall a. Maybe a
Prelude.Nothing,
        $sel:modelDeployConfig:CreateAutoMLJob' :: Maybe ModelDeployConfig
modelDeployConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:problemType:CreateAutoMLJob' :: Maybe ProblemType
problemType = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateAutoMLJob' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:autoMLJobName:CreateAutoMLJob' :: Text
autoMLJobName = Text
pAutoMLJobName_,
        $sel:inputDataConfig:CreateAutoMLJob' :: NonEmpty AutoMLChannel
inputDataConfig =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty AutoMLChannel
pInputDataConfig_,
        $sel:outputDataConfig:CreateAutoMLJob' :: AutoMLOutputDataConfig
outputDataConfig = AutoMLOutputDataConfig
pOutputDataConfig_,
        $sel:roleArn:CreateAutoMLJob' :: Text
roleArn = Text
pRoleArn_
      }

-- | A collection of settings used to configure an AutoML job.
createAutoMLJob_autoMLJobConfig :: Lens.Lens' CreateAutoMLJob (Prelude.Maybe AutoMLJobConfig)
createAutoMLJob_autoMLJobConfig :: Lens' CreateAutoMLJob (Maybe AutoMLJobConfig)
createAutoMLJob_autoMLJobConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Maybe AutoMLJobConfig
autoMLJobConfig :: Maybe AutoMLJobConfig
$sel:autoMLJobConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobConfig
autoMLJobConfig} -> Maybe AutoMLJobConfig
autoMLJobConfig) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Maybe AutoMLJobConfig
a -> CreateAutoMLJob
s {$sel:autoMLJobConfig:CreateAutoMLJob' :: Maybe AutoMLJobConfig
autoMLJobConfig = Maybe AutoMLJobConfig
a} :: CreateAutoMLJob)

-- | Defines the objective metric used to measure the predictive quality of
-- an AutoML job. You provide an AutoMLJobObjective$MetricName and
-- Autopilot infers whether to minimize or maximize it.
createAutoMLJob_autoMLJobObjective :: Lens.Lens' CreateAutoMLJob (Prelude.Maybe AutoMLJobObjective)
createAutoMLJob_autoMLJobObjective :: Lens' CreateAutoMLJob (Maybe AutoMLJobObjective)
createAutoMLJob_autoMLJobObjective = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Maybe AutoMLJobObjective
autoMLJobObjective :: Maybe AutoMLJobObjective
$sel:autoMLJobObjective:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobObjective
autoMLJobObjective} -> Maybe AutoMLJobObjective
autoMLJobObjective) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Maybe AutoMLJobObjective
a -> CreateAutoMLJob
s {$sel:autoMLJobObjective:CreateAutoMLJob' :: Maybe AutoMLJobObjective
autoMLJobObjective = Maybe AutoMLJobObjective
a} :: CreateAutoMLJob)

-- | Generates possible candidates without training the models. A candidate
-- is a combination of data preprocessors, algorithms, and algorithm
-- parameter settings.
createAutoMLJob_generateCandidateDefinitionsOnly :: Lens.Lens' CreateAutoMLJob (Prelude.Maybe Prelude.Bool)
createAutoMLJob_generateCandidateDefinitionsOnly :: Lens' CreateAutoMLJob (Maybe Bool)
createAutoMLJob_generateCandidateDefinitionsOnly = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Maybe Bool
generateCandidateDefinitionsOnly :: Maybe Bool
$sel:generateCandidateDefinitionsOnly:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe Bool
generateCandidateDefinitionsOnly} -> Maybe Bool
generateCandidateDefinitionsOnly) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Maybe Bool
a -> CreateAutoMLJob
s {$sel:generateCandidateDefinitionsOnly:CreateAutoMLJob' :: Maybe Bool
generateCandidateDefinitionsOnly = Maybe Bool
a} :: CreateAutoMLJob)

-- | Specifies how to generate the endpoint name for an automatic one-click
-- Autopilot model deployment.
createAutoMLJob_modelDeployConfig :: Lens.Lens' CreateAutoMLJob (Prelude.Maybe ModelDeployConfig)
createAutoMLJob_modelDeployConfig :: Lens' CreateAutoMLJob (Maybe ModelDeployConfig)
createAutoMLJob_modelDeployConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Maybe ModelDeployConfig
modelDeployConfig :: Maybe ModelDeployConfig
$sel:modelDeployConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ModelDeployConfig
modelDeployConfig} -> Maybe ModelDeployConfig
modelDeployConfig) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Maybe ModelDeployConfig
a -> CreateAutoMLJob
s {$sel:modelDeployConfig:CreateAutoMLJob' :: Maybe ModelDeployConfig
modelDeployConfig = Maybe ModelDeployConfig
a} :: CreateAutoMLJob)

-- | Defines the type of supervised learning available for the candidates.
-- For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/autopilot-automate-model-development-problem-types.html Amazon SageMaker Autopilot problem types and algorithm support>.
createAutoMLJob_problemType :: Lens.Lens' CreateAutoMLJob (Prelude.Maybe ProblemType)
createAutoMLJob_problemType :: Lens' CreateAutoMLJob (Maybe ProblemType)
createAutoMLJob_problemType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Maybe ProblemType
problemType :: Maybe ProblemType
$sel:problemType:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ProblemType
problemType} -> Maybe ProblemType
problemType) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Maybe ProblemType
a -> CreateAutoMLJob
s {$sel:problemType:CreateAutoMLJob' :: Maybe ProblemType
problemType = Maybe ProblemType
a} :: CreateAutoMLJob)

-- | Each tag consists of a key and an optional value. Tag keys must be
-- unique per resource.
createAutoMLJob_tags :: Lens.Lens' CreateAutoMLJob (Prelude.Maybe [Tag])
createAutoMLJob_tags :: Lens' CreateAutoMLJob (Maybe [Tag])
createAutoMLJob_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Maybe [Tag]
a -> CreateAutoMLJob
s {$sel:tags:CreateAutoMLJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateAutoMLJob) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Identifies an Autopilot job. The name must be unique to your account and
-- is case-insensitive.
createAutoMLJob_autoMLJobName :: Lens.Lens' CreateAutoMLJob Prelude.Text
createAutoMLJob_autoMLJobName :: Lens' CreateAutoMLJob Text
createAutoMLJob_autoMLJobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Text
autoMLJobName :: Text
$sel:autoMLJobName:CreateAutoMLJob' :: CreateAutoMLJob -> Text
autoMLJobName} -> Text
autoMLJobName) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Text
a -> CreateAutoMLJob
s {$sel:autoMLJobName:CreateAutoMLJob' :: Text
autoMLJobName = Text
a} :: CreateAutoMLJob)

-- | An array of channel objects that describes the input data and its
-- location. Each channel is a named input source. Similar to
-- @InputDataConfig@ supported by . Format(s) supported: CSV, Parquet. A
-- minimum of 500 rows is required for the training dataset. There is not a
-- minimum number of rows required for the validation dataset.
createAutoMLJob_inputDataConfig :: Lens.Lens' CreateAutoMLJob (Prelude.NonEmpty AutoMLChannel)
createAutoMLJob_inputDataConfig :: Lens' CreateAutoMLJob (NonEmpty AutoMLChannel)
createAutoMLJob_inputDataConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {NonEmpty AutoMLChannel
inputDataConfig :: NonEmpty AutoMLChannel
$sel:inputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> NonEmpty AutoMLChannel
inputDataConfig} -> NonEmpty AutoMLChannel
inputDataConfig) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} NonEmpty AutoMLChannel
a -> CreateAutoMLJob
s {$sel:inputDataConfig:CreateAutoMLJob' :: NonEmpty AutoMLChannel
inputDataConfig = NonEmpty AutoMLChannel
a} :: CreateAutoMLJob) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Provides information about encryption and the Amazon S3 output path
-- needed to store artifacts from an AutoML job. Format(s) supported: CSV.
createAutoMLJob_outputDataConfig :: Lens.Lens' CreateAutoMLJob AutoMLOutputDataConfig
createAutoMLJob_outputDataConfig :: Lens' CreateAutoMLJob AutoMLOutputDataConfig
createAutoMLJob_outputDataConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {AutoMLOutputDataConfig
outputDataConfig :: AutoMLOutputDataConfig
$sel:outputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> AutoMLOutputDataConfig
outputDataConfig} -> AutoMLOutputDataConfig
outputDataConfig) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} AutoMLOutputDataConfig
a -> CreateAutoMLJob
s {$sel:outputDataConfig:CreateAutoMLJob' :: AutoMLOutputDataConfig
outputDataConfig = AutoMLOutputDataConfig
a} :: CreateAutoMLJob)

-- | The ARN of the role that is used to access the data.
createAutoMLJob_roleArn :: Lens.Lens' CreateAutoMLJob Prelude.Text
createAutoMLJob_roleArn :: Lens' CreateAutoMLJob Text
createAutoMLJob_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJob' {Text
roleArn :: Text
$sel:roleArn:CreateAutoMLJob' :: CreateAutoMLJob -> Text
roleArn} -> Text
roleArn) (\s :: CreateAutoMLJob
s@CreateAutoMLJob' {} Text
a -> CreateAutoMLJob
s {$sel:roleArn:CreateAutoMLJob' :: Text
roleArn = Text
a} :: CreateAutoMLJob)

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

instance Prelude.Hashable CreateAutoMLJob where
  hashWithSalt :: Int -> CreateAutoMLJob -> Int
hashWithSalt Int
_salt CreateAutoMLJob' {Maybe Bool
Maybe [Tag]
Maybe AutoMLJobObjective
Maybe ModelDeployConfig
Maybe ProblemType
Maybe AutoMLJobConfig
NonEmpty AutoMLChannel
Text
AutoMLOutputDataConfig
roleArn :: Text
outputDataConfig :: AutoMLOutputDataConfig
inputDataConfig :: NonEmpty AutoMLChannel
autoMLJobName :: Text
tags :: Maybe [Tag]
problemType :: Maybe ProblemType
modelDeployConfig :: Maybe ModelDeployConfig
generateCandidateDefinitionsOnly :: Maybe Bool
autoMLJobObjective :: Maybe AutoMLJobObjective
autoMLJobConfig :: Maybe AutoMLJobConfig
$sel:roleArn:CreateAutoMLJob' :: CreateAutoMLJob -> Text
$sel:outputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> AutoMLOutputDataConfig
$sel:inputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> NonEmpty AutoMLChannel
$sel:autoMLJobName:CreateAutoMLJob' :: CreateAutoMLJob -> Text
$sel:tags:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe [Tag]
$sel:problemType:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ProblemType
$sel:modelDeployConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ModelDeployConfig
$sel:generateCandidateDefinitionsOnly:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe Bool
$sel:autoMLJobObjective:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobObjective
$sel:autoMLJobConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobConfig
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoMLJobConfig
autoMLJobConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoMLJobObjective
autoMLJobObjective
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
generateCandidateDefinitionsOnly
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ModelDeployConfig
modelDeployConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProblemType
problemType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
autoMLJobName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty AutoMLChannel
inputDataConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AutoMLOutputDataConfig
outputDataConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData CreateAutoMLJob where
  rnf :: CreateAutoMLJob -> ()
rnf CreateAutoMLJob' {Maybe Bool
Maybe [Tag]
Maybe AutoMLJobObjective
Maybe ModelDeployConfig
Maybe ProblemType
Maybe AutoMLJobConfig
NonEmpty AutoMLChannel
Text
AutoMLOutputDataConfig
roleArn :: Text
outputDataConfig :: AutoMLOutputDataConfig
inputDataConfig :: NonEmpty AutoMLChannel
autoMLJobName :: Text
tags :: Maybe [Tag]
problemType :: Maybe ProblemType
modelDeployConfig :: Maybe ModelDeployConfig
generateCandidateDefinitionsOnly :: Maybe Bool
autoMLJobObjective :: Maybe AutoMLJobObjective
autoMLJobConfig :: Maybe AutoMLJobConfig
$sel:roleArn:CreateAutoMLJob' :: CreateAutoMLJob -> Text
$sel:outputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> AutoMLOutputDataConfig
$sel:inputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> NonEmpty AutoMLChannel
$sel:autoMLJobName:CreateAutoMLJob' :: CreateAutoMLJob -> Text
$sel:tags:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe [Tag]
$sel:problemType:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ProblemType
$sel:modelDeployConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ModelDeployConfig
$sel:generateCandidateDefinitionsOnly:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe Bool
$sel:autoMLJobObjective:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobObjective
$sel:autoMLJobConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoMLJobConfig
autoMLJobConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoMLJobObjective
autoMLJobObjective
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
generateCandidateDefinitionsOnly
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ModelDeployConfig
modelDeployConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProblemType
problemType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
autoMLJobName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty AutoMLChannel
inputDataConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AutoMLOutputDataConfig
outputDataConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

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

instance Data.ToJSON CreateAutoMLJob where
  toJSON :: CreateAutoMLJob -> Value
toJSON CreateAutoMLJob' {Maybe Bool
Maybe [Tag]
Maybe AutoMLJobObjective
Maybe ModelDeployConfig
Maybe ProblemType
Maybe AutoMLJobConfig
NonEmpty AutoMLChannel
Text
AutoMLOutputDataConfig
roleArn :: Text
outputDataConfig :: AutoMLOutputDataConfig
inputDataConfig :: NonEmpty AutoMLChannel
autoMLJobName :: Text
tags :: Maybe [Tag]
problemType :: Maybe ProblemType
modelDeployConfig :: Maybe ModelDeployConfig
generateCandidateDefinitionsOnly :: Maybe Bool
autoMLJobObjective :: Maybe AutoMLJobObjective
autoMLJobConfig :: Maybe AutoMLJobConfig
$sel:roleArn:CreateAutoMLJob' :: CreateAutoMLJob -> Text
$sel:outputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> AutoMLOutputDataConfig
$sel:inputDataConfig:CreateAutoMLJob' :: CreateAutoMLJob -> NonEmpty AutoMLChannel
$sel:autoMLJobName:CreateAutoMLJob' :: CreateAutoMLJob -> Text
$sel:tags:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe [Tag]
$sel:problemType:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ProblemType
$sel:modelDeployConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe ModelDeployConfig
$sel:generateCandidateDefinitionsOnly:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe Bool
$sel:autoMLJobObjective:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobObjective
$sel:autoMLJobConfig:CreateAutoMLJob' :: CreateAutoMLJob -> Maybe AutoMLJobConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AutoMLJobConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoMLJobConfig
autoMLJobConfig,
            (Key
"AutoMLJobObjective" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoMLJobObjective
autoMLJobObjective,
            (Key
"GenerateCandidateDefinitionsOnly" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
generateCandidateDefinitionsOnly,
            (Key
"ModelDeployConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModelDeployConfig
modelDeployConfig,
            (Key
"ProblemType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProblemType
problemType,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"AutoMLJobName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
autoMLJobName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"InputDataConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty AutoMLChannel
inputDataConfig),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"OutputDataConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AutoMLOutputDataConfig
outputDataConfig),
            forall a. a -> Maybe a
Prelude.Just (Key
"RoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
          ]
      )

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

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

-- | /See:/ 'newCreateAutoMLJobResponse' smart constructor.
data CreateAutoMLJobResponse = CreateAutoMLJobResponse'
  { -- | The response's http status code.
    CreateAutoMLJobResponse -> Int
httpStatus :: Prelude.Int,
    -- | The unique ARN assigned to the AutoML job when it is created.
    CreateAutoMLJobResponse -> Text
autoMLJobArn :: Prelude.Text
  }
  deriving (CreateAutoMLJobResponse -> CreateAutoMLJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAutoMLJobResponse -> CreateAutoMLJobResponse -> Bool
$c/= :: CreateAutoMLJobResponse -> CreateAutoMLJobResponse -> Bool
== :: CreateAutoMLJobResponse -> CreateAutoMLJobResponse -> Bool
$c== :: CreateAutoMLJobResponse -> CreateAutoMLJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateAutoMLJobResponse]
ReadPrec CreateAutoMLJobResponse
Int -> ReadS CreateAutoMLJobResponse
ReadS [CreateAutoMLJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAutoMLJobResponse]
$creadListPrec :: ReadPrec [CreateAutoMLJobResponse]
readPrec :: ReadPrec CreateAutoMLJobResponse
$creadPrec :: ReadPrec CreateAutoMLJobResponse
readList :: ReadS [CreateAutoMLJobResponse]
$creadList :: ReadS [CreateAutoMLJobResponse]
readsPrec :: Int -> ReadS CreateAutoMLJobResponse
$creadsPrec :: Int -> ReadS CreateAutoMLJobResponse
Prelude.Read, Int -> CreateAutoMLJobResponse -> ShowS
[CreateAutoMLJobResponse] -> ShowS
CreateAutoMLJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAutoMLJobResponse] -> ShowS
$cshowList :: [CreateAutoMLJobResponse] -> ShowS
show :: CreateAutoMLJobResponse -> String
$cshow :: CreateAutoMLJobResponse -> String
showsPrec :: Int -> CreateAutoMLJobResponse -> ShowS
$cshowsPrec :: Int -> CreateAutoMLJobResponse -> ShowS
Prelude.Show, forall x. Rep CreateAutoMLJobResponse x -> CreateAutoMLJobResponse
forall x. CreateAutoMLJobResponse -> Rep CreateAutoMLJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAutoMLJobResponse x -> CreateAutoMLJobResponse
$cfrom :: forall x. CreateAutoMLJobResponse -> Rep CreateAutoMLJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAutoMLJobResponse' 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', 'createAutoMLJobResponse_httpStatus' - The response's http status code.
--
-- 'autoMLJobArn', 'createAutoMLJobResponse_autoMLJobArn' - The unique ARN assigned to the AutoML job when it is created.
newCreateAutoMLJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'autoMLJobArn'
  Prelude.Text ->
  CreateAutoMLJobResponse
newCreateAutoMLJobResponse :: Int -> Text -> CreateAutoMLJobResponse
newCreateAutoMLJobResponse
  Int
pHttpStatus_
  Text
pAutoMLJobArn_ =
    CreateAutoMLJobResponse'
      { $sel:httpStatus:CreateAutoMLJobResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:autoMLJobArn:CreateAutoMLJobResponse' :: Text
autoMLJobArn = Text
pAutoMLJobArn_
      }

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

-- | The unique ARN assigned to the AutoML job when it is created.
createAutoMLJobResponse_autoMLJobArn :: Lens.Lens' CreateAutoMLJobResponse Prelude.Text
createAutoMLJobResponse_autoMLJobArn :: Lens' CreateAutoMLJobResponse Text
createAutoMLJobResponse_autoMLJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAutoMLJobResponse' {Text
autoMLJobArn :: Text
$sel:autoMLJobArn:CreateAutoMLJobResponse' :: CreateAutoMLJobResponse -> Text
autoMLJobArn} -> Text
autoMLJobArn) (\s :: CreateAutoMLJobResponse
s@CreateAutoMLJobResponse' {} Text
a -> CreateAutoMLJobResponse
s {$sel:autoMLJobArn:CreateAutoMLJobResponse' :: Text
autoMLJobArn = Text
a} :: CreateAutoMLJobResponse)

instance Prelude.NFData CreateAutoMLJobResponse where
  rnf :: CreateAutoMLJobResponse -> ()
rnf CreateAutoMLJobResponse' {Int
Text
autoMLJobArn :: Text
httpStatus :: Int
$sel:autoMLJobArn:CreateAutoMLJobResponse' :: CreateAutoMLJobResponse -> Text
$sel:httpStatus:CreateAutoMLJobResponse' :: CreateAutoMLJobResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
autoMLJobArn