{-# 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.LineItemGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Textract.Types.LineItemFields
data LineItemGroup = LineItemGroup'
{
LineItemGroup -> Maybe [LineItemFields]
lineItems :: Prelude.Maybe [LineItemFields],
LineItemGroup -> Maybe Natural
lineItemGroupIndex :: Prelude.Maybe Prelude.Natural
}
deriving (LineItemGroup -> LineItemGroup -> Bool
(LineItemGroup -> LineItemGroup -> Bool)
-> (LineItemGroup -> LineItemGroup -> Bool) -> Eq LineItemGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LineItemGroup -> LineItemGroup -> Bool
$c/= :: LineItemGroup -> LineItemGroup -> Bool
== :: LineItemGroup -> LineItemGroup -> Bool
$c== :: LineItemGroup -> LineItemGroup -> Bool
Prelude.Eq, ReadPrec [LineItemGroup]
ReadPrec LineItemGroup
Int -> ReadS LineItemGroup
ReadS [LineItemGroup]
(Int -> ReadS LineItemGroup)
-> ReadS [LineItemGroup]
-> ReadPrec LineItemGroup
-> ReadPrec [LineItemGroup]
-> Read LineItemGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LineItemGroup]
$creadListPrec :: ReadPrec [LineItemGroup]
readPrec :: ReadPrec LineItemGroup
$creadPrec :: ReadPrec LineItemGroup
readList :: ReadS [LineItemGroup]
$creadList :: ReadS [LineItemGroup]
readsPrec :: Int -> ReadS LineItemGroup
$creadsPrec :: Int -> ReadS LineItemGroup
Prelude.Read, Int -> LineItemGroup -> ShowS
[LineItemGroup] -> ShowS
LineItemGroup -> String
(Int -> LineItemGroup -> ShowS)
-> (LineItemGroup -> String)
-> ([LineItemGroup] -> ShowS)
-> Show LineItemGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LineItemGroup] -> ShowS
$cshowList :: [LineItemGroup] -> ShowS
show :: LineItemGroup -> String
$cshow :: LineItemGroup -> String
showsPrec :: Int -> LineItemGroup -> ShowS
$cshowsPrec :: Int -> LineItemGroup -> ShowS
Prelude.Show, (forall x. LineItemGroup -> Rep LineItemGroup x)
-> (forall x. Rep LineItemGroup x -> LineItemGroup)
-> Generic LineItemGroup
forall x. Rep LineItemGroup x -> LineItemGroup
forall x. LineItemGroup -> Rep LineItemGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LineItemGroup x -> LineItemGroup
$cfrom :: forall x. LineItemGroup -> Rep LineItemGroup x
Prelude.Generic)
newLineItemGroup ::
LineItemGroup
newLineItemGroup :: LineItemGroup
newLineItemGroup =
LineItemGroup' :: Maybe [LineItemFields] -> Maybe Natural -> LineItemGroup
LineItemGroup'
{ $sel:lineItems:LineItemGroup' :: Maybe [LineItemFields]
lineItems = Maybe [LineItemFields]
forall a. Maybe a
Prelude.Nothing,
$sel:lineItemGroupIndex:LineItemGroup' :: Maybe Natural
lineItemGroupIndex = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
lineItemGroup_lineItems :: Lens.Lens' LineItemGroup (Prelude.Maybe [LineItemFields])
lineItemGroup_lineItems :: (Maybe [LineItemFields] -> f (Maybe [LineItemFields]))
-> LineItemGroup -> f LineItemGroup
lineItemGroup_lineItems = (LineItemGroup -> Maybe [LineItemFields])
-> (LineItemGroup -> Maybe [LineItemFields] -> LineItemGroup)
-> Lens
LineItemGroup
LineItemGroup
(Maybe [LineItemFields])
(Maybe [LineItemFields])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineItemGroup' {Maybe [LineItemFields]
lineItems :: Maybe [LineItemFields]
$sel:lineItems:LineItemGroup' :: LineItemGroup -> Maybe [LineItemFields]
lineItems} -> Maybe [LineItemFields]
lineItems) (\s :: LineItemGroup
s@LineItemGroup' {} Maybe [LineItemFields]
a -> LineItemGroup
s {$sel:lineItems:LineItemGroup' :: Maybe [LineItemFields]
lineItems = Maybe [LineItemFields]
a} :: LineItemGroup) ((Maybe [LineItemFields] -> f (Maybe [LineItemFields]))
-> LineItemGroup -> f LineItemGroup)
-> ((Maybe [LineItemFields] -> f (Maybe [LineItemFields]))
-> Maybe [LineItemFields] -> f (Maybe [LineItemFields]))
-> (Maybe [LineItemFields] -> f (Maybe [LineItemFields]))
-> LineItemGroup
-> f LineItemGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[LineItemFields] [LineItemFields] [LineItemFields] [LineItemFields]
-> Iso
(Maybe [LineItemFields])
(Maybe [LineItemFields])
(Maybe [LineItemFields])
(Maybe [LineItemFields])
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 AnIso
[LineItemFields] [LineItemFields] [LineItemFields] [LineItemFields]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
lineItemGroup_lineItemGroupIndex :: Lens.Lens' LineItemGroup (Prelude.Maybe Prelude.Natural)
lineItemGroup_lineItemGroupIndex :: (Maybe Natural -> f (Maybe Natural))
-> LineItemGroup -> f LineItemGroup
lineItemGroup_lineItemGroupIndex = (LineItemGroup -> Maybe Natural)
-> (LineItemGroup -> Maybe Natural -> LineItemGroup)
-> Lens LineItemGroup LineItemGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineItemGroup' {Maybe Natural
lineItemGroupIndex :: Maybe Natural
$sel:lineItemGroupIndex:LineItemGroup' :: LineItemGroup -> Maybe Natural
lineItemGroupIndex} -> Maybe Natural
lineItemGroupIndex) (\s :: LineItemGroup
s@LineItemGroup' {} Maybe Natural
a -> LineItemGroup
s {$sel:lineItemGroupIndex:LineItemGroup' :: Maybe Natural
lineItemGroupIndex = Maybe Natural
a} :: LineItemGroup)
instance Core.FromJSON LineItemGroup where
parseJSON :: Value -> Parser LineItemGroup
parseJSON =
String
-> (Object -> Parser LineItemGroup)
-> Value
-> Parser LineItemGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LineItemGroup"
( \Object
x ->
Maybe [LineItemFields] -> Maybe Natural -> LineItemGroup
LineItemGroup'
(Maybe [LineItemFields] -> Maybe Natural -> LineItemGroup)
-> Parser (Maybe [LineItemFields])
-> Parser (Maybe Natural -> LineItemGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [LineItemFields]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LineItems" Parser (Maybe (Maybe [LineItemFields]))
-> Maybe [LineItemFields] -> Parser (Maybe [LineItemFields])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [LineItemFields]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Natural -> LineItemGroup)
-> Parser (Maybe Natural) -> Parser LineItemGroup
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
"LineItemGroupIndex")
)
instance Prelude.Hashable LineItemGroup
instance Prelude.NFData LineItemGroup