{-# 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.ComprehendMedical.StartPHIDetectionJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts an asynchronous job to detect protected health information (PHI).
-- Use the @DescribePHIDetectionJob@ operation to track the status of a
-- job.
module Amazonka.ComprehendMedical.StartPHIDetectionJob
  ( -- * Creating a Request
    StartPHIDetectionJob (..),
    newStartPHIDetectionJob,

    -- * Request Lenses
    startPHIDetectionJob_clientRequestToken,
    startPHIDetectionJob_jobName,
    startPHIDetectionJob_kmsKey,
    startPHIDetectionJob_inputDataConfig,
    startPHIDetectionJob_outputDataConfig,
    startPHIDetectionJob_dataAccessRoleArn,
    startPHIDetectionJob_languageCode,

    -- * Destructuring the Response
    StartPHIDetectionJobResponse (..),
    newStartPHIDetectionJobResponse,

    -- * Response Lenses
    startPHIDetectionJobResponse_jobId,
    startPHIDetectionJobResponse_httpStatus,
  )
where

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

-- | /See:/ 'newStartPHIDetectionJob' smart constructor.
data StartPHIDetectionJob = StartPHIDetectionJob'
  { -- | A unique identifier for the request. If you don\'t set the client
    -- request token, Comprehend Medical; generates one.
    StartPHIDetectionJob -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the job.
    StartPHIDetectionJob -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | An AWS Key Management Service key to encrypt your output files. If you
    -- do not specify a key, the files are written in plain text.
    StartPHIDetectionJob -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
    -- | Specifies the format and location of the input data for the job.
    StartPHIDetectionJob -> InputDataConfig
inputDataConfig :: InputDataConfig,
    -- | Specifies where to send the output files.
    StartPHIDetectionJob -> OutputDataConfig
outputDataConfig :: OutputDataConfig,
    -- | The Amazon Resource Name (ARN) of the AWS Identity and Access Management
    -- (IAM) role that grants Comprehend Medical; read access to your input
    -- data. For more information, see
    -- <https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions-med.html#auth-role-permissions-med Role-Based Permissions Required for Asynchronous Operations>.
    StartPHIDetectionJob -> Text
dataAccessRoleArn :: Prelude.Text,
    -- | The language of the input documents. All documents must be in the same
    -- language.
    StartPHIDetectionJob -> LanguageCode
languageCode :: LanguageCode
  }
  deriving (StartPHIDetectionJob -> StartPHIDetectionJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartPHIDetectionJob -> StartPHIDetectionJob -> Bool
$c/= :: StartPHIDetectionJob -> StartPHIDetectionJob -> Bool
== :: StartPHIDetectionJob -> StartPHIDetectionJob -> Bool
$c== :: StartPHIDetectionJob -> StartPHIDetectionJob -> Bool
Prelude.Eq, ReadPrec [StartPHIDetectionJob]
ReadPrec StartPHIDetectionJob
Int -> ReadS StartPHIDetectionJob
ReadS [StartPHIDetectionJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartPHIDetectionJob]
$creadListPrec :: ReadPrec [StartPHIDetectionJob]
readPrec :: ReadPrec StartPHIDetectionJob
$creadPrec :: ReadPrec StartPHIDetectionJob
readList :: ReadS [StartPHIDetectionJob]
$creadList :: ReadS [StartPHIDetectionJob]
readsPrec :: Int -> ReadS StartPHIDetectionJob
$creadsPrec :: Int -> ReadS StartPHIDetectionJob
Prelude.Read, Int -> StartPHIDetectionJob -> ShowS
[StartPHIDetectionJob] -> ShowS
StartPHIDetectionJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartPHIDetectionJob] -> ShowS
$cshowList :: [StartPHIDetectionJob] -> ShowS
show :: StartPHIDetectionJob -> String
$cshow :: StartPHIDetectionJob -> String
showsPrec :: Int -> StartPHIDetectionJob -> ShowS
$cshowsPrec :: Int -> StartPHIDetectionJob -> ShowS
Prelude.Show, forall x. Rep StartPHIDetectionJob x -> StartPHIDetectionJob
forall x. StartPHIDetectionJob -> Rep StartPHIDetectionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartPHIDetectionJob x -> StartPHIDetectionJob
$cfrom :: forall x. StartPHIDetectionJob -> Rep StartPHIDetectionJob x
Prelude.Generic)

