{-# 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.StartRxNormInferenceJob
-- 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 medication entities and link them
-- to the RxNorm ontology. Use the @DescribeRxNormInferenceJob@ operation
-- to track the status of a job.
module Amazonka.ComprehendMedical.StartRxNormInferenceJob
  ( -- * Creating a Request
    StartRxNormInferenceJob (..),
    newStartRxNormInferenceJob,

    -- * Request Lenses
    startRxNormInferenceJob_kmsKey,
    startRxNormInferenceJob_jobName,
    startRxNormInferenceJob_clientRequestToken,
    startRxNormInferenceJob_inputDataConfig,
    startRxNormInferenceJob_outputDataConfig,
    startRxNormInferenceJob_dataAccessRoleArn,
    startRxNormInferenceJob_languageCode,

    -- * Destructuring the Response
    StartRxNormInferenceJobResponse (..),
    newStartRxNormInferenceJobResponse,

    -- * Response Lenses
    startRxNormInferenceJobResponse_jobId,
    startRxNormInferenceJobResponse_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:/ 'newStartRxNormInferenceJob' smart constructor.
data StartRxNormInferenceJob = StartRxNormInferenceJob'
  { -- | 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.
    StartRxNormInferenceJob -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the job.
    StartRxNormInferenceJob -> 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.
    StartRxNormInferenceJob -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the format and location of the input data for the job.
    StartRxNormInferenceJob -> InputDataConfig
inputDataConfig :: InputDataConfig,
    -- | Specifies where to send the output files.
    StartRxNormInferenceJob -> 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>.
    StartRxNormInferenceJob -> Text
dataAccessRoleArn :: Prelude.Text,
    -- | The language of the input documents. All documents must be in the same
    -- language.
    StartRxNormInferenceJob -> LanguageCode
languageCode :: LanguageCode
  }
  deriving (StartRxNormInferenceJob -> StartRxNormInferenceJob -> Bool
(StartRxNormInferenceJob -> StartRxNormInferenceJob -> Bool)
-> (StartRxNormInferenceJob -> StartRxNormInferenceJob -> Bool)
-> Eq StartRxNormInferenceJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartRxNormInferenceJob -> StartRxNormInferenceJob -> Bool
$c/= :: StartRxNormInferenceJob -> StartRxNormInferenceJob -> Bool
== :: StartRxNormInferenceJob -> StartRxNormInferenceJob -> Bool
$c== :: StartRxNormInferenceJob -> StartRxNormInferenceJob -> Bool
Prelude.Eq, ReadPrec [StartRxNormInferenceJob]
ReadPrec StartRxNormInferenceJob
Int -> ReadS StartRxNormInferenceJob
ReadS [StartRxNormInferenceJob]
(Int -> ReadS StartRxNormInferenceJob)
-> ReadS [StartRxNormInferenceJob]
-> ReadPrec StartRxNormInferenceJob
-> ReadPrec [StartRxNormInferenceJob]
-> Read StartRxNormInferenceJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartRxNormInferenceJob]
$creadListPrec :: ReadPrec [StartRxNormInferenceJob]
readPrec :: ReadPrec StartRxNormInferenceJob
$creadPrec :: ReadPrec StartRxNormInferenceJob
readList :: ReadS [StartRxNormInferenceJob]
$creadList :: ReadS [StartRxNormInferenceJob]
readsPrec :: Int -> ReadS StartRxNormInferenceJob
$creadsPrec :: Int -> ReadS StartRxNormInferenceJob
Prelude.Read, Int -> StartRxNormInferenceJob -> ShowS
[StartRxNormInferenceJob] -> ShowS
StartRxNormInferenceJob -> String
(Int -> StartRxNormInferenceJob -> ShowS)
-> (StartRxNormInferenceJob -> String)
-> ([StartRxNormInferenceJob] -> ShowS)
-> Show StartRxNormInferenceJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartRxNormInferenceJob] -> ShowS
$cshowList :: [StartRxNormInferenceJob] -> ShowS
show :: StartRxNormInferenceJob -> String
$cshow :: StartRxNormInferenceJob -> String
showsPrec :: Int -> StartRxNormInferenceJob -> ShowS
$cshowsPrec :: Int -> StartRxNormInferenceJob -> ShowS
Prelude.Show, (forall x.
 StartRxNormInferenceJob -> Rep StartRxNormInferenceJob x)
-> (forall x.
    Rep StartRxNormInferenceJob x -> StartRxNormInferenceJob)
-> Generic StartRxNormInferenceJob
forall x. Rep StartRxNormInferenceJob x -> StartRxNormInferenceJob
forall x. StartRxNormInferenceJob -> Rep StartRxNormInferenceJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartRxNormInferenceJob x -> StartRxNormInferenceJob
$cfrom :: forall x. StartRxNormInferenceJob -> Rep StartRxNormInferenceJob x
Prelude.Generic)

-- |
-- Create a value of 'StartRxNormInferenceJob' 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', 'startRxNormInferenceJob_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', 'startRxNormInferenceJob_jobName' - The identifier of the job.
--
-- 'clientRequestToken', 'startRxNormInferenceJob_clientRequestToken' - A unique identifier for the request. If you don\'t set the client
-- request token, Amazon Comprehend Medical generates one.
--
-- 'inputDataConfig', 'startRxNormInferenceJob_inputDataConfig' - Specifies the format and location of the input data for the job.
--
-- 'outputDataConfig', 'startRxNormInferenceJob_outputDataConfig' - Specifies where to send the output files.
--
-- 'dataAccessRoleArn', 'startRxNormInferenceJob_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', 'startRxNormInferenceJob_languageCode' - The language of the input documents. All documents must be in the same
-- language.
newStartRxNormInferenceJob ::
  -- | 'inputDataConfig'
  InputDataConfig ->
  -- | 'outputDataConfig'
  OutputDataConfig ->
  -- | 'dataAccessRoleArn'
  Prelude.Text ->
  -- | 'languageCode'
  LanguageCode ->
  StartRxNormInferenceJob
