{-# 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.GetLendingAnalysisSummary
-- 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 summarized results for the @StartLendingAnalysis@ operation, which
-- analyzes text in a lending document. The returned summary consists of
-- information about documents grouped together by a common document type.
-- Information like detected signatures, page numbers, and split documents
-- is returned with respect to the type of grouped 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
-- @GetLendingAnalysisSummary@, and pass the job identifier (@JobId@) from
-- the initial call to @StartLendingAnalysis@.
module Amazonka.Textract.GetLendingAnalysisSummary
  ( -- * Creating a Request
    GetLendingAnalysisSummary (..),
    newGetLendingAnalysisSummary,

    -- * Request Lenses
    getLendingAnalysisSummary_jobId,

    -- * Destructuring the Response
    GetLendingAnalysisSummaryResponse (..),
    newGetLendingAnalysisSummaryResponse,

    -- * Response Lenses
    getLendingAnalysisSummaryResponse_analyzeLendingModelVersion,
    getLendingAnalysisSummaryResponse_documentMetadata,
    getLendingAnalysisSummaryResponse_jobStatus,
    getLendingAnalysisSummaryResponse_statusMessage,
    getLendingAnalysisSummaryResponse_summary,
    getLendingAnalysisSummaryResponse_warnings,
    getLendingAnalysisSummaryResponse_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:/ 'newGetLendingAnalysisSummary' smart constructor.
data GetLendingAnalysisSummary = GetLendingAnalysisSummary'
  { -- | 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.
    GetLendingAnalysisSummary -> Text
jobId :: Prelude.Text
  }
  deriving (GetLendingAnalysisSummary -> GetLendingAnalysisSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLendingAnalysisSummary -> GetLendingAnalysisSummary -> Bool
$c/= :: GetLendingAnalysisSummary -> GetLendingAnalysisSummary -> Bool
== :: GetLendingAnalysisSummary -> GetLendingAnalysisSummary -> Bool
$c== :: GetLendingAnalysisSummary -> GetLendingAnalysisSummary -> Bool
Prelude.Eq, ReadPrec [GetLendingAnalysisSummary]
ReadPrec GetLendingAnalysisSummary
Int -> ReadS GetLendingAnalysisSummary
ReadS [GetLendingAnalysisSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLendingAnalysisSummary]
$creadListPrec :: ReadPrec [GetLendingAnalysisSummary]
readPrec :: ReadPrec GetLendingAnalysisSummary
$creadPrec :: ReadPrec GetLendingAnalysisSummary
readList :: ReadS [GetLendingAnalysisSummary]
$creadList :: ReadS [GetLendingAnalysisSummary]
readsPrec :: Int -> ReadS GetLendingAnalysisSummary
$creadsPrec :: Int -> ReadS GetLendingAnalysisSummary
Prelude.Read, Int -> GetLendingAnalysisSummary -> ShowS
[GetLendingAnalysisSummary] -> ShowS
GetLendingAnalysisSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLendingAnalysisSummary] -> ShowS
$cshowList :: [GetLendingAnalysisSummary] -> ShowS
show :: GetLendingAnalysisSummary -> String
$cshow :: GetLendingAnalysisSummary -> String
showsPrec :: Int -> GetLendingAnalysisSummary -> ShowS
$cshowsPrec :: Int -> GetLendingAnalysisSummary -> ShowS
Prelude.Show, forall x.
Rep GetLendingAnalysisSummary x -> GetLendingAnalysisSummary
forall x.
GetLendingAnalysisSummary -> Rep GetLendingAnalysisSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLendingAnalysisSummary x -> GetLendingAnalysisSummary
$cfrom :: forall x.
GetLendingAnalysisSummary -> Rep GetLendingAnalysisSummary x
Prelude.Generic)

-- |
-- Create a value of 'GetLendingAnalysisSummary' 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', 'getLendingAnalysisSummary_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.
newGetLendingAnalysisSummary ::
  -- | 'jobId'
  Prelude.Text ->
  GetLendingAnalysisSummary
newGetLendingAnalysisSummary :: Text -> GetLendingAnalysisSummary
newGetLendingAnalysisSummary Text
pJobId_ =
  GetLendingAnalysisSummary' {$sel:jobId:GetLendingAnalysisSummary' :: Text
jobId = Text
pJobId_}

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

