{-# 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.UpdateProfileJob
-- 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 profile job.
module Amazonka.DataBrew.UpdateProfileJob
  ( -- * Creating a Request
    UpdateProfileJob (..),
    newUpdateProfileJob,

    -- * Request Lenses
    updateProfileJob_configuration,
    updateProfileJob_encryptionKeyArn,
    updateProfileJob_encryptionMode,
    updateProfileJob_jobSample,
    updateProfileJob_logSubscription,
    updateProfileJob_maxCapacity,
    updateProfileJob_maxRetries,
    updateProfileJob_timeout,
    updateProfileJob_validationConfigurations,
    updateProfileJob_name,
    updateProfileJob_outputLocation,
    updateProfileJob_roleArn,

    -- * Destructuring the Response
    UpdateProfileJobResponse (..),
    newUpdateProfileJobResponse,

    -- * Response Lenses
    updateProfileJobResponse_httpStatus,
    updateProfileJobResponse_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:/ 'newUpdateProfileJob' smart constructor.
data UpdateProfileJob = UpdateProfileJob'
  { -- | Configuration for profile jobs. Used to select columns, do evaluations,
    -- and override default parameters of evaluations. When configuration is
    -- null, the profile job will run with default settings.
    UpdateProfileJob -> Maybe ProfileConfiguration
configuration :: Prelude.Maybe ProfileConfiguration,
    -- | The Amazon Resource Name (ARN) of an encryption key that is used to
    -- protect the job.
    UpdateProfileJob -> 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.
    UpdateProfileJob -> Maybe EncryptionMode
encryptionMode :: Prelude.Maybe EncryptionMode,
    -- | Sample configuration for Profile Jobs only. Determines the number of
    -- rows on which the Profile job will be executed. If a JobSample value is
    -- not provided for profile jobs, the default value will be used. The
    -- default value is CUSTOM_ROWS for the mode parameter and 20000 for the
    -- size parameter.
    UpdateProfileJob -> Maybe JobSample
jobSample :: Prelude.Maybe JobSample,
    -- | Enables or disables Amazon CloudWatch logging for the job. If logging is
    -- enabled, CloudWatch writes one log stream for each job run.
    UpdateProfileJob -> Maybe LogSubscription
logSubscription :: Prelude.Maybe LogSubscription,
    -- | The maximum number of compute nodes that DataBrew can use when the job
    -- processes data.
    UpdateProfileJob -> Maybe Int
maxCapacity :: Prelude.Maybe Prelude.Int,
    -- | The maximum number of times to retry the job after a job run fails.
    UpdateProfileJob -> Maybe Natural
maxRetries :: Prelude.Maybe Prelude.Natural,
    -- | The job\'s timeout in minutes. A job that attempts to run longer than
    -- this timeout period ends with a status of @TIMEOUT@.
    UpdateProfileJob -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | List of validation configurations that are applied to the profile job.
    UpdateProfileJob -> Maybe (NonEmpty ValidationConfiguration)
validationConfigurations :: Prelude.Maybe (Prelude.NonEmpty ValidationConfiguration),
    -- | The name of the job to be updated.
    UpdateProfileJob -> Text
name :: Prelude.Text,
    UpdateProfileJob -> S3Location
outputLocation :: S3Location,
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) role to be assumed when DataBrew runs the job.
    UpdateProfileJob -> Text
roleArn :: Prelude.Text
  }
  deriving (UpdateProfileJob -> UpdateProfileJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProfileJob -> UpdateProfileJob -> Bool
$c/= :: UpdateProfileJob -> UpdateProfileJob -> Bool
== :: UpdateProfileJob -> UpdateProfileJob -> Bool
$c== :: UpdateProfileJob -> UpdateProfileJob -> Bool
Prelude.Eq, ReadPrec [UpdateProfileJob]
ReadPrec UpdateProfileJob
Int -> ReadS UpdateProfileJob
ReadS [UpdateProfileJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProfileJob]
$creadListPrec :: ReadPrec [UpdateProfileJob]
readPrec :: ReadPrec UpdateProfileJob
$creadPrec :: ReadPrec UpdateProfileJob
readList :: ReadS [UpdateProfileJob]
$creadList :: ReadS [UpdateProfileJob]
readsPrec :: Int -> ReadS UpdateProfileJob
$creadsPrec :: Int -> ReadS UpdateProfileJob
Prelude.Read, Int -> UpdateProfileJob -> ShowS
[UpdateProfileJob] -> ShowS
UpdateProfileJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProfileJob] -> ShowS
$cshowList :: [UpdateProfileJob] -> ShowS
show :: UpdateProfileJob -> String
$cshow :: UpdateProfileJob -> String
showsPrec :: Int -> UpdateProfileJob -> ShowS
$cshowsPrec :: Int -> UpdateProfileJob -> ShowS
Prelude.Show, forall x. Rep UpdateProfileJob x -> UpdateProfileJob
forall x. UpdateProfileJob -> Rep UpdateProfileJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateProfileJob x -> UpdateProfileJob
$cfrom :: forall x. UpdateProfileJob -> Rep UpdateProfileJob x
Prelude.Generic)

