{-# 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.WcdmaObj
-- 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.WcdmaObj where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types.WcdmaLocalId
import Amazonka.IoTWireless.Types.WcdmaNmrObj
import qualified Amazonka.Prelude as Prelude

-- | WCDMA.
--
-- /See:/ 'newWcdmaObj' smart constructor.
data WcdmaObj = WcdmaObj'
  { -- | Location Area Code.
    WcdmaObj -> Maybe Natural
lac :: Prelude.Maybe Prelude.Natural,
    -- | Path loss, or path attenuation, is the reduction in power density of an
    -- electromagnetic wave as it propagates through space.
    WcdmaObj -> Maybe Natural
pathLoss :: Prelude.Maybe Prelude.Natural,
    -- | Received Signal Code Power (signal power) (dBm).
    WcdmaObj -> Maybe Int
rscp :: Prelude.Maybe Prelude.Int,
    -- | WCDMA local ID information.
    WcdmaObj -> Maybe WcdmaLocalId
wcdmaLocalId :: Prelude.Maybe WcdmaLocalId,
    -- | WCDMA object for network measurement reports.
    WcdmaObj -> Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr :: Prelude.Maybe (Prelude.NonEmpty WcdmaNmrObj),
    -- | Mobile Country Code.
    WcdmaObj -> Natural
mcc :: Prelude.Natural,
    -- | Mobile Network Code.
    WcdmaObj -> Natural
mnc :: Prelude.Natural,
    -- | UTRAN (UMTS Terrestrial Radio Access Network) Cell Global Identifier.
    WcdmaObj -> Natural
utranCid :: Prelude.Natural
  }
  deriving (WcdmaObj -> WcdmaObj -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WcdmaObj -> WcdmaObj -> Bool
$c/= :: WcdmaObj -> WcdmaObj -> Bool
== :: WcdmaObj -> WcdmaObj -> Bool
$c== :: WcdmaObj -> WcdmaObj -> Bool
Prelude.Eq, ReadPrec [WcdmaObj]
ReadPrec WcdmaObj
Int -> ReadS WcdmaObj
ReadS [WcdmaObj]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WcdmaObj]
$creadListPrec :: ReadPrec [WcdmaObj]
readPrec :: ReadPrec WcdmaObj
$creadPrec :: ReadPrec WcdmaObj
readList :: ReadS [WcdmaObj]
$creadList :: ReadS [WcdmaObj]
readsPrec :: Int -> ReadS WcdmaObj
$creadsPrec :: Int -> ReadS WcdmaObj
Prelude.Read, Int -> WcdmaObj -> ShowS
[WcdmaObj] -> ShowS
WcdmaObj -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WcdmaObj] -> ShowS
$cshowList :: [WcdmaObj] -> ShowS
show :: WcdmaObj -> String
$cshow :: WcdmaObj -> String
showsPrec :: Int -> WcdmaObj -> ShowS
$cshowsPrec :: Int -> WcdmaObj -> ShowS
Prelude.Show, forall x. Rep WcdmaObj x -> WcdmaObj
forall x. WcdmaObj -> Rep WcdmaObj x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WcdmaObj x -> WcdmaObj
$cfrom :: forall x. WcdmaObj -> Rep WcdmaObj x
Prelude.Generic)

-- |
-- Create a value of 'WcdmaObj' 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:
--
-- 'lac', 'wcdmaObj_lac' - Location Area Code.
--
-- 'pathLoss', 'wcdmaObj_pathLoss' - Path loss, or path attenuation, is the reduction in power density of an
-- electromagnetic wave as it propagates through space.
--
-- 'rscp', 'wcdmaObj_rscp' - Received Signal Code Power (signal power) (dBm).
--
-- 'wcdmaLocalId', 'wcdmaObj_wcdmaLocalId' - WCDMA local ID information.
--
-- 'wcdmaNmr', 'wcdmaObj_wcdmaNmr' - WCDMA object for network measurement reports.
--
-- 'mcc', 'wcdmaObj_mcc' - Mobile Country Code.
--
-- 'mnc', 'wcdmaObj_mnc' - Mobile Network Code.
--
-- 'utranCid', 'wcdmaObj_utranCid' - UTRAN (UMTS Terrestrial Radio Access Network) Cell Global Identifier.
newWcdmaObj ::
  -- | 'mcc'
  Prelude.Natural ->
  -- | 'mnc'
  Prelude.Natural ->
  -- | 'utranCid'
  Prelude.Natural ->
  WcdmaObj
