{-# 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.DataBrew.CreateRecipeJob
-- 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 new job to transform input data, using steps defined in an
-- existing Glue DataBrew recipe
module Amazonka.DataBrew.CreateRecipeJob
  ( -- * Creating a Request
    CreateRecipeJob (..),
    newCreateRecipeJob,

    -- * Request Lenses
    createRecipeJob_dataCatalogOutputs,
    createRecipeJob_recipeReference,
    createRecipeJob_databaseOutputs,
    createRecipeJob_encryptionMode,
    createRecipeJob_outputs,
    createRecipeJob_logSubscription,
    createRecipeJob_projectName,
    createRecipeJob_maxRetries,
    createRecipeJob_datasetName,
    createRecipeJob_encryptionKeyArn,
    createRecipeJob_maxCapacity,
    createRecipeJob_timeout,
    createRecipeJob_tags,
    createRecipeJob_name,
    createRecipeJob_roleArn,

    -- * Destructuring the Response
    CreateRecipeJobResponse (..),
    newCreateRecipeJobResponse,

    -- * Response Lenses
    createRecipeJobResponse_httpStatus,
    createRecipeJobResponse_name,
  )
where

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

-- | /See:/ 'newCreateRecipeJob' smart constructor.
data CreateRecipeJob = CreateRecipeJob'
  { -- | One or more artifacts that represent the Glue Data Catalog output from
    -- running the job.
    CreateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs :: Prelude.Maybe (Prelude.NonEmpty DataCatalogOutput),
    CreateRecipeJob -> Maybe RecipeReference
recipeReference :: Prelude.Maybe RecipeReference,
    -- | Represents a list of JDBC database output objects which defines the
    -- output destination for a DataBrew recipe job to write to.
    CreateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
databaseOutputs :: Prelude.Maybe (Prelude.NonEmpty DatabaseOutput),
    -- | The encryption mode for the job, which can be one of the following:
    --
    -- -   @SSE-KMS@ - Server-side encryption with keys managed by KMS.
    --
    -- -   @SSE-S3@ - Server-side encryption with keys managed by Amazon S3.
    CreateRecipeJob -> Maybe EncryptionMode
encryptionMode :: Prelude.Maybe EncryptionMode,
    -- | One or more artifacts that represent the output from running the job.
    CreateRecipeJob -> Maybe (NonEmpty Output)
outputs :: Prelude.Maybe (Prelude.NonEmpty Output),
    -- | Enables or disables Amazon CloudWatch logging for the job. If logging is
    -- enabled, CloudWatch writes one log stream for each job run.
    CreateRecipeJob -> Maybe LogSubscription
logSubscription :: Prelude.Maybe LogSubscription,
    -- | Either the name of an existing project, or a combination of a recipe and
    -- a dataset to associate with the recipe.
    CreateRecipeJob -> Maybe Text
projectName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of times to retry the job after a job run fails.
    CreateRecipeJob -> Maybe Natural
maxRetries :: Prelude.Maybe Prelude.Natural,
    -- | The name of the dataset that this job processes.
    CreateRecipeJob -> Maybe Text
datasetName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an encryption key that is used to
    -- protect the job.
    CreateRecipeJob -> Maybe Text
encryptionKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of nodes that DataBrew can consume when the job
    -- processes data.
    CreateRecipeJob -> Maybe Int
maxCapacity :: Prelude.Maybe Prelude.Int,
    -- | The job\'s timeout in minutes. A job that attempts to run longer than
    -- this timeout period ends with a status of @TIMEOUT@.
    CreateRecipeJob -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | Metadata tags to apply to this job.
    CreateRecipeJob -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A unique name for the job. Valid characters are alphanumeric (A-Z, a-z,
    -- 0-9), hyphen (-), period (.), and space.
    CreateRecipeJob -> Text
name :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) role to be assumed when DataBrew runs the job.
    CreateRecipeJob -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateRecipeJob -> CreateRecipeJob -> Bool
(CreateRecipeJob -> CreateRecipeJob -> Bool)
-> (CreateRecipeJob -> CreateRecipeJob -> Bool)
-> Eq CreateRecipeJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRecipeJob -> CreateRecipeJob -> Bool
$c/= :: CreateRecipeJob -> CreateRecipeJob -> Bool
== :: CreateRecipeJob -> CreateRecipeJob -> Bool
$c== :: CreateRecipeJob -> CreateRecipeJob -> Bool
Prelude.Eq, ReadPrec [CreateRecipeJob]
ReadPrec CreateRecipeJob
Int -> ReadS CreateRecipeJob
ReadS [CreateRecipeJob]
(Int -> ReadS CreateRecipeJob)
-> ReadS [CreateRecipeJob]
-> ReadPrec CreateRecipeJob
-> ReadPrec [CreateRecipeJob]
-> Read CreateRecipeJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRecipeJob]
$creadListPrec :: ReadPrec [CreateRecipeJob]
readPrec :: ReadPrec CreateRecipeJob
$creadPrec :: ReadPrec CreateRecipeJob
readList :: ReadS [CreateRecipeJob]
$creadList :: ReadS [CreateRecipeJob]
readsPrec :: Int -> ReadS CreateRecipeJob
$creadsPrec :: Int -> ReadS CreateRecipeJob
Prelude.Read, Int -> CreateRecipeJob -> ShowS
[CreateRecipeJob] -> ShowS
CreateRecipeJob -> String
(Int -> CreateRecipeJob -> ShowS)
-> (CreateRecipeJob -> String)
-> ([CreateRecipeJob] -> ShowS)
-> Show CreateRecipeJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRecipeJob] -> ShowS
$cshowList :: [CreateRecipeJob] -> ShowS
show :: CreateRecipeJob -> String
$cshow :: CreateRecipeJob -> String
showsPrec :: Int -> CreateRecipeJob -> ShowS
$cshowsPrec :: Int -> CreateRecipeJob -> ShowS
Prelude.Show, (forall x. CreateRecipeJob -> Rep CreateRecipeJob x)
-> (forall x. Rep CreateRecipeJob x -> CreateRecipeJob)
-> Generic CreateRecipeJob
forall x. Rep CreateRecipeJob x -> CreateRecipeJob
forall x. CreateRecipeJob -> Rep CreateRecipeJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRecipeJob x -> CreateRecipeJob
$cfrom :: forall x. CreateRecipeJob -> Rep CreateRecipeJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateRecipeJob' 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:
--
-- 'dataCatalogOutputs', 'createRecipeJob_dataCatalogOutputs' - One or more artifacts that represent the Glue Data Catalog output from
-- running the job.
--
-- 'recipeReference', 'createRecipeJob_recipeReference' - Undocumented member.
--
-- 'databaseOutputs', 'createRecipeJob_databaseOutputs' - Represents a list of JDBC database output objects which defines the
-- output destination for a DataBrew recipe job to write to.
--
-- 'encryptionMode', 'createRecipeJob_encryptionMode' - The encryption mode for the job, which can be one of the following:
--
-- -   @SSE-KMS@ - Server-side encryption with keys managed by KMS.
--
-- -   @SSE-S3@ - Server-side encryption with keys managed by Amazon S3.
--
-- 'outputs', 'createRecipeJob_outputs' - One or more artifacts that represent the output from running the job.
--
-- 'logSubscription', 'createRecipeJob_logSubscription' - Enables or disables Amazon CloudWatch logging for the job. If logging is
-- enabled, CloudWatch writes one log stream for each job run.
--
-- 'projectName', 'createRecipeJob_projectName' - Either the name of an existing project, or a combination of a recipe and
-- a dataset to associate with the recipe.
--
-- 'maxRetries', 'createRecipeJob_maxRetries' - The maximum number of times to retry the job after a job run fails.
--
-- 'datasetName', 'createRecipeJob_datasetName' - The name of the dataset that this job processes.
--
-- 'encryptionKeyArn', 'createRecipeJob_encryptionKeyArn' - The Amazon Resource Name (ARN) of an encryption key that is used to
-- protect the job.
--
-- 'maxCapacity', 'createRecipeJob_maxCapacity' - The maximum number of nodes that DataBrew can consume when the job
-- processes data.
--
-- 'timeout', 'createRecipeJob_timeout' - The job\'s timeout in minutes. A job that attempts to run longer than
-- this timeout period ends with a status of @TIMEOUT@.
--
-- 'tags', 'createRecipeJob_tags' - Metadata tags to apply to this job.
--
-- 'name', 'createRecipeJob_name' - A unique name for the job. Valid characters are alphanumeric (A-Z, a-z,
-- 0-9), hyphen (-), period (.), and space.
--
-- 'roleArn', 'createRecipeJob_roleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role to be assumed when DataBrew runs the job.
newCreateRecipeJob ::
  -- | 'name'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateRecipeJob
newCreateRecipeJob :: Text -> Text -> CreateRecipeJob
newCreateRecipeJob Text
pName_ Text
pRoleArn_ =
  CreateRecipeJob' :: Maybe (NonEmpty DataCatalogOutput)
-> Maybe RecipeReference
-> Maybe (NonEmpty DatabaseOutput)
-> Maybe EncryptionMode
-> Maybe (NonEmpty Output)
-> Maybe LogSubscription
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Natural
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> CreateRecipeJob
CreateRecipeJob'
    { $sel:dataCatalogOutputs:CreateRecipeJob' :: Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs =
        Maybe (NonEmpty DataCatalogOutput)
forall a. Maybe a
Prelude.Nothing,
      $sel:recipeReference:CreateRecipeJob' :: Maybe RecipeReference
recipeReference = Maybe RecipeReference
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseOutputs:CreateRecipeJob' :: Maybe (NonEmpty DatabaseOutput)
databaseOutputs = Maybe (NonEmpty DatabaseOutput)
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionMode:CreateRecipeJob' :: Maybe EncryptionMode
encryptionMode = Maybe EncryptionMode
forall a. Maybe a
Prelude.Nothing,
      $sel:outputs:CreateRecipeJob' :: Maybe (NonEmpty Output)
outputs = Maybe (NonEmpty Output)
forall a. Maybe a
Prelude.Nothing,
      $sel:logSubscription:CreateRecipeJob' :: Maybe LogSubscription
logSubscription = Maybe LogSubscription
forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:CreateRecipeJob' :: Maybe Text
projectName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRetries:CreateRecipeJob' :: Maybe Natural
maxRetries = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetName:CreateRecipeJob' :: Maybe Text
datasetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionKeyArn:CreateRecipeJob' :: Maybe Text
encryptionKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxCapacity:CreateRecipeJob' :: Maybe Int
maxCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:CreateRecipeJob' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateRecipeJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateRecipeJob' :: Text
name = Text
pName_,
      $sel:roleArn:CreateRecipeJob' :: Text
roleArn = Text
pRoleArn_
    }