-- |
-- Create a value of 'UpdateProfileJob' 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:
--
-- 'configuration', 'updateProfileJob_configuration' - Configuration for profile jobs. Used to select columns, do evaluations,
-- and override default parameters of evaluations. When configuration is
-- null, the profile job will run with default settings.
--
-- 'encryptionKeyArn', 'updateProfileJob_encryptionKeyArn' - The Amazon Resource Name (ARN) of an encryption key that is used to
-- protect the job.
--
-- 'encryptionMode', 'updateProfileJob_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.
--
-- 'jobSample', 'updateProfileJob_jobSample' - Sample configuration for Profile Jobs only. Determines the number of
-- rows on which the Profile job will be executed. If a JobSample value is
-- not provided for profile jobs, the default value will be used. The
-- default value is CUSTOM_ROWS for the mode parameter and 20000 for the
-- size parameter.
--
-- 'logSubscription', 'updateProfileJob_logSubscription' - Enables or disables Amazon CloudWatch logging for the job. If logging is
-- enabled, CloudWatch writes one log stream for each job run.
--
-- 'maxCapacity', 'updateProfileJob_maxCapacity' - The maximum number of compute nodes that DataBrew can use when the job
-- processes data.
--
-- 'maxRetries', 'updateProfileJob_maxRetries' - The maximum number of times to retry the job after a job run fails.
--
-- 'timeout', 'updateProfileJob_timeout' - The job\'s timeout in minutes. A job that attempts to run longer than
-- this timeout period ends with a status of @TIMEOUT@.
--
-- 'validationConfigurations', 'updateProfileJob_validationConfigurations' - List of validation configurations that are applied to the profile job.
--
-- 'name', 'updateProfileJob_name' - The name of the job to be updated.
--
-- 'outputLocation', 'updateProfileJob_outputLocation' - Undocumented member.
--
-- 'roleArn', 'updateProfileJob_roleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role to be assumed when DataBrew runs the job.
newUpdateProfileJob ::
  -- | 'name'
  Prelude.Text ->
  -- | 'outputLocation'
  S3Location ->
  -- | 'roleArn'
  Prelude.Text ->
  UpdateProfileJob
newUpdateProfileJob :: Text -> S3Location -> Text -> UpdateProfileJob
newUpdateProfileJob Text
pName_ S3Location
pOutputLocation_ Text
pRoleArn_ =
  UpdateProfileJob'
    { $sel:configuration:UpdateProfileJob' :: Maybe ProfileConfiguration
configuration = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionKeyArn:UpdateProfileJob' :: Maybe Text
encryptionKeyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionMode:UpdateProfileJob' :: Maybe EncryptionMode
encryptionMode = forall a. Maybe a
Prelude.Nothing,
      $sel:jobSample:UpdateProfileJob' :: Maybe JobSample
jobSample = forall a. Maybe a
Prelude.Nothing,
      $sel:logSubscription:UpdateProfileJob' :: Maybe LogSubscription
logSubscription = forall a. Maybe a
Prelude.Nothing,
      $sel:maxCapacity:UpdateProfileJob' :: Maybe Int
maxCapacity = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRetries:UpdateProfileJob' :: Maybe Natural
maxRetries = forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:UpdateProfileJob' :: Maybe Natural
timeout = forall a. Maybe a
Prelude.Nothing,
      $sel:validationConfigurations:UpdateProfileJob' :: Maybe (NonEmpty ValidationConfiguration)
validationConfigurations = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateProfileJob' :: Text
name = Text
pName_,
      $sel:outputLocation:UpdateProfileJob' :: S3Location
outputLocation = S3Location
pOutputLocation_,
      $sel:roleArn:UpdateProfileJob' :: Text
roleArn = Text
pRoleArn_
    }

