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