{-# 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.CreateProcessingJob
-- 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)
--
-- Creates a processing job.
module Amazonka.SageMaker.CreateProcessingJob
  ( -- * Creating a Request
    CreateProcessingJob (..),
    newCreateProcessingJob,

    -- * Request Lenses
    createProcessingJob_environment,
    createProcessingJob_stoppingCondition,
    createProcessingJob_experimentConfig,
    createProcessingJob_processingInputs,
    createProcessingJob_networkConfig,
    createProcessingJob_processingOutputConfig,
    createProcessingJob_tags,
    createProcessingJob_processingJobName,
    createProcessingJob_processingResources,
    createProcessingJob_appSpecification,
    createProcessingJob_roleArn,

    -- * Destructuring the Response
    CreateProcessingJobResponse (..),
    newCreateProcessingJobResponse,

    -- * Response Lenses
    createProcessingJobResponse_httpStatus,
    createProcessingJobResponse_processingJobArn,
  )
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:/ 'newCreateProcessingJob' smart constructor.
data CreateProcessingJob = CreateProcessingJob'
  { -- | The environment variables to set in the Docker container. Up to 100 key
    -- and values entries in the map are supported.
    CreateProcessingJob -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The time limit for how long the processing job is allowed to run.
    CreateProcessingJob -> Maybe ProcessingStoppingCondition
stoppingCondition :: Prelude.Maybe ProcessingStoppingCondition,
    CreateProcessingJob -> Maybe ExperimentConfig
experimentConfig :: Prelude.Maybe ExperimentConfig,
    -- | An array of inputs configuring the data to download into the processing
    -- container.
    CreateProcessingJob -> Maybe [ProcessingInput]
processingInputs :: Prelude.Maybe [ProcessingInput],
    -- | Networking options for a processing job, such as whether to allow
    -- inbound and outbound network calls to and from processing containers,
    -- and the VPC subnets and security groups to use for VPC-enabled
    -- processing jobs.
    CreateProcessingJob -> Maybe NetworkConfig
networkConfig :: Prelude.Maybe NetworkConfig,
    -- | Output configuration for the processing job.
    CreateProcessingJob -> Maybe ProcessingOutputConfig
processingOutputConfig :: Prelude.Maybe ProcessingOutputConfig,
    -- | (Optional) An array of key-value pairs. For more information, see
    -- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL Using Cost Allocation Tags>
    -- in the /Amazon Web Services Billing and Cost Management User Guide/.
    CreateProcessingJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the processing job. The name must be unique within an Amazon
    -- Web Services Region in the Amazon Web Services account.
    CreateProcessingJob -> Text
processingJobName :: Prelude.Text,
    -- | Identifies the resources, ML compute instances, and ML storage volumes
    -- to deploy for a processing job. In distributed training, you specify
    -- more than one instance.
    CreateProcessingJob -> ProcessingResources
processingResources :: ProcessingResources,
    -- | Configures the processing job to run a specified Docker container image.
    CreateProcessingJob -> AppSpecification
appSpecification :: AppSpecification,
    -- | The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can
    -- assume to perform tasks on your behalf.
    CreateProcessingJob -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateProcessingJob -> CreateProcessingJob -> Bool
(CreateProcessingJob -> CreateProcessingJob -> Bool)
-> (CreateProcessingJob -> CreateProcessingJob -> Bool)
-> Eq CreateProcessingJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProcessingJob -> CreateProcessingJob -> Bool
$c/= :: CreateProcessingJob -> CreateProcessingJob -> Bool
== :: CreateProcessingJob -> CreateProcessingJob -> Bool
$c== :: CreateProcessingJob -> CreateProcessingJob -> Bool
Prelude.Eq, ReadPrec [CreateProcessingJob]
ReadPrec CreateProcessingJob
Int -> ReadS CreateProcessingJob
ReadS [CreateProcessingJob]
(Int -> ReadS CreateProcessingJob)
-> ReadS [CreateProcessingJob]
-> ReadPrec CreateProcessingJob
-> ReadPrec [CreateProcessingJob]
-> Read CreateProcessingJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProcessingJob]
$creadListPrec :: ReadPrec [CreateProcessingJob]
readPrec :: ReadPrec CreateProcessingJob
$creadPrec :: ReadPrec CreateProcessingJob
readList :: ReadS [CreateProcessingJob]
$creadList :: ReadS [CreateProcessingJob]
readsPrec :: Int -> ReadS CreateProcessingJob
$creadsPrec :: Int -> ReadS CreateProcessingJob
Prelude.Read, Int -> CreateProcessingJob -> ShowS
[CreateProcessingJob] -> ShowS
CreateProcessingJob -> String
(Int -> CreateProcessingJob -> ShowS)
-> (CreateProcessingJob -> String)
-> ([CreateProcessingJob] -> ShowS)
-> Show CreateProcessingJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProcessingJob] -> ShowS
$cshowList :: [CreateProcessingJob] -> ShowS
show :: CreateProcessingJob -> String
$cshow :: CreateProcessingJob -> String
showsPrec :: Int -> CreateProcessingJob -> ShowS
$cshowsPrec :: Int -> CreateProcessingJob -> ShowS
Prelude.Show, (forall x. CreateProcessingJob -> Rep CreateProcessingJob x)
-> (forall x. Rep CreateProcessingJob x -> CreateProcessingJob)
-> Generic CreateProcessingJob
forall x. Rep CreateProcessingJob x -> CreateProcessingJob
forall x. CreateProcessingJob -> Rep CreateProcessingJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProcessingJob x -> CreateProcessingJob
$cfrom :: forall x. CreateProcessingJob -> Rep CreateProcessingJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateProcessingJob' 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', 'createProcessingJob_environment' - The environment variables to set in the Docker container. Up to 100 key
-- and values entries in the map are supported.
--
-- 'stoppingCondition', 'createProcessingJob_stoppingCondition' - The time limit for how long the processing job is allowed to run.
--
-- 'experimentConfig', 'createProcessingJob_experimentConfig' - Undocumented member.
--
-- 'processingInputs', 'createProcessingJob_processingInputs' - An array of inputs configuring the data to download into the processing
-- container.
--
-- 'networkConfig', 'createProcessingJob_networkConfig' - Networking options for a processing job, such as whether to allow
-- inbound and outbound network calls to and from processing containers,
-- and the VPC subnets and security groups to use for VPC-enabled
-- processing jobs.
--
-- 'processingOutputConfig', 'createProcessingJob_processingOutputConfig' - Output configuration for the processing job.
--
-- 'tags', 'createProcessingJob_tags' - (Optional) An array of key-value pairs. For more information, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL Using Cost Allocation Tags>
-- in the /Amazon Web Services Billing and Cost Management User Guide/.
--
-- 'processingJobName', 'createProcessingJob_processingJobName' - The name of the processing job. The name must be unique within an Amazon
-- Web Services Region in the Amazon Web Services account.
--
-- 'processingResources', 'createProcessingJob_processingResources' - Identifies the resources, ML compute instances, and ML storage volumes
-- to deploy for a processing job. In distributed training, you specify
-- more than one instance.
--
-- 'appSpecification', 'createProcessingJob_appSpecification' - Configures the processing job to run a specified Docker container image.
--
-- 'roleArn', 'createProcessingJob_roleArn' - The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can
-- assume to perform tasks on your behalf.
newCreateProcessingJob ::
  -- | 'processingJobName'
  Prelude.Text ->
  -- | 'processingResources'
  ProcessingResources ->
  -- | 'appSpecification'
  AppSpecification ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateProcessingJob
newCreateProcessingJob :: Text
-> ProcessingResources
-> AppSpecification
-> Text
-> CreateProcessingJob
newCreateProcessingJob
  Text
pProcessingJobName_
  ProcessingResources
pProcessingResources_
  AppSpecification
pAppSpecification_
  Text
pRoleArn_ =
    CreateProcessingJob' :: Maybe (HashMap Text Text)
-> Maybe ProcessingStoppingCondition
-> Maybe ExperimentConfig
-> Maybe [ProcessingInput]
-> Maybe NetworkConfig
-> Maybe ProcessingOutputConfig
-> Maybe [Tag]
-> Text
-> ProcessingResources
-> AppSpecification
-> Text
-> CreateProcessingJob
CreateProcessingJob'
      { $sel:environment:CreateProcessingJob' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:stoppingCondition:CreateProcessingJob' :: Maybe ProcessingStoppingCondition
stoppingCondition = Maybe ProcessingStoppingCondition
forall a. Maybe a
Prelude.Nothing,
        $sel:experimentConfig:CreateProcessingJob' :: Maybe ExperimentConfig
experimentConfig = Maybe ExperimentConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:processingInputs:CreateProcessingJob' :: Maybe [ProcessingInput]
processingInputs = Maybe [ProcessingInput]
forall a. Maybe a
Prelude.Nothing,
        $sel:networkConfig:CreateProcessingJob' :: Maybe NetworkConfig
networkConfig = Maybe NetworkConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:processingOutputConfig:CreateProcessingJob' :: Maybe ProcessingOutputConfig
processingOutputConfig = Maybe ProcessingOutputConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProcessingJob' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:processingJobName:CreateProcessingJob' :: Text
processingJobName = Text
pProcessingJobName_,
        $sel:processingResources:CreateProcessingJob' :: ProcessingResources
processingResources = ProcessingResources
pProcessingResources_,
        $sel:appSpecification:CreateProcessingJob' :: AppSpecification
appSpecification = AppSpecification
pAppSpecification_,
        $sel:roleArn:CreateProcessingJob' :: Text
roleArn = Text
pRoleArn_
      }

