{-# 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.Textract.GetLendingAnalysis
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the results for an Amazon Textract asynchronous operation that
-- analyzes text in a lending document.
--
-- You start asynchronous text analysis by calling @StartLendingAnalysis@,
-- which returns a job identifier (@JobId@). When the text analysis
-- operation finishes, Amazon Textract publishes a completion status to the
-- Amazon Simple Notification Service (Amazon SNS) topic that\'s registered
-- in the initial call to @StartLendingAnalysis@.
--
-- To get the results of the text analysis operation, first check that the
-- status value published to the Amazon SNS topic is SUCCEEDED. If so, call
-- GetLendingAnalysis, and pass the job identifier (@JobId@) from the
-- initial call to @StartLendingAnalysis@.
module Amazonka.Textract.GetLendingAnalysis
  ( -- * Creating a Request
    GetLendingAnalysis (..),
    newGetLendingAnalysis,

    -- * Request Lenses
    getLendingAnalysis_maxResults,
    getLendingAnalysis_nextToken,
    getLendingAnalysis_jobId,

    -- * Destructuring the Response
    GetLendingAnalysisResponse (..),
    newGetLendingAnalysisResponse,

    -- * Response Lenses
    getLendingAnalysisResponse_analyzeLendingModelVersion,
    getLendingAnalysisResponse_documentMetadata,
    getLendingAnalysisResponse_jobStatus,
    getLendingAnalysisResponse_nextToken,
    getLendingAnalysisResponse_results,
    getLendingAnalysisResponse_statusMessage,
    getLendingAnalysisResponse_warnings,
    getLendingAnalysisResponse_httpStatus,
  )
where

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
import Amazonka.Textract.Types

-- | /See:/ 'newGetLendingAnalysis' smart constructor.
data GetLendingAnalysis = GetLendingAnalysis'
  { -- | The maximum number of results to return per paginated call. The largest
    -- value that you can specify is 30. If you specify a value greater than
    -- 30, a maximum of 30 results is returned. The default value is 30.
    GetLendingAnalysis -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous response was incomplete, Amazon Textract returns a
    -- pagination token in the response. You can use this pagination token to
    -- retrieve the next set of lending results.
    GetLendingAnalysis -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the lending or text-detection job. The @JobId@
    -- is returned from @StartLendingAnalysis@. A @JobId@ value is only valid
    -- for 7 days.
    GetLendingAnalysis -> Text
jobId :: Prelude.Text
  }
  deriving (GetLendingAnalysis -> GetLendingAnalysis -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLendingAnalysis -> GetLendingAnalysis -> Bool
$c/= :: GetLendingAnalysis -> GetLendingAnalysis -> Bool
== :: GetLendingAnalysis -> GetLendingAnalysis -> Bool
$c== :: GetLendingAnalysis -> GetLendingAnalysis -> Bool
Prelude.Eq, ReadPrec [GetLendingAnalysis]
ReadPrec GetLendingAnalysis
Int -> ReadS GetLendingAnalysis
ReadS [GetLendingAnalysis]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLendingAnalysis]
$creadListPrec :: ReadPrec [GetLendingAnalysis]
readPrec :: ReadPrec GetLendingAnalysis
$creadPrec :: ReadPrec GetLendingAnalysis
readList :: ReadS [GetLendingAnalysis]
$creadList :: ReadS [GetLendingAnalysis]
readsPrec :: Int -> ReadS GetLendingAnalysis
$creadsPrec :: Int -> ReadS GetLendingAnalysis
Prelude.Read, Int -> GetLendingAnalysis -> ShowS
[GetLendingAnalysis] -> ShowS
GetLendingAnalysis -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLendingAnalysis] -> ShowS
$cshowList :: [GetLendingAnalysis] -> ShowS
show :: GetLendingAnalysis -> String
$cshow :: GetLendingAnalysis -> String
showsPrec :: Int -> GetLendingAnalysis -> ShowS
$cshowsPrec :: Int -> GetLendingAnalysis -> ShowS
Prelude.Show, forall x. Rep GetLendingAnalysis x -> GetLendingAnalysis
forall x. GetLendingAnalysis -> Rep GetLendingAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLendingAnalysis x -> GetLendingAnalysis
$cfrom :: forall x. GetLendingAnalysis -> Rep GetLendingAnalysis x
Prelude.Generic)

