{-# 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.Lens as Lens
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
(ModerationLabel -> ModerationLabel -> Bool)
-> (ModerationLabel -> ModerationLabel -> Bool)
-> Eq ModerationLabel
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]
(Int -> ReadS ModerationLabel)
-> ReadS [ModerationLabel]
-> ReadPrec ModerationLabel
-> ReadPrec [ModerationLabel]
-> Read 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
(Int -> ModerationLabel -> ShowS)
-> (ModerationLabel -> String)
-> ([ModerationLabel] -> ShowS)
-> Show ModerationLabel
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. ModerationLabel -> Rep ModerationLabel x)
-> (forall x. Rep ModerationLabel x -> ModerationLabel)
-> Generic ModerationLabel
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' :: Maybe Double -> Maybe Text -> Maybe Text -> ModerationLabel
ModerationLabel'
{ $sel:confidence:ModerationLabel' :: Maybe Double
confidence = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:name:ModerationLabel' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parentName:ModerationLabel' :: Maybe Text
parentName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
moderationLabel_confidence :: Lens.Lens' ModerationLabel (Prelude.Maybe Prelude.Double)
moderationLabel_confidence :: (Maybe Double -> f (Maybe Double))
-> ModerationLabel -> f ModerationLabel
moderationLabel_confidence = (ModerationLabel -> Maybe Double)
-> (ModerationLabel -> Maybe Double -> ModerationLabel)
-> Lens
ModerationLabel ModerationLabel (Maybe Double) (Maybe Double)
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 :: (Maybe Text -> f (Maybe Text))
-> ModerationLabel -> f ModerationLabel
moderationLabel_name = (ModerationLabel -> Maybe Text)
-> (ModerationLabel -> Maybe Text -> ModerationLabel)
-> Lens ModerationLabel ModerationLabel (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ModerationLabel -> f ModerationLabel
moderationLabel_parentName = (ModerationLabel -> Maybe Text)
-> (ModerationLabel -> Maybe Text -> ModerationLabel)
-> Lens ModerationLabel ModerationLabel (Maybe Text) (Maybe Text)
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 Core.FromJSON ModerationLabel where
parseJSON :: Value -> Parser ModerationLabel
parseJSON =
String
-> (Object -> Parser ModerationLabel)
-> Value
-> Parser ModerationLabel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ModerationLabel"
( \Object
x ->
Maybe Double -> Maybe Text -> Maybe Text -> ModerationLabel
ModerationLabel'
(Maybe Double -> Maybe Text -> Maybe Text -> ModerationLabel)
-> Parser (Maybe Double)
-> Parser (Maybe Text -> Maybe Text -> ModerationLabel)
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
"Confidence")
Parser (Maybe Text -> Maybe Text -> ModerationLabel)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ModerationLabel)
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
"Name")
Parser (Maybe Text -> ModerationLabel)
-> Parser (Maybe Text) -> Parser ModerationLabel
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
"ParentName")
)
instance Prelude.Hashable ModerationLabel
instance Prelude.NFData ModerationLabel