-- | One or more artifacts that represent the Glue Data Catalog output from
-- running the job.
createRecipeJob_dataCatalogOutputs :: Lens.Lens' CreateRecipeJob (Prelude.Maybe (Prelude.NonEmpty DataCatalogOutput))
createRecipeJob_dataCatalogOutputs :: (Maybe (NonEmpty DataCatalogOutput)
 -> f (Maybe (NonEmpty DataCatalogOutput)))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_dataCatalogOutputs = (CreateRecipeJob -> Maybe (NonEmpty DataCatalogOutput))
-> (CreateRecipeJob
    -> Maybe (NonEmpty DataCatalogOutput) -> CreateRecipeJob)
-> Lens
     CreateRecipeJob
     CreateRecipeJob
     (Maybe (NonEmpty DataCatalogOutput))
     (Maybe (NonEmpty DataCatalogOutput))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs :: Maybe (NonEmpty DataCatalogOutput)
$sel:dataCatalogOutputs:CreateRecipeJob' :: CreateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs} -> Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe (NonEmpty DataCatalogOutput)
a -> CreateRecipeJob
s {$sel:dataCatalogOutputs:CreateRecipeJob' :: Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs = Maybe (NonEmpty DataCatalogOutput)
a} :: CreateRecipeJob) ((Maybe (NonEmpty DataCatalogOutput)
  -> f (Maybe (NonEmpty DataCatalogOutput)))
 -> CreateRecipeJob -> f CreateRecipeJob)
-> ((Maybe (NonEmpty DataCatalogOutput)
     -> f (Maybe (NonEmpty DataCatalogOutput)))
    -> Maybe (NonEmpty DataCatalogOutput)
    -> f (Maybe (NonEmpty DataCatalogOutput)))
-> (Maybe (NonEmpty DataCatalogOutput)
    -> f (Maybe (NonEmpty DataCatalogOutput)))
-> CreateRecipeJob
-> f CreateRecipeJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty DataCatalogOutput)
  (NonEmpty DataCatalogOutput)
  (NonEmpty DataCatalogOutput)
  (NonEmpty DataCatalogOutput)