-- |
-- Create a value of 'GetLendingAnalysis' 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:
--
-- 'maxResults', 'getLendingAnalysis_maxResults' - The maximum number of results to return per paginated call. The largest
-- value that you can specify is 30. If you specify a value greater than
-- 30, a maximum of 30 results is returned. The default value is 30.
--
-- 'nextToken', 'getLendingAnalysis_nextToken' - If the previous response was incomplete, Amazon Textract returns a
-- pagination token in the response. You can use this pagination token to
-- retrieve the next set of lending results.
--
-- 'jobId', 'getLendingAnalysis_jobId' - A unique identifier for the lending or text-detection job. The @JobId@
-- is returned from @StartLendingAnalysis@. A @JobId@ value is only valid
-- for 7 days.
newGetLendingAnalysis ::
  -- | 'jobId'
  Prelude.Text ->
  GetLendingAnalysis
newGetLendingAnalysis :: Text -> GetLendingAnalysis
newGetLendingAnalysis Text
pJobId_ =
  GetLendingAnalysis'
    { $sel:maxResults:GetLendingAnalysis' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetLendingAnalysis' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:GetLendingAnalysis' :: Text
jobId = Text
pJobId_
    }

-- | The maximum number of results to return per paginated call. The largest
-- value that you can specify is 30. If you specify a value greater than
-- 30, a maximum of 30 results is returned. The default value is 30.
getLendingAnalysis_maxResults :: Lens.Lens' GetLendingAnalysis (Prelude.Maybe Prelude.Natural)
getLendingAnalysis_maxResults :: Lens' GetLendingAnalysis (Maybe Natural)
getLendingAnalysis_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysis' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetLendingAnalysis
s@GetLendingAnalysis' {} Maybe Natural
a -> GetLendingAnalysis
s {$sel:maxResults:GetLendingAnalysis' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetLendingAnalysis)

-- | If the previous response was incomplete, Amazon Textract returns a
-- pagination token in the response. You can use this pagination token to
-- retrieve the next set of lending results.
getLendingAnalysis_nextToken :: Lens.Lens' GetLendingAnalysis (Prelude.Maybe Prelude.Text)
getLendingAnalysis_nextToken :: Lens' GetLendingAnalysis (Maybe Text)
getLendingAnalysis_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysis' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetLendingAnalysis
s@GetLendingAnalysis' {} Maybe Text
a -> GetLendingAnalysis
s {$sel:nextToken:GetLendingAnalysis' :: Maybe Text
nextToken = Maybe Text
a} :: GetLendingAnalysis)

-- | A unique identifier for the lending or text-detection job. The @JobId@
-- is returned from @StartLendingAnalysis@. A @JobId@ value is only valid
-- for 7 days.
getLendingAnalysis_jobId :: Lens.Lens' GetLendingAnalysis Prelude.Text
getLendingAnalysis_jobId :: Lens' GetLendingAnalysis Text
getLendingAnalysis_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysis' {Text
jobId :: Text
$sel:jobId:GetLendingAnalysis' :: GetLendingAnalysis -> Text
jobId} -> Text
jobId) (\s :: GetLendingAnalysis
s@GetLendingAnalysis' {} Text
a -> GetLendingAnalysis
s {$sel:jobId:GetLendingAnalysis' :: Text
jobId = Text
a} :: GetLendingAnalysis)

instance Core.AWSRequest GetLendingAnalysis where
  type
    AWSResponse GetLendingAnalysis =
      GetLendingAnalysisResponse
  request :: (Service -> Service)
-> GetLendingAnalysis -> Request GetLendingAnalysis
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 GetLendingAnalysis
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetLendingAnalysis)))
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
-> Maybe DocumentMetadata
-> Maybe JobStatus
-> Maybe Text
-> Maybe [LendingResult]
-> Maybe Text
-> Maybe [Warning]
-> Int
-> GetLendingAnalysisResponse
GetLendingAnalysisResponse'
            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
"AnalyzeLendingModelVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DocumentMetadata")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"JobStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Results" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StatusMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Warnings" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            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 GetLendingAnalysis where
  hashWithSalt :: Int -> GetLendingAnalysis -> Int
hashWithSalt Int
_salt GetLendingAnalysis' {Maybe Natural
Maybe Text
Text
jobId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetLendingAnalysis' :: GetLendingAnalysis -> Text
$sel:nextToken:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Text
$sel:maxResults:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId

instance Prelude.NFData GetLendingAnalysis where
  rnf :: GetLendingAnalysis -> ()
