{-# 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.UpdateRecipeJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies the definition of an existing DataBrew recipe job.
module Amazonka.DataBrew.UpdateRecipeJob
  ( -- * Creating a Request
    UpdateRecipeJob (..),
    newUpdateRecipeJob,

    -- * Request Lenses
    updateRecipeJob_dataCatalogOutputs,
    updateRecipeJob_databaseOutputs,
    updateRecipeJob_encryptionKeyArn,
    updateRecipeJob_encryptionMode,
    updateRecipeJob_logSubscription,
    updateRecipeJob_maxCapacity,
    updateRecipeJob_maxRetries,
    updateRecipeJob_outputs,
    updateRecipeJob_timeout,
    updateRecipeJob_name,
    updateRecipeJob_roleArn,

    -- * Destructuring the Response
    UpdateRecipeJobResponse (..),
    newUpdateRecipeJobResponse,

    -- * Response Lenses
    updateRecipeJobResponse_httpStatus,
    updateRecipeJobResponse_name,
  )
where

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

-- | /See:/ 'newUpdateRecipeJob' smart constructor.
data UpdateRecipeJob = UpdateRecipeJob'
  { -- | One or more artifacts that represent the Glue Data Catalog output from
    -- running the job.
    UpdateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs :: Prelude.Maybe (Prelude.NonEmpty DataCatalogOutput),
    -- | Represents a list of JDBC database output objects which defines the
    -- output destination for a DataBrew recipe job to write into.
    UpdateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
databaseOutputs :: Prelude.Maybe (Prelude.NonEmpty DatabaseOutput),
    -- | The Amazon Resource Name (ARN) of an encryption key that is used to
    -- protect the job.
    UpdateRecipeJob -> Maybe Text
encryptionKeyArn :: Prelude.Maybe Prelude.Text,
    -- | 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.
    UpdateRecipeJob -> Maybe EncryptionMode
encryptionMode :: Prelude.Maybe EncryptionMode,
    -- | Enables or disables Amazon CloudWatch logging for the job. If logging is
    -- enabled, CloudWatch writes one log stream for each job run.
    UpdateRecipeJob -> Maybe LogSubscription
logSubscription :: Prelude.Maybe LogSubscription,
    -- | The maximum number of nodes that DataBrew can consume when the job
    -- processes data.
    UpdateRecipeJob -> Maybe Int
maxCapacity :: Prelude.Maybe Prelude.Int,
    -- | The maximum number of times to retry the job after a job run fails.
    UpdateRecipeJob -> Maybe Natural
maxRetries :: Prelude.Maybe Prelude.Natural,
    -- | One or more artifacts that represent the output from running the job.
    UpdateRecipeJob -> Maybe (NonEmpty Output)
outputs :: Prelude.Maybe (Prelude.NonEmpty Output),
    -- | The job\'s timeout in minutes. A job that attempts to run longer than
    -- this timeout period ends with a status of @TIMEOUT@.
    UpdateRecipeJob -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | The name of the job to update.
    UpdateRecipeJob -> 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.
    UpdateRecipeJob -> Text
roleArn :: Prelude.Text
  }
  deriving (UpdateRecipeJob -> UpdateRecipeJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRecipeJob -> UpdateRecipeJob -> Bool
$c/= :: UpdateRecipeJob -> UpdateRecipeJob -> Bool
== :: UpdateRecipeJob -> UpdateRecipeJob -> Bool
$c== :: UpdateRecipeJob -> UpdateRecipeJob -> Bool
Prelude.Eq, ReadPrec [UpdateRecipeJob]
ReadPrec UpdateRecipeJob
Int -> ReadS UpdateRecipeJob
ReadS [UpdateRecipeJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRecipeJob]
$creadListPrec :: ReadPrec [UpdateRecipeJob]
readPrec :: ReadPrec UpdateRecipeJob
$creadPrec :: ReadPrec UpdateRecipeJob
readList :: ReadS [UpdateRecipeJob]
$creadList :: ReadS [UpdateRecipeJob]
readsPrec :: Int -> ReadS UpdateRecipeJob
$creadsPrec :: Int -> ReadS UpdateRecipeJob
Prelude.Read, Int -> UpdateRecipeJob -> ShowS
[UpdateRecipeJob] -> ShowS
UpdateRecipeJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRecipeJob] -> ShowS
$cshowList :: [UpdateRecipeJob] -> ShowS
show :: UpdateRecipeJob -> String
$cshow :: UpdateRecipeJob -> String
showsPrec :: Int -> UpdateRecipeJob -> ShowS
$cshowsPrec :: Int -> UpdateRecipeJob -> ShowS
Prelude.Show, forall x. Rep UpdateRecipeJob x -> UpdateRecipeJob
forall x. UpdateRecipeJob -> Rep UpdateRecipeJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRecipeJob x -> UpdateRecipeJob
$cfrom :: forall x. UpdateRecipeJob -> Rep UpdateRecipeJob x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRecipeJob' 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', 'updateRecipeJob_dataCatalogOutputs' - One or more artifacts that represent the Glue Data Catalog output from
-- running the job.
--
-- 'databaseOutputs', 'updateRecipeJob_databaseOutputs' - Represents a list of JDBC database output objects which defines the
-- output destination for a DataBrew recipe job to write into.
--
-- 'encryptionKeyArn', 'updateRecipeJob_encryptionKeyArn' - The Amazon Resource Name (ARN) of an encryption key that is used to
-- protect the job.
--
-- 'encryptionMode', 'updateRecipeJob_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.
--
-- 'logSubscription', 'updateRecipeJob_logSubscription' - Enables or disables Amazon CloudWatch logging for the job. If logging is
-- enabled, CloudWatch writes one log stream for each job run.
--
-- 'maxCapacity', 'updateRecipeJob_maxCapacity' - The maximum number of nodes that DataBrew can consume when the job
-- processes data.
--
-- 'maxRetries', 'updateRecipeJob_maxRetries' - The maximum number of times to retry the job after a job run fails.
--
-- 'outputs', 'updateRecipeJob_outputs' - One or more artifacts that represent the output from running the job.
--
-- 'timeout', 'updateRecipeJob_timeout' - The job\'s timeout in minutes. A job that attempts to run longer than
-- this timeout period ends with a status of @TIMEOUT@.
--
-- 'name', 'updateRecipeJob_name' - The name of the job to update.
--
-- 'roleArn', 'updateRecipeJob_roleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role to be assumed when DataBrew runs the job.
newUpdateRecipeJob ::
  -- | 'name'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  UpdateRecipeJob
newUpdateRecipeJob :: Text -> Text -> UpdateRecipeJob
newUpdateRecipeJob Text
pName_ Text
pRoleArn_ =
  UpdateRecipeJob'
    { $sel:dataCatalogOutputs:UpdateRecipeJob' :: Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs =
        forall a. Maybe a
Prelude.Nothing,
      $sel:databaseOutputs:UpdateRecipeJob' :: Maybe (NonEmpty DatabaseOutput)
databaseOutputs = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionKeyArn:UpdateRecipeJob' :: Maybe Text
encryptionKeyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionMode:UpdateRecipeJob' :: Maybe EncryptionMode
encryptionMode = forall a. Maybe a
Prelude.Nothing,
      $sel:logSubscription:UpdateRecipeJob' :: Maybe LogSubscription
logSubscription = forall a. Maybe a
Prelude.Nothing,
      $sel:maxCapacity:UpdateRecipeJob' :: Maybe Int
maxCapacity = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRetries:UpdateRecipeJob' :: Maybe Natural
maxRetries = forall a. Maybe a
Prelude.Nothing,
      $sel:outputs:UpdateRecipeJob' :: Maybe (NonEmpty Output)
outputs = forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:UpdateRecipeJob' :: Maybe Natural
timeout = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateRecipeJob' :: Text
name = Text
pName_,
      $sel:roleArn:UpdateRecipeJob' :: Text
roleArn = Text
pRoleArn_
    }

-- | One or more artifacts that represent the Glue Data Catalog output from
-- running the job.
updateRecipeJob_dataCatalogOutputs :: Lens.Lens' UpdateRecipeJob (Prelude.Maybe (Prelude.NonEmpty DataCatalogOutput))
updateRecipeJob_dataCatalogOutputs :: Lens' UpdateRecipeJob (Maybe (NonEmpty DataCatalogOutput))
updateRecipeJob_dataCatalogOutputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecipeJob' {Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs :: Maybe (NonEmpty DataCatalogOutput)
$sel:dataCatalogOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs} -> Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs) (\s :: UpdateRecipeJob
s@UpdateRecipeJob' {} Maybe (NonEmpty DataCatalogOutput)
a -> UpdateRecipeJob
s {$sel:dataCatalogOutputs:UpdateRecipeJob' :: Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs = Maybe (NonEmpty DataCatalogOutput)
a} :: UpdateRecipeJob) 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