instance Core.AWSRequest GetLendingAnalysisSummary where
  type
    AWSResponse GetLendingAnalysisSummary =
      GetLendingAnalysisSummaryResponse
  request :: (Service -> Service)
-> GetLendingAnalysisSummary -> Request GetLendingAnalysisSummary
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 GetLendingAnalysisSummary
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetLendingAnalysisSummary)))
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 LendingSummary
-> Maybe [Warning]
-> Int
-> GetLendingAnalysisSummaryResponse
GetLendingAnalysisSummaryResponse'
            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
"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
"Summary")
            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 GetLendingAnalysisSummary where
  hashWithSalt :: Int -> GetLendingAnalysisSummary -> Int
hashWithSalt Int
_salt GetLendingAnalysisSummary' {Text
jobId :: Text
$sel:jobId:GetLendingAnalysisSummary' :: GetLendingAnalysisSummary -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId

instance Prelude.NFData GetLendingAnalysisSummary where
  rnf :: GetLendingAnalysisSummary -> ()
rnf GetLendingAnalysisSummary' {Text
jobId :: Text
$sel:jobId:GetLendingAnalysisSummary' :: GetLendingAnalysisSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
jobId

instance Data.ToHeaders GetLendingAnalysisSummary where
  toHeaders :: GetLendingAnalysisSummary -> 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.GetLendingAnalysisSummary" ::
                          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 GetLendingAnalysisSummary where
  toJSON :: GetLendingAnalysisSummary -> Value
toJSON GetLendingAnalysisSummary' {Text
jobId :: Text
$sel:jobId:GetLendingAnalysisSummary' :: GetLendingAnalysisSummary -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [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 GetLendingAnalysisSummary where
  toPath :: GetLendingAnalysisSummary -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetLendingAnalysisSummaryResponse' smart constructor.
data GetLendingAnalysisSummaryResponse = GetLendingAnalysisSummaryResponse'
  { -- | The current model version of the Analyze Lending API.
    GetLendingAnalysisSummaryResponse -> Maybe Text
analyzeLendingModelVersion :: Prelude.Maybe Prelude.Text,
    GetLendingAnalysisSummaryResponse -> Maybe DocumentMetadata
documentMetadata :: Prelude.Maybe DocumentMetadata,
    -- | The current status of the lending analysis job.
    GetLendingAnalysisSummaryResponse -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
    -- | Returns if the lending analysis could not be completed. Contains
    -- explanation for what error occurred.
    GetLendingAnalysisSummaryResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | Contains summary information for documents grouped by type.
    GetLendingAnalysisSummaryResponse -> Maybe LendingSummary
summary :: Prelude.Maybe LendingSummary,
    -- | A list of warnings that occurred during the lending analysis operation.
    GetLendingAnalysisSummaryResponse -> Maybe [Warning]
warnings :: Prelude.Maybe [Warning],
    -- | The response's http status code.
    GetLendingAnalysisSummaryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetLendingAnalysisSummaryResponse
-> GetLendingAnalysisSummaryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLendingAnalysisSummaryResponse
-> GetLendingAnalysisSummaryResponse -> Bool
$c/= :: GetLendingAnalysisSummaryResponse
-> GetLendingAnalysisSummaryResponse -> Bool
== :: GetLendingAnalysisSummaryResponse
-> GetLendingAnalysisSummaryResponse -> Bool
$c== :: GetLendingAnalysisSummaryResponse
-> GetLendingAnalysisSummaryResponse -> Bool
Prelude.Eq, ReadPrec [GetLendingAnalysisSummaryResponse]
ReadPrec GetLendingAnalysisSummaryResponse
Int -> ReadS GetLendingAnalysisSummaryResponse
ReadS [GetLendingAnalysisSummaryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLendingAnalysisSummaryResponse]
$creadListPrec :: ReadPrec [GetLendingAnalysisSummaryResponse]
readPrec :: ReadPrec GetLendingAnalysisSummaryResponse
$creadPrec :: ReadPrec GetLendingAnalysisSummaryResponse
readList :: ReadS [GetLendingAnalysisSummaryResponse]
$creadList :: ReadS [GetLendingAnalysisSummaryResponse]
readsPrec :: Int -> ReadS GetLendingAnalysisSummaryResponse
$creadsPrec :: Int -> ReadS GetLendingAnalysisSummaryResponse
Prelude.Read, Int -> GetLendingAnalysisSummaryResponse -> ShowS
[GetLendingAnalysisSummaryResponse] -> ShowS
GetLendingAnalysisSummaryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLendingAnalysisSummaryResponse] -> ShowS
$cshowList :: [GetLendingAnalysisSummaryResponse] -> ShowS
show :: GetLendingAnalysisSummaryResponse -> String
$cshow :: GetLendingAnalysisSummaryResponse -> String
showsPrec :: Int -> GetLendingAnalysisSummaryResponse -> ShowS
$cshowsPrec :: Int -> GetLendingAnalysisSummaryResponse -> ShowS
Prelude.Show, forall x.
Rep GetLendingAnalysisSummaryResponse x
-> GetLendingAnalysisSummaryResponse
forall x.
GetLendingAnalysisSummaryResponse
-> Rep GetLendingAnalysisSummaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLendingAnalysisSummaryResponse x
-> GetLendingAnalysisSummaryResponse
$cfrom :: forall x.
GetLendingAnalysisSummaryResponse
-> Rep GetLendingAnalysisSummaryResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetLendingAnalysisSummaryResponse' 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', 'getLendingAnalysisSummaryResponse_analyzeLendingModelVersion' - The current model version of the Analyze Lending API.
--
-- 'documentMetadata', 'getLendingAnalysisSummaryResponse_documentMetadata' - Undocumented member.
--
-- 'jobStatus', 'getLendingAnalysisSummaryResponse_jobStatus' - The current status of the lending analysis job.
--
-- 'statusMessage', 'getLendingAnalysisSummaryResponse_statusMessage' - Returns if the lending analysis could not be completed. Contains
-- explanation for what error occurred.
--
-- 'summary', 'getLendingAnalysisSummaryResponse_summary' - Contains summary information for documents grouped by type.
--
-- 'warnings', 'getLendingAnalysisSummaryResponse_warnings' - A list of warnings that occurred during the lending analysis operation.
--
-- 'httpStatus', 'getLendingAnalysisSummaryResponse_httpStatus' - The response's http status code.
newGetLendingAnalysisSummaryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetLendingAnalysisSummaryResponse
newGetLendingAnalysisSummaryResponse :: Int -> GetLendingAnalysisSummaryResponse
newGetLendingAnalysisSummaryResponse Int
pHttpStatus_ =
  GetLendingAnalysisSummaryResponse'
    { $sel:analyzeLendingModelVersion:GetLendingAnalysisSummaryResponse' :: Maybe Text
analyzeLendingModelVersion =
        forall a. Maybe a
Prelude.Nothing,
      $sel:documentMetadata:GetLendingAnalysisSummaryResponse' :: Maybe DocumentMetadata
documentMetadata = forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:GetLendingAnalysisSummaryResponse' :: Maybe JobStatus
jobStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:GetLendingAnalysisSummaryResponse' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:summary:GetLendingAnalysisSummaryResponse' :: Maybe LendingSummary
summary = forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:GetLendingAnalysisSummaryResponse' :: Maybe [Warning]
warnings = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetLendingAnalysisSummaryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

-- | Contains summary information for documents grouped by type.
getLendingAnalysisSummaryResponse_summary :: Lens.Lens' GetLendingAnalysisSummaryResponse (Prelude.Maybe LendingSummary)
getLendingAnalysisSummaryResponse_summary :: Lens' GetLendingAnalysisSummaryResponse (Maybe LendingSummary)
getLendingAnalysisSummaryResponse_summary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisSummaryResponse' {Maybe LendingSummary
summary :: Maybe LendingSummary
$sel:summary:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Maybe LendingSummary
summary} -> Maybe LendingSummary
summary) (\s :: GetLendingAnalysisSummaryResponse
s@GetLendingAnalysisSummaryResponse' {} Maybe LendingSummary
a -> GetLendingAnalysisSummaryResponse
s {$sel:summary:GetLendingAnalysisSummaryResponse' :: Maybe LendingSummary
summary = Maybe LendingSummary
a} :: GetLendingAnalysisSummaryResponse)

-- | A list of warnings that occurred during the lending analysis operation.
getLendingAnalysisSummaryResponse_warnings :: Lens.Lens' GetLendingAnalysisSummaryResponse (Prelude.Maybe [Warning])
getLendingAnalysisSummaryResponse_warnings :: Lens' GetLendingAnalysisSummaryResponse (Maybe [Warning])
getLendingAnalysisSummaryResponse_warnings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisSummaryResponse' {Maybe [Warning]
warnings :: Maybe [Warning]
$sel:warnings:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Maybe [Warning]
warnings} -> Maybe [Warning]
warnings) (\s :: GetLendingAnalysisSummaryResponse
s@GetLendingAnalysisSummaryResponse' {} Maybe [Warning]
a -> GetLendingAnalysisSummaryResponse
s {$sel:warnings:GetLendingAnalysisSummaryResponse' :: Maybe [Warning]
warnings = Maybe [Warning]
a} :: GetLendingAnalysisSummaryResponse) 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.
getLendingAnalysisSummaryResponse_httpStatus :: Lens.Lens' GetLendingAnalysisSummaryResponse Prelude.Int
getLendingAnalysisSummaryResponse_httpStatus :: Lens' GetLendingAnalysisSummaryResponse Int
getLendingAnalysisSummaryResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLendingAnalysisSummaryResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetLendingAnalysisSummaryResponse
s@GetLendingAnalysisSummaryResponse' {} Int
a -> GetLendingAnalysisSummaryResponse
s {$sel:httpStatus:GetLendingAnalysisSummaryResponse' :: Int
httpStatus = Int
a} :: GetLendingAnalysisSummaryResponse)

instance
  Prelude.NFData
    GetLendingAnalysisSummaryResponse
  where
  rnf :: GetLendingAnalysisSummaryResponse -> ()
rnf GetLendingAnalysisSummaryResponse' {Int
Maybe [Warning]
Maybe Text
Maybe DocumentMetadata
Maybe JobStatus
Maybe LendingSummary
httpStatus :: Int
warnings :: Maybe [Warning]
summary :: Maybe LendingSummary
statusMessage :: Maybe Text
jobStatus :: Maybe JobStatus
documentMetadata :: Maybe DocumentMetadata
analyzeLendingModelVersion :: Maybe Text
$sel:httpStatus:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Int
$sel:warnings:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Maybe [Warning]
$sel:summary:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Maybe LendingSummary
$sel:statusMessage:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Maybe Text
$sel:jobStatus:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Maybe JobStatus
$sel:documentMetadata:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> Maybe DocumentMetadata
$sel:analyzeLendingModelVersion:GetLendingAnalysisSummaryResponse' :: GetLendingAnalysisSummaryResponse -> 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
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LendingSummary
summary
      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