{-# 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-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)
--
-- 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_kmsKey,
    startPHIDetectionJob_jobName,
    startPHIDetectionJob_clientRequestToken,
    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.Lens as Lens
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'
  { -- | 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,
    -- | The identifier of the job.
    StartPHIDetectionJob -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the request. If you don\'t set the client
    -- request token, Amazon Comprehend Medical generates one.
    StartPHIDetectionJob -> Maybe Text
clientRequestToken :: 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 Amazon 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
(StartPHIDetectionJob -> StartPHIDetectionJob -> Bool)
-> (StartPHIDetectionJob -> StartPHIDetectionJob -> Bool)
-> Eq StartPHIDetectionJob
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]
(Int -> ReadS StartPHIDetectionJob)
-> ReadS [StartPHIDetectionJob]
-> ReadPrec StartPHIDetectionJob
-> ReadPrec [StartPHIDetectionJob]
-> Read 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
(Int -> StartPHIDetectionJob -> ShowS)
-> (StartPHIDetectionJob -> String)
-> ([StartPHIDetectionJob] -> ShowS)
-> Show StartPHIDetectionJob
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. StartPHIDetectionJob -> Rep StartPHIDetectionJob x)
-> (forall x. Rep StartPHIDetectionJob x -> StartPHIDetectionJob)
-> Generic StartPHIDetectionJob
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:
--
-- '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.
--
-- 'jobName', 'startPHIDetectionJob_jobName' - The identifier of the job.
--
-- 'clientRequestToken', 'startPHIDetectionJob_clientRequestToken' - A unique identifier for the request. If you don\'t set the client
-- request token, Amazon Comprehend Medical generates one.
--
-- '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 Amazon 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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> InputDataConfig
-> OutputDataConfig
-> Text
-> LanguageCode
-> StartPHIDetectionJob
StartPHIDetectionJob'
      { $sel:kmsKey:StartPHIDetectionJob' :: Maybe Text
kmsKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:jobName:StartPHIDetectionJob' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:StartPHIDetectionJob' :: Maybe Text
clientRequestToken = Maybe Text
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_
      }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> StartPHIDetectionJob -> f StartPHIDetectionJob
startPHIDetectionJob_kmsKey = (StartPHIDetectionJob -> Maybe Text)
-> (StartPHIDetectionJob -> Maybe Text -> StartPHIDetectionJob)
-> Lens
     StartPHIDetectionJob StartPHIDetectionJob (Maybe Text) (Maybe Text)
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)

-- | The identifier of the job.
startPHIDetectionJob_jobName :: Lens.Lens' StartPHIDetectionJob (Prelude.Maybe Prelude.Text)
startPHIDetectionJob_jobName :: (Maybe Text -> f (Maybe Text))
-> StartPHIDetectionJob -> f StartPHIDetectionJob
startPHIDetectionJob_jobName = (StartPHIDetectionJob -> Maybe Text)
-> (StartPHIDetectionJob -> Maybe Text -> StartPHIDetectionJob)
-> Lens
     StartPHIDetectionJob StartPHIDetectionJob (Maybe Text) (Maybe Text)
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)

-- | A unique identifier for the request. If you don\'t set the client
-- request token, Amazon Comprehend Medical generates one.
startPHIDetectionJob_clientRequestToken :: Lens.Lens' StartPHIDetectionJob (Prelude.Maybe Prelude.Text)
startPHIDetectionJob_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> StartPHIDetectionJob -> f StartPHIDetectionJob
startPHIDetectionJob_clientRequestToken = (StartPHIDetectionJob -> Maybe Text)
-> (StartPHIDetectionJob -> Maybe Text -> StartPHIDetectionJob)
-> Lens
     StartPHIDetectionJob StartPHIDetectionJob (Maybe Text) (Maybe Text)
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)

-- | Specifies the format and location of the input data for the job.
startPHIDetectionJob_inputDataConfig :: Lens.Lens' StartPHIDetectionJob InputDataConfig
startPHIDetectionJob_inputDataConfig :: (InputDataConfig -> f InputDataConfig)
-> StartPHIDetectionJob -> f StartPHIDetectionJob
startPHIDetectionJob_inputDataConfig = (StartPHIDetectionJob -> InputDataConfig)
-> (StartPHIDetectionJob
    -> InputDataConfig -> StartPHIDetectionJob)
-> Lens
     StartPHIDetectionJob
     StartPHIDetectionJob
     InputDataConfig
     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 :: (OutputDataConfig -> f OutputDataConfig)
-> StartPHIDetectionJob -> f StartPHIDetectionJob
startPHIDetectionJob_outputDataConfig = (StartPHIDetectionJob -> OutputDataConfig)
-> (StartPHIDetectionJob
    -> OutputDataConfig -> StartPHIDetectionJob)
-> Lens
     StartPHIDetectionJob
     StartPHIDetectionJob
     OutputDataConfig
     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 Amazon 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 :: (Text -> f Text) -> StartPHIDetectionJob -> f StartPHIDetectionJob