-- |
-- Create a value of 'StartPHIDetectionJob' 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:
--
-- 'clientRequestToken', 'startPHIDetectionJob_clientRequestToken' - A unique identifier for the request. If you don\'t set the client
-- request token, Comprehend Medical; generates one.
--
-- 'jobName', 'startPHIDetectionJob_jobName' - The identifier of the job.
--
-- 'kmsKey', 'startPHIDetectionJob_kmsKey' - An AWS Key Management Service key to encrypt your output files. If you
-- do not specify a key, the files are written in plain text.
--
-- 'inputDataConfig', 'startPHIDetectionJob_inputDataConfig' - Specifies the format and location of the input data for the job.
--
-- 'outputDataConfig', 'startPHIDetectionJob_outputDataConfig' - Specifies where to send the output files.
--
-- 'dataAccessRoleArn', 'startPHIDetectionJob_dataAccessRoleArn' - The Amazon Resource Name (ARN) of the AWS Identity and Access Management
-- (IAM) role that grants Comprehend Medical; read access to your input
-- data. For more information, see
-- <https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions-med.html#auth-role-permissions-med Role-Based Permissions Required for Asynchronous Operations>.
--
-- 'languageCode', 'startPHIDetectionJob_languageCode' - The language of the input documents. All documents must be in the same
-- language.
newStartPHIDetectionJob ::
  -- | 'inputDataConfig'
  InputDataConfig ->
  -- | 'outputDataConfig'
  OutputDataConfig ->
  -- | 'dataAccessRoleArn'
  Prelude.Text ->
  -- | 'languageCode'
  LanguageCode ->
  StartPHIDetectionJob
newStartPHIDetectionJob :: InputDataConfig
-> OutputDataConfig -> Text -> LanguageCode -> StartPHIDetectionJob
newStartPHIDetectionJob
  InputDataConfig
pInputDataConfig_
  OutputDataConfig
pOutputDataConfig_
  Text
pDataAccessRoleArn_
  LanguageCode
pLanguageCode_ =
    StartPHIDetectionJob'
      { $sel:clientRequestToken:StartPHIDetectionJob' :: Maybe Text
clientRequestToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:jobName:StartPHIDetectionJob' :: Maybe Text
jobName = forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKey:StartPHIDetectionJob' :: Maybe Text
kmsKey = forall a. Maybe a
Prelude.Nothing,
        $sel:inputDataConfig:StartPHIDetectionJob' :: InputDataConfig
inputDataConfig = InputDataConfig
pInputDataConfig_,
        $sel:outputDataConfig:StartPHIDetectionJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
pOutputDataConfig_,
        $sel:dataAccessRoleArn:StartPHIDetectionJob' :: Text
dataAccessRoleArn = Text
pDataAccessRoleArn_,
        $sel:languageCode:StartPHIDetectionJob' :: LanguageCode
languageCode = LanguageCode
pLanguageCode_
      }

-- | A unique identifier for the request. If you don\'t set the client
-- request token, Comprehend Medical; generates one.
startPHIDetectionJob_clientRequestToken :: Lens.Lens' StartPHIDetectionJob (Prelude.Maybe Prelude.Text)
startPHIDetectionJob_clientRequestToken :: Lens' StartPHIDetectionJob (Maybe Text)
startPHIDetectionJob_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJob' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: StartPHIDetectionJob
s@StartPHIDetectionJob' {} Maybe Text
a -> StartPHIDetectionJob
s {$sel:clientRequestToken:StartPHIDetectionJob' :: Maybe Text
clientRequestToken = Maybe Text
a} :: StartPHIDetectionJob)

-- | The identifier of the job.
startPHIDetectionJob_jobName :: Lens.Lens' StartPHIDetectionJob (Prelude.Maybe Prelude.Text)
startPHIDetectionJob_jobName :: Lens' StartPHIDetectionJob (Maybe Text)
startPHIDetectionJob_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJob' {Maybe Text
jobName :: Maybe Text
$sel:jobName:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: StartPHIDetectionJob
s@StartPHIDetectionJob' {} Maybe Text
a -> StartPHIDetectionJob
s {$sel:jobName:StartPHIDetectionJob' :: Maybe Text
jobName = Maybe Text
a} :: StartPHIDetectionJob)