-- | Represents a list of JDBC database output objects which defines the
-- output destination for a DataBrew recipe job to write into.
updateRecipeJob_databaseOutputs :: Lens.Lens' UpdateRecipeJob (Prelude.Maybe (Prelude.NonEmpty DatabaseOutput))
updateRecipeJob_databaseOutputs :: Lens' UpdateRecipeJob (Maybe (NonEmpty DatabaseOutput))
updateRecipeJob_databaseOutputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecipeJob' {Maybe (NonEmpty DatabaseOutput)
databaseOutputs :: Maybe (NonEmpty DatabaseOutput)
$sel:databaseOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
databaseOutputs} -> Maybe (NonEmpty DatabaseOutput)
databaseOutputs) (\s :: UpdateRecipeJob
s@UpdateRecipeJob' {} Maybe (NonEmpty DatabaseOutput)
a -> UpdateRecipeJob
s {$sel:databaseOutputs:UpdateRecipeJob' :: Maybe (NonEmpty DatabaseOutput)
databaseOutputs = Maybe (NonEmpty DatabaseOutput)
a} :: UpdateRecipeJob) 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 Amazon Resource Name (ARN) of an encryption key that is used to
-- protect the job.
updateRecipeJob_encryptionKeyArn :: Lens.Lens' UpdateRecipeJob (Prelude.Maybe Prelude.Text)
updateRecipeJob_encryptionKeyArn :: Lens' UpdateRecipeJob (Maybe Text)
updateRecipeJob_encryptionKeyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecipeJob' {Maybe Text
encryptionKeyArn :: Maybe Text
$sel:encryptionKeyArn:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Text
encryptionKeyArn} -> Maybe Text
encryptionKeyArn) (\s :: UpdateRecipeJob
s@UpdateRecipeJob' {} Maybe Text
a -> UpdateRecipeJob
s {$sel:encryptionKeyArn:UpdateRecipeJob' :: Maybe Text
encryptionKeyArn = Maybe Text
a} :: UpdateRecipeJob)