startPHIDetectionJob_dataAccessRoleArn = (StartPHIDetectionJob -> Text)
-> (StartPHIDetectionJob -> Text -> StartPHIDetectionJob)
-> Lens StartPHIDetectionJob StartPHIDetectionJob Text Text
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 :: (LanguageCode -> f LanguageCode)
-> StartPHIDetectionJob -> f StartPHIDetectionJob
startPHIDetectionJob_languageCode = (StartPHIDetectionJob -> LanguageCode)
-> (StartPHIDetectionJob -> LanguageCode -> StartPHIDetectionJob)
-> Lens
     StartPHIDetectionJob StartPHIDetectionJob LanguageCode 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 :: StartPHIDetectionJob -> Request StartPHIDetectionJob
request = Service -> StartPHIDetectionJob -> Request StartPHIDetectionJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartPHIDetectionJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartPHIDetectionJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartPHIDetectionJob))
-> Logger
-> Service
-> Proxy StartPHIDetectionJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartPHIDetectionJob)))
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 ->
          Maybe Text -> Int -> StartPHIDetectionJobResponse
StartPHIDetectionJobResponse'
            (Maybe Text -> Int -> StartPHIDetectionJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartPHIDetectionJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"JobId")
            Either String (Int -> StartPHIDetectionJobResponse)
-> Either String Int -> Either String StartPHIDetectionJobResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable StartPHIDetectionJob

instance Prelude.NFData StartPHIDetectionJob

instance Core.ToHeaders StartPHIDetectionJob where
  toHeaders :: StartPHIDetectionJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartPHIDetectionJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"ComprehendMedical_20181030.StartPHIDetectionJob" ::
                          Prelude.ByteString
                      ),
            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 StartPHIDetectionJob where
  toJSON :: StartPHIDetectionJob -> Value
toJSON StartPHIDetectionJob' {Maybe Text
Text
InputDataConfig
LanguageCode
OutputDataConfig
languageCode :: LanguageCode
dataAccessRoleArn :: Text
outputDataConfig :: OutputDataConfig
inputDataConfig :: InputDataConfig
clientRequestToken :: Maybe Text
jobName :: Maybe Text
kmsKey :: Maybe Text
$sel:languageCode:StartPHIDetectionJob' :: StartPHIDetectionJob -> LanguageCode
$sel:dataAccessRoleArn:StartPHIDetectionJob' :: StartPHIDetectionJob -> Text
$sel:outputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> OutputDataConfig
$sel:inputDataConfig:StartPHIDetectionJob' :: StartPHIDetectionJob -> InputDataConfig
$sel:clientRequestToken:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:jobName:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
$sel:kmsKey:StartPHIDetectionJob' :: StartPHIDetectionJob -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"KMSKey" 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
kmsKey,
            (Text
"JobName" 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
jobName,
            (Text
"ClientRequestToken" 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
clientRequestToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"InputDataConfig" Text -> InputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputDataConfig
inputDataConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OutputDataConfig" Text -> OutputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputDataConfig
outputDataConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DataAccessRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataAccessRoleArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LanguageCode" Text -> LanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LanguageCode
languageCode)
          ]
      )

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

instance Core.ToQuery StartPHIDetectionJob where
  toQuery :: StartPHIDetectionJob -> QueryString
toQuery = QueryString -> StartPHIDetectionJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(StartPHIDetectionJobResponse
 -> StartPHIDetectionJobResponse -> Bool)
-> (StartPHIDetectionJobResponse
    -> StartPHIDetectionJobResponse -> Bool)
-> Eq StartPHIDetectionJobResponse
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]
(Int -> ReadS StartPHIDetectionJobResponse)
-> ReadS [StartPHIDetectionJobResponse]
-> ReadPrec StartPHIDetectionJobResponse
-> ReadPrec [StartPHIDetectionJobResponse]
-> Read 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
(Int -> StartPHIDetectionJobResponse -> ShowS)
-> (StartPHIDetectionJobResponse -> String)
-> ([StartPHIDetectionJobResponse] -> ShowS)
-> Show StartPHIDetectionJobResponse
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.
 StartPHIDetectionJobResponse -> Rep StartPHIDetectionJobResponse x)
-> (forall x.
    Rep StartPHIDetectionJobResponse x -> StartPHIDetectionJobResponse)
-> Generic StartPHIDetectionJobResponse
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' :: Maybe Text -> Int -> StartPHIDetectionJobResponse
StartPHIDetectionJobResponse'
    { $sel:jobId:StartPHIDetectionJobResponse' :: Maybe Text
jobId =
        Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> StartPHIDetectionJobResponse -> f StartPHIDetectionJobResponse
startPHIDetectionJobResponse_jobId = (StartPHIDetectionJobResponse -> Maybe Text)
-> (StartPHIDetectionJobResponse
    -> Maybe Text -> StartPHIDetectionJobResponse)
-> Lens
     StartPHIDetectionJobResponse
     StartPHIDetectionJobResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Int -> f Int)
-> StartPHIDetectionJobResponse -> f StartPHIDetectionJobResponse
startPHIDetectionJobResponse_httpStatus = (StartPHIDetectionJobResponse -> Int)
-> (StartPHIDetectionJobResponse
    -> Int -> StartPHIDetectionJobResponse)
-> Lens
     StartPHIDetectionJobResponse StartPHIDetectionJobResponse Int Int
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