{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GroundStation.Types.Elevation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GroundStation.Types.Elevation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GroundStation.Types.AngleUnits
import qualified Amazonka.Prelude as Prelude

-- | Elevation angle of the satellite in the sky during a contact.
--
-- /See:/ 'newElevation' smart constructor.
data Elevation = Elevation'
  { -- | Elevation angle units.
    Elevation -> AngleUnits
unit :: AngleUnits,
    -- | Elevation angle value.
    Elevation -> Double
value :: Prelude.Double
  }
  deriving (Elevation -> Elevation -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'Elevation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'unit', 'elevation_unit' - Elevation angle units.
--
-- 'value', 'elevation_value' - Elevation angle value.
newElevation ::
  -- | 'unit'
  AngleUnits ->
  -- | 'value'
  Prelude.Double ->
  Elevation
newElevation :: AngleUnits -> Double -> Elevation
newElevation AngleUnits
pUnit_ Double
pValue_ =
  Elevation' {$sel:unit:Elevation' :: AngleUnits
unit = AngleUnits
pUnit_, $sel:value:Elevation' :: Double
value = Double
pValue_}

-- | Elevation angle units.
elevation_unit :: Lens.Lens' Elevation AngleUnits
elevation_unit :: Lens' Elevation AngleUnits
elevation_unit = 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 angle value.
elevation_value :: Lens.Lens' Elevation Prelude.Double
elevation_value :: Lens' Elevation Double
elevation_value = 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 Data.FromJSON Elevation where
  parseJSON :: Value -> Parser Elevation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Elevation"
      ( \Object
x ->
          AngleUnits -> Double -> Elevation
Elevation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"unit")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"value")
      )

instance Prelude.Hashable Elevation where
  hashWithSalt :: Int -> Elevation -> Int
hashWithSalt Int
_salt Elevation' {Double
AngleUnits
value :: Double
unit :: AngleUnits
$sel:value:Elevation' :: Elevation -> Double
$sel:unit:Elevation' :: Elevation -> AngleUnits
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AngleUnits
unit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
value

instance Prelude.NFData Elevation where
  rnf :: Elevation -> ()
rnf Elevation' {Double
AngleUnits
value :: Double
unit :: AngleUnits
$sel:value:Elevation' :: Elevation -> Double
$sel:unit:Elevation' :: Elevation -> AngleUnits
..} =
    forall a. NFData a => a -> ()
Prelude.rnf AngleUnits
unit seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
value