{-# 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.GroundStation.Types.Elevation where
import qualified Amazonka.Core as Core
import Amazonka.GroundStation.Types.AngleUnits
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Elevation = Elevation'
{
Elevation -> AngleUnits
unit :: AngleUnits,
Elevation -> Double
value :: Prelude.Double
}
deriving (Elevation -> Elevation -> Bool
(Elevation -> Elevation -> Bool)
-> (Elevation -> Elevation -> Bool) -> Eq Elevation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Elevation -> Elevation -> Bool
$c/= :: Elevation -> Elevation -> Bool
== :: Elevation -> Elevation -> Bool
$c== :: Elevation -> Elevation -> Bool
Prelude.Eq, ReadPrec [Elevation]
ReadPrec Elevation
Int -> ReadS Elevation
ReadS [Elevation]
(Int -> ReadS Elevation)
-> ReadS [Elevation]
-> ReadPrec Elevation
-> ReadPrec [Elevation]
-> Read Elevation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Elevation]
$creadListPrec :: ReadPrec [Elevation]
readPrec :: ReadPrec Elevation
$creadPrec :: ReadPrec Elevation
readList :: ReadS [Elevation]
$creadList :: ReadS [Elevation]
readsPrec :: Int -> ReadS Elevation
$creadsPrec :: Int -> ReadS Elevation
Prelude.Read, Int -> Elevation -> ShowS
[Elevation] -> ShowS
Elevation -> String
(Int -> Elevation -> ShowS)
-> (Elevation -> String)
-> ([Elevation] -> ShowS)
-> Show Elevation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Elevation] -> ShowS
$cshowList :: [Elevation] -> ShowS
show :: Elevation -> String
$cshow :: Elevation -> String
showsPrec :: Int -> Elevation -> ShowS
$cshowsPrec :: Int -> Elevation -> ShowS
Prelude.Show, (forall x. Elevation -> Rep Elevation x)
-> (forall x. Rep Elevation x -> Elevation) -> Generic Elevation
forall x. Rep Elevation x -> Elevation
forall x. Elevation -> Rep Elevation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Elevation x -> Elevation
$cfrom :: forall x. Elevation -> Rep Elevation x
Prelude.Generic)
newElevation ::
AngleUnits ->
Prelude.Double ->
Elevation
newElevation :: AngleUnits -> Double -> Elevation
newElevation AngleUnits
pUnit_ Double
pValue_ =
Elevation' :: AngleUnits -> Double -> Elevation
Elevation' {$sel:unit:Elevation' :: AngleUnits
unit = AngleUnits
pUnit_, $sel:value:Elevation' :: Double
value = Double
pValue_}
elevation_unit :: Lens.Lens' Elevation AngleUnits
elevation_unit :: (AngleUnits -> f AngleUnits) -> Elevation -> f Elevation
elevation_unit = (Elevation -> AngleUnits)
-> (Elevation -> AngleUnits -> Elevation)
-> Lens Elevation Elevation AngleUnits AngleUnits
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Elevation' {AngleUnits
unit :: AngleUnits
$sel:unit:Elevation' :: Elevation -> AngleUnits
unit} -> AngleUnits
unit) (\s :: Elevation
s@Elevation' {} AngleUnits
a -> Elevation
s {$sel:unit:Elevation' :: AngleUnits
unit = AngleUnits
a} :: Elevation)
elevation_value :: Lens.Lens' Elevation Prelude.Double
elevation_value :: (Double -> f Double) -> Elevation -> f Elevation
elevation_value = (Elevation -> Double)
-> (Elevation -> Double -> Elevation)
-> Lens Elevation Elevation Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Elevation' {Double
value :: Double
$sel:value:Elevation' :: Elevation -> Double
value} -> Double
value) (\s :: Elevation
s@Elevation' {} Double
a -> Elevation
s {$sel:value:Elevation' :: Double
value = Double
a} :: Elevation)
instance Core.FromJSON Elevation where
parseJSON :: Value -> Parser Elevation
parseJSON =
String -> (Object -> Parser Elevation) -> Value -> Parser Elevation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Elevation"
( \Object
x ->
AngleUnits -> Double -> Elevation
Elevation'
(AngleUnits -> Double -> Elevation)
-> Parser AngleUnits -> Parser (Double -> Elevation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser AngleUnits
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"unit") Parser (Double -> Elevation) -> Parser Double -> Parser Elevation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"value")
)
instance Prelude.Hashable Elevation
instance Prelude.NFData Elevation