newWcdmaObj :: Natural -> Natural -> Natural -> WcdmaObj
newWcdmaObj Natural
pMcc_ Natural
pMnc_ Natural
pUtranCid_ =
  WcdmaObj'
    { $sel:lac:WcdmaObj' :: Maybe Natural
lac = forall a. Maybe a
Prelude.Nothing,
      $sel:pathLoss:WcdmaObj' :: Maybe Natural
pathLoss = forall a. Maybe a
Prelude.Nothing,
      $sel:rscp:WcdmaObj' :: Maybe Int
rscp = forall a. Maybe a
Prelude.Nothing,
      $sel:wcdmaLocalId:WcdmaObj' :: Maybe WcdmaLocalId
wcdmaLocalId = forall a. Maybe a
Prelude.Nothing,
      $sel:wcdmaNmr:WcdmaObj' :: Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr = forall a. Maybe a
Prelude.Nothing,
      $sel:mcc:WcdmaObj' :: Natural
mcc = Natural
pMcc_,
      $sel:mnc:WcdmaObj' :: Natural
mnc = Natural
pMnc_,
      $sel:utranCid:WcdmaObj' :: Natural
utranCid = Natural
pUtranCid_
    }

-- | Location Area Code.
wcdmaObj_lac :: Lens.Lens' WcdmaObj (Prelude.Maybe Prelude.Natural)
wcdmaObj_lac :: Lens' WcdmaObj (Maybe Natural)
wcdmaObj_lac = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Maybe Natural
lac :: Maybe Natural
$sel:lac:WcdmaObj' :: WcdmaObj -> Maybe Natural
lac} -> Maybe Natural
lac) (\s :: WcdmaObj
s@WcdmaObj' {} Maybe Natural
a -> WcdmaObj
s {$sel:lac:WcdmaObj' :: Maybe Natural
lac = Maybe Natural
a} :: WcdmaObj)

-- | Path loss, or path attenuation, is the reduction in power density of an
-- electromagnetic wave as it propagates through space.
wcdmaObj_pathLoss :: Lens.Lens' WcdmaObj (Prelude.Maybe Prelude.Natural)
wcdmaObj_pathLoss :: Lens' WcdmaObj (Maybe Natural)
wcdmaObj_pathLoss = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Maybe Natural
pathLoss :: Maybe Natural
$sel:pathLoss:WcdmaObj' :: WcdmaObj -> Maybe Natural
pathLoss} -> Maybe Natural
pathLoss) (\s :: WcdmaObj
s@WcdmaObj' {} Maybe Natural
a -> WcdmaObj
s {$sel:pathLoss:WcdmaObj' :: Maybe Natural
pathLoss = Maybe Natural
a} :: WcdmaObj)

-- | Received Signal Code Power (signal power) (dBm).
wcdmaObj_rscp :: Lens.Lens' WcdmaObj (Prelude.Maybe Prelude.Int)
wcdmaObj_rscp :: Lens' WcdmaObj (Maybe Int)
wcdmaObj_rscp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Maybe Int
rscp :: Maybe Int
$sel:rscp:WcdmaObj' :: WcdmaObj -> Maybe Int
rscp} -> Maybe Int
rscp) (\s :: WcdmaObj
s@WcdmaObj' {} Maybe Int
a -> WcdmaObj
s {$sel:rscp:WcdmaObj' :: Maybe Int
rscp = Maybe Int
a} :: WcdmaObj)

