{-# 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.AntennaDownlinkDemodDecodeConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GroundStation.Types.AntennaDownlinkDemodDecodeConfig where

import qualified Amazonka.Core as Core
import Amazonka.GroundStation.Types.DecodeConfig
import Amazonka.GroundStation.Types.DemodulationConfig
import Amazonka.GroundStation.Types.SpectrumConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about how AWS Ground Station should configure an antenna for
-- downlink demod decode during a contact.
--
-- /See:/ 'newAntennaDownlinkDemodDecodeConfig' smart constructor.
data AntennaDownlinkDemodDecodeConfig = AntennaDownlinkDemodDecodeConfig'
  { -- | Information about the decode @Config@.
    AntennaDownlinkDemodDecodeConfig -> DecodeConfig
decodeConfig :: DecodeConfig,
    -- | Information about the demodulation @Config@.
    AntennaDownlinkDemodDecodeConfig -> DemodulationConfig
demodulationConfig :: DemodulationConfig,
    -- | Information about the spectral @Config@.
    AntennaDownlinkDemodDecodeConfig -> SpectrumConfig
spectrumConfig :: SpectrumConfig
  }
  deriving (AntennaDownlinkDemodDecodeConfig
-> AntennaDownlinkDemodDecodeConfig -> Bool
(AntennaDownlinkDemodDecodeConfig
 -> AntennaDownlinkDemodDecodeConfig -> Bool)
-> (AntennaDownlinkDemodDecodeConfig
    -> AntennaDownlinkDemodDecodeConfig -> Bool)
-> Eq AntennaDownlinkDemodDecodeConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AntennaDownlinkDemodDecodeConfig
-> AntennaDownlinkDemodDecodeConfig -> Bool
$c/= :: AntennaDownlinkDemodDecodeConfig
-> AntennaDownlinkDemodDecodeConfig -> Bool
== :: AntennaDownlinkDemodDecodeConfig
-> AntennaDownlinkDemodDecodeConfig -> Bool
$c== :: AntennaDownlinkDemodDecodeConfig
-> AntennaDownlinkDemodDecodeConfig -> Bool
Prelude.Eq, ReadPrec [AntennaDownlinkDemodDecodeConfig]
ReadPrec AntennaDownlinkDemodDecodeConfig
Int -> ReadS AntennaDownlinkDemodDecodeConfig
ReadS [AntennaDownlinkDemodDecodeConfig]
(Int -> ReadS AntennaDownlinkDemodDecodeConfig)
-> ReadS [AntennaDownlinkDemodDecodeConfig]
-> ReadPrec AntennaDownlinkDemodDecodeConfig
-> ReadPrec [AntennaDownlinkDemodDecodeConfig]
-> Read AntennaDownlinkDemodDecodeConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AntennaDownlinkDemodDecodeConfig]
$creadListPrec :: ReadPrec [AntennaDownlinkDemodDecodeConfig]
readPrec :: ReadPrec AntennaDownlinkDemodDecodeConfig
$creadPrec :: ReadPrec AntennaDownlinkDemodDecodeConfig
readList :: ReadS [AntennaDownlinkDemodDecodeConfig]
$creadList :: ReadS [AntennaDownlinkDemodDecodeConfig]
readsPrec :: Int -> ReadS AntennaDownlinkDemodDecodeConfig
$creadsPrec :: Int -> ReadS AntennaDownlinkDemodDecodeConfig
Prelude.Read, Int -> AntennaDownlinkDemodDecodeConfig -> ShowS
[AntennaDownlinkDemodDecodeConfig] -> ShowS
AntennaDownlinkDemodDecodeConfig -> String
(Int -> AntennaDownlinkDemodDecodeConfig -> ShowS)
-> (AntennaDownlinkDemodDecodeConfig -> String)
-> ([AntennaDownlinkDemodDecodeConfig] -> ShowS)
-> Show AntennaDownlinkDemodDecodeConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AntennaDownlinkDemodDecodeConfig] -> ShowS
$cshowList :: [AntennaDownlinkDemodDecodeConfig] -> ShowS
show :: AntennaDownlinkDemodDecodeConfig -> String
$cshow :: AntennaDownlinkDemodDecodeConfig -> String
showsPrec :: Int -> AntennaDownlinkDemodDecodeConfig -> ShowS
$cshowsPrec :: Int -> AntennaDownlinkDemodDecodeConfig -> ShowS
Prelude.Show, (forall x.
 AntennaDownlinkDemodDecodeConfig
 -> Rep AntennaDownlinkDemodDecodeConfig x)
-> (forall x.
    Rep AntennaDownlinkDemodDecodeConfig x
    -> AntennaDownlinkDemodDecodeConfig)
-> Generic AntennaDownlinkDemodDecodeConfig
forall x.
Rep AntennaDownlinkDemodDecodeConfig x
-> AntennaDownlinkDemodDecodeConfig
forall x.
AntennaDownlinkDemodDecodeConfig
-> Rep AntennaDownlinkDemodDecodeConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AntennaDownlinkDemodDecodeConfig x
-> AntennaDownlinkDemodDecodeConfig
$cfrom :: forall x.
AntennaDownlinkDemodDecodeConfig
-> Rep AntennaDownlinkDemodDecodeConfig x
Prelude.Generic)