-> Iso
     (Maybe (NonEmpty DataCatalogOutput))
     (Maybe (NonEmpty DataCatalogOutput))
     (Maybe (NonEmpty DataCatalogOutput))
     (Maybe (NonEmpty DataCatalogOutput))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty DataCatalogOutput)
  (NonEmpty DataCatalogOutput)
  (NonEmpty DataCatalogOutput)
  (NonEmpty DataCatalogOutput)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
createRecipeJob_recipeReference :: Lens.Lens' CreateRecipeJob (Prelude.Maybe RecipeReference)
createRecipeJob_recipeReference :: (Maybe RecipeReference -> f (Maybe RecipeReference))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_recipeReference = (CreateRecipeJob -> Maybe RecipeReference)
-> (CreateRecipeJob -> Maybe RecipeReference -> CreateRecipeJob)
-> Lens
     CreateRecipeJob
     CreateRecipeJob
     (Maybe RecipeReference)
     (Maybe RecipeReference)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe RecipeReference
recipeReference :: Maybe RecipeReference
$sel:recipeReference:CreateRecipeJob' :: CreateRecipeJob -> Maybe RecipeReference
recipeReference} -> Maybe RecipeReference
recipeReference) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe RecipeReference
a -> CreateRecipeJob
s {$sel:recipeReference:CreateRecipeJob' :: Maybe RecipeReference
recipeReference = Maybe RecipeReference
a} :: CreateRecipeJob)

-- | Represents a list of JDBC database output objects which defines the
-- output destination for a DataBrew recipe job to write to.
createRecipeJob_databaseOutputs :: Lens.Lens' CreateRecipeJob (Prelude.Maybe (Prelude.NonEmpty DatabaseOutput))
createRecipeJob_databaseOutputs :: (Maybe (NonEmpty DatabaseOutput)
 -> f (Maybe (NonEmpty DatabaseOutput)))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_databaseOutputs = (CreateRecipeJob -> Maybe (NonEmpty DatabaseOutput))
-> (CreateRecipeJob
    -> Maybe (NonEmpty DatabaseOutput) -> CreateRecipeJob)
-> Lens
     CreateRecipeJob
     CreateRecipeJob
     (Maybe (NonEmpty DatabaseOutput))
     (Maybe (NonEmpty DatabaseOutput))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe (NonEmpty DatabaseOutput)
databaseOutputs :: Maybe (NonEmpty DatabaseOutput)
$sel:databaseOutputs:CreateRecipeJob' :: CreateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
databaseOutputs} -> Maybe (NonEmpty DatabaseOutput)
databaseOutputs) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe (NonEmpty DatabaseOutput)
a -> CreateRecipeJob
s {$sel:databaseOutputs:CreateRecipeJob' :: Maybe (NonEmpty DatabaseOutput)
databaseOutputs = Maybe (NonEmpty DatabaseOutput)
a} :: CreateRecipeJob) ((Maybe (NonEmpty DatabaseOutput)
  -> f (Maybe (NonEmpty DatabaseOutput)))
 -> CreateRecipeJob -> f CreateRecipeJob)
-> ((Maybe (NonEmpty DatabaseOutput)
     -> f (Maybe (NonEmpty DatabaseOutput)))
    -> Maybe (NonEmpty DatabaseOutput)
    -> f (Maybe (NonEmpty DatabaseOutput)))
-> (Maybe (NonEmpty DatabaseOutput)
    -> f (Maybe (NonEmpty DatabaseOutput)))
-> CreateRecipeJob
-> f CreateRecipeJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty DatabaseOutput)
  (NonEmpty DatabaseOutput)
  (NonEmpty DatabaseOutput)
  (NonEmpty DatabaseOutput)
-> Iso
     (Maybe (NonEmpty DatabaseOutput))
     (Maybe (NonEmpty DatabaseOutput))
     (Maybe (NonEmpty DatabaseOutput))
     (Maybe (NonEmpty DatabaseOutput))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty DatabaseOutput)
  (NonEmpty DatabaseOutput)
  (NonEmpty DatabaseOutput)
  (NonEmpty DatabaseOutput)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The encryption mode for the job, which can be one of the following:
