{-# 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.Pose where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Pose = Pose'
{
Pose -> Maybe Double
yaw :: Prelude.Maybe Prelude.Double,
Pose -> Maybe Double
roll :: Prelude.Maybe Prelude.Double,
Pose -> Maybe Double
pitch :: Prelude.Maybe Prelude.Double
}
deriving (Pose -> Pose -> Bool
(Pose -> Pose -> Bool) -> (Pose -> Pose -> Bool) -> Eq Pose
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Pose -> Pose -> Bool
$c/= :: Pose -> Pose -> Bool
== :: Pose -> Pose -> Bool
$c== :: Pose -> Pose -> Bool
Prelude.Eq, ReadPrec [Pose]
ReadPrec Pose
Int -> ReadS Pose
ReadS [Pose]
(Int -> ReadS Pose)
-> ReadS [Pose] -> ReadPrec Pose -> ReadPrec [Pose] -> Read Pose
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Pose]
$creadListPrec :: ReadPrec [Pose]
readPrec :: ReadPrec Pose
$creadPrec :: ReadPrec Pose
readList :: ReadS [Pose]
$creadList :: ReadS [Pose]
readsPrec :: Int -> ReadS Pose
$creadsPrec :: Int -> ReadS Pose
Prelude.Read, Int -> Pose -> ShowS
[Pose] -> ShowS
Pose -> String
(Int -> Pose -> ShowS)
-> (Pose -> String) -> ([Pose] -> ShowS) -> Show Pose
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Pose] -> ShowS
$cshowList :: [Pose] -> ShowS
show :: Pose -> String
$cshow :: Pose -> String
showsPrec :: Int -> Pose -> ShowS
$cshowsPrec :: Int -> Pose -> ShowS
Prelude.Show, (forall x. Pose -> Rep Pose x)
-> (forall x. Rep Pose x -> Pose) -> Generic Pose
forall x. Rep Pose x -> Pose
forall x. Pose -> Rep Pose x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Pose x -> Pose
$cfrom :: forall x. Pose -> Rep Pose x
Prelude.Generic)
newPose ::
Pose
newPose :: Pose
newPose =
Pose' :: Maybe Double -> Maybe Double -> Maybe Double -> Pose
Pose'
{ $sel:yaw:Pose' :: Maybe Double
yaw = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:roll:Pose' :: Maybe Double
roll = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:pitch:Pose' :: Maybe Double
pitch = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
pose_yaw :: Lens.Lens' Pose (Prelude.Maybe Prelude.Double)
pose_yaw :: (Maybe Double -> f (Maybe Double)) -> Pose -> f Pose
pose_yaw = (Pose -> Maybe Double)
-> (Pose -> Maybe Double -> Pose)
-> Lens Pose Pose (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pose' {Maybe Double
yaw :: Maybe Double
$sel:yaw:Pose' :: Pose -> Maybe Double
yaw} -> Maybe Double
yaw) (\s :: Pose
s@Pose' {} Maybe Double
a -> Pose
s {$sel:yaw:Pose' :: Maybe Double
yaw = Maybe Double
a} :: Pose)
pose_roll :: Lens.Lens' Pose (Prelude.Maybe Prelude.Double)
pose_roll :: (Maybe Double -> f (Maybe Double)) -> Pose -> f Pose
pose_roll = (Pose -> Maybe Double)
-> (Pose -> Maybe Double -> Pose)
-> Lens Pose Pose (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pose' {Maybe Double
roll :: Maybe Double
$sel:roll:Pose' :: Pose -> Maybe Double
roll} -> Maybe Double
roll) (\s :: Pose
s@Pose' {} Maybe Double
a -> Pose
s {$sel:roll:Pose' :: Maybe Double
roll = Maybe Double
a} :: Pose)
pose_pitch :: Lens.Lens' Pose (Prelude.Maybe Prelude.Double)
pose_pitch :: (Maybe Double -> f (Maybe Double)) -> Pose -> f Pose
pose_pitch = (Pose -> Maybe Double)
-> (Pose -> Maybe Double -> Pose)
-> Lens Pose Pose (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Pose' {Maybe Double
pitch :: Maybe Double
$sel:pitch:Pose' :: Pose -> Maybe Double
pitch} -> Maybe Double
pitch) (\s :: Pose
s@Pose' {} Maybe Double
a -> Pose
s {$sel:pitch:Pose' :: Maybe Double
pitch = Maybe Double
a} :: Pose)
instance Core.FromJSON Pose where
parseJSON :: Value -> Parser Pose
parseJSON =
String -> (Object -> Parser Pose) -> Value -> Parser Pose
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Pose"
( \Object
x ->
Maybe Double -> Maybe Double -> Maybe Double -> Pose
Pose'
(Maybe Double -> Maybe Double -> Maybe Double -> Pose)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> Maybe Double -> Pose)
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
"Yaw")
Parser (Maybe Double -> Maybe Double -> Pose)
-> Parser (Maybe Double) -> Parser (Maybe Double -> Pose)
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
"Roll")
Parser (Maybe Double -> Pose)
-> Parser (Maybe Double) -> Parser Pose
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
"Pitch")
)
instance Prelude.Hashable Pose
instance Prelude.NFData Pose