-- |
-- Create a value of 'AntennaDownlinkDemodDecodeConfig' 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:
--
-- 'decodeConfig', 'antennaDownlinkDemodDecodeConfig_decodeConfig' - Information about the decode @Config@.
--
-- 'demodulationConfig', 'antennaDownlinkDemodDecodeConfig_demodulationConfig' - Information about the demodulation @Config@.
--
-- 'spectrumConfig', 'antennaDownlinkDemodDecodeConfig_spectrumConfig' - Information about the spectral @Config@.
newAntennaDownlinkDemodDecodeConfig ::
  -- | 'decodeConfig'
  DecodeConfig ->
  -- | 'demodulationConfig'
  DemodulationConfig ->
  -- | 'spectrumConfig'
  SpectrumConfig ->
  AntennaDownlinkDemodDecodeConfig
newAntennaDownlinkDemodDecodeConfig :: DecodeConfig
-> DemodulationConfig
-> SpectrumConfig
-> AntennaDownlinkDemodDecodeConfig
newAntennaDownlinkDemodDecodeConfig
  DecodeConfig
pDecodeConfig_
  DemodulationConfig
pDemodulationConfig_
  SpectrumConfig
pSpectrumConfig_ =
    AntennaDownlinkDemodDecodeConfig' :: DecodeConfig
-> DemodulationConfig
-> SpectrumConfig
-> AntennaDownlinkDemodDecodeConfig
AntennaDownlinkDemodDecodeConfig'
      { $sel:decodeConfig:AntennaDownlinkDemodDecodeConfig' :: DecodeConfig
decodeConfig =
          DecodeConfig
pDecodeConfig_,
        $sel:demodulationConfig:AntennaDownlinkDemodDecodeConfig' :: DemodulationConfig
demodulationConfig = DemodulationConfig
pDemodulationConfig_,
        $sel:spectrumConfig:AntennaDownlinkDemodDecodeConfig' :: SpectrumConfig
spectrumConfig = SpectrumConfig
pSpectrumConfig_
      }

-- | Information about the decode @Config@.
antennaDownlinkDemodDecodeConfig_decodeConfig :: Lens.Lens' AntennaDownlinkDemodDecodeConfig DecodeConfig
antennaDownlinkDemodDecodeConfig_decodeConfig :: (DecodeConfig -> f DecodeConfig)
-> AntennaDownlinkDemodDecodeConfig
-> f AntennaDownlinkDemodDecodeConfig
antennaDownlinkDemodDecodeConfig_decodeConfig = (AntennaDownlinkDemodDecodeConfig -> DecodeConfig)
-> (AntennaDownlinkDemodDecodeConfig
    -> DecodeConfig -> AntennaDownlinkDemodDecodeConfig)
-> Lens
     AntennaDownlinkDemodDecodeConfig
     AntennaDownlinkDemodDecodeConfig
     DecodeConfig
     DecodeConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AntennaDownlinkDemodDecodeConfig' {DecodeConfig
decodeConfig :: DecodeConfig
$sel:decodeConfig:AntennaDownlinkDemodDecodeConfig' :: AntennaDownlinkDemodDecodeConfig -> DecodeConfig
decodeConfig} -> DecodeConfig
decodeConfig) (\s :: AntennaDownlinkDemodDecodeConfig
s@AntennaDownlinkDemodDecodeConfig' {} DecodeConfig
a -> AntennaDownlinkDemodDecodeConfig
s {$sel:decodeConfig:AntennaDownlinkDemodDecodeConfig' :: DecodeConfig
decodeConfig = DecodeConfig
a} :: AntennaDownlinkDemodDecodeConfig)

-- | Information about the demodulation @Config@.
antennaDownlinkDemodDecodeConfig_demodulationConfig :: Lens.Lens' AntennaDownlinkDemodDecodeConfig DemodulationConfig
antennaDownlinkDemodDecodeConfig_demodulationConfig :: (DemodulationConfig -> f DemodulationConfig)
-> AntennaDownlinkDemodDecodeConfig
-> f AntennaDownlinkDemodDecodeConfig
antennaDownlinkDemodDecodeConfig_demodulationConfig = (AntennaDownlinkDemodDecodeConfig -> DemodulationConfig)
-> (AntennaDownlinkDemodDecodeConfig
    -> DemodulationConfig -> AntennaDownlinkDemodDecodeConfig)
-> Lens
     AntennaDownlinkDemodDecodeConfig
     AntennaDownlinkDemodDecodeConfig
     DemodulationConfig
     DemodulationConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AntennaDownlinkDemodDecodeConfig' {DemodulationConfig