-- | An AWS Key Management Service key to encrypt your output files. If you
-- do not specify a key, the files are written in plain text.
startPHIDetectionJob_kmsKey :: Lens.Lens' StartPHIDetectionJob (Prelude.Maybe Prelude.Text)
startPHIDetectionJob_kmsKey :: Lens' StartPHIDetectionJob (Maybe Text)
startPHIDetectionJob_kmsKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJob' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: StartPHIDetectionJob
s@StartPHIDetectionJob' {} Maybe Text
a -> StartPHIDetectionJob
s {$sel:kmsKey:StartPHIDetectionJob' :: Maybe Text
kmsKey = Maybe Text
a} :: StartPHIDetectionJob)

-- | Specifies the format and location of the input data for the job.
startPHIDetectionJob_inputDataConfig :: Lens.Lens' StartPHIDetectionJob InputDataConfig
startPHIDetectionJob_inputDataConfig :: Lens' StartPHIDetectionJob InputDataConfig
startPHIDetectionJob_inputDataConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJob' {InputDataConfig
inputDataConfig :: InputDataConfig
$sel:inputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> InputDataConfig
inputDataConfig} -> InputDataConfig
inputDataConfig) (\s :: StartPHIDetectionJob
s@StartPHIDetectionJob' {} InputDataConfig
a -> StartPHIDetectionJob
s {$sel:inputDataConfig:StartPHIDetectionJob' :: InputDataConfig
inputDataConfig = InputDataConfig
a} :: StartPHIDetectionJob)

-- | Specifies where to send the output files.
startPHIDetectionJob_outputDataConfig :: Lens.Lens' StartPHIDetectionJob OutputDataConfig
startPHIDetectionJob_outputDataConfig :: Lens' StartPHIDetectionJob OutputDataConfig
startPHIDetectionJob_outputDataConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJob' {OutputDataConfig
outputDataConfig :: OutputDataConfig
$sel:outputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> OutputDataConfig
outputDataConfig} -> OutputDataConfig
outputDataConfig) (\s :: StartPHIDetectionJob
s@StartPHIDetectionJob' {} OutputDataConfig
a -> StartPHIDetectionJob
s {$sel:outputDataConfig:StartPHIDetectionJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
a} :: StartPHIDetectionJob)

-- | The Amazon Resource Name (ARN) of the AWS Identity and Access Management
-- (IAM) role that grants Comprehend Medical; read access to your input
-- data. For more information, see
-- <https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions-med.html#auth-role-permissions-med Role-Based Permissions Required for Asynchronous Operations>.
startPHIDetectionJob_dataAccessRoleArn :: Lens.Lens' StartPHIDetectionJob Prelude.Text
startPHIDetectionJob_dataAccessRoleArn :: Lens' StartPHIDetectionJob Text
startPHIDetectionJob_dataAccessRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJob' {Text
dataAccessRoleArn :: Text
$sel:dataAccessRoleArn:StartPHIDetectionJob' :: StartPHIDetectionJob -> Text
dataAccessRoleArn} -> Text
dataAccessRoleArn) (\s :: StartPHIDetectionJob
s@StartPHIDetectionJob' {} Text
a -> StartPHIDetectionJob
s {$sel:dataAccessRoleArn:StartPHIDetectionJob' :: Text
dataAccessRoleArn = Text
a} :: StartPHIDetectionJob)

-- | The language of the input documents. All documents must be in the same
-- language.
startPHIDetectionJob_languageCode :: Lens.Lens' StartPHIDetectionJob LanguageCode
startPHIDetectionJob_languageCode :: Lens' StartPHIDetectionJob LanguageCode
startPHIDetectionJob_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJob' {LanguageCode
languageCode :: LanguageCode
$sel:languageCode:StartPHIDetectionJob' :: StartPHIDetectionJob -> LanguageCode
languageCode} -> LanguageCode
languageCode) (\s :: StartPHIDetectionJob
s@StartPHIDetectionJob' {} LanguageCode
a -> StartPHIDetectionJob
s {$sel:languageCode:StartPHIDetectionJob' :: LanguageCode
languageCode = LanguageCode
a} :: StartPHIDetectionJob)