--
-- -   @SSE-KMS@ - Server-side encryption with keys managed by KMS.
--
-- -   @SSE-S3@ - Server-side encryption with keys managed by Amazon S3.
createRecipeJob_encryptionMode :: Lens.Lens' CreateRecipeJob (Prelude.Maybe EncryptionMode)
createRecipeJob_encryptionMode :: (Maybe EncryptionMode -> f (Maybe EncryptionMode))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_encryptionMode = (CreateRecipeJob -> Maybe EncryptionMode)
-> (CreateRecipeJob -> Maybe EncryptionMode -> CreateRecipeJob)
-> Lens
     CreateRecipeJob
     CreateRecipeJob
     (Maybe EncryptionMode)
     (Maybe EncryptionMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe EncryptionMode
encryptionMode :: Maybe EncryptionMode
$sel:encryptionMode:CreateRecipeJob' :: CreateRecipeJob -> Maybe EncryptionMode
encryptionMode} -> Maybe EncryptionMode
encryptionMode) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe EncryptionMode
a -> CreateRecipeJob
s {$sel:encryptionMode:CreateRecipeJob' :: Maybe EncryptionMode
encryptionMode = Maybe EncryptionMode
a} :: CreateRecipeJob)

-- | One or more artifacts that represent the output from running the job.
createRecipeJob_outputs :: Lens.Lens' CreateRecipeJob (Prelude.Maybe (Prelude.NonEmpty Output))
createRecipeJob_outputs :: (Maybe (NonEmpty Output) -> f (Maybe (NonEmpty Output)))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_outputs = (CreateRecipeJob -> Maybe (NonEmpty Output))
-> (CreateRecipeJob -> Maybe (NonEmpty Output) -> CreateRecipeJob)
-> Lens
     CreateRecipeJob
     CreateRecipeJob
     (Maybe (NonEmpty Output))
     (Maybe (NonEmpty Output))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe (NonEmpty Output)
outputs :: Maybe (NonEmpty Output)
$sel:outputs:CreateRecipeJob' :: CreateRecipeJob -> Maybe (NonEmpty Output)
outputs} -> Maybe (NonEmpty Output)
outputs) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe (NonEmpty Output)
a -> CreateRecipeJob
s {$sel:outputs:CreateRecipeJob' :: Maybe (NonEmpty Output)
outputs = Maybe (NonEmpty Output)
a} :: CreateRecipeJob) ((Maybe (NonEmpty Output) -> f (Maybe (NonEmpty Output)))
 -> CreateRecipeJob -> f CreateRecipeJob)
-> ((Maybe (NonEmpty Output) -> f (Maybe (NonEmpty Output)))
    -> Maybe (NonEmpty Output) -> f (Maybe (NonEmpty Output)))
-> (Maybe (NonEmpty Output) -> f (Maybe (NonEmpty Output)))
-> CreateRecipeJob
-> f CreateRecipeJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Output)
  (NonEmpty Output)
  (NonEmpty Output)
  (NonEmpty Output)
-> Iso
     (Maybe (NonEmpty Output))
     (Maybe (NonEmpty Output))
     (Maybe (NonEmpty Output))
     (Maybe (NonEmpty Output))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Output)
  (NonEmpty Output)
  (NonEmpty Output)
  (NonEmpty Output)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Enables or disables Amazon CloudWatch logging for the job. If logging is
-- enabled, CloudWatch writes one log stream for each job run.
createRecipeJob_logSubscription :: Lens.Lens' CreateRecipeJob (Prelude.Maybe LogSubscription)
createRecipeJob_logSubscription :: (Maybe LogSubscription -> f (Maybe LogSubscription))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_logSubscription = (CreateRecipeJob -> Maybe LogSubscription)
-> (CreateRecipeJob -> Maybe LogSubscription -> CreateRecipeJob)
-> Lens
     CreateRecipeJob
     CreateRecipeJob
     (Maybe LogSubscription)
     (Maybe LogSubscription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe LogSubscription
logSubscription :: Maybe LogSubscription
$sel:logSubscription:CreateRecipeJob' :: CreateRecipeJob -> Maybe LogSubscription
logSubscription} -> Maybe LogSubscription
logSubscription) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe LogSubscription
a -> CreateRecipeJob
s {$sel:logSubscription:CreateRecipeJob' :: Maybe LogSubscription
logSubscription = Maybe LogSubscription
a} :: CreateRecipeJob)

-- | Either the name of an existing project, or a combination of a recipe and
-- a dataset to associate with the recipe.
createRecipeJob_projectName :: Lens.Lens' CreateRecipeJob (Prelude.Maybe Prelude.Text)
createRecipeJob_projectName :: (Maybe Text -> f (Maybe Text))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_projectName = (CreateRecipeJob -> Maybe Text)
-> (CreateRecipeJob -> Maybe Text -> CreateRecipeJob)
-> Lens CreateRecipeJob CreateRecipeJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe Text
projectName :: Maybe Text
$sel:projectName:CreateRecipeJob' :: CreateRecipeJob -> Maybe Text
projectName} -> Maybe Text
projectName) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe Text
a -> CreateRecipeJob
s {$sel:projectName:CreateRecipeJob' :: Maybe Text
projectName = Maybe Text
a} :: CreateRecipeJob)

