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