rnf GetLendingAnalysis' {Maybe Natural
Maybe Text
Text
jobId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetLendingAnalysis' :: GetLendingAnalysis -> Text
$sel:nextToken:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Text
$sel:maxResults:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId

instance Data.ToHeaders GetLendingAnalysis where
  toHeaders :: GetLendingAnalysis -> 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
"Textract.GetLendingAnalysis" ::
                          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 GetLendingAnalysis where
  toJSON :: GetLendingAnalysis -> Value
toJSON GetLendingAnalysis' {Maybe Natural
Maybe Text
Text
jobId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:jobId:GetLendingAnalysis' :: GetLendingAnalysis -> Text
$sel:nextToken:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Text
$sel:maxResults:GetLendingAnalysis' :: GetLendingAnalysis -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" 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 Natural
maxResults,
            (Key
"NextToken" 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
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"JobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)
          ]
      )

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

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

-- | /See:/ 'newGetLendingAnalysisResponse' smart constructor.
data GetLendingAnalysisResponse = GetLendingAnalysisResponse'
  { -- | The current model version of the Analyze Lending API.
    GetLendingAnalysisResponse -> Maybe Text
analyzeLendingModelVersion :: Prelude.Maybe Prelude.Text,
    GetLendingAnalysisResponse -> Maybe DocumentMetadata
documentMetadata :: Prelude.Maybe DocumentMetadata,
    -- | The current status of the lending analysis job.
    GetLendingAnalysisResponse -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
    -- | If the response is truncated, Amazon Textract returns this token. You
    -- can use this token in the subsequent request to retrieve the next set of
    -- lending results.
    GetLendingAnalysisResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Holds the information returned by one of AmazonTextract\'s document
    -- analysis operations for the pinstripe.
    GetLendingAnalysisResponse -> Maybe [LendingResult]
results :: Prelude.Maybe [LendingResult],
    -- | Returns if the lending analysis job could not be completed. Contains
    -- explanation for what error occurred.
    GetLendingAnalysisResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | A list of warnings that occurred during the lending analysis operation.
    GetLendingAnalysisResponse -> Maybe [Warning]
warnings :: Prelude.Maybe [Warning],
    -- | The response's http status code.
    GetLendingAnalysisResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetLendingAnalysisResponse -> GetLendingAnalysisResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLendingAnalysisResponse -> GetLendingAnalysisResponse -> Bool
$c/= :: GetLendingAnalysisResponse -> GetLendingAnalysisResponse -> Bool
== :: GetLendingAnalysisResponse -> GetLendingAnalysisResponse -> Bool
$c== :: GetLendingAnalysisResponse -> GetLendingAnalysisResponse -> Bool
Prelude.Eq, ReadPrec [GetLendingAnalysisResponse]
ReadPrec GetLendingAnalysisResponse
Int -> ReadS GetLendingAnalysisResponse
ReadS [GetLendingAnalysisResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLendingAnalysisResponse]
$creadListPrec :: ReadPrec [GetLendingAnalysisResponse]
readPrec :: ReadPrec GetLendingAnalysisResponse
$creadPrec :: ReadPrec GetLendingAnalysisResponse
readList :: ReadS [GetLendingAnalysisResponse]
$creadList :: ReadS [GetLendingAnalysisResponse]
readsPrec :: Int -> ReadS GetLendingAnalysisResponse
$creadsPrec :: Int -> ReadS GetLendingAnalysisResponse
Prelude.Read, Int -> GetLendingAnalysisResponse -> ShowS
[GetLendingAnalysisResponse] -> ShowS
GetLendingAnalysisResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLendingAnalysisResponse] -> ShowS
$cshowList :: [GetLendingAnalysisResponse] -> ShowS
show :: GetLendingAnalysisResponse -> String
$cshow :: GetLendingAnalysisResponse -> String
showsPrec :: Int -> GetLendingAnalysisResponse -> ShowS
$cshowsPrec :: Int -> GetLendingAnalysisResponse -> ShowS
Prelude.Show, forall x.
Rep GetLendingAnalysisResponse x -> GetLendingAnalysisResponse
forall x.
GetLendingAnalysisResponse -> Rep GetLendingAnalysisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLendingAnalysisResponse x -> GetLendingAnalysisResponse
$cfrom :: forall x.
GetLendingAnalysisResponse -> Rep GetLendingAnalysisResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetLendingAnalysisResponse' 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:
--
-- 'analyzeLendingModelVersion', 'getLendingAnalysisResponse_analyzeLendingModelVersion' - The current model version of the Analyze Lending API.
--
-- 'documentMetadata', 'getLendingAnalysisResponse_documentMetadata' - Undocumented member.
--
-- 'jobStatus', 'getLendingAnalysisResponse_jobStatus' - The current status of the lending analysis job.
--
-- 'nextToken', 'getLendingAnalysisResponse_nextToken' - If the response is truncated, Amazon Textract returns this token. You
-- can use this token in the subsequent request to retrieve the next set of
-- lending results.
--
-- 'results', 'getLendingAnalysisResponse_results' - Holds the information returned by one of AmazonTextract\'s document
-- analysis operations for the pinstripe.
--
-- 'statusMessage', 'getLendingAnalysisResponse_statusMessage' - Returns if the lending analysis job could not be completed. Contains
-- explanation for what error occurred.
--
-- 'warnings', 'getLendingAnalysisResponse_warnings' - A list of warnings that occurred during the lending analysis operation.
--
-- 'httpStatus', 'getLendingAnalysisResponse_httpStatus' - The response's http status code.
newGetLendingAnalysisResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetLendingAnalysisResponse
newGetLendingAnalysisResponse :: Int -> GetLendingAnalysisResponse
newGetLendingAnalysisResponse Int
pHttpStatus_ =
  GetLendingAnalysisResponse'
    { $sel:analyzeLendingModelVersion:GetLendingAnalysisResponse' :: Maybe Text
analyzeLendingModelVersion =
        forall a. Maybe a
Prelude.Nothing,
      $sel:documentMetadata:GetLendingAnalysisResponse' :: Maybe DocumentMetadata
documentMetadata = forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:GetLendingAnalysisResponse' :: Maybe JobStatus
jobStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetLendingAnalysisResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:results:GetLendingAnalysisResponse' :: Maybe [LendingResult]
results = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:GetLendingAnalysisResponse' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:GetLendingAnalysisResponse' :: Maybe [Warning]
warnings = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetLendingAnalysisResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The current model version of the Analyze Lending API.
getLendingAnalysisResponse_analyzeLendingModelVersion :: Lens.Lens' GetLendingAnalysisResponse (Prelude.Maybe Prelude.Text)
getLendingAnalysisResponse_analyzeLendingModelVersion :: Lens' GetLendingAnalysisResponse (Maybe Text)
getLendingAnalysisResponse_analyzeLendingModelVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisResponse' {Maybe Text
analyzeLendingModelVersion :: Maybe Text
$sel:analyzeLendingModelVersion:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe Text
analyzeLendingModelVersion} -> Maybe Text
analyzeLendingModelVersion) (\s :: GetLendingAnalysisResponse
s@GetLendingAnalysisResponse' {} Maybe Text
a -> GetLendingAnalysisResponse
s {$sel:analyzeLendingModelVersion:GetLendingAnalysisResponse' :: Maybe Text
analyzeLendingModelVersion = Maybe Text
a} :: GetLendingAnalysisResponse)