-- | 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.
updateRecipeJob_encryptionMode :: Lens.Lens' UpdateRecipeJob (Prelude.Maybe EncryptionMode)
updateRecipeJob_encryptionMode :: Lens' UpdateRecipeJob (Maybe EncryptionMode)
updateRecipeJob_encryptionMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecipeJob' {Maybe EncryptionMode
encryptionMode :: Maybe EncryptionMode
$sel:encryptionMode:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe EncryptionMode
encryptionMode} -> Maybe EncryptionMode
encryptionMode) (\s :: UpdateRecipeJob
s@UpdateRecipeJob' {} Maybe EncryptionMode
a -> UpdateRecipeJob
s {$sel:encryptionMode:UpdateRecipeJob' :: Maybe EncryptionMode
encryptionMode = Maybe EncryptionMode
a} :: UpdateRecipeJob)

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

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

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

-- | One or more artifacts that represent the output from running the job.
updateRecipeJob_outputs :: Lens.Lens' UpdateRecipeJob (Prelude.Maybe (Prelude.NonEmpty Output))
updateRecipeJob_outputs :: Lens' UpdateRecipeJob (Maybe (NonEmpty Output))
updateRecipeJob_outputs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecipeJob' {Maybe (NonEmpty Output)
outputs :: Maybe (NonEmpty Output)
$sel:outputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty Output)
outputs} -> Maybe (NonEmpty Output)
outputs) (\s :: UpdateRecipeJob
s@UpdateRecipeJob' {} Maybe (NonEmpty Output)
a -> UpdateRecipeJob
s {$sel:outputs:UpdateRecipeJob' :: Maybe (NonEmpty Output)
outputs = Maybe (NonEmpty Output)
a} :: UpdateRecipeJob) 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 job\'s timeout in minutes. A job that attempts to run longer than
-- this timeout period ends with a status of @TIMEOUT@.
updateRecipeJob_timeout :: Lens.Lens' UpdateRecipeJob (Prelude.Maybe Prelude.Natural)
updateRecipeJob_timeout :: Lens' UpdateRecipeJob (Maybe Natural)
updateRecipeJob_timeout = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecipeJob' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: UpdateRecipeJob
s@UpdateRecipeJob' {} Maybe Natural
a -> UpdateRecipeJob
s {$sel:timeout:UpdateRecipeJob' :: Maybe Natural
timeout = Maybe Natural
a} :: UpdateRecipeJob)

