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