{-# 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.NormalizedValue 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.Textract.Types.ValueType
data NormalizedValue = NormalizedValue'
{
NormalizedValue -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
NormalizedValue -> Maybe ValueType
valueType :: Prelude.Maybe ValueType
}
deriving (NormalizedValue -> NormalizedValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NormalizedValue -> NormalizedValue -> Bool
$c/= :: NormalizedValue -> NormalizedValue -> Bool
== :: NormalizedValue -> NormalizedValue -> Bool
$c== :: NormalizedValue -> NormalizedValue -> Bool
Prelude.Eq, ReadPrec [NormalizedValue]
ReadPrec NormalizedValue
Int -> ReadS NormalizedValue
ReadS [NormalizedValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NormalizedValue]
$creadListPrec :: ReadPrec [NormalizedValue]
readPrec :: ReadPrec NormalizedValue
$creadPrec :: ReadPrec NormalizedValue
readList :: ReadS [NormalizedValue]
$creadList :: ReadS [NormalizedValue]
readsPrec :: Int -> ReadS NormalizedValue
$creadsPrec :: Int -> ReadS NormalizedValue
Prelude.Read, Int -> NormalizedValue -> ShowS
[NormalizedValue] -> ShowS
NormalizedValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NormalizedValue] -> ShowS
$cshowList :: [NormalizedValue] -> ShowS
show :: NormalizedValue -> String
$cshow :: NormalizedValue -> String
showsPrec :: Int -> NormalizedValue -> ShowS
$cshowsPrec :: Int -> NormalizedValue -> ShowS
Prelude.Show, forall x. Rep NormalizedValue x -> NormalizedValue
forall x. NormalizedValue -> Rep NormalizedValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NormalizedValue x -> NormalizedValue
$cfrom :: forall x. NormalizedValue -> Rep NormalizedValue x
Prelude.Generic)
newNormalizedValue ::
NormalizedValue
newNormalizedValue :: NormalizedValue
newNormalizedValue =
NormalizedValue'
{ $sel:value:NormalizedValue' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing,
$sel:valueType:NormalizedValue' :: Maybe ValueType
valueType = forall a. Maybe a
Prelude.Nothing
}
normalizedValue_value :: Lens.Lens' NormalizedValue (Prelude.Maybe Prelude.Text)
normalizedValue_value :: Lens' NormalizedValue (Maybe Text)
normalizedValue_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NormalizedValue' {Maybe Text
value :: Maybe Text
$sel:value:NormalizedValue' :: NormalizedValue -> Maybe Text
value} -> Maybe Text
value) (\s :: NormalizedValue
s@NormalizedValue' {} Maybe Text
a -> NormalizedValue
s {$sel:value:NormalizedValue' :: Maybe Text
value = Maybe Text
a} :: NormalizedValue)
normalizedValue_valueType :: Lens.Lens' NormalizedValue (Prelude.Maybe ValueType)
normalizedValue_valueType :: Lens' NormalizedValue (Maybe ValueType)
normalizedValue_valueType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NormalizedValue' {Maybe ValueType
valueType :: Maybe ValueType
$sel:valueType:NormalizedValue' :: NormalizedValue -> Maybe ValueType
valueType} -> Maybe ValueType
valueType) (\s :: NormalizedValue
s@NormalizedValue' {} Maybe ValueType
a -> NormalizedValue
s {$sel:valueType:NormalizedValue' :: Maybe ValueType
valueType = Maybe ValueType
a} :: NormalizedValue)
instance Data.FromJSON NormalizedValue where
parseJSON :: Value -> Parser NormalizedValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NormalizedValue"
( \Object
x ->
Maybe Text -> Maybe ValueType -> NormalizedValue
NormalizedValue'
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
"Value")
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
"ValueType")
)
instance Prelude.Hashable NormalizedValue where
hashWithSalt :: Int -> NormalizedValue -> Int
hashWithSalt Int
_salt NormalizedValue' {Maybe Text
Maybe ValueType
valueType :: Maybe ValueType
value :: Maybe Text
$sel:valueType:NormalizedValue' :: NormalizedValue -> Maybe ValueType
$sel:value:NormalizedValue' :: NormalizedValue -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ValueType
valueType
instance Prelude.NFData NormalizedValue where
rnf :: NormalizedValue -> ()
rnf NormalizedValue' {Maybe Text
Maybe ValueType
valueType :: Maybe ValueType
value :: Maybe Text
$sel:valueType:NormalizedValue' :: NormalizedValue -> Maybe ValueType
$sel:value:NormalizedValue' :: NormalizedValue -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ValueType
valueType