-- | The name of the job to update.
updateRecipeJob_name :: Lens.Lens' UpdateRecipeJob Prelude.Text
updateRecipeJob_name :: Lens' UpdateRecipeJob Text
updateRecipeJob_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRecipeJob' {Text
name :: Text
$sel:name:UpdateRecipeJob' :: UpdateRecipeJob -> Text
name} -> Text
name) (\s :: UpdateRecipeJob
s@UpdateRecipeJob' {} Text
a -> UpdateRecipeJob
s {$sel:name:UpdateRecipeJob' :: Text
name = Text
a} :: UpdateRecipeJob)

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

instance Core.AWSRequest UpdateRecipeJob where
  type
    AWSResponse UpdateRecipeJob =
      UpdateRecipeJobResponse
  request :: (Service -> Service) -> UpdateRecipeJob -> Request UpdateRecipeJob
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateRecipeJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRecipeJob)))
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 -> UpdateRecipeJobResponse
UpdateRecipeJobResponse'
            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
"Name")
      )

instance Prelude.Hashable UpdateRecipeJob where
  hashWithSalt :: Int -> UpdateRecipeJob -> Int
hashWithSalt Int
_salt UpdateRecipeJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty Output)
Maybe (NonEmpty DatabaseOutput)
Maybe (NonEmpty DataCatalogOutput)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Text
roleArn :: Text
name :: Text
timeout :: Maybe Natural
outputs :: Maybe (NonEmpty Output)
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
databaseOutputs :: Maybe (NonEmpty DatabaseOutput)
dataCatalogOutputs :: Maybe (NonEmpty DataCatalogOutput)
$sel:roleArn:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:name:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:timeout:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:outputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty Output)
$sel:maxRetries:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:maxCapacity:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Int
$sel:logSubscription:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe LogSubscription
$sel:encryptionMode:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Text
$sel:databaseOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
$sel:dataCatalogOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty DatabaseOutput)
databaseOutputs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encryptionKeyArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EncryptionMode
encryptionMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LogSubscription
logSubscription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxCapacity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxRetries
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Output)
outputs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeout
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData UpdateRecipeJob where
  rnf :: UpdateRecipeJob -> ()
rnf UpdateRecipeJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty Output)
Maybe (NonEmpty DatabaseOutput)
Maybe (NonEmpty DataCatalogOutput)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Text
roleArn :: Text
name :: Text
timeout :: Maybe Natural
outputs :: Maybe (NonEmpty Output)
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
databaseOutputs :: Maybe (NonEmpty DatabaseOutput)
dataCatalogOutputs :: Maybe (NonEmpty DataCatalogOutput)
$sel:roleArn:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:name:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:timeout:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:outputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty Output)
$sel:maxRetries:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:maxCapacity:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Int
$sel:logSubscription:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe LogSubscription
$sel:encryptionMode:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Text
$sel:databaseOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
$sel:dataCatalogOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty DataCatalogOutput)
dataCatalogOutputs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty DatabaseOutput)
databaseOutputs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encryptionKeyArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EncryptionMode
encryptionMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LogSubscription
logSubscription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxCapacity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxRetries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Output)
outputs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeout
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

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