-- | WCDMA local ID information.
wcdmaObj_wcdmaLocalId :: Lens.Lens' WcdmaObj (Prelude.Maybe WcdmaLocalId)
wcdmaObj_wcdmaLocalId :: Lens' WcdmaObj (Maybe WcdmaLocalId)
wcdmaObj_wcdmaLocalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Maybe WcdmaLocalId
wcdmaLocalId :: Maybe WcdmaLocalId
$sel:wcdmaLocalId:WcdmaObj' :: WcdmaObj -> Maybe WcdmaLocalId
wcdmaLocalId} -> Maybe WcdmaLocalId
wcdmaLocalId) (\s :: WcdmaObj
s@WcdmaObj' {} Maybe WcdmaLocalId
a -> WcdmaObj
s {$sel:wcdmaLocalId:WcdmaObj' :: Maybe WcdmaLocalId
wcdmaLocalId = Maybe WcdmaLocalId
a} :: WcdmaObj)

-- | WCDMA object for network measurement reports.
wcdmaObj_wcdmaNmr :: Lens.Lens' WcdmaObj (Prelude.Maybe (Prelude.NonEmpty WcdmaNmrObj))
wcdmaObj_wcdmaNmr :: Lens' WcdmaObj (Maybe (NonEmpty WcdmaNmrObj))
wcdmaObj_wcdmaNmr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr :: Maybe (NonEmpty WcdmaNmrObj)
$sel:wcdmaNmr:WcdmaObj' :: WcdmaObj -> Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr} -> Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr) (\s :: WcdmaObj
s@WcdmaObj' {} Maybe (NonEmpty WcdmaNmrObj)
a -> WcdmaObj
s {$sel:wcdmaNmr:WcdmaObj' :: Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr = Maybe (NonEmpty WcdmaNmrObj)
a} :: WcdmaObj) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Mobile Country Code.
wcdmaObj_mcc :: Lens.Lens' WcdmaObj Prelude.Natural
wcdmaObj_mcc :: Lens' WcdmaObj Natural
wcdmaObj_mcc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Natural
mcc :: Natural
$sel:mcc:WcdmaObj' :: WcdmaObj -> Natural
mcc} -> Natural
mcc) (\s :: WcdmaObj
s@WcdmaObj' {} Natural
a -> WcdmaObj
s {$sel:mcc:WcdmaObj' :: Natural
mcc = Natural
a} :: WcdmaObj)

-- | Mobile Network Code.
wcdmaObj_mnc :: Lens.Lens' WcdmaObj Prelude.Natural
wcdmaObj_mnc :: Lens' WcdmaObj Natural
wcdmaObj_mnc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Natural
mnc :: Natural
$sel:mnc:WcdmaObj' :: WcdmaObj -> Natural
mnc} -> Natural
mnc) (\s :: WcdmaObj
s@WcdmaObj' {} Natural
a -> WcdmaObj
s {$sel:mnc:WcdmaObj' :: Natural
mnc = Natural
a} :: WcdmaObj)

-- | UTRAN (UMTS Terrestrial Radio Access Network) Cell Global Identifier.
wcdmaObj_utranCid :: Lens.Lens' WcdmaObj Prelude.Natural
wcdmaObj_utranCid :: Lens' WcdmaObj Natural
wcdmaObj_utranCid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WcdmaObj' {Natural
utranCid :: Natural
$sel:utranCid:WcdmaObj' :: WcdmaObj -> Natural
utranCid} -> Natural
utranCid) (\s :: WcdmaObj
s@WcdmaObj' {} Natural
a -> WcdmaObj
s {$sel:utranCid:WcdmaObj' :: Natural
utranCid = Natural
a} :: WcdmaObj)

instance Prelude.Hashable WcdmaObj where
  hashWithSalt :: Int -> WcdmaObj -> Int
hashWithSalt Int
_salt WcdmaObj' {Natural
Maybe Int
Maybe Natural
Maybe (NonEmpty WcdmaNmrObj)
Maybe WcdmaLocalId
utranCid :: Natural
mnc :: Natural
mcc :: Natural
wcdmaNmr :: Maybe (NonEmpty WcdmaNmrObj)
wcdmaLocalId :: Maybe WcdmaLocalId
rscp :: Maybe Int
pathLoss :: Maybe Natural
lac :: Maybe Natural
$sel:utranCid:WcdmaObj' :: WcdmaObj -> Natural
$sel:mnc:WcdmaObj' :: WcdmaObj -> Natural
$sel:mcc:WcdmaObj' :: WcdmaObj -> Natural
$sel:wcdmaNmr:WcdmaObj' :: WcdmaObj -> Maybe (NonEmpty WcdmaNmrObj)
$sel:wcdmaLocalId:WcdmaObj' :: WcdmaObj -> Maybe WcdmaLocalId
$sel:rscp:WcdmaObj' :: WcdmaObj -> Maybe Int
$sel:pathLoss:WcdmaObj' :: WcdmaObj -> Maybe Natural
$sel:lac:WcdmaObj' :: WcdmaObj -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
lac
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pathLoss
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
rscp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WcdmaLocalId
wcdmaLocalId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
mcc
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
mnc
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
utranCid

