{-# 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.Block where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Textract.Types.BlockType
import Amazonka.Textract.Types.EntityType
import Amazonka.Textract.Types.Geometry
import Amazonka.Textract.Types.Relationship
import Amazonka.Textract.Types.SelectionStatus
import Amazonka.Textract.Types.TextType
data Block = Block'
{
Block -> Maybe Natural
columnSpan :: Prelude.Maybe Prelude.Natural,
Block -> Maybe Text
text :: Prelude.Maybe Prelude.Text,
Block -> Maybe [EntityType]
entityTypes :: Prelude.Maybe [EntityType],
Block -> Maybe Natural
columnIndex :: Prelude.Maybe Prelude.Natural,
Block -> Maybe Natural
page :: Prelude.Maybe Prelude.Natural,
Block -> Maybe Natural
rowSpan :: Prelude.Maybe Prelude.Natural,
Block -> Maybe SelectionStatus
selectionStatus :: Prelude.Maybe SelectionStatus,
Block -> Maybe Natural
rowIndex :: Prelude.Maybe Prelude.Natural,
Block -> Maybe Double
confidence :: Prelude.Maybe Prelude.Double,
Block -> Maybe [Relationship]
relationships :: Prelude.Maybe [Relationship],
Block -> Maybe Geometry
geometry :: Prelude.Maybe Geometry,
Block -> Maybe TextType
textType :: Prelude.Maybe TextType,
Block -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Block -> Maybe BlockType
blockType :: Prelude.Maybe BlockType
}
deriving (Block -> Block -> Bool
(Block -> Block -> Bool) -> (Block -> Block -> Bool) -> Eq Block
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Block -> Block -> Bool
$c/= :: Block -> Block -> Bool
== :: Block -> Block -> Bool
$c== :: Block -> Block -> Bool
Prelude.Eq, ReadPrec [Block]
ReadPrec Block
Int -> ReadS Block
ReadS [Block]
(Int -> ReadS Block)
-> ReadS [Block]
-> ReadPrec Block
-> ReadPrec [Block]
-> Read Block
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Block]
$creadListPrec :: ReadPrec [Block]
readPrec :: ReadPrec Block
$creadPrec :: ReadPrec Block
readList :: ReadS [Block]
$creadList :: ReadS [Block]
readsPrec :: Int -> ReadS Block
$creadsPrec :: Int -> ReadS Block
Prelude.Read, Int -> Block -> ShowS
[Block] -> ShowS
Block -> String
(Int -> Block -> ShowS)
-> (Block -> String) -> ([Block] -> ShowS) -> Show Block
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Block] -> ShowS
$cshowList :: [Block] -> ShowS
show :: Block -> String
$cshow :: Block -> String
showsPrec :: Int -> Block -> ShowS
$cshowsPrec :: Int -> Block -> ShowS
Prelude.Show, (forall x. Block -> Rep Block x)
-> (forall x. Rep Block x -> Block) -> Generic Block
forall x. Rep Block x -> Block
forall x. Block -> Rep Block x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Block x -> Block
$cfrom :: forall x. Block -> Rep Block x
Prelude.Generic)
newBlock ::
Block
newBlock :: Block
newBlock =
Block' :: Maybe Natural
-> Maybe Text
-> Maybe [EntityType]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block
Block'
{ $sel:columnSpan:Block' :: Maybe Natural
columnSpan = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:text:Block' :: Maybe Text
text = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entityTypes:Block' :: Maybe [EntityType]
entityTypes = Maybe [EntityType]
forall a. Maybe a
Prelude.Nothing,
$sel:columnIndex:Block' :: Maybe Natural
columnIndex = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:page:Block' :: Maybe Natural
page = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:rowSpan:Block' :: Maybe Natural
rowSpan = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:selectionStatus:Block' :: Maybe SelectionStatus
selectionStatus = Maybe SelectionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:rowIndex:Block' :: Maybe Natural
rowIndex = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:confidence:Block' :: Maybe Double
confidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:relationships:Block' :: Maybe [Relationship]
relationships = Maybe [Relationship]
forall a. Maybe a
Prelude.Nothing,
$sel:geometry:Block' :: Maybe Geometry
geometry = Maybe Geometry
forall a. Maybe a
Prelude.Nothing,
$sel:textType:Block' :: Maybe TextType
textType = Maybe TextType
forall a. Maybe a
Prelude.Nothing,
$sel:id:Block' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:blockType:Block' :: Maybe BlockType
blockType = Maybe BlockType
forall a. Maybe a
Prelude.Nothing
}
block_columnSpan :: Lens.Lens' Block (Prelude.Maybe Prelude.Natural)
block_columnSpan :: (Maybe Natural -> f (Maybe Natural)) -> Block -> f Block
block_columnSpan = (Block -> Maybe Natural)
-> (Block -> Maybe Natural -> Block)
-> Lens Block Block (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Natural
columnSpan :: Maybe Natural
$sel:columnSpan:Block' :: Block -> Maybe Natural
columnSpan} -> Maybe Natural
columnSpan) (\s :: Block
s@Block' {} Maybe Natural
a -> Block
s {$sel:columnSpan:Block' :: Maybe Natural
columnSpan = Maybe Natural
a} :: Block)
block_text :: Lens.Lens' Block (Prelude.Maybe Prelude.Text)
block_text :: (Maybe Text -> f (Maybe Text)) -> Block -> f Block
block_text = (Block -> Maybe Text)
-> (Block -> Maybe Text -> Block)
-> Lens Block Block (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Text
text :: Maybe Text
$sel:text:Block' :: Block -> Maybe Text
text} -> Maybe Text
text) (\s :: Block
s@Block' {} Maybe Text
a -> Block
s {$sel:text:Block' :: Maybe Text
text = Maybe Text
a} :: Block)
block_entityTypes :: Lens.Lens' Block (Prelude.Maybe [EntityType])
block_entityTypes :: (Maybe [EntityType] -> f (Maybe [EntityType])) -> Block -> f Block
block_entityTypes = (Block -> Maybe [EntityType])
-> (Block -> Maybe [EntityType] -> Block)
-> Lens Block Block (Maybe [EntityType]) (Maybe [EntityType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe [EntityType]
entityTypes :: Maybe [EntityType]
$sel:entityTypes:Block' :: Block -> Maybe [EntityType]
entityTypes} -> Maybe [EntityType]
entityTypes) (\s :: Block
s@Block' {} Maybe [EntityType]
a -> Block
s {$sel:entityTypes:Block' :: Maybe [EntityType]
entityTypes = Maybe [EntityType]
a} :: Block) ((Maybe [EntityType] -> f (Maybe [EntityType]))
-> Block -> f Block)
-> ((Maybe [EntityType] -> f (Maybe [EntityType]))
-> Maybe [EntityType] -> f (Maybe [EntityType]))
-> (Maybe [EntityType] -> f (Maybe [EntityType]))
-> Block
-> f Block
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [EntityType] [EntityType] [EntityType] [EntityType]
-> Iso
(Maybe [EntityType])
(Maybe [EntityType])
(Maybe [EntityType])
(Maybe [EntityType])
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 [EntityType] [EntityType] [EntityType] [EntityType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
block_columnIndex :: Lens.Lens' Block (Prelude.Maybe Prelude.Natural)
block_columnIndex :: (Maybe Natural -> f (Maybe Natural)) -> Block -> f Block
block_columnIndex = (Block -> Maybe Natural)
-> (Block -> Maybe Natural -> Block)
-> Lens Block Block (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Natural
columnIndex :: Maybe Natural
$sel:columnIndex:Block' :: Block -> Maybe Natural
columnIndex} -> Maybe Natural
columnIndex) (\s :: Block
s@Block' {} Maybe Natural
a -> Block
s {$sel:columnIndex:Block' :: Maybe Natural
columnIndex = Maybe Natural
a} :: Block)
block_page :: Lens.Lens' Block (Prelude.Maybe Prelude.Natural)
block_page :: (Maybe Natural -> f (Maybe Natural)) -> Block -> f Block
block_page = (Block -> Maybe Natural)
-> (Block -> Maybe Natural -> Block)
-> Lens Block Block (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Natural
page :: Maybe Natural
$sel:page:Block' :: Block -> Maybe Natural
page} -> Maybe Natural
page) (\s :: Block
s@Block' {} Maybe Natural
a -> Block
s {$sel:page:Block' :: Maybe Natural
page = Maybe Natural
a} :: Block)
block_rowSpan :: Lens.Lens' Block (Prelude.Maybe Prelude.Natural)
block_rowSpan :: (Maybe Natural -> f (Maybe Natural)) -> Block -> f Block
block_rowSpan = (Block -> Maybe Natural)
-> (Block -> Maybe Natural -> Block)
-> Lens Block Block (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Natural
rowSpan :: Maybe Natural
$sel:rowSpan:Block' :: Block -> Maybe Natural
rowSpan} -> Maybe Natural
rowSpan) (\s :: Block
s@Block' {} Maybe Natural
a -> Block
s {$sel:rowSpan:Block' :: Maybe Natural
rowSpan = Maybe Natural
a} :: Block)
block_selectionStatus :: Lens.Lens' Block (Prelude.Maybe SelectionStatus)
block_selectionStatus :: (Maybe SelectionStatus -> f (Maybe SelectionStatus))
-> Block -> f Block
block_selectionStatus = (Block -> Maybe SelectionStatus)
-> (Block -> Maybe SelectionStatus -> Block)
-> Lens Block Block (Maybe SelectionStatus) (Maybe SelectionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe SelectionStatus
selectionStatus :: Maybe SelectionStatus
$sel:selectionStatus:Block' :: Block -> Maybe SelectionStatus
selectionStatus} -> Maybe SelectionStatus
selectionStatus) (\s :: Block
s@Block' {} Maybe SelectionStatus
a -> Block
s {$sel:selectionStatus:Block' :: Maybe SelectionStatus
selectionStatus = Maybe SelectionStatus
a} :: Block)
block_rowIndex :: Lens.Lens' Block (Prelude.Maybe Prelude.Natural)
block_rowIndex :: (Maybe Natural -> f (Maybe Natural)) -> Block -> f Block
block_rowIndex = (Block -> Maybe Natural)
-> (Block -> Maybe Natural -> Block)
-> Lens Block Block (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Natural
rowIndex :: Maybe Natural
$sel:rowIndex:Block' :: Block -> Maybe Natural
rowIndex} -> Maybe Natural
rowIndex) (\s :: Block
s@Block' {} Maybe Natural
a -> Block
s {$sel:rowIndex:Block' :: Maybe Natural
rowIndex = Maybe Natural
a} :: Block)
block_confidence :: Lens.Lens' Block (Prelude.Maybe Prelude.Double)
block_confidence :: (Maybe Double -> f (Maybe Double)) -> Block -> f Block
block_confidence = (Block -> Maybe Double)
-> (Block -> Maybe Double -> Block)
-> Lens Block Block (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Double
confidence :: Maybe Double
$sel:confidence:Block' :: Block -> Maybe Double
confidence} -> Maybe Double
confidence) (\s :: Block
s@Block' {} Maybe Double
a -> Block
s {$sel:confidence:Block' :: Maybe Double
confidence = Maybe Double
a} :: Block)
block_relationships :: Lens.Lens' Block (Prelude.Maybe [Relationship])
block_relationships :: (Maybe [Relationship] -> f (Maybe [Relationship]))
-> Block -> f Block
block_relationships = (Block -> Maybe [Relationship])
-> (Block -> Maybe [Relationship] -> Block)
-> Lens Block Block (Maybe [Relationship]) (Maybe [Relationship])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe [Relationship]
relationships :: Maybe [Relationship]
$sel:relationships:Block' :: Block -> Maybe [Relationship]
relationships} -> Maybe [Relationship]
relationships) (\s :: Block
s@Block' {} Maybe [Relationship]
a -> Block
s {$sel:relationships:Block' :: Maybe [Relationship]
relationships = Maybe [Relationship]
a} :: Block) ((Maybe [Relationship] -> f (Maybe [Relationship]))
-> Block -> f Block)
-> ((Maybe [Relationship] -> f (Maybe [Relationship]))
-> Maybe [Relationship] -> f (Maybe [Relationship]))
-> (Maybe [Relationship] -> f (Maybe [Relationship]))
-> Block
-> f Block
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Relationship] [Relationship] [Relationship] [Relationship]
-> Iso
(Maybe [Relationship])
(Maybe [Relationship])
(Maybe [Relationship])
(Maybe [Relationship])
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 [Relationship] [Relationship] [Relationship] [Relationship]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
block_geometry :: Lens.Lens' Block (Prelude.Maybe Geometry)
block_geometry :: (Maybe Geometry -> f (Maybe Geometry)) -> Block -> f Block
block_geometry = (Block -> Maybe Geometry)
-> (Block -> Maybe Geometry -> Block)
-> Lens Block Block (Maybe Geometry) (Maybe Geometry)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Geometry
geometry :: Maybe Geometry
$sel:geometry:Block' :: Block -> Maybe Geometry
geometry} -> Maybe Geometry
geometry) (\s :: Block
s@Block' {} Maybe Geometry
a -> Block
s {$sel:geometry:Block' :: Maybe Geometry
geometry = Maybe Geometry
a} :: Block)
block_textType :: Lens.Lens' Block (Prelude.Maybe TextType)
block_textType :: (Maybe TextType -> f (Maybe TextType)) -> Block -> f Block
block_textType = (Block -> Maybe TextType)
-> (Block -> Maybe TextType -> Block)
-> Lens Block Block (Maybe TextType) (Maybe TextType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe TextType
textType :: Maybe TextType
$sel:textType:Block' :: Block -> Maybe TextType
textType} -> Maybe TextType
textType) (\s :: Block
s@Block' {} Maybe TextType
a -> Block
s {$sel:textType:Block' :: Maybe TextType
textType = Maybe TextType
a} :: Block)
block_id :: Lens.Lens' Block (Prelude.Maybe Prelude.Text)
block_id :: (Maybe Text -> f (Maybe Text)) -> Block -> f Block
block_id = (Block -> Maybe Text)
-> (Block -> Maybe Text -> Block)
-> Lens Block Block (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe Text
id :: Maybe Text
$sel:id:Block' :: Block -> Maybe Text
id} -> Maybe Text
id) (\s :: Block
s@Block' {} Maybe Text
a -> Block
s {$sel:id:Block' :: Maybe Text
id = Maybe Text
a} :: Block)
block_blockType :: Lens.Lens' Block (Prelude.Maybe BlockType)
block_blockType :: (Maybe BlockType -> f (Maybe BlockType)) -> Block -> f Block
block_blockType = (Block -> Maybe BlockType)
-> (Block -> Maybe BlockType -> Block)
-> Lens Block Block (Maybe BlockType) (Maybe BlockType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Block' {Maybe BlockType
blockType :: Maybe BlockType
$sel:blockType:Block' :: Block -> Maybe BlockType
blockType} -> Maybe BlockType
blockType) (\s :: Block
s@Block' {} Maybe BlockType
a -> Block
s {$sel:blockType:Block' :: Maybe BlockType
blockType = Maybe BlockType
a} :: Block)
instance Core.FromJSON Block where
parseJSON :: Value -> Parser Block
parseJSON =
String -> (Object -> Parser Block) -> Value -> Parser Block
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Block"
( \Object
x ->
Maybe Natural
-> Maybe Text
-> Maybe [EntityType]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block
Block'
(Maybe Natural
-> Maybe Text
-> Maybe [EntityType]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe [EntityType]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
forall (f :: * -> *) a b. Functor 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
"ColumnSpan")
Parser
(Maybe Text
-> Maybe [EntityType]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe Text)
-> Parser
(Maybe [EntityType]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
forall (f :: * -> *) a b. Applicative f => 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 [EntityType]
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe [EntityType])
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [EntityType]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EntityTypes" Parser (Maybe (Maybe [EntityType]))
-> Maybe [EntityType] -> Parser (Maybe [EntityType])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EntityType]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
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
"ColumnIndex")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
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
"Page")
Parser
(Maybe Natural
-> Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe Natural)
-> Parser
(Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
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
"RowSpan")
Parser
(Maybe SelectionStatus
-> Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe SelectionStatus)
-> Parser
(Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SelectionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SelectionStatus")
Parser
(Maybe Natural
-> Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe Natural)
-> Parser
(Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
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
"RowIndex")
Parser
(Maybe Double
-> Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe Double)
-> Parser
(Maybe [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
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 [Relationship]
-> Maybe Geometry
-> Maybe TextType
-> Maybe Text
-> Maybe BlockType
-> Block)
-> Parser (Maybe [Relationship])
-> Parser
(Maybe Geometry
-> Maybe TextType -> Maybe Text -> Maybe BlockType -> Block)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Relationship]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Relationships" Parser (Maybe (Maybe [Relationship]))
-> Maybe [Relationship] -> Parser (Maybe [Relationship])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Relationship]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Geometry
-> Maybe TextType -> Maybe Text -> Maybe BlockType -> Block)
-> Parser (Maybe Geometry)
-> Parser
(Maybe TextType -> Maybe Text -> Maybe BlockType -> Block)
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")
Parser (Maybe TextType -> Maybe Text -> Maybe BlockType -> Block)
-> Parser (Maybe TextType)
-> Parser (Maybe Text -> Maybe BlockType -> Block)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TextType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TextType")
Parser (Maybe Text -> Maybe BlockType -> Block)
-> Parser (Maybe Text) -> Parser (Maybe BlockType -> Block)
forall (f :: * -> *) a b. Applicative f => 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
"Id")
Parser (Maybe BlockType -> Block)
-> Parser (Maybe BlockType) -> Parser Block
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BlockType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BlockType")
)
instance Prelude.Hashable Block
instance Prelude.NFData Block