newStartRxNormInferenceJob :: InputDataConfig
-> OutputDataConfig
-> Text
-> LanguageCode
-> StartRxNormInferenceJob
newStartRxNormInferenceJob
  InputDataConfig
pInputDataConfig_
  OutputDataConfig
pOutputDataConfig_
  Text
pDataAccessRoleArn_
  LanguageCode
pLanguageCode_ =
    StartRxNormInferenceJob' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> InputDataConfig
-> OutputDataConfig
-> Text
-> LanguageCode
-> StartRxNormInferenceJob
StartRxNormInferenceJob'
      { $sel:kmsKey:StartRxNormInferenceJob' :: Maybe Text
kmsKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:jobName:StartRxNormInferenceJob' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:StartRxNormInferenceJob' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:inputDataConfig:StartRxNormInferenceJob' :: InputDataConfig
inputDataConfig = InputDataConfig
pInputDataConfig_,
        $sel:outputDataConfig:StartRxNormInferenceJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
pOutputDataConfig_,
        $sel:dataAccessRoleArn:StartRxNormInferenceJob' :: Text
dataAccessRoleArn = Text
pDataAccessRoleArn_,
        $sel:languageCode:StartRxNormInferenceJob' :: 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.
startRxNormInferenceJob_kmsKey :: Lens.Lens' StartRxNormInferenceJob (Prelude.Maybe Prelude.Text)
startRxNormInferenceJob_kmsKey :: (Maybe Text -> f (Maybe Text))
-> StartRxNormInferenceJob -> f StartRxNormInferenceJob
startRxNormInferenceJob_kmsKey = (StartRxNormInferenceJob -> Maybe Text)
-> (StartRxNormInferenceJob
    -> Maybe Text -> StartRxNormInferenceJob)
-> Lens
     StartRxNormInferenceJob
     StartRxNormInferenceJob
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRxNormInferenceJob' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: StartRxNormInferenceJob
s@StartRxNormInferenceJob' {} Maybe Text
a -> StartRxNormInferenceJob
s {$sel:kmsKey:StartRxNormInferenceJob' :: Maybe Text
kmsKey = Maybe Text
a} :: StartRxNormInferenceJob)

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

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

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

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

-- | 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>.
startRxNormInferenceJob_dataAccessRoleArn :: Lens.Lens' StartRxNormInferenceJob Prelude.Text
startRxNormInferenceJob_dataAccessRoleArn :: (Text -> f Text)
-> StartRxNormInferenceJob -> f StartRxNormInferenceJob
startRxNormInferenceJob_dataAccessRoleArn = (StartRxNormInferenceJob -> Text)
-> (StartRxNormInferenceJob -> Text -> StartRxNormInferenceJob)
-> Lens StartRxNormInferenceJob StartRxNormInferenceJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartRxNormInferenceJob' {Text
dataAccessRoleArn :: Text
$sel:dataAccessRoleArn:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> Text
dataAccessRoleArn} -> Text
dataAccessRoleArn) (\s :: StartRxNormInferenceJob
s@StartRxNormInferenceJob' {} Text
a -> StartRxNormInferenceJob
s {$sel:dataAccessRoleArn:StartRxNormInferenceJob' :: Text
dataAccessRoleArn = Text
a} :: StartRxNormInferenceJob)

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

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

instance Prelude.NFData StartRxNormInferenceJob

instance Core.ToHeaders StartRxNormInferenceJob where
  toHeaders :: StartRxNormInferenceJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartRxNormInferenceJob -> 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.StartRxNormInferenceJob" ::
                          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 StartRxNormInferenceJob where
  toJSON :: StartRxNormInferenceJob -> Value
toJSON StartRxNormInferenceJob' {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:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> LanguageCode
$sel:dataAccessRoleArn:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> Text
$sel:outputDataConfig:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> OutputDataConfig
$sel:inputDataConfig:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> InputDataConfig
$sel:clientRequestToken:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> Maybe Text
$sel:jobName:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> Maybe Text
$sel:kmsKey:StartRxNormInferenceJob' :: StartRxNormInferenceJob -> 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 StartRxNormInferenceJob where
  toPath :: StartRxNormInferenceJob -> ByteString
toPath = ByteString -> StartRxNormInferenceJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'StartRxNormInferenceJobResponse' 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', 'startRxNormInferenceJobResponse_jobId' - The identifier of the job.
--
-- 'httpStatus', 'startRxNormInferenceJobResponse_httpStatus' - The response's http status code.
newStartRxNormInferenceJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartRxNormInferenceJobResponse
newStartRxNormInferenceJobResponse :: Int -> StartRxNormInferenceJobResponse
newStartRxNormInferenceJobResponse Int
pHttpStatus_ =
  StartRxNormInferenceJobResponse' :: Maybe Text -> Int -> StartRxNormInferenceJobResponse
StartRxNormInferenceJobResponse'
    { $sel:jobId:StartRxNormInferenceJobResponse' :: Maybe Text
jobId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartRxNormInferenceJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance
  Prelude.NFData
    StartRxNormInferenceJobResponse