{-# 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.CreateProfileJob
-- 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 analyze a dataset and create its data profile.
module Amazonka.DataBrew.CreateProfileJob
  ( -- * Creating a Request
    CreateProfileJob (..),
    newCreateProfileJob,

    -- * Request Lenses
    createProfileJob_encryptionMode,
    createProfileJob_logSubscription,
    createProfileJob_maxRetries,
    createProfileJob_encryptionKeyArn,
    createProfileJob_maxCapacity,
    createProfileJob_configuration,
    createProfileJob_timeout,
    createProfileJob_tags,
    createProfileJob_jobSample,
    createProfileJob_datasetName,
    createProfileJob_name,
    createProfileJob_outputLocation,
    createProfileJob_roleArn,

    -- * Destructuring the Response
    CreateProfileJobResponse (..),
    newCreateProfileJobResponse,

    -- * Response Lenses
    createProfileJobResponse_httpStatus,
    createProfileJobResponse_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:/ 'newCreateProfileJob' smart constructor.
data CreateProfileJob = CreateProfileJob'
  { -- | The encryption mode for the job, which can be one of the following:
    --
    -- -   @SSE-KMS@ - @SSE-KMS@ - Server-side encryption with KMS-managed
    --     keys.
    --
    -- -   @SSE-S3@ - Server-side encryption with keys managed by Amazon S3.
    CreateProfileJob -> 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.
    CreateProfileJob -> Maybe LogSubscription
logSubscription :: Prelude.Maybe LogSubscription,
    -- | The maximum number of times to retry the job after a job run fails.
    CreateProfileJob -> Maybe Natural
maxRetries :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of an encryption key that is used to
    -- protect the job.
    CreateProfileJob -> Maybe Text
encryptionKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of nodes that DataBrew can use when the job processes
    -- data.
    CreateProfileJob -> Maybe Int
maxCapacity :: Prelude.Maybe Prelude.Int,
    -- | 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.
    CreateProfileJob -> Maybe ProfileConfiguration
configuration :: Prelude.Maybe ProfileConfiguration,
    -- | The job\'s timeout in minutes. A job that attempts to run longer than
    -- this timeout period ends with a status of @TIMEOUT@.
    CreateProfileJob -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | Metadata tags to apply to this job.
    CreateProfileJob -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | 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, the default value will be used. The default value is
    -- CUSTOM_ROWS for the mode parameter and 20000 for the size parameter.
    CreateProfileJob -> Maybe JobSample
jobSample :: Prelude.Maybe JobSample,
    -- | The name of the dataset that this job is to act upon.
    CreateProfileJob -> Text
datasetName :: Prelude.Text,
    -- | The name of the job to be created. Valid characters are alphanumeric
    -- (A-Z, a-z, 0-9), hyphen (-), period (.), and space.
    CreateProfileJob -> Text
name :: Prelude.Text,
    CreateProfileJob -> S3Location
outputLocation :: S3Location,
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) role to be assumed when DataBrew runs the job.
    CreateProfileJob -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateProfileJob -> CreateProfileJob -> Bool
(CreateProfileJob -> CreateProfileJob -> Bool)
-> (CreateProfileJob -> CreateProfileJob -> Bool)
-> Eq CreateProfileJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProfileJob -> CreateProfileJob -> Bool
$c/= :: CreateProfileJob -> CreateProfileJob -> Bool
== :: CreateProfileJob -> CreateProfileJob -> Bool
$c== :: CreateProfileJob -> CreateProfileJob -> Bool
Prelude.Eq, ReadPrec [CreateProfileJob]
ReadPrec CreateProfileJob
Int -> ReadS CreateProfileJob
ReadS [CreateProfileJob]
(Int -> ReadS CreateProfileJob)
-> ReadS [CreateProfileJob]
-> ReadPrec CreateProfileJob
-> ReadPrec [CreateProfileJob]
-> Read CreateProfileJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProfileJob]
$creadListPrec :: ReadPrec [CreateProfileJob]
readPrec :: ReadPrec CreateProfileJob
$creadPrec :: ReadPrec CreateProfileJob
readList :: ReadS [CreateProfileJob]
$creadList :: ReadS [CreateProfileJob]
readsPrec :: Int -> ReadS CreateProfileJob
$creadsPrec :: Int -> ReadS CreateProfileJob
Prelude.Read, Int -> CreateProfileJob -> ShowS
[CreateProfileJob] -> ShowS
CreateProfileJob -> String
(Int -> CreateProfileJob -> ShowS)
-> (CreateProfileJob -> String)
-> ([CreateProfileJob] -> ShowS)
-> Show CreateProfileJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProfileJob] -> ShowS
$cshowList :: [CreateProfileJob] -> ShowS
show :: CreateProfileJob -> String
$cshow :: CreateProfileJob -> String
showsPrec :: Int -> CreateProfileJob -> ShowS
$cshowsPrec :: Int -> CreateProfileJob -> ShowS
Prelude.Show, (forall x. CreateProfileJob -> Rep CreateProfileJob x)
-> (forall x. Rep CreateProfileJob x -> CreateProfileJob)
-> Generic CreateProfileJob
forall x. Rep CreateProfileJob x -> CreateProfileJob
forall x. CreateProfileJob -> Rep CreateProfileJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProfileJob x -> CreateProfileJob
$cfrom :: forall x. CreateProfileJob -> Rep CreateProfileJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateProfileJob' 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:
--
-- 'encryptionMode', 'createProfileJob_encryptionMode' - The encryption mode for the job, which can be one of the following:
--
-- -   @SSE-KMS@ - @SSE-KMS@ - Server-side encryption with KMS-managed
--     keys.
--
-- -   @SSE-S3@ - Server-side encryption with keys managed by Amazon S3.
--
-- 'logSubscription', 'createProfileJob_logSubscription' - Enables or disables Amazon CloudWatch logging for the job. If logging is
-- enabled, CloudWatch writes one log stream for each job run.
--
-- 'maxRetries', 'createProfileJob_maxRetries' - The maximum number of times to retry the job after a job run fails.
--
-- 'encryptionKeyArn', 'createProfileJob_encryptionKeyArn' - The Amazon Resource Name (ARN) of an encryption key that is used to
-- protect the job.
--
-- 'maxCapacity', 'createProfileJob_maxCapacity' - The maximum number of nodes that DataBrew can use when the job processes
-- data.
--
-- 'configuration', 'createProfileJob_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.
--
-- 'timeout', 'createProfileJob_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', 'createProfileJob_tags' - Metadata tags to apply to this job.
--
-- 'jobSample', 'createProfileJob_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, the default value will be used. The default value is
-- CUSTOM_ROWS for the mode parameter and 20000 for the size parameter.
--
-- 'datasetName', 'createProfileJob_datasetName' - The name of the dataset that this job is to act upon.
--
-- 'name', 'createProfileJob_name' - The name of the job to be created. Valid characters are alphanumeric
-- (A-Z, a-z, 0-9), hyphen (-), period (.), and space.
--
-- 'outputLocation', 'createProfileJob_outputLocation' - Undocumented member.
--
-- 'roleArn', 'createProfileJob_roleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role to be assumed when DataBrew runs the job.
newCreateProfileJob ::
  -- | 'datasetName'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'outputLocation'
  S3Location ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateProfileJob
newCreateProfileJob :: Text -> Text -> S3Location -> Text -> CreateProfileJob
newCreateProfileJob
  Text
pDatasetName_
  Text
pName_
  S3Location
pOutputLocation_
  Text
pRoleArn_ =
    CreateProfileJob' :: Maybe EncryptionMode
-> Maybe LogSubscription
-> Maybe Natural
-> Maybe Text
-> Maybe Int
-> Maybe ProfileConfiguration
-> Maybe Natural
-> Maybe (HashMap Text Text)
-> Maybe JobSample
-> Text
-> Text
-> S3Location
-> Text
-> CreateProfileJob
CreateProfileJob'
      { $sel:encryptionMode:CreateProfileJob' :: Maybe EncryptionMode
encryptionMode = Maybe EncryptionMode
forall a. Maybe a
Prelude.Nothing,
        $sel:logSubscription:CreateProfileJob' :: Maybe LogSubscription
logSubscription = Maybe LogSubscription
forall a. Maybe a
Prelude.Nothing,
        $sel:maxRetries:CreateProfileJob' :: Maybe Natural
maxRetries = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:encryptionKeyArn:CreateProfileJob' :: Maybe Text
encryptionKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxCapacity:CreateProfileJob' :: Maybe Int
maxCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:configuration:CreateProfileJob' :: Maybe ProfileConfiguration
configuration = Maybe ProfileConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:timeout:CreateProfileJob' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProfileJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:jobSample:CreateProfileJob' :: Maybe JobSample
jobSample = Maybe JobSample
forall a. Maybe a
Prelude.Nothing,
        $sel:datasetName:CreateProfileJob' :: Text
datasetName = Text
pDatasetName_,
        $sel:name:CreateProfileJob' :: Text
name = Text
pName_,
        $sel:outputLocation:CreateProfileJob' :: S3Location
outputLocation = S3Location
pOutputLocation_,
        $sel:roleArn:CreateProfileJob' :: Text
roleArn = Text
pRoleArn_
      }

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

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

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

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

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

-- | 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.
createProfileJob_configuration :: Lens.Lens' CreateProfileJob (Prelude.Maybe ProfileConfiguration)
createProfileJob_configuration :: (Maybe ProfileConfiguration -> f (Maybe ProfileConfiguration))
-> CreateProfileJob -> f CreateProfileJob
createProfileJob_configuration = (CreateProfileJob -> Maybe ProfileConfiguration)
-> (CreateProfileJob
    -> Maybe ProfileConfiguration -> CreateProfileJob)
-> Lens
     CreateProfileJob
     CreateProfileJob
     (Maybe ProfileConfiguration)
     (Maybe ProfileConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfileJob' {Maybe ProfileConfiguration
configuration :: Maybe ProfileConfiguration
$sel:configuration:CreateProfileJob' :: CreateProfileJob -> Maybe ProfileConfiguration
configuration} -> Maybe ProfileConfiguration
configuration) (\s :: CreateProfileJob
s@CreateProfileJob' {} Maybe ProfileConfiguration
a -> CreateProfileJob
s {$sel:configuration:CreateProfileJob' :: Maybe ProfileConfiguration
configuration = Maybe ProfileConfiguration
a} :: CreateProfileJob)

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

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

-- | 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, the default value will be used. The default value is
-- CUSTOM_ROWS for the mode parameter and 20000 for the size parameter.
createProfileJob_jobSample :: Lens.Lens' CreateProfileJob (Prelude.Maybe JobSample)
createProfileJob_jobSample :: (Maybe JobSample -> f (Maybe JobSample))
-> CreateProfileJob -> f CreateProfileJob
createProfileJob_jobSample = (CreateProfileJob -> Maybe JobSample)
-> (CreateProfileJob -> Maybe JobSample -> CreateProfileJob)
-> Lens
     CreateProfileJob
     CreateProfileJob
     (Maybe JobSample)
     (Maybe JobSample)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfileJob' {Maybe JobSample
jobSample :: Maybe JobSample
$sel:jobSample:CreateProfileJob' :: CreateProfileJob -> Maybe JobSample
jobSample} -> Maybe JobSample
jobSample) (\s :: CreateProfileJob
s@CreateProfileJob' {} Maybe JobSample
a -> CreateProfileJob
s {$sel:jobSample:CreateProfileJob' :: Maybe JobSample
jobSample = Maybe JobSample
a} :: CreateProfileJob)

-- | The name of the dataset that this job is to act upon.
createProfileJob_datasetName :: Lens.Lens' CreateProfileJob Prelude.Text
createProfileJob_datasetName :: (Text -> f Text) -> CreateProfileJob -> f CreateProfileJob
createProfileJob_datasetName = (CreateProfileJob -> Text)
-> (CreateProfileJob -> Text -> CreateProfileJob)
-> Lens CreateProfileJob CreateProfileJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfileJob' {Text
datasetName :: Text
$sel:datasetName:CreateProfileJob' :: CreateProfileJob -> Text
datasetName} -> Text
datasetName) (\s :: CreateProfileJob
s@CreateProfileJob' {} Text
a -> CreateProfileJob
s {$sel:datasetName:CreateProfileJob' :: Text
datasetName = Text
a} :: CreateProfileJob)

-- | The name of the job to be created. Valid characters are alphanumeric
-- (A-Z, a-z, 0-9), hyphen (-), period (.), and space.
createProfileJob_name :: Lens.Lens' CreateProfileJob Prelude.Text
createProfileJob_name :: (Text -> f Text) -> CreateProfileJob -> f CreateProfileJob
createProfileJob_name = (CreateProfileJob -> Text)
-> (CreateProfileJob -> Text -> CreateProfileJob)
-> Lens CreateProfileJob CreateProfileJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfileJob' {Text
name :: Text
$sel:name:CreateProfileJob' :: CreateProfileJob -> Text
name} -> Text
name) (\s :: CreateProfileJob
s@CreateProfileJob' {} Text
a -> CreateProfileJob
s {$sel:name:CreateProfileJob' :: Text
name = Text
a} :: CreateProfileJob)

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

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

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

instance Prelude.NFData CreateProfileJob

instance Core.ToHeaders CreateProfileJob where
  toHeaders :: CreateProfileJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateProfileJob -> 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 CreateProfileJob where
  toJSON :: CreateProfileJob -> Value
toJSON CreateProfileJob' {Maybe Int
Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe EncryptionMode
Maybe LogSubscription
Maybe JobSample
Maybe ProfileConfiguration
Text
S3Location
roleArn :: Text
outputLocation :: S3Location
name :: Text
datasetName :: Text
jobSample :: Maybe JobSample
tags :: Maybe (HashMap Text Text)
timeout :: Maybe Natural
configuration :: Maybe ProfileConfiguration
maxCapacity :: Maybe Int
encryptionKeyArn :: Maybe Text
maxRetries :: Maybe Natural
logSubscription :: Maybe LogSubscription
encryptionMode :: Maybe EncryptionMode
$sel:roleArn:CreateProfileJob' :: CreateProfileJob -> Text
$sel:outputLocation:CreateProfileJob' :: CreateProfileJob -> S3Location
$sel:name:CreateProfileJob' :: CreateProfileJob -> Text
$sel:datasetName:CreateProfileJob' :: CreateProfileJob -> Text
$sel:jobSample:CreateProfileJob' :: CreateProfileJob -> Maybe JobSample
$sel:tags:CreateProfileJob' :: CreateProfileJob -> Maybe (HashMap Text Text)
$sel:timeout:CreateProfileJob' :: CreateProfileJob -> Maybe Natural
$sel:configuration:CreateProfileJob' :: CreateProfileJob -> Maybe ProfileConfiguration
$sel:maxCapacity:CreateProfileJob' :: CreateProfileJob -> Maybe Int
$sel:encryptionKeyArn:CreateProfileJob' :: CreateProfileJob -> Maybe Text
$sel:maxRetries:CreateProfileJob' :: CreateProfileJob -> Maybe Natural
$sel:logSubscription:CreateProfileJob' :: CreateProfileJob -> Maybe LogSubscription
$sel:encryptionMode:CreateProfileJob' :: CreateProfileJob -> Maybe EncryptionMode
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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
"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
"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
"Configuration" Text -> ProfileConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ProfileConfiguration -> Pair)
-> Maybe ProfileConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProfileConfiguration
configuration,
            (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,
            (Text
"JobSample" Text -> JobSample -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobSample -> Pair) -> Maybe JobSample -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobSample
jobSample,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatasetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datasetName),
            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
"OutputLocation" Text -> S3Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3Location
outputLocation),
            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 CreateProfileJob where
  toPath :: CreateProfileJob -> ByteString
toPath = ByteString -> CreateProfileJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/profileJobs"

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

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

-- |
-- Create a value of 'CreateProfileJobResponse' 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', 'createProfileJobResponse_httpStatus' - The response's http status code.
--
-- 'name', 'createProfileJobResponse_name' - The name of the job that was created.
newCreateProfileJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  CreateProfileJobResponse
newCreateProfileJobResponse :: Int -> Text -> CreateProfileJobResponse
newCreateProfileJobResponse Int
pHttpStatus_ Text
pName_ =
  CreateProfileJobResponse' :: Int -> Text -> CreateProfileJobResponse
CreateProfileJobResponse'
    { $sel:httpStatus:CreateProfileJobResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:name:CreateProfileJobResponse' :: Text
name = Text
pName_
    }

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

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

instance Prelude.NFData CreateProfileJobResponse