-- | Configuration for profile jobs. Used to select columns, do evaluations,
-- and override default parameters of evaluations. When configuration is
-- null, the profile job will run with default settings.
updateProfileJob_configuration :: Lens.Lens' UpdateProfileJob (Prelude.Maybe ProfileConfiguration)
updateProfileJob_configuration :: Lens' UpdateProfileJob (Maybe ProfileConfiguration)
updateProfileJob_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfileJob' {Maybe ProfileConfiguration
configuration :: Maybe ProfileConfiguration
$sel:configuration:UpdateProfileJob' :: UpdateProfileJob -> Maybe ProfileConfiguration
configuration} -> Maybe ProfileConfiguration
configuration) (\s :: UpdateProfileJob
s@UpdateProfileJob' {} Maybe ProfileConfiguration
a -> UpdateProfileJob
s {$sel:configuration:UpdateProfileJob' :: Maybe ProfileConfiguration
configuration = Maybe ProfileConfiguration
a} :: UpdateProfileJob)

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

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

-- | Sample configuration for Profile Jobs only. Determines the number of
-- rows on which the Profile job will be executed. If a JobSample value is
-- not provided for profile jobs, the default value will be used. The
-- default value is CUSTOM_ROWS for the mode parameter and 20000 for the
-- size parameter.
updateProfileJob_jobSample :: Lens.Lens' UpdateProfileJob (Prelude.Maybe JobSample)
updateProfileJob_jobSample :: Lens' UpdateProfileJob (Maybe JobSample)
updateProfileJob_jobSample = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfileJob' {Maybe JobSample
jobSample :: Maybe JobSample
$sel:jobSample:UpdateProfileJob' :: UpdateProfileJob -> Maybe JobSample
jobSample} -> Maybe JobSample
jobSample) (\s :: UpdateProfileJob
s@UpdateProfileJob' {} Maybe JobSample
a -> UpdateProfileJob
s {$sel:jobSample:UpdateProfileJob' :: Maybe JobSample
jobSample = Maybe JobSample
a} :: UpdateProfileJob)

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

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

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

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

-- | List of validation configurations that are applied to the profile job.
updateProfileJob_validationConfigurations :: Lens.Lens' UpdateProfileJob (Prelude.Maybe (Prelude.NonEmpty ValidationConfiguration))
updateProfileJob_validationConfigurations :: Lens' UpdateProfileJob (Maybe (NonEmpty ValidationConfiguration))
updateProfileJob_validationConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfileJob' {Maybe (NonEmpty ValidationConfiguration)
validationConfigurations :: Maybe (NonEmpty ValidationConfiguration)
$sel:validationConfigurations:UpdateProfileJob' :: UpdateProfileJob -> Maybe (NonEmpty ValidationConfiguration)
validationConfigurations} -> Maybe (NonEmpty ValidationConfiguration)
validationConfigurations) (\s :: UpdateProfileJob
s@UpdateProfileJob' {} Maybe (NonEmpty ValidationConfiguration)
a -> UpdateProfileJob
s {$sel:validationConfigurations:UpdateProfileJob' :: Maybe (NonEmpty ValidationConfiguration)
validationConfigurations = Maybe (NonEmpty ValidationConfiguration)
a} :: UpdateProfileJob) 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 job to be updated.
updateProfileJob_name :: Lens.Lens' UpdateProfileJob Prelude.Text
updateProfileJob_name :: Lens' UpdateProfileJob Text
updateProfileJob_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfileJob' {Text
name :: Text
$sel:name:UpdateProfileJob' :: UpdateProfileJob -> Text
name} -> Text
name) (\s :: UpdateProfileJob
s@UpdateProfileJob' {} Text
a -> UpdateProfileJob
s {$sel:name:UpdateProfileJob' :: Text
name = Text
a} :: UpdateProfileJob)

