{-# 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.IoTWireless.Types.CdmaNmrObj
-- 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.IoTWireless.Types.CdmaNmrObj where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | CDMA object for network measurement reports.
--
-- /See:/ 'newCdmaNmrObj' smart constructor.
data CdmaNmrObj = CdmaNmrObj'
  { -- | CDMA base station ID (BSID).
    CdmaNmrObj -> Maybe Natural
baseStationId :: Prelude.Maybe Prelude.Natural,
    -- | Transmit power level of the pilot signal, measured in dBm
    -- (decibel-milliwatts).
    CdmaNmrObj -> Maybe Int
pilotPower :: Prelude.Maybe Prelude.Int,
    -- | Pseudo-noise offset, which is a characteristic of the signal from a cell
    -- on a radio tower.
    CdmaNmrObj -> Natural
pnOffset :: Prelude.Natural,
    -- | CDMA channel information.
    CdmaNmrObj -> Natural
cdmaChannel :: Prelude.Natural
  }
  deriving (CdmaNmrObj -> CdmaNmrObj -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CdmaNmrObj -> CdmaNmrObj -> Bool
$c/= :: CdmaNmrObj -> CdmaNmrObj -> Bool
== :: CdmaNmrObj -> CdmaNmrObj -> Bool
$c== :: CdmaNmrObj -> CdmaNmrObj -> Bool
Prelude.Eq, ReadPrec [CdmaNmrObj]
ReadPrec CdmaNmrObj
Int -> ReadS CdmaNmrObj
ReadS [CdmaNmrObj]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CdmaNmrObj]
$creadListPrec :: ReadPrec [CdmaNmrObj]
readPrec :: ReadPrec CdmaNmrObj
$creadPrec :: ReadPrec CdmaNmrObj
readList :: ReadS [CdmaNmrObj]
$creadList :: ReadS [CdmaNmrObj]
readsPrec :: Int -> ReadS CdmaNmrObj
$creadsPrec :: Int -> ReadS CdmaNmrObj
Prelude.Read, Int -> CdmaNmrObj -> ShowS
[CdmaNmrObj] -> ShowS
CdmaNmrObj -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CdmaNmrObj] -> ShowS
$cshowList :: [CdmaNmrObj] -> ShowS
show :: CdmaNmrObj -> String
$cshow :: CdmaNmrObj -> String
showsPrec :: Int -> CdmaNmrObj -> ShowS
$cshowsPrec :: Int -> CdmaNmrObj -> ShowS
Prelude.Show, forall x. Rep CdmaNmrObj x -> CdmaNmrObj
forall x. CdmaNmrObj -> Rep CdmaNmrObj x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CdmaNmrObj x -> CdmaNmrObj
$cfrom :: forall x. CdmaNmrObj -> Rep CdmaNmrObj x
Prelude.Generic)

-- |
-- Create a value of 'CdmaNmrObj' 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:
--
-- 'baseStationId', 'cdmaNmrObj_baseStationId' - CDMA base station ID (BSID).
--
-- 'pilotPower', 'cdmaNmrObj_pilotPower' - Transmit power level of the pilot signal, measured in dBm
-- (decibel-milliwatts).
--
-- 'pnOffset', 'cdmaNmrObj_pnOffset' - Pseudo-noise offset, which is a characteristic of the signal from a cell
-- on a radio tower.
--
-- 'cdmaChannel', 'cdmaNmrObj_cdmaChannel' - CDMA channel information.
newCdmaNmrObj ::
  -- | 'pnOffset'
  Prelude.Natural ->
  -- | 'cdmaChannel'
  Prelude.Natural ->
  CdmaNmrObj
newCdmaNmrObj :: Natural -> Natural -> CdmaNmrObj
newCdmaNmrObj Natural
pPnOffset_ Natural
pCdmaChannel_ =
  CdmaNmrObj'
    { $sel:baseStationId:CdmaNmrObj' :: Maybe Natural
baseStationId = forall a. Maybe a
Prelude.Nothing,
      $sel:pilotPower:CdmaNmrObj' :: Maybe Int
pilotPower = forall a. Maybe a
Prelude.Nothing,
      $sel:pnOffset:CdmaNmrObj' :: Natural
pnOffset = Natural
pPnOffset_,
      $sel:cdmaChannel:CdmaNmrObj' :: Natural
cdmaChannel = Natural
pCdmaChannel_
    }

-- | CDMA base station ID (BSID).
cdmaNmrObj_baseStationId :: Lens.Lens' CdmaNmrObj (Prelude.Maybe Prelude.Natural)
cdmaNmrObj_baseStationId :: Lens' CdmaNmrObj (Maybe Natural)
cdmaNmrObj_baseStationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CdmaNmrObj' {Maybe Natural
baseStationId :: Maybe Natural
$sel:baseStationId:CdmaNmrObj' :: CdmaNmrObj -> Maybe Natural
baseStationId} -> Maybe Natural
baseStationId) (\s :: CdmaNmrObj
s@CdmaNmrObj' {} Maybe Natural
a -> CdmaNmrObj
s {$sel:baseStationId:CdmaNmrObj' :: Maybe Natural
baseStationId = Maybe Natural
a} :: CdmaNmrObj)