-- | The maximum number of times to retry the job after a job run fails.
createRecipeJob_maxRetries :: Lens.Lens' CreateRecipeJob (Prelude.Maybe Prelude.Natural)
createRecipeJob_maxRetries :: (Maybe Natural -> f (Maybe Natural))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_maxRetries = (CreateRecipeJob -> Maybe Natural)
-> (CreateRecipeJob -> Maybe Natural -> CreateRecipeJob)
-> Lens
     CreateRecipeJob CreateRecipeJob (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe Natural
maxRetries :: Maybe Natural
$sel:maxRetries:CreateRecipeJob' :: CreateRecipeJob -> Maybe Natural
maxRetries} -> Maybe Natural
maxRetries) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe Natural
a -> CreateRecipeJob
s {$sel:maxRetries:CreateRecipeJob' :: Maybe Natural
maxRetries = Maybe Natural
a} :: CreateRecipeJob)

-- | The name of the dataset that this job processes.
createRecipeJob_datasetName :: Lens.Lens' CreateRecipeJob (Prelude.Maybe Prelude.Text)
createRecipeJob_datasetName :: (Maybe Text -> f (Maybe Text))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_datasetName = (CreateRecipeJob -> Maybe Text)
-> (CreateRecipeJob -> Maybe Text -> CreateRecipeJob)
-> Lens CreateRecipeJob CreateRecipeJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe Text
datasetName :: Maybe Text
$sel:datasetName:CreateRecipeJob' :: CreateRecipeJob -> Maybe Text
datasetName} -> Maybe Text
datasetName) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe Text
a -> CreateRecipeJob
s {$sel:datasetName:CreateRecipeJob' :: Maybe Text
datasetName = Maybe Text
a} :: CreateRecipeJob)

-- | The Amazon Resource Name (ARN) of an encryption key that is used to
-- protect the job.
createRecipeJob_encryptionKeyArn :: Lens.Lens' CreateRecipeJob (Prelude.Maybe Prelude.Text)
createRecipeJob_encryptionKeyArn :: (Maybe Text -> f (Maybe Text))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_encryptionKeyArn = (CreateRecipeJob -> Maybe Text)
-> (CreateRecipeJob -> Maybe Text -> CreateRecipeJob)
-> Lens CreateRecipeJob CreateRecipeJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe Text
encryptionKeyArn :: Maybe Text
$sel:encryptionKeyArn:CreateRecipeJob' :: CreateRecipeJob -> Maybe Text
encryptionKeyArn} -> Maybe Text
encryptionKeyArn) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe Text
a -> CreateRecipeJob
s {$sel:encryptionKeyArn:CreateRecipeJob' :: Maybe Text
encryptionKeyArn = Maybe Text
a} :: CreateRecipeJob)

-- | The maximum number of nodes that DataBrew can consume when the job
-- processes data.
createRecipeJob_maxCapacity :: Lens.Lens' CreateRecipeJob (Prelude.Maybe Prelude.Int)
createRecipeJob_maxCapacity :: (Maybe Int -> f (Maybe Int))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_maxCapacity = (CreateRecipeJob -> Maybe Int)
-> (CreateRecipeJob -> Maybe Int -> CreateRecipeJob)
-> Lens CreateRecipeJob CreateRecipeJob (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe Int
maxCapacity :: Maybe Int
$sel:maxCapacity:CreateRecipeJob' :: CreateRecipeJob -> Maybe Int
maxCapacity} -> Maybe Int
maxCapacity) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe Int
a -> CreateRecipeJob
s {$sel:maxCapacity:CreateRecipeJob' :: Maybe Int
maxCapacity = Maybe Int
a} :: CreateRecipeJob)

