{-# 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.CdmaLocalId
-- 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.CdmaLocalId 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 local ID information, which corresponds to the local identification
-- parameters of a CDMA cell.
--
-- /See:/ 'newCdmaLocalId' smart constructor.
data CdmaLocalId = CdmaLocalId'
  { -- | Pseudo-noise offset, which is a characteristic of the signal from a cell
    -- on a radio tower.
    CdmaLocalId -> Natural
pnOffset :: Prelude.Natural,
    -- | CDMA channel information.
    CdmaLocalId -> Natural
cdmaChannel :: Prelude.Natural
  }
  deriving (CdmaLocalId -> CdmaLocalId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CdmaLocalId -> CdmaLocalId -> Bool
$c/= :: CdmaLocalId -> CdmaLocalId -> Bool
== :: CdmaLocalId -> CdmaLocalId -> Bool
$c== :: CdmaLocalId -> CdmaLocalId -> Bool
Prelude.Eq, ReadPrec [CdmaLocalId]
ReadPrec CdmaLocalId
Int -> ReadS CdmaLocalId
ReadS [CdmaLocalId]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CdmaLocalId]
$creadListPrec :: ReadPrec [CdmaLocalId]
readPrec :: ReadPrec CdmaLocalId
$creadPrec :: ReadPrec CdmaLocalId
readList :: ReadS [CdmaLocalId]
$creadList :: ReadS [CdmaLocalId]
readsPrec :: Int -> ReadS CdmaLocalId
$creadsPrec :: Int -> ReadS CdmaLocalId
Prelude.Read, Int -> CdmaLocalId -> ShowS
[CdmaLocalId] -> ShowS
CdmaLocalId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CdmaLocalId] -> ShowS
$cshowList :: [CdmaLocalId] -> ShowS
show :: CdmaLocalId -> String
$cshow :: CdmaLocalId -> String
showsPrec :: Int -> CdmaLocalId -> ShowS
$cshowsPrec :: Int -> CdmaLocalId -> ShowS
Prelude.Show, forall x. Rep CdmaLocalId x -> CdmaLocalId
forall x. CdmaLocalId -> Rep CdmaLocalId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CdmaLocalId x -> CdmaLocalId
$cfrom :: forall x. CdmaLocalId -> Rep CdmaLocalId x
Prelude.Generic)

-- |
-- Create a value of 'CdmaLocalId' 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:
--
-- 'pnOffset', 'cdmaLocalId_pnOffset' - Pseudo-noise offset, which is a characteristic of the signal from a cell
-- on a radio tower.
--
-- 'cdmaChannel', 'cdmaLocalId_cdmaChannel' - CDMA channel information.
newCdmaLocalId ::
  -- | 'pnOffset'
  Prelude.Natural ->
  -- | 'cdmaChannel'
  Prelude.Natural ->
  CdmaLocalId
newCdmaLocalId :: Natural -> Natural -> CdmaLocalId
newCdmaLocalId Natural
pPnOffset_ Natural
pCdmaChannel_ =
  CdmaLocalId'
    { $sel:pnOffset:CdmaLocalId' :: Natural
pnOffset = Natural
pPnOffset_,
      $sel:cdmaChannel:CdmaLocalId' :: Natural
cdmaChannel = Natural
pCdmaChannel_
    }

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

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

instance Prelude.Hashable CdmaLocalId where
  hashWithSalt :: Int -> CdmaLocalId -> Int
hashWithSalt Int
_salt CdmaLocalId' {Natural
cdmaChannel :: Natural
pnOffset :: Natural
$sel:cdmaChannel:CdmaLocalId' :: CdmaLocalId -> Natural
$sel:pnOffset:CdmaLocalId' :: CdmaLocalId -> Natural
..} =
    Int
_salt
      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 CdmaLocalId where
  rnf :: CdmaLocalId -> ()
rnf CdmaLocalId' {Natural
cdmaChannel :: Natural
pnOffset :: Natural
$sel:cdmaChannel:CdmaLocalId' :: CdmaLocalId -> Natural
$sel:pnOffset:CdmaLocalId' :: CdmaLocalId -> Natural
..} =
    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 CdmaLocalId where
  toJSON :: CdmaLocalId -> Value
toJSON CdmaLocalId' {Natural
cdmaChannel :: Natural
pnOffset :: Natural
$sel:cdmaChannel:CdmaLocalId' :: CdmaLocalId -> Natural
$sel:pnOffset:CdmaLocalId' :: CdmaLocalId -> Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ 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)
          ]
      )