-- | Transmit power level of the pilot signal, measured in dBm
-- (decibel-milliwatts).
cdmaNmrObj_pilotPower :: Lens.Lens' CdmaNmrObj (Prelude.Maybe Prelude.Int)
cdmaNmrObj_pilotPower :: Lens' CdmaNmrObj (Maybe Int)
cdmaNmrObj_pilotPower = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CdmaNmrObj' {Maybe Int
pilotPower :: Maybe Int
$sel:pilotPower:CdmaNmrObj' :: CdmaNmrObj -> Maybe Int
pilotPower} -> Maybe Int
pilotPower) (\s :: CdmaNmrObj
s@CdmaNmrObj' {} Maybe Int
a -> CdmaNmrObj
s {$sel:pilotPower:CdmaNmrObj' :: Maybe Int
pilotPower = Maybe Int
a} :: CdmaNmrObj)

-- | Pseudo-noise offset, which is a characteristic of the signal from a cell
-- on a radio tower.
cdmaNmrObj_pnOffset :: Lens.Lens' CdmaNmrObj Prelude.Natural
cdmaNmrObj_pnOffset :: Lens' CdmaNmrObj Natural
cdmaNmrObj_pnOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CdmaNmrObj' {Natural
pnOffset :: Natural
$sel:pnOffset:CdmaNmrObj' :: CdmaNmrObj -> Natural
pnOffset} -> Natural
pnOffset) (\s :: CdmaNmrObj
s@CdmaNmrObj' {} Natural
a -> CdmaNmrObj
s {$sel:pnOffset:CdmaNmrObj' :: Natural
pnOffset = Natural
a} :: CdmaNmrObj)

-- | CDMA channel information.
cdmaNmrObj_cdmaChannel :: Lens.Lens' CdmaNmrObj Prelude.Natural
cdmaNmrObj_cdmaChannel :: Lens' CdmaNmrObj Natural
cdmaNmrObj_cdmaChannel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CdmaNmrObj' {Natural
cdmaChannel :: Natural
$sel:cdmaChannel:CdmaNmrObj' :: CdmaNmrObj -> Natural
cdmaChannel} -> Natural
cdmaChannel) (\s :: CdmaNmrObj
s@CdmaNmrObj' {} Natural
a -> CdmaNmrObj
s {$sel:cdmaChannel:CdmaNmrObj' :: Natural
cdmaChannel = Natural
a} :: CdmaNmrObj)

instance Prelude.Hashable CdmaNmrObj where
  hashWithSalt :: Int -> CdmaNmrObj -> Int
hashWithSalt Int
_salt CdmaNmrObj' {Natural
Maybe Int
Maybe Natural
cdmaChannel :: Natural
pnOffset :: Natural
pilotPower :: Maybe Int
baseStationId :: Maybe Natural
$sel:cdmaChannel:CdmaNmrObj' :: CdmaNmrObj -> Natural
$sel:pnOffset:CdmaNmrObj' :: CdmaNmrObj -> Natural
$sel:pilotPower:CdmaNmrObj' :: CdmaNmrObj -> Maybe Int
$sel:baseStationId:CdmaNmrObj' :: CdmaNmrObj -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
baseStationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
pilotPower
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
pnOffset
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
cdmaChannel

instance Prelude.NFData CdmaNmrObj where
  rnf :: CdmaNmrObj -> ()
rnf CdmaNmrObj' {Natural
Maybe Int
Maybe Natural
cdmaChannel :: Natural
pnOffset :: Natural
pilotPower :: Maybe Int
baseStationId :: Maybe Natural
$sel:cdmaChannel:CdmaNmrObj' :: CdmaNmrObj -> Natural
$sel:pnOffset:CdmaNmrObj' :: CdmaNmrObj -> Natural
$sel:pilotPower:CdmaNmrObj' :: CdmaNmrObj -> Maybe Int
$sel:baseStationId:CdmaNmrObj' :: CdmaNmrObj -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
baseStationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
pilotPower
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
pnOffset
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
cdmaChannel

instance Data.ToJSON CdmaNmrObj where
  toJSON :: CdmaNmrObj -> Value
toJSON CdmaNmrObj' {Natural
Maybe Int
Maybe Natural
cdmaChannel :: Natural
pnOffset :: Natural
pilotPower :: Maybe Int
baseStationId :: Maybe Natural
$sel:cdmaChannel:CdmaNmrObj' :: CdmaNmrObj -> Natural
$sel:pnOffset:CdmaNmrObj' :: CdmaNmrObj -> Natural
$sel:pilotPower:CdmaNmrObj' :: CdmaNmrObj -> Maybe Int
$sel:baseStationId:CdmaNmrObj' :: CdmaNmrObj -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"BaseStationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
baseStationId,
            (Key
"PilotPower" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
pilotPower,
            forall a. a -> Maybe a
Prelude.Just (Key
"PnOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
pnOffset),
            forall a. a -> Maybe a
Prelude.Just (Key
"CdmaChannel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
cdmaChannel)
          ]
      )