-- | The job\'s timeout in minutes. A job that attempts to run longer than
-- this timeout period ends with a status of @TIMEOUT@.
createRecipeJob_timeout :: Lens.Lens' CreateRecipeJob (Prelude.Maybe Prelude.Natural)
createRecipeJob_timeout :: (Maybe Natural -> f (Maybe Natural))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_timeout = (CreateRecipeJob -> Maybe Natural)
-> (CreateRecipeJob -> Maybe Natural -> CreateRecipeJob)
-> Lens
     CreateRecipeJob CreateRecipeJob (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:CreateRecipeJob' :: CreateRecipeJob -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe Natural
a -> CreateRecipeJob
s {$sel:timeout:CreateRecipeJob' :: Maybe Natural
timeout = Maybe Natural
a} :: CreateRecipeJob)

-- | Metadata tags to apply to this job.
createRecipeJob_tags :: Lens.Lens' CreateRecipeJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRecipeJob_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_tags = (CreateRecipeJob -> Maybe (HashMap Text Text))
-> (CreateRecipeJob
    -> Maybe (HashMap Text Text) -> CreateRecipeJob)
-> Lens
     CreateRecipeJob
     CreateRecipeJob
     (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 (\CreateRecipeJob' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateRecipeJob' :: CreateRecipeJob -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Maybe (HashMap Text Text)
a -> CreateRecipeJob
s {$sel:tags:CreateRecipeJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateRecipeJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateRecipeJob -> f CreateRecipeJob)
-> ((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)))
-> CreateRecipeJob
-> f CreateRecipeJob
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

-- | A unique name for the job. Valid characters are alphanumeric (A-Z, a-z,
-- 0-9), hyphen (-), period (.), and space.
createRecipeJob_name :: Lens.Lens' CreateRecipeJob Prelude.Text
createRecipeJob_name :: (Text -> f Text) -> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_name = (CreateRecipeJob -> Text)
-> (CreateRecipeJob -> Text -> CreateRecipeJob)
-> Lens CreateRecipeJob CreateRecipeJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Text
name :: Text
$sel:name:CreateRecipeJob' :: CreateRecipeJob -> Text
name} -> Text
name) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Text
a -> CreateRecipeJob
s {$sel:name:CreateRecipeJob' :: Text
name = Text
a} :: CreateRecipeJob)

-- | The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role to be assumed when DataBrew runs the job.
createRecipeJob_roleArn :: Lens.Lens' CreateRecipeJob Prelude.Text
createRecipeJob_roleArn :: (Text -> f Text) -> CreateRecipeJob -> f CreateRecipeJob
createRecipeJob_roleArn = (CreateRecipeJob -> Text)
-> (CreateRecipeJob -> Text -> CreateRecipeJob)
-> Lens CreateRecipeJob CreateRecipeJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJob' {Text
roleArn :: Text
$sel:roleArn:CreateRecipeJob' :: CreateRecipeJob -> Text
roleArn} -> Text
roleArn) (\s :: CreateRecipeJob
s@CreateRecipeJob' {} Text
a -> CreateRecipeJob
s {$sel:roleArn:CreateRecipeJob' :: Text
roleArn = Text
a} :: CreateRecipeJob)

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

instance Prelude.Hashable CreateRecipeJob

instance Prelude.NFData CreateRecipeJob

instance Core.ToHeaders CreateRecipeJob where
  toHeaders :: CreateRecipeJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateRecipeJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateRecipeJob where
  toJSON :: CreateRecipeJob -> Value
