{-# 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.ExpenseField where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Textract.Types.ExpenseDetection
import Amazonka.Textract.Types.ExpenseType
data ExpenseField = ExpenseField'
{
ExpenseField -> Maybe ExpenseDetection
labelDetection :: Prelude.Maybe ExpenseDetection,
ExpenseField -> Maybe ExpenseDetection
valueDetection :: Prelude.Maybe ExpenseDetection,
ExpenseField -> Maybe ExpenseType
type' :: Prelude.Maybe ExpenseType,
ExpenseField -> Maybe Natural
pageNumber :: Prelude.Maybe Prelude.Natural
}
deriving (ExpenseField -> ExpenseField -> Bool
(ExpenseField -> ExpenseField -> Bool)
-> (ExpenseField -> ExpenseField -> Bool) -> Eq ExpenseField
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExpenseField -> ExpenseField -> Bool
$c/= :: ExpenseField -> ExpenseField -> Bool
== :: ExpenseField -> ExpenseField -> Bool
$c== :: ExpenseField -> ExpenseField -> Bool
Prelude.Eq, ReadPrec [ExpenseField]
ReadPrec ExpenseField
Int -> ReadS ExpenseField
ReadS [ExpenseField]
(Int -> ReadS ExpenseField)
-> ReadS [ExpenseField]
-> ReadPrec ExpenseField
-> ReadPrec [ExpenseField]
-> Read ExpenseField
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExpenseField]
$creadListPrec :: ReadPrec [ExpenseField]
readPrec :: ReadPrec ExpenseField
$creadPrec :: ReadPrec ExpenseField
readList :: ReadS [ExpenseField]
$creadList :: ReadS [ExpenseField]
readsPrec :: Int -> ReadS ExpenseField
$creadsPrec :: Int -> ReadS ExpenseField
Prelude.Read, Int -> ExpenseField -> ShowS
[ExpenseField] -> ShowS
ExpenseField -> String
(Int -> ExpenseField -> ShowS)
-> (ExpenseField -> String)
-> ([ExpenseField] -> ShowS)
-> Show ExpenseField
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExpenseField] -> ShowS
$cshowList :: [ExpenseField] -> ShowS
show :: ExpenseField -> String
$cshow :: ExpenseField -> String
showsPrec :: Int -> ExpenseField -> ShowS
$cshowsPrec :: Int -> ExpenseField -> ShowS
Prelude.Show, (forall x. ExpenseField -> Rep ExpenseField x)
-> (forall x. Rep ExpenseField x -> ExpenseField)
-> Generic ExpenseField
forall x. Rep ExpenseField x -> ExpenseField
forall x. ExpenseField -> Rep ExpenseField x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExpenseField x -> ExpenseField
$cfrom :: forall x. ExpenseField -> Rep ExpenseField x
Prelude.Generic)
newExpenseField ::
ExpenseField
newExpenseField :: ExpenseField
newExpenseField =
ExpenseField' :: Maybe ExpenseDetection
-> Maybe ExpenseDetection
-> Maybe ExpenseType
-> Maybe Natural
-> ExpenseField
ExpenseField'
{ $sel:labelDetection:ExpenseField' :: Maybe ExpenseDetection
labelDetection = Maybe ExpenseDetection
forall a. Maybe a
Prelude.Nothing,
$sel:valueDetection:ExpenseField' :: Maybe ExpenseDetection
valueDetection = Maybe ExpenseDetection
forall a. Maybe a
Prelude.Nothing,
$sel:type':ExpenseField' :: Maybe ExpenseType
type' = Maybe ExpenseType
forall a. Maybe a
Prelude.Nothing,
$sel:pageNumber:ExpenseField' :: Maybe Natural
pageNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
expenseField_labelDetection :: Lens.Lens' ExpenseField (Prelude.Maybe ExpenseDetection)
expenseField_labelDetection :: (Maybe ExpenseDetection -> f (Maybe ExpenseDetection))
-> ExpenseField -> f ExpenseField
expenseField_labelDetection = (ExpenseField -> Maybe ExpenseDetection)
-> (ExpenseField -> Maybe ExpenseDetection -> ExpenseField)
-> Lens
ExpenseField
ExpenseField
(Maybe ExpenseDetection)
(Maybe ExpenseDetection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExpenseField' {Maybe ExpenseDetection
labelDetection :: Maybe ExpenseDetection
$sel:labelDetection:ExpenseField' :: ExpenseField -> Maybe ExpenseDetection
labelDetection} -> Maybe ExpenseDetection
labelDetection) (\s :: ExpenseField
s@ExpenseField' {} Maybe ExpenseDetection
a -> ExpenseField
s {$sel:labelDetection:ExpenseField' :: Maybe ExpenseDetection
labelDetection = Maybe ExpenseDetection
a} :: ExpenseField)
expenseField_valueDetection :: Lens.Lens' ExpenseField (Prelude.Maybe ExpenseDetection)
expenseField_valueDetection :: (Maybe ExpenseDetection -> f (Maybe ExpenseDetection))
-> ExpenseField -> f ExpenseField
expenseField_valueDetection = (ExpenseField -> Maybe ExpenseDetection)
-> (ExpenseField -> Maybe ExpenseDetection -> ExpenseField)
-> Lens
ExpenseField
ExpenseField
(Maybe ExpenseDetection)
(Maybe ExpenseDetection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExpenseField' {Maybe ExpenseDetection
valueDetection :: Maybe ExpenseDetection
$sel:valueDetection:ExpenseField' :: ExpenseField -> Maybe ExpenseDetection
valueDetection} -> Maybe ExpenseDetection
valueDetection) (\s :: ExpenseField
s@ExpenseField' {} Maybe ExpenseDetection
a -> ExpenseField
s {$sel:valueDetection:ExpenseField' :: Maybe ExpenseDetection
valueDetection = Maybe ExpenseDetection
a} :: ExpenseField)
expenseField_type :: Lens.Lens' ExpenseField (Prelude.Maybe ExpenseType)
expenseField_type :: (Maybe ExpenseType -> f (Maybe ExpenseType))
-> ExpenseField -> f ExpenseField
expenseField_type = (ExpenseField -> Maybe ExpenseType)
-> (ExpenseField -> Maybe ExpenseType -> ExpenseField)
-> Lens
ExpenseField ExpenseField (Maybe ExpenseType) (Maybe ExpenseType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExpenseField' {Maybe ExpenseType
type' :: Maybe ExpenseType
$sel:type':ExpenseField' :: ExpenseField -> Maybe ExpenseType
type'} -> Maybe ExpenseType
type') (\s :: ExpenseField
s@ExpenseField' {} Maybe ExpenseType
a -> ExpenseField
s {$sel:type':ExpenseField' :: Maybe ExpenseType
type' = Maybe ExpenseType
a} :: ExpenseField)
expenseField_pageNumber :: Lens.Lens' ExpenseField (Prelude.Maybe Prelude.Natural)
expenseField_pageNumber :: (Maybe Natural -> f (Maybe Natural))
-> ExpenseField -> f ExpenseField
expenseField_pageNumber = (ExpenseField -> Maybe Natural)
-> (ExpenseField -> Maybe Natural -> ExpenseField)
-> Lens ExpenseField ExpenseField (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExpenseField' {Maybe Natural
pageNumber :: Maybe Natural
$sel:pageNumber:ExpenseField' :: ExpenseField -> Maybe Natural
pageNumber} -> Maybe Natural
pageNumber) (\s :: ExpenseField
s@ExpenseField' {} Maybe Natural
a -> ExpenseField
s {$sel:pageNumber:ExpenseField' :: Maybe Natural
pageNumber = Maybe Natural
a} :: ExpenseField)
instance Core.FromJSON ExpenseField where
parseJSON :: Value -> Parser ExpenseField
parseJSON =
String
-> (Object -> Parser ExpenseField) -> Value -> Parser ExpenseField
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExpenseField"
( \Object
x ->
Maybe ExpenseDetection
-> Maybe ExpenseDetection
-> Maybe ExpenseType
-> Maybe Natural
-> ExpenseField
ExpenseField'
(Maybe ExpenseDetection
-> Maybe ExpenseDetection
-> Maybe ExpenseType
-> Maybe Natural
-> ExpenseField)
-> Parser (Maybe ExpenseDetection)
-> Parser
(Maybe ExpenseDetection
-> Maybe ExpenseType -> Maybe Natural -> ExpenseField)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ExpenseDetection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LabelDetection")
Parser
(Maybe ExpenseDetection
-> Maybe ExpenseType -> Maybe Natural -> ExpenseField)
-> Parser (Maybe ExpenseDetection)
-> Parser (Maybe ExpenseType -> Maybe Natural -> ExpenseField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExpenseDetection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValueDetection")
Parser (Maybe ExpenseType -> Maybe Natural -> ExpenseField)
-> Parser (Maybe ExpenseType)
-> Parser (Maybe Natural -> ExpenseField)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExpenseType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Natural -> ExpenseField)
-> Parser (Maybe Natural) -> Parser ExpenseField
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PageNumber")
)
instance Prelude.Hashable ExpenseField
instance Prelude.NFData ExpenseField