demodulationConfig :: DemodulationConfig
$sel:demodulationConfig:AntennaDownlinkDemodDecodeConfig' :: AntennaDownlinkDemodDecodeConfig -> DemodulationConfig
demodulationConfig} -> DemodulationConfig
demodulationConfig) (\s :: AntennaDownlinkDemodDecodeConfig
s@AntennaDownlinkDemodDecodeConfig' {} DemodulationConfig
a -> AntennaDownlinkDemodDecodeConfig
s {$sel:demodulationConfig:AntennaDownlinkDemodDecodeConfig' :: DemodulationConfig
demodulationConfig = DemodulationConfig
a} :: AntennaDownlinkDemodDecodeConfig)

-- | Information about the spectral @Config@.
antennaDownlinkDemodDecodeConfig_spectrumConfig :: Lens.Lens' AntennaDownlinkDemodDecodeConfig SpectrumConfig
antennaDownlinkDemodDecodeConfig_spectrumConfig :: (SpectrumConfig -> f SpectrumConfig)
-> AntennaDownlinkDemodDecodeConfig
-> f AntennaDownlinkDemodDecodeConfig
antennaDownlinkDemodDecodeConfig_spectrumConfig = (AntennaDownlinkDemodDecodeConfig -> SpectrumConfig)
-> (AntennaDownlinkDemodDecodeConfig
    -> SpectrumConfig -> AntennaDownlinkDemodDecodeConfig)
-> Lens
     AntennaDownlinkDemodDecodeConfig
     AntennaDownlinkDemodDecodeConfig
     SpectrumConfig
     SpectrumConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AntennaDownlinkDemodDecodeConfig' {SpectrumConfig
spectrumConfig :: SpectrumConfig
$sel:spectrumConfig:AntennaDownlinkDemodDecodeConfig' :: AntennaDownlinkDemodDecodeConfig -> SpectrumConfig
spectrumConfig} -> SpectrumConfig
spectrumConfig) (\s :: AntennaDownlinkDemodDecodeConfig
s@AntennaDownlinkDemodDecodeConfig' {} SpectrumConfig
a -> AntennaDownlinkDemodDecodeConfig
s {$sel:spectrumConfig:AntennaDownlinkDemodDecodeConfig' :: SpectrumConfig
spectrumConfig = SpectrumConfig
a} :: AntennaDownlinkDemodDecodeConfig)

instance
  Core.FromJSON
    AntennaDownlinkDemodDecodeConfig
  where
  parseJSON :: Value -> Parser AntennaDownlinkDemodDecodeConfig
parseJSON =
    String
-> (Object -> Parser AntennaDownlinkDemodDecodeConfig)
-> Value
-> Parser AntennaDownlinkDemodDecodeConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AntennaDownlinkDemodDecodeConfig"
      ( \Object
x ->
          DecodeConfig
-> DemodulationConfig
-> SpectrumConfig
-> AntennaDownlinkDemodDecodeConfig
AntennaDownlinkDemodDecodeConfig'
            (DecodeConfig
 -> DemodulationConfig
 -> SpectrumConfig
 -> AntennaDownlinkDemodDecodeConfig)
-> Parser DecodeConfig
-> Parser
     (DemodulationConfig
      -> SpectrumConfig -> AntennaDownlinkDemodDecodeConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser DecodeConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"decodeConfig")
            Parser
  (DemodulationConfig
   -> SpectrumConfig -> AntennaDownlinkDemodDecodeConfig)
-> Parser DemodulationConfig
-> Parser (SpectrumConfig -> AntennaDownlinkDemodDecodeConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DemodulationConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"demodulationConfig")
            Parser (SpectrumConfig -> AntennaDownlinkDemodDecodeConfig)
-> Parser SpectrumConfig -> Parser AntennaDownlinkDemodDecodeConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SpectrumConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"spectrumConfig")
      )

instance
  Prelude.Hashable
    AntennaDownlinkDemodDecodeConfig

instance
  Prelude.NFData
    AntennaDownlinkDemodDecodeConfig

instance Core.ToJSON AntennaDownlinkDemodDecodeConfig where
  toJSON :: AntennaDownlinkDemodDecodeConfig -> Value
toJSON AntennaDownlinkDemodDecodeConfig' {DecodeConfig
DemodulationConfig
SpectrumConfig
spectrumConfig :: SpectrumConfig
demodulationConfig :: DemodulationConfig
decodeConfig :: DecodeConfig
$sel:spectrumConfig:AntennaDownlinkDemodDecodeConfig' :: AntennaDownlinkDemodDecodeConfig -> SpectrumConfig
$sel:demodulationConfig:AntennaDownlinkDemodDecodeConfig' :: AntennaDownlinkDemodDecodeConfig -> DemodulationConfig
$sel:decodeConfig:AntennaDownlinkDemodDecodeConfig' :: AntennaDownlinkDemodDecodeConfig -> DecodeConfig
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"decodeConfig" Text -> DecodeConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DecodeConfig
decodeConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"demodulationConfig" Text -> DemodulationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DemodulationConfig
demodulationConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"spectrumConfig" Text -> SpectrumConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SpectrumConfig
spectrumConfig)
          ]
      )