-- | Undocumented member.
updateProfileJob_outputLocation :: Lens.Lens' UpdateProfileJob S3Location
updateProfileJob_outputLocation :: Lens' UpdateProfileJob S3Location
updateProfileJob_outputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfileJob' {S3Location
outputLocation :: S3Location
$sel:outputLocation:UpdateProfileJob' :: UpdateProfileJob -> S3Location
outputLocation} -> S3Location
outputLocation) (\s :: UpdateProfileJob
s@UpdateProfileJob' {} S3Location
a -> UpdateProfileJob
s {$sel:outputLocation:UpdateProfileJob' :: S3Location
outputLocation = S3Location
a} :: UpdateProfileJob)

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

instance Core.AWSRequest UpdateProfileJob where
  type
    AWSResponse UpdateProfileJob =
      UpdateProfileJobResponse
  request :: (Service -> Service)
-> UpdateProfileJob -> Request UpdateProfileJob
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 UpdateProfileJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateProfileJob)))
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 -> UpdateProfileJobResponse
UpdateProfileJobResponse'
            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 UpdateProfileJob where
  hashWithSalt :: Int -> UpdateProfileJob -> Int
hashWithSalt Int
_salt UpdateProfileJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty ValidationConfiguration)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Maybe JobSample
Maybe ProfileConfiguration
Text
S3Location
roleArn :: Text
outputLocation :: S3Location
name :: Text
validationConfigurations :: Maybe (NonEmpty ValidationConfiguration)
timeout :: Maybe Natural
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
jobSample :: Maybe JobSample
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
configuration :: Maybe ProfileConfiguration
$sel:roleArn:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:outputLocation:UpdateProfileJob' :: UpdateProfileJob -> S3Location
$sel:name:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:validationConfigurations:UpdateProfileJob' :: UpdateProfileJob -> Maybe (NonEmpty ValidationConfiguration)
$sel:timeout:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxRetries:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxCapacity:UpdateProfileJob' :: UpdateProfileJob -> Maybe Int
$sel:logSubscription:UpdateProfileJob' :: UpdateProfileJob -> Maybe LogSubscription
$sel:jobSample:UpdateProfileJob' :: UpdateProfileJob -> Maybe JobSample
$sel:encryptionMode:UpdateProfileJob' :: UpdateProfileJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateProfileJob' :: UpdateProfileJob -> Maybe Text
$sel:configuration:UpdateProfileJob' :: UpdateProfileJob -> Maybe ProfileConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProfileConfiguration
configuration
      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 JobSample
jobSample
      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 Natural
timeout
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ValidationConfiguration)
validationConfigurations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3Location
outputLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData UpdateProfileJob where
  rnf :: UpdateProfileJob -> ()
rnf UpdateProfileJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty ValidationConfiguration)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Maybe JobSample
Maybe ProfileConfiguration
Text
S3Location
roleArn :: Text
outputLocation :: S3Location
name :: Text
validationConfigurations :: Maybe (NonEmpty ValidationConfiguration)
timeout :: Maybe Natural
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
jobSample :: Maybe JobSample
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
configuration :: Maybe ProfileConfiguration
$sel:roleArn:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:outputLocation:UpdateProfileJob' :: UpdateProfileJob -> S3Location
$sel:name:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:validationConfigurations:UpdateProfileJob' :: UpdateProfileJob -> Maybe (NonEmpty ValidationConfiguration)
$sel:timeout:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxRetries:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxCapacity:UpdateProfileJob' :: UpdateProfileJob -> Maybe Int
$sel:logSubscription:UpdateProfileJob' :: UpdateProfileJob -> Maybe LogSubscription
$sel:jobSample:UpdateProfileJob' :: UpdateProfileJob -> Maybe JobSample
$sel:encryptionMode:UpdateProfileJob' :: UpdateProfileJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateProfileJob' :: UpdateProfileJob -> Maybe Text
$sel:configuration:UpdateProfileJob' :: UpdateProfileJob -> Maybe ProfileConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ProfileConfiguration
configuration
      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 JobSample
jobSample
      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 Natural
timeout
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ValidationConfiguration)
validationConfigurations
      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 S3Location
outputLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

instance Data.ToHeaders UpdateProfileJob where
  toHeaders :: UpdateProfileJob -> 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 UpdateProfileJob where
  toJSON :: UpdateProfileJob -> Value