instance Data.ToJSON UpdateRecipeJob where
  toJSON :: UpdateRecipeJob -> Value
toJSON UpdateRecipeJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty Output)
Maybe (NonEmpty DatabaseOutput)
Maybe (NonEmpty DataCatalogOutput)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Text
roleArn :: Text
name :: Text
timeout :: Maybe Natural
outputs :: Maybe (NonEmpty Output)
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
databaseOutputs :: Maybe (NonEmpty DatabaseOutput)
dataCatalogOutputs :: Maybe (NonEmpty DataCatalogOutput)
$sel:roleArn:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:name:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:timeout:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:outputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty Output)
$sel:maxRetries:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:maxCapacity:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Int
$sel:logSubscription:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe LogSubscription
$sel:encryptionMode:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Text
$sel:databaseOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
$sel:dataCatalogOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DataCatalogOutputs" 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 (NonEmpty DataCatalogOutput)
dataCatalogOutputs,
            (Key
"DatabaseOutputs" 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 (NonEmpty DatabaseOutput)
databaseOutputs,
            (Key
"EncryptionKeyArn" 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 Text
encryptionKeyArn,
            (Key
"EncryptionMode" 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 EncryptionMode
encryptionMode,
            (Key
"LogSubscription" 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 LogSubscription
logSubscription,
            (Key
"MaxCapacity" 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 Int
maxCapacity,
            (Key
"MaxRetries" 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 Natural
maxRetries,
            (Key
"Outputs" 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 (NonEmpty Output)
outputs,
            (Key
"Timeout" 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 Natural
timeout,
            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 UpdateRecipeJob where
  toPath :: UpdateRecipeJob -> ByteString
toPath UpdateRecipeJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty Output)
Maybe (NonEmpty DatabaseOutput)
Maybe (NonEmpty DataCatalogOutput)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Text
roleArn :: Text
name :: Text
timeout :: Maybe Natural
outputs :: Maybe (NonEmpty Output)
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
databaseOutputs :: Maybe (NonEmpty DatabaseOutput)
dataCatalogOutputs :: Maybe (NonEmpty DataCatalogOutput)
$sel:roleArn:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:name:UpdateRecipeJob' :: UpdateRecipeJob -> Text
$sel:timeout:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:outputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty Output)
$sel:maxRetries:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Natural
$sel:maxCapacity:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Int
$sel:logSubscription:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe LogSubscription
$sel:encryptionMode:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe Text
$sel:databaseOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DatabaseOutput)
$sel:dataCatalogOutputs:UpdateRecipeJob' :: UpdateRecipeJob -> Maybe (NonEmpty DataCatalogOutput)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/recipeJobs/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]

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

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

-- |
-- Create a value of 'UpdateRecipeJobResponse' 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', 'updateRecipeJobResponse_httpStatus' - The response's http status code.
--
-- 'name', 'updateRecipeJobResponse_name' - The name of the job that you updated.
newUpdateRecipeJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  UpdateRecipeJobResponse
newUpdateRecipeJobResponse :: Int -> Text -> UpdateRecipeJobResponse
newUpdateRecipeJobResponse Int
pHttpStatus_ Text
pName_ =
  UpdateRecipeJobResponse'
    { $sel:httpStatus:UpdateRecipeJobResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:name:UpdateRecipeJobResponse' :: Text
name = Text
pName_
    }

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

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

instance Prelude.NFData UpdateRecipeJobResponse where
  rnf :: UpdateRecipeJobResponse -> ()
rnf UpdateRecipeJobResponse' {Int
Text
name :: Text
httpStatus :: Int
$sel:name:UpdateRecipeJobResponse' :: UpdateRecipeJobResponse -> Text
$sel:httpStatus:UpdateRecipeJobResponse' :: UpdateRecipeJobResponse -> 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
name