toJSON CreateRecipeJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty Output)
Maybe (NonEmpty DatabaseOutput)
Maybe (NonEmpty DataCatalogOutput)
Maybe Text
Maybe (HashMap Text Text)
Maybe EncryptionMode
Maybe LogSubscription
Maybe RecipeReference
Text
roleArn :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
timeout :: Maybe Natural
maxCapacity :: Maybe Int
encryptionKeyArn :: Maybe Text
datasetName :: Maybe Text
maxRetries :: Maybe Natural
projectName :: Maybe Text
logSubscription :: Maybe LogSubscription
outputs :: Maybe (NonEmpty Output)
encryptionMode :: Maybe EncryptionMode
databaseOutputs :: Maybe (NonEmpty DatabaseOutput)
recipeReference :: Maybe RecipeReference
dataCatalogOutputs :: Maybe (NonEmpty DataCatalogOutput)
$sel:roleArn:CreateRecipeJob' :: CreateRecipeJob -> Text
$sel:name:CreateRecipeJob' :: CreateRecipeJob -> Text
$sel:tags:CreateRecipeJob' :: CreateRecipeJob -> Maybe (HashMap Text Text)
$sel:timeout:CreateRecipeJob' :: CreateRecipeJob -> Maybe Natural
$sel:maxCapacity:CreateRecipeJob' :: CreateRecipeJob -> Maybe Int
$sel:encryptionKeyArn:CreateRecipeJob' :: CreateRecipeJob -> Maybe Text
$sel:datasetName:CreateRecipeJob' :: CreateRecipeJob -> Maybe Text
$sel:maxRetries:CreateRecipeJob' :: CreateRecipeJob -> Maybe Natural
$sel:projectName:CreateRecipeJob' :: CreateRecipeJob -> Maybe Text
$sel:logSubscription:CreateRecipeJob' :: CreateRecipeJob -> Maybe LogSubscription
$sel:outputs:CreateRecipeJob' :: CreateRecipeJob -> Maybe (NonEmpty Output)
$sel:encryptionMode:CreateRecipeJob' :: CreateRecipeJob -> Maybe EncryptionMode
$sel:databaseOutputs:CreateRecipeJob' :: CreateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
$sel:recipeReference:CreateRecipeJob' :: CreateRecipeJob -> Maybe RecipeReference
$sel:dataCatalogOutputs:CreateRecipeJob' :: CreateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DataCatalogOutputs" Text -> NonEmpty DataCatalogOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty DataCatalogOutput -> Pair)
-> Maybe (NonEmpty DataCatalogOutput) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs,
            (Text
"RecipeReference" Text -> RecipeReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RecipeReference -> Pair) -> Maybe RecipeReference -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecipeReference
recipeReference,
            (Text
"DatabaseOutputs" Text -> NonEmpty DatabaseOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty DatabaseOutput -> Pair)
-> Maybe (NonEmpty DatabaseOutput) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty DatabaseOutput)
databaseOutputs,
            (Text
"EncryptionMode" Text -> EncryptionMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EncryptionMode -> Pair) -> Maybe EncryptionMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionMode
encryptionMode,
            (Text
"Outputs" Text -> NonEmpty Output -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Output -> Pair) -> Maybe (NonEmpty Output) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Output)
outputs,
            (Text
"LogSubscription" Text -> LogSubscription -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LogSubscription -> Pair) -> Maybe LogSubscription -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LogSubscription
logSubscription,
            (Text
"ProjectName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
projectName,
            (Text
"MaxRetries" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxRetries,
            (Text
"DatasetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
datasetName,
            (Text
"EncryptionKeyArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
encryptionKeyArn,
            (Text
"MaxCapacity" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxCapacity,
            (Text
"Timeout" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeout,
            (Text
"Tags" 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)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            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 CreateRecipeJob where
  toPath :: CreateRecipeJob -> ByteString
toPath = ByteString -> CreateRecipeJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/recipeJobs"

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

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

-- |
-- Create a value of 'CreateRecipeJobResponse' 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', 'createRecipeJobResponse_httpStatus' - The response's http status code.
--
-- 'name', 'createRecipeJobResponse_name' - The name of the job that you created.
newCreateRecipeJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  CreateRecipeJobResponse
newCreateRecipeJobResponse :: Int -> Text -> CreateRecipeJobResponse
newCreateRecipeJobResponse Int
pHttpStatus_ Text
pName_ =
  CreateRecipeJobResponse' :: Int -> Text -> CreateRecipeJobResponse
CreateRecipeJobResponse'
    { $sel:httpStatus:CreateRecipeJobResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:name:CreateRecipeJobResponse' :: Text
name = Text
pName_
    }

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

-- | The name of the job that you created.
createRecipeJobResponse_name :: Lens.Lens' CreateRecipeJobResponse Prelude.Text
createRecipeJobResponse_name :: (Text -> f Text)
-> CreateRecipeJobResponse -> f CreateRecipeJobResponse
createRecipeJobResponse_name = (CreateRecipeJobResponse -> Text)
-> (CreateRecipeJobResponse -> Text -> CreateRecipeJobResponse)
-> Lens CreateRecipeJobResponse CreateRecipeJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecipeJobResponse' {Text
name :: Text
$sel:name:CreateRecipeJobResponse' :: CreateRecipeJobResponse -> Text
name} -> Text
name) (\s :: CreateRecipeJobResponse
s@CreateRecipeJobResponse' {} Text
a -> CreateRecipeJobResponse
s {$sel:name:CreateRecipeJobResponse' :: Text
name = Text
a} :: CreateRecipeJobResponse)

instance Prelude.NFData CreateRecipeJobResponse