-- | The environment variables to set in the Docker container. Up to 100 key
-- and values entries in the map are supported.
createProcessingJob_environment :: Lens.Lens' CreateProcessingJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createProcessingJob_environment :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_environment = (CreateProcessingJob -> Maybe (HashMap Text Text))
-> (CreateProcessingJob
    -> Maybe (HashMap Text Text) -> CreateProcessingJob)
-> Lens
     CreateProcessingJob
     CreateProcessingJob
     (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 (\CreateProcessingJob' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:CreateProcessingJob' :: CreateProcessingJob -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Maybe (HashMap Text Text)
a -> CreateProcessingJob
s {$sel:environment:CreateProcessingJob' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: CreateProcessingJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateProcessingJob -> f CreateProcessingJob)
-> ((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)))
-> CreateProcessingJob
-> f CreateProcessingJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time limit for how long the processing job is allowed to run.
createProcessingJob_stoppingCondition :: Lens.Lens' CreateProcessingJob (Prelude.Maybe ProcessingStoppingCondition)
createProcessingJob_stoppingCondition :: (Maybe ProcessingStoppingCondition
 -> f (Maybe ProcessingStoppingCondition))
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_stoppingCondition = (CreateProcessingJob -> Maybe ProcessingStoppingCondition)
-> (CreateProcessingJob
    -> Maybe ProcessingStoppingCondition -> CreateProcessingJob)
-> Lens
     CreateProcessingJob
     CreateProcessingJob
     (Maybe ProcessingStoppingCondition)
     (Maybe ProcessingStoppingCondition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {Maybe ProcessingStoppingCondition
stoppingCondition :: Maybe ProcessingStoppingCondition
$sel:stoppingCondition:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingStoppingCondition
stoppingCondition} -> Maybe ProcessingStoppingCondition
stoppingCondition) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Maybe ProcessingStoppingCondition
a -> CreateProcessingJob
s {$sel:stoppingCondition:CreateProcessingJob' :: Maybe ProcessingStoppingCondition
stoppingCondition = Maybe ProcessingStoppingCondition
a} :: CreateProcessingJob)

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

-- | An array of inputs configuring the data to download into the processing
-- container.
createProcessingJob_processingInputs :: Lens.Lens' CreateProcessingJob (Prelude.Maybe [ProcessingInput])
createProcessingJob_processingInputs :: (Maybe [ProcessingInput] -> f (Maybe [ProcessingInput]))
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_processingInputs = (CreateProcessingJob -> Maybe [ProcessingInput])
-> (CreateProcessingJob
    -> Maybe [ProcessingInput] -> CreateProcessingJob)
-> Lens
     CreateProcessingJob
     CreateProcessingJob
     (Maybe [ProcessingInput])
     (Maybe [ProcessingInput])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {Maybe [ProcessingInput]
processingInputs :: Maybe [ProcessingInput]
$sel:processingInputs:CreateProcessingJob' :: CreateProcessingJob -> Maybe [ProcessingInput]
processingInputs} -> Maybe [ProcessingInput]
processingInputs) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Maybe [ProcessingInput]
a -> CreateProcessingJob
s {$sel:processingInputs:CreateProcessingJob' :: Maybe [ProcessingInput]
processingInputs = Maybe [ProcessingInput]
a} :: CreateProcessingJob) ((Maybe [ProcessingInput] -> f (Maybe [ProcessingInput]))
 -> CreateProcessingJob -> f CreateProcessingJob)
-> ((Maybe [ProcessingInput] -> f (Maybe [ProcessingInput]))
    -> Maybe [ProcessingInput] -> f (Maybe [ProcessingInput]))
-> (Maybe [ProcessingInput] -> f (Maybe [ProcessingInput]))
-> CreateProcessingJob
-> f CreateProcessingJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProcessingInput]
  [ProcessingInput]
  [ProcessingInput]
  [ProcessingInput]
-> Iso
     (Maybe [ProcessingInput])
     (Maybe [ProcessingInput])
     (Maybe [ProcessingInput])
     (Maybe [ProcessingInput])
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
  [ProcessingInput]
  [ProcessingInput]
  [ProcessingInput]
  [ProcessingInput]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Networking options for a processing job, such as whether to allow
-- inbound and outbound network calls to and from processing containers,
-- and the VPC subnets and security groups to use for VPC-enabled
-- processing jobs.
createProcessingJob_networkConfig :: Lens.Lens' CreateProcessingJob (Prelude.Maybe NetworkConfig)
createProcessingJob_networkConfig :: (Maybe NetworkConfig -> f (Maybe NetworkConfig))
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_networkConfig = (CreateProcessingJob -> Maybe NetworkConfig)
-> (CreateProcessingJob
    -> Maybe NetworkConfig -> CreateProcessingJob)
-> Lens
     CreateProcessingJob
     CreateProcessingJob
     (Maybe NetworkConfig)
     (Maybe NetworkConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {Maybe NetworkConfig
networkConfig :: Maybe NetworkConfig
$sel:networkConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe NetworkConfig
networkConfig} -> Maybe NetworkConfig
networkConfig) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Maybe NetworkConfig
a -> CreateProcessingJob
s {$sel:networkConfig:CreateProcessingJob' :: Maybe NetworkConfig
networkConfig = Maybe NetworkConfig
a} :: CreateProcessingJob)

-- | Output configuration for the processing job.
createProcessingJob_processingOutputConfig :: Lens.Lens' CreateProcessingJob (Prelude.Maybe ProcessingOutputConfig)
createProcessingJob_processingOutputConfig :: (Maybe ProcessingOutputConfig -> f (Maybe ProcessingOutputConfig))
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_processingOutputConfig = (CreateProcessingJob -> Maybe ProcessingOutputConfig)
-> (CreateProcessingJob
    -> Maybe ProcessingOutputConfig -> CreateProcessingJob)
-> Lens
     CreateProcessingJob
     CreateProcessingJob
     (Maybe ProcessingOutputConfig)
     (Maybe ProcessingOutputConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {Maybe ProcessingOutputConfig
processingOutputConfig :: Maybe ProcessingOutputConfig
$sel:processingOutputConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingOutputConfig
processingOutputConfig} -> Maybe ProcessingOutputConfig
processingOutputConfig) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Maybe ProcessingOutputConfig
a -> CreateProcessingJob
s {$sel:processingOutputConfig:CreateProcessingJob' :: Maybe ProcessingOutputConfig
processingOutputConfig = Maybe ProcessingOutputConfig
a} :: CreateProcessingJob)

-- | (Optional) An array of key-value pairs. For more information, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL Using Cost Allocation Tags>
-- in the /Amazon Web Services Billing and Cost Management User Guide/.
createProcessingJob_tags :: Lens.Lens' CreateProcessingJob (Prelude.Maybe [Tag])
createProcessingJob_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_tags = (CreateProcessingJob -> Maybe [Tag])
-> (CreateProcessingJob -> Maybe [Tag] -> CreateProcessingJob)
-> Lens
     CreateProcessingJob CreateProcessingJob (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateProcessingJob' :: CreateProcessingJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Maybe [Tag]
a -> CreateProcessingJob
s {$sel:tags:CreateProcessingJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateProcessingJob) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateProcessingJob -> f CreateProcessingJob)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateProcessingJob
-> f CreateProcessingJob
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 processing job. The name must be unique within an Amazon
-- Web Services Region in the Amazon Web Services account.
createProcessingJob_processingJobName :: Lens.Lens' CreateProcessingJob Prelude.Text
createProcessingJob_processingJobName :: (Text -> f Text) -> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_processingJobName = (CreateProcessingJob -> Text)
-> (CreateProcessingJob -> Text -> CreateProcessingJob)
-> Lens CreateProcessingJob CreateProcessingJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {Text
processingJobName :: Text
$sel:processingJobName:CreateProcessingJob' :: CreateProcessingJob -> Text
processingJobName} -> Text
processingJobName) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Text
a -> CreateProcessingJob
s {$sel:processingJobName:CreateProcessingJob' :: Text
processingJobName = Text
a} :: CreateProcessingJob)

-- | Identifies the resources, ML compute instances, and ML storage volumes
-- to deploy for a processing job. In distributed training, you specify
-- more than one instance.
createProcessingJob_processingResources :: Lens.Lens' CreateProcessingJob ProcessingResources
createProcessingJob_processingResources :: (ProcessingResources -> f ProcessingResources)
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_processingResources = (CreateProcessingJob -> ProcessingResources)
-> (CreateProcessingJob
    -> ProcessingResources -> CreateProcessingJob)
-> Lens
     CreateProcessingJob
     CreateProcessingJob
     ProcessingResources
     ProcessingResources
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {ProcessingResources
processingResources :: ProcessingResources
$sel:processingResources:CreateProcessingJob' :: CreateProcessingJob -> ProcessingResources
processingResources} -> ProcessingResources
processingResources) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} ProcessingResources
a -> CreateProcessingJob
s {$sel:processingResources:CreateProcessingJob' :: ProcessingResources
processingResources = ProcessingResources
a} :: CreateProcessingJob)

-- | Configures the processing job to run a specified Docker container image.
createProcessingJob_appSpecification :: Lens.Lens' CreateProcessingJob AppSpecification
createProcessingJob_appSpecification :: (AppSpecification -> f AppSpecification)
-> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_appSpecification = (CreateProcessingJob -> AppSpecification)
-> (CreateProcessingJob -> AppSpecification -> CreateProcessingJob)
-> Lens
     CreateProcessingJob
     CreateProcessingJob
     AppSpecification
     AppSpecification
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {AppSpecification
appSpecification :: AppSpecification
$sel:appSpecification:CreateProcessingJob' :: CreateProcessingJob -> AppSpecification
appSpecification} -> AppSpecification
appSpecification) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} AppSpecification
a -> CreateProcessingJob
s {$sel:appSpecification:CreateProcessingJob' :: AppSpecification
appSpecification = AppSpecification
a} :: CreateProcessingJob)

-- | The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can
-- assume to perform tasks on your behalf.
createProcessingJob_roleArn :: Lens.Lens' CreateProcessingJob Prelude.Text
createProcessingJob_roleArn :: (Text -> f Text) -> CreateProcessingJob -> f CreateProcessingJob
createProcessingJob_roleArn = (CreateProcessingJob -> Text)
-> (CreateProcessingJob -> Text -> CreateProcessingJob)
-> Lens CreateProcessingJob CreateProcessingJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProcessingJob' {Text
roleArn :: Text
$sel:roleArn:CreateProcessingJob' :: CreateProcessingJob -> Text
roleArn} -> Text
roleArn) (\s :: CreateProcessingJob
s@CreateProcessingJob' {} Text
a -> CreateProcessingJob
s {$sel:roleArn:CreateProcessingJob' :: Text
roleArn = Text
a} :: CreateProcessingJob)

instance Core.AWSRequest CreateProcessingJob where
  type
    AWSResponse CreateProcessingJob =
      CreateProcessingJobResponse
  request :: CreateProcessingJob -> Request CreateProcessingJob
request = Service -> CreateProcessingJob -> Request CreateProcessingJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateProcessingJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateProcessingJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateProcessingJob))
-> Logger
-> Service
-> Proxy CreateProcessingJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateProcessingJob)))
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 -> CreateProcessingJobResponse
CreateProcessingJobResponse'
            (Int -> Text -> CreateProcessingJobResponse)
-> Either String Int
-> Either String (Text -> CreateProcessingJobResponse)
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 -> CreateProcessingJobResponse)
-> Either String Text -> Either String CreateProcessingJobResponse
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
"ProcessingJobArn")
      )

instance Prelude.Hashable CreateProcessingJob

instance Prelude.NFData CreateProcessingJob

instance Core.ToHeaders CreateProcessingJob where
  toHeaders :: CreateProcessingJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateProcessingJob -> 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.CreateProcessingJob" ::
                          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 CreateProcessingJob where
  toJSON :: CreateProcessingJob -> Value
toJSON CreateProcessingJob' {Maybe [ProcessingInput]
Maybe [Tag]
Maybe (HashMap Text Text)
Maybe ExperimentConfig
Maybe ProcessingOutputConfig
Maybe ProcessingStoppingCondition
Maybe NetworkConfig
Text
AppSpecification
ProcessingResources
roleArn :: Text
appSpecification :: AppSpecification
processingResources :: ProcessingResources
processingJobName :: Text
tags :: Maybe [Tag]
processingOutputConfig :: Maybe ProcessingOutputConfig
networkConfig :: Maybe NetworkConfig
processingInputs :: Maybe [ProcessingInput]
experimentConfig :: Maybe ExperimentConfig
stoppingCondition :: Maybe ProcessingStoppingCondition
environment :: Maybe (HashMap Text Text)
$sel:roleArn:CreateProcessingJob' :: CreateProcessingJob -> Text
$sel:appSpecification:CreateProcessingJob' :: CreateProcessingJob -> AppSpecification
$sel:processingResources:CreateProcessingJob' :: CreateProcessingJob -> ProcessingResources
$sel:processingJobName:CreateProcessingJob' :: CreateProcessingJob -> Text
$sel:tags:CreateProcessingJob' :: CreateProcessingJob -> Maybe [Tag]
$sel:processingOutputConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingOutputConfig
$sel:networkConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe NetworkConfig
$sel:processingInputs:CreateProcessingJob' :: CreateProcessingJob -> Maybe [ProcessingInput]
$sel:experimentConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ExperimentConfig
$sel:stoppingCondition:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingStoppingCondition
$sel:environment:CreateProcessingJob' :: CreateProcessingJob -> 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
"StoppingCondition" Text -> ProcessingStoppingCondition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProcessingStoppingCondition -> Pair)
-> Maybe ProcessingStoppingCondition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProcessingStoppingCondition
stoppingCondition,
            (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
"ProcessingInputs" Text -> [ProcessingInput] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ProcessingInput] -> Pair)
-> Maybe [ProcessingInput] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ProcessingInput]
processingInputs,
            (Text
"NetworkConfig" Text -> NetworkConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NetworkConfig -> Pair) -> Maybe NetworkConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkConfig
networkConfig,
            (Text
"ProcessingOutputConfig" Text -> ProcessingOutputConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProcessingOutputConfig -> Pair)
-> Maybe ProcessingOutputConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProcessingOutputConfig
processingOutputConfig,
            (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
"ProcessingJobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
processingJobName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ProcessingResources" Text -> ProcessingResources -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ProcessingResources
processingResources),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AppSpecification" Text -> AppSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AppSpecification
appSpecification),
            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)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateProcessingJobResponse' 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', 'createProcessingJobResponse_httpStatus' - The response's http status code.
--
-- 'processingJobArn', 'createProcessingJobResponse_processingJobArn' - The Amazon Resource Name (ARN) of the processing job.
newCreateProcessingJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'processingJobArn'
  Prelude.Text ->
  CreateProcessingJobResponse
newCreateProcessingJobResponse :: Int -> Text -> CreateProcessingJobResponse
newCreateProcessingJobResponse
  Int
pHttpStatus_
  Text
pProcessingJobArn_ =
    CreateProcessingJobResponse' :: Int -> Text -> CreateProcessingJobResponse
CreateProcessingJobResponse'
      { $sel:httpStatus:CreateProcessingJobResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:processingJobArn:CreateProcessingJobResponse' :: Text
processingJobArn = Text
pProcessingJobArn_
      }

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

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

instance Prelude.NFData CreateProcessingJobResponse