{-# 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.Rekognition.Types.TextDetection 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.Rekognition.Types.Geometry
import Amazonka.Rekognition.Types.TextTypes
data TextDetection = TextDetection'
{
TextDetection -> Maybe Double
confidence :: Prelude.Maybe Prelude.Double,
TextDetection -> Maybe Text
detectedText :: Prelude.Maybe Prelude.Text,
TextDetection -> Maybe Geometry
geometry :: Prelude.Maybe Geometry,
TextDetection -> Maybe Natural
id :: Prelude.Maybe Prelude.Natural,
TextDetection -> Maybe Natural
parentId :: Prelude.Maybe Prelude.Natural,
TextDetection -> Maybe TextTypes
type' :: Prelude.Maybe TextTypes
}
deriving (TextDetection -> TextDetection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextDetection -> TextDetection -> Bool
$c/= :: TextDetection -> TextDetection -> Bool
== :: TextDetection -> TextDetection -> Bool
$c== :: TextDetection -> TextDetection -> Bool
Prelude.Eq, ReadPrec [TextDetection]
ReadPrec TextDetection
Int -> ReadS TextDetection
ReadS [TextDetection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TextDetection]
$creadListPrec :: ReadPrec [TextDetection]
readPrec :: ReadPrec TextDetection
$creadPrec :: ReadPrec TextDetection
readList :: ReadS [TextDetection]
$creadList :: ReadS [TextDetection]
readsPrec :: Int -> ReadS TextDetection
$creadsPrec :: Int -> ReadS TextDetection
Prelude.Read, Int -> TextDetection -> ShowS
[TextDetection] -> ShowS
TextDetection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextDetection] -> ShowS
$cshowList :: [TextDetection] -> ShowS
show :: TextDetection -> String
$cshow :: TextDetection -> String
showsPrec :: Int -> TextDetection -> ShowS
$cshowsPrec :: Int -> TextDetection -> ShowS
Prelude.Show, forall x. Rep TextDetection x -> TextDetection
forall x. TextDetection -> Rep TextDetection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TextDetection x -> TextDetection
$cfrom :: forall x. TextDetection -> Rep TextDetection x
Prelude.Generic)
newTextDetection ::
TextDetection
newTextDetection :: TextDetection
newTextDetection =
TextDetection'
{ $sel:confidence:TextDetection' :: Maybe Double
confidence = forall a. Maybe a
Prelude.Nothing,
$sel:detectedText:TextDetection' :: Maybe Text
detectedText = forall a. Maybe a
Prelude.Nothing,
$sel:geometry:TextDetection' :: Maybe Geometry
geometry = forall a. Maybe a
Prelude.Nothing,
$sel:id:TextDetection' :: Maybe Natural
id = forall a. Maybe a
Prelude.Nothing,
$sel:parentId:TextDetection' :: Maybe Natural
parentId = forall a. Maybe a
Prelude.Nothing,
$sel:type':TextDetection' :: Maybe TextTypes
type' = forall a. Maybe a
Prelude.Nothing
}
textDetection_confidence :: Lens.Lens' TextDetection (Prelude.Maybe Prelude.Double)
textDetection_confidence :: Lens' TextDetection (Maybe Double)
textDetection_confidence = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextDetection' {Maybe Double
confidence :: Maybe Double
$sel:confidence:TextDetection' :: TextDetection -> Maybe Double
confidence} -> Maybe Double
confidence) (\s :: TextDetection
s@TextDetection' {} Maybe Double
a -> TextDetection
s {$sel:confidence:TextDetection' :: Maybe Double
confidence = Maybe Double
a} :: TextDetection)
textDetection_detectedText :: Lens.Lens' TextDetection (Prelude.Maybe Prelude.Text)
textDetection_detectedText :: Lens' TextDetection (Maybe Text)
textDetection_detectedText = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextDetection' {Maybe Text
detectedText :: Maybe Text
$sel:detectedText:TextDetection' :: TextDetection -> Maybe Text
detectedText} -> Maybe Text
detectedText) (\s :: TextDetection
s@TextDetection' {} Maybe Text
a -> TextDetection
s {$sel:detectedText:TextDetection' :: Maybe Text
detectedText = Maybe Text
a} :: TextDetection)
textDetection_geometry :: Lens.Lens' TextDetection (Prelude.Maybe Geometry)
textDetection_geometry :: Lens' TextDetection (Maybe Geometry)
textDetection_geometry = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextDetection' {Maybe Geometry
geometry :: Maybe Geometry
$sel:geometry:TextDetection' :: TextDetection -> Maybe Geometry
geometry} -> Maybe Geometry
geometry) (\s :: TextDetection
s@TextDetection' {} Maybe Geometry
a -> TextDetection
s {$sel:geometry:TextDetection' :: Maybe Geometry
geometry = Maybe Geometry
a} :: TextDetection)
textDetection_id :: Lens.Lens' TextDetection (Prelude.Maybe Prelude.Natural)
textDetection_id :: Lens' TextDetection (Maybe Natural)
textDetection_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextDetection' {Maybe Natural
id :: Maybe Natural
$sel:id:TextDetection' :: TextDetection -> Maybe Natural
id} -> Maybe Natural
id) (\s :: TextDetection
s@TextDetection' {} Maybe Natural
a -> TextDetection
s {$sel:id:TextDetection' :: Maybe Natural
id = Maybe Natural
a} :: TextDetection)
textDetection_parentId :: Lens.Lens' TextDetection (Prelude.Maybe Prelude.Natural)
textDetection_parentId :: Lens' TextDetection (Maybe Natural)
textDetection_parentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextDetection' {Maybe Natural
parentId :: Maybe Natural
$sel:parentId:TextDetection' :: TextDetection -> Maybe Natural
parentId} -> Maybe Natural
parentId) (\s :: TextDetection
s@TextDetection' {} Maybe Natural
a -> TextDetection
s {$sel:parentId:TextDetection' :: Maybe Natural
parentId = Maybe Natural
a} :: TextDetection)
textDetection_type :: Lens.Lens' TextDetection (Prelude.Maybe TextTypes)
textDetection_type :: Lens' TextDetection (Maybe TextTypes)
textDetection_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TextDetection' {Maybe TextTypes
type' :: Maybe TextTypes
$sel:type':TextDetection' :: TextDetection -> Maybe TextTypes
type'} -> Maybe TextTypes
type') (\s :: TextDetection
s@TextDetection' {} Maybe TextTypes
a -> TextDetection
s {$sel:type':TextDetection' :: Maybe TextTypes
type' = Maybe TextTypes
a} :: TextDetection)
instance Data.FromJSON TextDetection where
parseJSON :: Value -> Parser TextDetection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TextDetection"
( \Object
x ->
Maybe Double
-> Maybe Text
-> Maybe Geometry
-> Maybe Natural
-> Maybe Natural
-> Maybe TextTypes
-> TextDetection
TextDetection'
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
"Confidence")
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
"DetectedText")
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
"Geometry")
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
"Id")
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
"ParentId")
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
"Type")
)
instance Prelude.Hashable TextDetection where
hashWithSalt :: Int -> TextDetection -> Int
hashWithSalt Int
_salt TextDetection' {Maybe Double
Maybe Natural
Maybe Text
Maybe Geometry
Maybe TextTypes
type' :: Maybe TextTypes
parentId :: Maybe Natural
id :: Maybe Natural
geometry :: Maybe Geometry
detectedText :: Maybe Text
confidence :: Maybe Double
$sel:type':TextDetection' :: TextDetection -> Maybe TextTypes
$sel:parentId:TextDetection' :: TextDetection -> Maybe Natural
$sel:id:TextDetection' :: TextDetection -> Maybe Natural
$sel:geometry:TextDetection' :: TextDetection -> Maybe Geometry
$sel:detectedText:TextDetection' :: TextDetection -> Maybe Text
$sel:confidence:TextDetection' :: TextDetection -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
confidence
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detectedText
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Geometry
geometry
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
parentId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TextTypes
type'
instance Prelude.NFData TextDetection where
rnf :: TextDetection -> ()
rnf TextDetection' {Maybe Double
Maybe Natural
Maybe Text
Maybe Geometry
Maybe TextTypes
type' :: Maybe TextTypes
parentId :: Maybe Natural
id :: Maybe Natural
geometry :: Maybe Geometry
detectedText :: Maybe Text
confidence :: Maybe Double
$sel:type':TextDetection' :: TextDetection -> Maybe TextTypes
$sel:parentId:TextDetection' :: TextDetection -> Maybe Natural
$sel:id:TextDetection' :: TextDetection -> Maybe Natural
$sel:geometry:TextDetection' :: TextDetection -> Maybe Geometry
$sel:detectedText:TextDetection' :: TextDetection -> Maybe Text
$sel:confidence:TextDetection' :: TextDetection -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
confidence
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detectedText
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Geometry
geometry
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
parentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TextTypes
type'