-- | Undocumented member.
getLendingAnalysisResponse_documentMetadata :: Lens.Lens' GetLendingAnalysisResponse (Prelude.Maybe DocumentMetadata)
getLendingAnalysisResponse_documentMetadata :: Lens' GetLendingAnalysisResponse (Maybe DocumentMetadata)
getLendingAnalysisResponse_documentMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisResponse' {Maybe DocumentMetadata
documentMetadata :: Maybe DocumentMetadata
$sel:documentMetadata:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe DocumentMetadata
documentMetadata} -> Maybe DocumentMetadata
documentMetadata) (\s :: GetLendingAnalysisResponse
s@GetLendingAnalysisResponse' {} Maybe DocumentMetadata
a -> GetLendingAnalysisResponse
s {$sel:documentMetadata:GetLendingAnalysisResponse' :: Maybe DocumentMetadata
documentMetadata = Maybe DocumentMetadata
a} :: GetLendingAnalysisResponse)

-- | The current status of the lending analysis job.
getLendingAnalysisResponse_jobStatus :: Lens.Lens' GetLendingAnalysisResponse (Prelude.Maybe JobStatus)
getLendingAnalysisResponse_jobStatus :: Lens' GetLendingAnalysisResponse (Maybe JobStatus)
getLendingAnalysisResponse_jobStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisResponse' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: GetLendingAnalysisResponse
s@GetLendingAnalysisResponse' {} Maybe JobStatus
a -> GetLendingAnalysisResponse
s {$sel:jobStatus:GetLendingAnalysisResponse' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: GetLendingAnalysisResponse)

-- | If the response is truncated, Amazon Textract returns this token. You
-- can use this token in the subsequent request to retrieve the next set of
-- lending results.
getLendingAnalysisResponse_nextToken :: Lens.Lens' GetLendingAnalysisResponse (Prelude.Maybe Prelude.Text)
getLendingAnalysisResponse_nextToken :: Lens' GetLendingAnalysisResponse (Maybe Text)
getLendingAnalysisResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetLendingAnalysisResponse
s@GetLendingAnalysisResponse' {} Maybe Text
a -> GetLendingAnalysisResponse
s {$sel:nextToken:GetLendingAnalysisResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetLendingAnalysisResponse)

-- | Holds the information returned by one of AmazonTextract\'s document
-- analysis operations for the pinstripe.
getLendingAnalysisResponse_results :: Lens.Lens' GetLendingAnalysisResponse (Prelude.Maybe [LendingResult])
getLendingAnalysisResponse_results :: Lens' GetLendingAnalysisResponse (Maybe [LendingResult])
getLendingAnalysisResponse_results = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisResponse' {Maybe [LendingResult]
results :: Maybe [LendingResult]
$sel:results:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe [LendingResult]
results} -> Maybe [LendingResult]
results) (\s :: GetLendingAnalysisResponse
s@GetLendingAnalysisResponse' {} Maybe [LendingResult]
a -> GetLendingAnalysisResponse
s {$sel:results:GetLendingAnalysisResponse' :: Maybe [LendingResult]
results = Maybe [LendingResult]
a} :: GetLendingAnalysisResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Returns if the lending analysis job could not be completed. Contains
-- explanation for what error occurred.
getLendingAnalysisResponse_statusMessage :: Lens.Lens' GetLendingAnalysisResponse (Prelude.Maybe Prelude.Text)
getLendingAnalysisResponse_statusMessage :: Lens' GetLendingAnalysisResponse (Maybe Text)
getLendingAnalysisResponse_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisResponse' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: GetLendingAnalysisResponse
s@GetLendingAnalysisResponse' {} Maybe Text
a -> GetLendingAnalysisResponse
s {$sel:statusMessage:GetLendingAnalysisResponse' :: Maybe Text
statusMessage = Maybe Text
a} :: GetLendingAnalysisResponse)