instance Core.AWSRequest StartPHIDetectionJob where
  type
    AWSResponse StartPHIDetectionJob =
      StartPHIDetectionJobResponse
  request :: (Service -> Service)
-> StartPHIDetectionJob -> Request StartPHIDetectionJob
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartPHIDetectionJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartPHIDetectionJob)))
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 ->
          Maybe Text -> Int -> StartPHIDetectionJobResponse
StartPHIDetectionJobResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"JobId")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable StartPHIDetectionJob where
  hashWithSalt :: Int -> StartPHIDetectionJob -> Int
hashWithSalt Int
_salt StartPHIDetectionJob' {Maybe Text
Text
InputDataConfig
LanguageCode
OutputDataConfig
languageCode :: LanguageCode
dataAccessRoleArn :: Text
outputDataConfig :: OutputDataConfig
inputDataConfig :: InputDataConfig
kmsKey :: Maybe Text
jobName :: Maybe Text
clientRequestToken :: Maybe Text
$sel:languageCode:StartPHIDetectionJob' :: StartPHIDetectionJob -> LanguageCode
$sel:dataAccessRoleArn:StartPHIDetectionJob' :: StartPHIDetectionJob -> Text
$sel:outputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> OutputDataConfig
$sel:inputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> InputDataConfig
$sel:kmsKey:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:jobName:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:clientRequestToken:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InputDataConfig
inputDataConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OutputDataConfig
outputDataConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataAccessRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LanguageCode
languageCode

instance Prelude.NFData StartPHIDetectionJob where
  rnf :: StartPHIDetectionJob -> ()
rnf StartPHIDetectionJob' {Maybe Text
Text
InputDataConfig
LanguageCode
OutputDataConfig
languageCode :: LanguageCode
dataAccessRoleArn :: Text
outputDataConfig :: OutputDataConfig
inputDataConfig :: InputDataConfig
kmsKey :: Maybe Text
jobName :: Maybe Text
clientRequestToken :: Maybe Text
$sel:languageCode:StartPHIDetectionJob' :: StartPHIDetectionJob -> LanguageCode
$sel:dataAccessRoleArn:StartPHIDetectionJob' :: StartPHIDetectionJob -> Text
$sel:outputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> OutputDataConfig
$sel:inputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> InputDataConfig
$sel:kmsKey:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:jobName:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:clientRequestToken:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InputDataConfig
inputDataConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OutputDataConfig
outputDataConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dataAccessRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LanguageCode
languageCode

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

instance Data.ToJSON StartPHIDetectionJob where
  toJSON :: StartPHIDetectionJob -> Value
toJSON StartPHIDetectionJob' {Maybe Text
Text
InputDataConfig
LanguageCode
OutputDataConfig
languageCode :: LanguageCode
dataAccessRoleArn :: Text
outputDataConfig :: OutputDataConfig
inputDataConfig :: InputDataConfig
kmsKey :: Maybe Text
jobName :: Maybe Text
clientRequestToken :: Maybe Text
$sel:languageCode:StartPHIDetectionJob' :: StartPHIDetectionJob -> LanguageCode
$sel:dataAccessRoleArn:StartPHIDetectionJob' :: StartPHIDetectionJob -> Text
$sel:outputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> OutputDataConfig
$sel:inputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> InputDataConfig
$sel:kmsKey:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:jobName:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:clientRequestToken:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientRequestToken" 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
clientRequestToken,
            (Key
"JobName" 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
jobName,
            (Key
"KMSKey" 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
kmsKey,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"InputDataConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= InputDataConfig
inputDataConfig),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"OutputDataConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OutputDataConfig
outputDataConfig),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"DataAccessRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
dataAccessRoleArn),
            forall a. a -> Maybe a
Prelude.Just (Key
"LanguageCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LanguageCode
languageCode)
          ]
      )

instance Data.ToPath StartPHIDetectionJob where
  toPath :: StartPHIDetectionJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newStartPHIDetectionJobResponse' smart constructor.
