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