{-# 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.StartICD10CMInferenceJob
-- 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 medical conditions and link them to
-- the ICD-10-CM ontology. Use the @DescribeICD10CMInferenceJob@ operation
-- to track the status of a job.
module Amazonka.ComprehendMedical.StartICD10CMInferenceJob
  ( -- * Creating a Request
    StartICD10CMInferenceJob (..),
    newStartICD10CMInferenceJob,

    -- * Request Lenses
    startICD10CMInferenceJob_kmsKey,
    startICD10CMInferenceJob_jobName,
    startICD10CMInferenceJob_clientRequestToken,
    startICD10CMInferenceJob_inputDataConfig,
    startICD10CMInferenceJob_outputDataConfig,
    startICD10CMInferenceJob_dataAccessRoleArn,
    startICD10CMInferenceJob_languageCode,

    -- * Destructuring the Response
    StartICD10CMInferenceJobResponse (..),
    newStartICD10CMInferenceJobResponse,

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

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

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

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

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

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

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

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

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

instance Prelude.NFData StartICD10CMInferenceJob

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

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

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

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

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

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

instance
  Prelude.NFData
    StartICD10CMInferenceJobResponse