{-# 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.ExpenseDetection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Textract.Types.Geometry
data ExpenseDetection = ExpenseDetection'
{
ExpenseDetection -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
ExpenseDetection -> Maybe Double
confidence :: Prelude.Maybe Prelude.Double,
ExpenseDetection -> Maybe Geometry
geometry :: Prelude.Maybe Geometry
}
deriving (ExpenseDetection -> ExpenseDetection -> Bool
(ExpenseDetection -> ExpenseDetection -> Bool)
-> (ExpenseDetection -> ExpenseDetection -> Bool)
-> Eq ExpenseDetection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExpenseDetection -> ExpenseDetection -> Bool
$c/= :: ExpenseDetection -> ExpenseDetection -> Bool
== :: ExpenseDetection -> ExpenseDetection -> Bool
$c== :: ExpenseDetection -> ExpenseDetection -> Bool
Prelude.Eq, ReadPrec [ExpenseDetection]
ReadPrec ExpenseDetection
Int -> ReadS ExpenseDetection
ReadS [ExpenseDetection]
(Int -> ReadS ExpenseDetection)
-> ReadS [ExpenseDetection]
-> ReadPrec ExpenseDetection
-> ReadPrec [ExpenseDetection]
-> Read ExpenseDetection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExpenseDetection]
$creadListPrec :: ReadPrec [ExpenseDetection]
readPrec :: ReadPrec ExpenseDetection
$creadPrec :: ReadPrec ExpenseDetection
readList :: ReadS [ExpenseDetection]
$creadList :: ReadS [ExpenseDetection]
readsPrec :: Int -> ReadS ExpenseDetection
$creadsPrec :: Int -> ReadS ExpenseDetection
Prelude.Read, Int -> ExpenseDetection -> ShowS
[ExpenseDetection] -> ShowS
ExpenseDetection -> String
(Int -> ExpenseDetection -> ShowS)
-> (ExpenseDetection -> String)
-> ([ExpenseDetection] -> ShowS)
-> Show ExpenseDetection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExpenseDetection] -> ShowS
$cshowList :: [ExpenseDetection] -> ShowS
show :: ExpenseDetection -> String
$cshow :: ExpenseDetection -> String
showsPrec :: Int -> ExpenseDetection -> ShowS
$cshowsPrec :: Int -> ExpenseDetection -> ShowS
Prelude.Show, (forall x. ExpenseDetection -> Rep ExpenseDetection x)
-> (forall x. Rep ExpenseDetection x -> ExpenseDetection)
-> Generic ExpenseDetection
forall x. Rep ExpenseDetection x -> ExpenseDetection
forall x. ExpenseDetection -> Rep ExpenseDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExpenseDetection x -> ExpenseDetection
$cfrom :: forall x. ExpenseDetection -> Rep ExpenseDetection x
Prelude.Generic)
newExpenseDetection ::
ExpenseDetection
newExpenseDetection :: ExpenseDetection
newExpenseDetection =
ExpenseDetection' :: Maybe Text -> Maybe Double -> Maybe Geometry -> ExpenseDetection
ExpenseDetection'
{ $sel:text:ExpenseDetection' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:confidence:ExpenseDetection' :: Maybe Double
confidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:geometry:ExpenseDetection' :: Maybe Geometry
geometry = Maybe Geometry
forall a. Maybe a
Prelude.Nothing
}
expenseDetection_text :: Lens.Lens' ExpenseDetection (Prelude.Maybe Prelude.Text)
expenseDetection_text :: (Maybe Text -> f (Maybe Text))
-> ExpenseDetection -> f ExpenseDetection
expenseDetection_text = (ExpenseDetection -> Maybe Text)
-> (ExpenseDetection -> Maybe Text -> ExpenseDetection)
-> Lens ExpenseDetection ExpenseDetection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExpenseDetection' {Maybe Text
text :: Maybe Text
$sel:text:ExpenseDetection' :: ExpenseDetection -> Maybe Text
text} -> Maybe Text
text) (\s :: ExpenseDetection
s@ExpenseDetection' {} Maybe Text
a -> ExpenseDetection
s {$sel:text:ExpenseDetection' :: Maybe Text
text = Maybe Text
a} :: ExpenseDetection)
expenseDetection_confidence :: Lens.Lens' ExpenseDetection (Prelude.Maybe Prelude.Double)
expenseDetection_confidence :: (Maybe Double -> f (Maybe Double))
-> ExpenseDetection -> f ExpenseDetection
expenseDetection_confidence = (ExpenseDetection -> Maybe Double)
-> (ExpenseDetection -> Maybe Double -> ExpenseDetection)
-> Lens
ExpenseDetection ExpenseDetection (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExpenseDetection' {Maybe Double
confidence :: Maybe Double
$sel:confidence:ExpenseDetection' :: ExpenseDetection -> Maybe Double
confidence} -> Maybe Double
confidence) (\s :: ExpenseDetection
s@ExpenseDetection' {} Maybe Double
a -> ExpenseDetection
s {$sel:confidence:ExpenseDetection' :: Maybe Double
confidence = Maybe Double
a} :: ExpenseDetection)
expenseDetection_geometry :: Lens.Lens' ExpenseDetection (Prelude.Maybe Geometry)
expenseDetection_geometry :: (Maybe Geometry -> f (Maybe Geometry))
-> ExpenseDetection -> f ExpenseDetection
expenseDetection_geometry = (ExpenseDetection -> Maybe Geometry)
-> (ExpenseDetection -> Maybe Geometry -> ExpenseDetection)
-> Lens
ExpenseDetection ExpenseDetection (Maybe Geometry) (Maybe Geometry)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExpenseDetection' {Maybe Geometry
geometry :: Maybe Geometry
$sel:geometry:ExpenseDetection' :: ExpenseDetection -> Maybe Geometry
geometry} -> Maybe Geometry
geometry) (\s :: ExpenseDetection
s@ExpenseDetection' {} Maybe Geometry
a -> ExpenseDetection
s {$sel:geometry:ExpenseDetection' :: Maybe Geometry
geometry = Maybe Geometry
a} :: ExpenseDetection)
instance Core.FromJSON ExpenseDetection where
parseJSON :: Value -> Parser ExpenseDetection
parseJSON =
String
-> (Object -> Parser ExpenseDetection)
-> Value
-> Parser ExpenseDetection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExpenseDetection"
( \Object
x ->
Maybe Text -> Maybe Double -> Maybe Geometry -> ExpenseDetection
ExpenseDetection'
(Maybe Text -> Maybe Double -> Maybe Geometry -> ExpenseDetection)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> Maybe Geometry -> ExpenseDetection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Text")
Parser (Maybe Double -> Maybe Geometry -> ExpenseDetection)
-> Parser (Maybe Double)
-> Parser (Maybe Geometry -> ExpenseDetection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Confidence")
Parser (Maybe Geometry -> ExpenseDetection)
-> Parser (Maybe Geometry) -> Parser ExpenseDetection
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Geometry)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Geometry")
)
instance Prelude.Hashable ExpenseDetection
instance Prelude.NFData ExpenseDetection