-- | A list of warnings that occurred during the lending analysis operation.
getLendingAnalysisResponse_warnings :: Lens.Lens' GetLendingAnalysisResponse (Prelude.Maybe [Warning])
getLendingAnalysisResponse_warnings :: Lens' GetLendingAnalysisResponse (Maybe [Warning])
getLendingAnalysisResponse_warnings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisResponse' {Maybe [Warning]
warnings :: Maybe [Warning]
$sel:warnings:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe [Warning]
warnings} -> Maybe [Warning]
warnings) (\s :: GetLendingAnalysisResponse
s@GetLendingAnalysisResponse' {} Maybe [Warning]
a -> GetLendingAnalysisResponse
s {$sel:warnings:GetLendingAnalysisResponse' :: Maybe [Warning]
warnings = Maybe [Warning]
a} :: GetLendingAnalysisResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetLendingAnalysisResponse where
  rnf :: GetLendingAnalysisResponse -> ()
rnf GetLendingAnalysisResponse' {Int
Maybe [LendingResult]
Maybe [Warning]
Maybe Text
Maybe DocumentMetadata
Maybe JobStatus
httpStatus :: Int
warnings :: Maybe [Warning]
statusMessage :: Maybe Text
results :: Maybe [LendingResult]
nextToken :: Maybe Text
jobStatus :: Maybe JobStatus
documentMetadata :: Maybe DocumentMetadata
analyzeLendingModelVersion :: Maybe Text
$sel:httpStatus:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Int
$sel:warnings:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe [Warning]
$sel:statusMessage:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe Text
$sel:results:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe [LendingResult]
$sel:nextToken:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe Text
$sel:jobStatus:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe JobStatus
$sel:documentMetadata:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe DocumentMetadata
$sel:analyzeLendingModelVersion:GetLendingAnalysisResponse' :: GetLendingAnalysisResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
analyzeLendingModelVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DocumentMetadata
documentMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobStatus
jobStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [LendingResult]
results
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Warning]
warnings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus