{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Textract.Types.LendingDocument 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 Amazonka.Textract.Types.LendingField
import Amazonka.Textract.Types.SignatureDetection
data LendingDocument = LendingDocument'
{
LendingDocument -> Maybe [LendingField]
lendingFields :: Prelude.Maybe [LendingField],
LendingDocument -> Maybe [SignatureDetection]
signatureDetections :: Prelude.Maybe [SignatureDetection]
}
deriving (LendingDocument -> LendingDocument -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LendingDocument -> LendingDocument -> Bool
$c/= :: LendingDocument -> LendingDocument -> Bool
== :: LendingDocument -> LendingDocument -> Bool
$c== :: LendingDocument -> LendingDocument -> Bool
Prelude.Eq, ReadPrec [LendingDocument]
ReadPrec LendingDocument
Int -> ReadS LendingDocument
ReadS [LendingDocument]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LendingDocument]
$creadListPrec :: ReadPrec [LendingDocument]
readPrec :: ReadPrec LendingDocument
$creadPrec :: ReadPrec LendingDocument
readList :: ReadS [LendingDocument]
$creadList :: ReadS [LendingDocument]
readsPrec :: Int -> ReadS LendingDocument
$creadsPrec :: Int -> ReadS LendingDocument
Prelude.Read, Int -> LendingDocument -> ShowS
[LendingDocument] -> ShowS
LendingDocument -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LendingDocument] -> ShowS
$cshowList :: [LendingDocument] -> ShowS
show :: LendingDocument -> String
$cshow :: LendingDocument -> String
showsPrec :: Int -> LendingDocument -> ShowS
$cshowsPrec :: Int -> LendingDocument -> ShowS
Prelude.Show, forall x. Rep LendingDocument x -> LendingDocument
forall x. LendingDocument -> Rep LendingDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LendingDocument x -> LendingDocument
$cfrom :: forall x. LendingDocument -> Rep LendingDocument x
Prelude.Generic)
newLendingDocument ::
LendingDocument
newLendingDocument :: LendingDocument
newLendingDocument =
LendingDocument'
{ $sel:lendingFields:LendingDocument' :: Maybe [LendingField]
lendingFields = forall a. Maybe a
Prelude.Nothing,
$sel:signatureDetections:LendingDocument' :: Maybe [SignatureDetection]
signatureDetections = forall a. Maybe a
Prelude.Nothing
}
lendingDocument_lendingFields :: Lens.Lens' LendingDocument (Prelude.Maybe [LendingField])
lendingDocument_lendingFields :: Lens' LendingDocument (Maybe [LendingField])
lendingDocument_lendingFields = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LendingDocument' {Maybe [LendingField]
lendingFields :: Maybe [LendingField]
$sel:lendingFields:LendingDocument' :: LendingDocument -> Maybe [LendingField]
lendingFields} -> Maybe [LendingField]
lendingFields) (\s :: LendingDocument
s@LendingDocument' {} Maybe [LendingField]
a -> LendingDocument
s {$sel:lendingFields:LendingDocument' :: Maybe [LendingField]
lendingFields = Maybe [LendingField]
a} :: LendingDocument) 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
lendingDocument_signatureDetections :: Lens.Lens' LendingDocument (Prelude.Maybe [SignatureDetection])
lendingDocument_signatureDetections :: Lens' LendingDocument (Maybe [SignatureDetection])
lendingDocument_signatureDetections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LendingDocument' {Maybe [SignatureDetection]
signatureDetections :: Maybe [SignatureDetection]
$sel:signatureDetections:LendingDocument' :: LendingDocument -> Maybe [SignatureDetection]
signatureDetections} -> Maybe [SignatureDetection]
signatureDetections) (\s :: LendingDocument
s@LendingDocument' {} Maybe [SignatureDetection]
a -> LendingDocument
s {$sel:signatureDetections:LendingDocument' :: Maybe [SignatureDetection]
signatureDetections = Maybe [SignatureDetection]
a} :: LendingDocument) 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
instance Data.FromJSON LendingDocument where
parseJSON :: Value -> Parser LendingDocument
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LendingDocument"
( \Object
x ->
Maybe [LendingField]
-> Maybe [SignatureDetection] -> LendingDocument
LendingDocument'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LendingFields" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"SignatureDetections"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable LendingDocument where
hashWithSalt :: Int -> LendingDocument -> Int
hashWithSalt Int
_salt LendingDocument' {Maybe [LendingField]
Maybe [SignatureDetection]
signatureDetections :: Maybe [SignatureDetection]
lendingFields :: Maybe [LendingField]
$sel:signatureDetections:LendingDocument' :: LendingDocument -> Maybe [SignatureDetection]
$sel:lendingFields:LendingDocument' :: LendingDocument -> Maybe [LendingField]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [LendingField]
lendingFields
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SignatureDetection]
signatureDetections
instance Prelude.NFData LendingDocument where
rnf :: LendingDocument -> ()
rnf LendingDocument' {Maybe [LendingField]
Maybe [SignatureDetection]
signatureDetections :: Maybe [SignatureDetection]
lendingFields :: Maybe [LendingField]
$sel:signatureDetections:LendingDocument' :: LendingDocument -> Maybe [SignatureDetection]
$sel:lendingFields:LendingDocument' :: LendingDocument -> Maybe [LendingField]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [LendingField]
lendingFields
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SignatureDetection]
signatureDetections