data StartPHIDetectionJobResponse = StartPHIDetectionJobResponse'
  { -- | The identifier generated for the job. To get the status of a job, use
    -- this identifier with the @DescribePHIDetectionJob@ operation.
    StartPHIDetectionJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    StartPHIDetectionJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (StartPHIDetectionJobResponse
-> StartPHIDetectionJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartPHIDetectionJobResponse
-> StartPHIDetectionJobResponse -> Bool
$c/= :: StartPHIDetectionJobResponse
-> StartPHIDetectionJobResponse -> Bool
== :: StartPHIDetectionJobResponse
-> StartPHIDetectionJobResponse -> Bool
$c== :: StartPHIDetectionJobResponse
-> StartPHIDetectionJobResponse -> Bool
Prelude.Eq, ReadPrec [StartPHIDetectionJobResponse]
ReadPrec StartPHIDetectionJobResponse
Int -> ReadS StartPHIDetectionJobResponse
ReadS [StartPHIDetectionJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartPHIDetectionJobResponse]
$creadListPrec :: ReadPrec [StartPHIDetectionJobResponse]
readPrec :: ReadPrec StartPHIDetectionJobResponse
$creadPrec :: ReadPrec StartPHIDetectionJobResponse
readList :: ReadS [StartPHIDetectionJobResponse]
$creadList :: ReadS [StartPHIDetectionJobResponse]
readsPrec :: Int -> ReadS StartPHIDetectionJobResponse
$creadsPrec :: Int -> ReadS StartPHIDetectionJobResponse
Prelude.Read, Int -> StartPHIDetectionJobResponse -> ShowS
[StartPHIDetectionJobResponse] -> ShowS
StartPHIDetectionJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartPHIDetectionJobResponse] -> ShowS
$cshowList :: [StartPHIDetectionJobResponse] -> ShowS
show :: StartPHIDetectionJobResponse -> String
$cshow :: StartPHIDetectionJobResponse -> String
showsPrec :: Int -> StartPHIDetectionJobResponse -> ShowS
$cshowsPrec :: Int -> StartPHIDetectionJobResponse -> ShowS
Prelude.Show, forall x.
Rep StartPHIDetectionJobResponse x -> StartPHIDetectionJobResponse
forall x.
StartPHIDetectionJobResponse -> Rep StartPHIDetectionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartPHIDetectionJobResponse x -> StartPHIDetectionJobResponse
$cfrom :: forall x.
StartPHIDetectionJobResponse -> Rep StartPHIDetectionJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'StartPHIDetectionJobResponse' 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:
--
-- 'jobId', 'startPHIDetectionJobResponse_jobId' - The identifier generated for the job. To get the status of a job, use
-- this identifier with the @DescribePHIDetectionJob@ operation.
--
-- 'httpStatus', 'startPHIDetectionJobResponse_httpStatus' - The response's http status code.
newStartPHIDetectionJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartPHIDetectionJobResponse
newStartPHIDetectionJobResponse :: Int -> StartPHIDetectionJobResponse
newStartPHIDetectionJobResponse Int
pHttpStatus_ =
  StartPHIDetectionJobResponse'
    { $sel:jobId:StartPHIDetectionJobResponse' :: Maybe Text
jobId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartPHIDetectionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier generated for the job. To get the status of a job, use
-- this identifier with the @DescribePHIDetectionJob@ operation.
startPHIDetectionJobResponse_jobId :: Lens.Lens' StartPHIDetectionJobResponse (Prelude.Maybe Prelude.Text)
startPHIDetectionJobResponse_jobId :: Lens' StartPHIDetectionJobResponse (Maybe Text)
startPHIDetectionJobResponse_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPHIDetectionJobResponse' {Maybe Text
jobId :: Maybe Text
$sel:jobId:StartPHIDetectionJobResponse' :: StartPHIDetectionJobResponse -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: StartPHIDetectionJobResponse
s@StartPHIDetectionJobResponse' {} Maybe Text
a -> StartPHIDetectionJobResponse
s {$sel:jobId:StartPHIDetectionJobResponse' :: Maybe Text
jobId = Maybe Text
a} :: StartPHIDetectionJobResponse)

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

instance Prelude.NFData StartPHIDetectionJobResponse where
  rnf :: StartPHIDetectionJobResponse -> ()
rnf StartPHIDetectionJobResponse' {Int
Maybe Text
httpStatus :: Int
jobId :: Maybe Text
$sel:httpStatus:StartPHIDetectionJobResponse' :: StartPHIDetectionJobResponse -> Int
$sel:jobId:StartPHIDetectionJobResponse' :: StartPHIDetectionJobResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus