{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_experimentConfig,
    createProcessingJob_networkConfig,
    createProcessingJob_processingInputs,
    createProcessingJob_processingOutputConfig,
    createProcessingJob_stoppingCondition,
    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.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:/ '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),
    CreateProcessingJob -> Maybe ExperimentConfig
experimentConfig :: Prelude.Maybe ExperimentConfig,
    -- | 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,
    -- | An array of inputs configuring the data to download into the processing
    -- container.
    CreateProcessingJob -> Maybe [ProcessingInput]
processingInputs :: Prelude.Maybe [ProcessingInput],
    -- | Output configuration for the processing job.
    CreateProcessingJob -> Maybe ProcessingOutputConfig
processingOutputConfig :: Prelude.Maybe ProcessingOutputConfig,
    -- | The time limit for how long the processing job is allowed to run.
    CreateProcessingJob -> Maybe ProcessingStoppingCondition
stoppingCondition :: Prelude.Maybe ProcessingStoppingCondition,
    -- | (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
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]
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
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. 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.
--
-- 'experimentConfig', 'createProcessingJob_experimentConfig' - Undocumented member.
--
-- '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.
--
-- 'processingInputs', 'createProcessingJob_processingInputs' - An array of inputs configuring the data to download into the processing
-- container.
--
-- 'processingOutputConfig', 'createProcessingJob_processingOutputConfig' - Output configuration for the processing job.
--
-- 'stoppingCondition', 'createProcessingJob_stoppingCondition' - The time limit for how long the processing job is allowed to run.
--
-- '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'
      { $sel:environment:CreateProcessingJob' :: Maybe (HashMap Text Text)
environment = forall a. Maybe a
Prelude.Nothing,
        $sel:experimentConfig:CreateProcessingJob' :: Maybe ExperimentConfig
experimentConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:networkConfig:CreateProcessingJob' :: Maybe NetworkConfig
networkConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:processingInputs:CreateProcessingJob' :: Maybe [ProcessingInput]
processingInputs = forall a. Maybe a
Prelude.Nothing,
        $sel:processingOutputConfig:CreateProcessingJob' :: Maybe ProcessingOutputConfig
processingOutputConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:stoppingCondition:CreateProcessingJob' :: Maybe ProcessingStoppingCondition
stoppingCondition = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProcessingJob' :: Maybe [Tag]
tags = 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 :: Lens' CreateProcessingJob (Maybe (HashMap Text Text))
createProcessingJob_environment = 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) 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

-- | Undocumented member.
createProcessingJob_experimentConfig :: Lens.Lens' CreateProcessingJob (Prelude.Maybe ExperimentConfig)
createProcessingJob_experimentConfig :: Lens' CreateProcessingJob (Maybe ExperimentConfig)
createProcessingJob_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)

-- | 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 :: Lens' CreateProcessingJob (Maybe NetworkConfig)
createProcessingJob_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)

-- | An array of inputs configuring the data to download into the processing
-- container.
createProcessingJob_processingInputs :: Lens.Lens' CreateProcessingJob (Prelude.Maybe [ProcessingInput])
createProcessingJob_processingInputs :: Lens' CreateProcessingJob (Maybe [ProcessingInput])
createProcessingJob_processingInputs = 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) 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

-- | Output configuration for the processing job.
createProcessingJob_processingOutputConfig :: Lens.Lens' CreateProcessingJob (Prelude.Maybe ProcessingOutputConfig)
createProcessingJob_processingOutputConfig :: Lens' CreateProcessingJob (Maybe ProcessingOutputConfig)
createProcessingJob_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)

-- | The time limit for how long the processing job is allowed to run.
createProcessingJob_stoppingCondition :: Lens.Lens' CreateProcessingJob (Prelude.Maybe ProcessingStoppingCondition)
createProcessingJob_stoppingCondition :: Lens' CreateProcessingJob (Maybe ProcessingStoppingCondition)
createProcessingJob_stoppingCondition = 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)

-- | (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 :: Lens' CreateProcessingJob (Maybe [Tag])
createProcessingJob_tags = 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) 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

-- | 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 :: Lens' CreateProcessingJob Text
createProcessingJob_processingJobName = 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 :: Lens' CreateProcessingJob ProcessingResources
createProcessingJob_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 :: Lens' CreateProcessingJob AppSpecification
createProcessingJob_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 :: Lens' CreateProcessingJob Text
createProcessingJob_roleArn = 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 :: (Service -> Service)
-> CreateProcessingJob -> Request CreateProcessingJob
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 CreateProcessingJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateProcessingJob)))
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 -> CreateProcessingJobResponse
CreateProcessingJobResponse'
            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