instance Prelude.NFData WcdmaObj where
  rnf :: WcdmaObj -> ()
rnf WcdmaObj' {Natural
Maybe Int
Maybe Natural
Maybe (NonEmpty WcdmaNmrObj)
Maybe WcdmaLocalId
utranCid :: Natural
mnc :: Natural
mcc :: Natural
wcdmaNmr :: Maybe (NonEmpty WcdmaNmrObj)
wcdmaLocalId :: Maybe WcdmaLocalId
rscp :: Maybe Int
pathLoss :: Maybe Natural
lac :: Maybe Natural
$sel:utranCid:WcdmaObj' :: WcdmaObj -> Natural
$sel:mnc:WcdmaObj' :: WcdmaObj -> Natural
$sel:mcc:WcdmaObj' :: WcdmaObj -> Natural
$sel:wcdmaNmr:WcdmaObj' :: WcdmaObj -> Maybe (NonEmpty WcdmaNmrObj)
$sel:wcdmaLocalId:WcdmaObj' :: WcdmaObj -> Maybe WcdmaLocalId
$sel:rscp:WcdmaObj' :: WcdmaObj -> Maybe Int
$sel:pathLoss:WcdmaObj' :: WcdmaObj -> Maybe Natural
$sel:lac:WcdmaObj' :: WcdmaObj -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
lac
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pathLoss
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
rscp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WcdmaLocalId
wcdmaLocalId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty WcdmaNmrObj)
wcdmaNmr
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
mcc
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
mnc
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
utranCid

instance Data.ToJSON WcdmaObj where
  toJSON :: WcdmaObj -> Value
toJSON WcdmaObj' {Natural
Maybe Int
Maybe Natural
Maybe (NonEmpty WcdmaNmrObj)
Maybe WcdmaLocalId
utranCid :: Natural
mnc :: Natural
mcc :: Natural
wcdmaNmr :: Maybe (NonEmpty WcdmaNmrObj)
wcdmaLocalId :: Maybe WcdmaLocalId
rscp :: Maybe Int
pathLoss :: Maybe Natural
lac :: Maybe Natural
$sel:utranCid:WcdmaObj' :: WcdmaObj -> Natural
$sel:mnc:WcdmaObj' :: WcdmaObj -> Natural
$sel:mcc:WcdmaObj' :: WcdmaObj -> Natural
$sel:wcdmaNmr:WcdmaObj' :: WcdmaObj -> Maybe (NonEmpty WcdmaNmrObj)
$sel:wcdmaLocalId:WcdmaObj' :: WcdmaObj -> Maybe WcdmaLocalId
$sel:rscp:WcdmaObj' :: WcdmaObj -> Maybe Int
$sel:pathLoss:WcdmaObj' :: WcdmaObj -> Maybe Natural
$sel:lac:WcdmaObj' :: WcdmaObj -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Lac" 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
lac,
            (Key
"PathLoss" 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
pathLoss,
            (Key
"Rscp" 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
rscp,
            (Key
"WcdmaLocalId" 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 WcdmaLocalId
wcdmaLocalId,
            (Key
"WcdmaNmr" 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 (NonEmpty WcdmaNmrObj)
wcdmaNmr,
            forall a. a -> Maybe a
Prelude.Just (Key
"Mcc" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
mcc),
            forall a. a -> Maybe a
Prelude.Just (Key
"Mnc" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
mnc),
            forall a. a -> Maybe a
Prelude.Just (Key
"UtranCid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
utranCid)
          ]
      )