toJSON UpdateProfileJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty ValidationConfiguration)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Maybe JobSample
Maybe ProfileConfiguration
Text
S3Location
roleArn :: Text
outputLocation :: S3Location
name :: Text
validationConfigurations :: Maybe (NonEmpty ValidationConfiguration)
timeout :: Maybe Natural
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
jobSample :: Maybe JobSample
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
configuration :: Maybe ProfileConfiguration
$sel:roleArn:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:outputLocation:UpdateProfileJob' :: UpdateProfileJob -> S3Location
$sel:name:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:validationConfigurations:UpdateProfileJob' :: UpdateProfileJob -> Maybe (NonEmpty ValidationConfiguration)
$sel:timeout:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxRetries:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxCapacity:UpdateProfileJob' :: UpdateProfileJob -> Maybe Int
$sel:logSubscription:UpdateProfileJob' :: UpdateProfileJob -> Maybe LogSubscription
$sel:jobSample:UpdateProfileJob' :: UpdateProfileJob -> Maybe JobSample
$sel:encryptionMode:UpdateProfileJob' :: UpdateProfileJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateProfileJob' :: UpdateProfileJob -> Maybe Text
$sel:configuration:UpdateProfileJob' :: UpdateProfileJob -> Maybe ProfileConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Configuration" 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 ProfileConfiguration
configuration,
            (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
"JobSample" 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 JobSample
jobSample,
            (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
"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,
            (Key
"ValidationConfigurations" 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 ValidationConfiguration)
validationConfigurations,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"OutputLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3Location
outputLocation),
            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 UpdateProfileJob where
  toPath :: UpdateProfileJob -> ByteString
toPath UpdateProfileJob' {Maybe Int
Maybe Natural
Maybe (NonEmpty ValidationConfiguration)
Maybe Text
Maybe EncryptionMode
Maybe LogSubscription
Maybe JobSample
Maybe ProfileConfiguration
Text
S3Location
roleArn :: Text
outputLocation :: S3Location
name :: Text
validationConfigurations :: Maybe (NonEmpty ValidationConfiguration)
timeout :: Maybe Natural
maxRetries :: Maybe Natural
maxCapacity :: Maybe Int
logSubscription :: Maybe LogSubscription
jobSample :: Maybe JobSample
encryptionMode :: Maybe EncryptionMode
encryptionKeyArn :: Maybe Text
configuration :: Maybe ProfileConfiguration
$sel:roleArn:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:outputLocation:UpdateProfileJob' :: UpdateProfileJob -> S3Location
$sel:name:UpdateProfileJob' :: UpdateProfileJob -> Text
$sel:validationConfigurations:UpdateProfileJob' :: UpdateProfileJob -> Maybe (NonEmpty ValidationConfiguration)
$sel:timeout:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxRetries:UpdateProfileJob' :: UpdateProfileJob -> Maybe Natural
$sel:maxCapacity:UpdateProfileJob' :: UpdateProfileJob -> Maybe Int
$sel:logSubscription:UpdateProfileJob' :: UpdateProfileJob -> Maybe LogSubscription
$sel:jobSample:UpdateProfileJob' :: UpdateProfileJob -> Maybe JobSample
$sel:encryptionMode:UpdateProfileJob' :: UpdateProfileJob -> Maybe EncryptionMode
$sel:encryptionKeyArn:UpdateProfileJob' :: UpdateProfileJob -> Maybe Text
$sel:configuration:UpdateProfileJob' :: UpdateProfileJob -> Maybe ProfileConfiguration
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/profileJobs/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]

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

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

-- |
-- Create a value of 'UpdateProfileJobResponse' 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', 'updateProfileJobResponse_httpStatus' - The response's http status code.
--
-- 'name', 'updateProfileJobResponse_name' - The name of the job that was updated.
newUpdateProfileJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  UpdateProfileJobResponse
newUpdateProfileJobResponse :: Int -> Text -> UpdateProfileJobResponse
newUpdateProfileJobResponse Int
pHttpStatus_ Text
pName_ =
  UpdateProfileJobResponse'
    { $sel:httpStatus:UpdateProfileJobResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:name:UpdateProfileJobResponse' :: Text
name = Text
pName_
    }

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

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

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