"ProcessingJobArn")
      )

instance Prelude.Hashable CreateProcessingJob where
  hashWithSalt :: Int -> CreateProcessingJob -> Int
hashWithSalt Int
_salt 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]
stoppingCondition :: Maybe ProcessingStoppingCondition
processingOutputConfig :: Maybe ProcessingOutputConfig
processingInputs :: Maybe [ProcessingInput]
networkConfig :: Maybe NetworkConfig
experimentConfig :: Maybe ExperimentConfig
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:stoppingCondition:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingStoppingCondition
$sel:processingOutputConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingOutputConfig
$sel:processingInputs:CreateProcessingJob' :: CreateProcessingJob -> Maybe [ProcessingInput]
$sel:networkConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe NetworkConfig
$sel:experimentConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ExperimentConfig
$sel:environment:CreateProcessingJob' :: CreateProcessingJob -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
environment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExperimentConfig
experimentConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkConfig
networkConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProcessingInput]
processingInputs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProcessingOutputConfig
processingOutputConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProcessingStoppingCondition
stoppingCondition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
processingJobName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProcessingResources
processingResources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AppSpecification
appSpecification
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData CreateProcessingJob where
  rnf :: CreateProcessingJob -> ()
rnf 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]
stoppingCondition :: Maybe ProcessingStoppingCondition
processingOutputConfig :: Maybe ProcessingOutputConfig
processingInputs :: Maybe [ProcessingInput]
networkConfig :: Maybe NetworkConfig
experimentConfig :: Maybe ExperimentConfig
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:stoppingCondition:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingStoppingCondition
$sel:processingOutputConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingOutputConfig
$sel:processingInputs:CreateProcessingJob' :: CreateProcessingJob -> Maybe [ProcessingInput]
$sel:networkConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe NetworkConfig
$sel:experimentConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ExperimentConfig
$sel:environment:CreateProcessingJob' :: CreateProcessingJob -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
environment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExperimentConfig
experimentConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkConfig
networkConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProcessingInput]
processingInputs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProcessingOutputConfig
processingOutputConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProcessingStoppingCondition
stoppingCondition
      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
processingJobName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProcessingResources
processingResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AppSpecification
appSpecification
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

instance Data.ToHeaders CreateProcessingJob where
  toHeaders :: CreateProcessingJob -> 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.CreateProcessingJob" ::
                          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 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]
stoppingCondition :: Maybe ProcessingStoppingCondition
processingOutputConfig :: Maybe ProcessingOutputConfig
processingInputs :: Maybe [ProcessingInput]
networkConfig :: Maybe NetworkConfig
experimentConfig :: Maybe ExperimentConfig
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:stoppingCondition:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingStoppingCondition
$sel:processingOutputConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ProcessingOutputConfig
$sel:processingInputs:CreateProcessingJob' :: CreateProcessingJob -> Maybe [ProcessingInput]
$sel:networkConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe NetworkConfig
$sel:experimentConfig:CreateProcessingJob' :: CreateProcessingJob -> Maybe ExperimentConfig
$sel:environment:CreateProcessingJob' :: CreateProcessingJob -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Environment" 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 (HashMap Text Text)
environment,
            (Key
"ExperimentConfig" 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 ExperimentConfig
experimentConfig,
            (Key
"NetworkConfig" 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 NetworkConfig
networkConfig,
            (Key
"ProcessingInputs" 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 [ProcessingInput]
processingInputs,
            (Key
"ProcessingOutputConfig" 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 ProcessingOutputConfig
processingOutputConfig,
            (Key
"StoppingCondition" 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 ProcessingStoppingCondition
stoppingCondition,
            (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
"ProcessingJobName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
processingJobName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ProcessingResources" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProcessingResources
processingResources),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"AppSpecification" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AppSpecification
appSpecification),
            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 CreateProcessingJob where
  toPath :: CreateProcessingJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateProcessingJob where
  toQuery :: CreateProcessingJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
      { $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 :: Lens' CreateProcessingJobResponse Int
createProcessingJobResponse_httpStatus = 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 :: Lens' CreateProcessingJobResponse Text
createProcessingJobResponse_processingJobArn = 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 where
  rnf :: CreateProcessingJobResponse -> ()
rnf CreateProcessingJobResponse' {Int
Text
processingJobArn :: Text
httpStatus :: Int
$sel:processingJobArn:CreateProcessingJobResponse' :: CreateProcessingJobResponse -> Text
$sel:httpStatus:CreateProcessingJobResponse' :: CreateProcessingJobResponse -> 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
processingJobArn