{-# 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 #-}
module Amazonka.IoTWireless.Types.GsmNmrObj 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.GlobalIdentity
import qualified Amazonka.Prelude as Prelude
data GsmNmrObj = GsmNmrObj'
{
GsmNmrObj -> Maybe GlobalIdentity
globalIdentity :: Prelude.Maybe GlobalIdentity,
GsmNmrObj -> Maybe Int
rxLevel :: Prelude.Maybe Prelude.Int,
GsmNmrObj -> Natural
bsic :: Prelude.Natural,
GsmNmrObj -> Natural
bcch :: Prelude.Natural
}
deriving (GsmNmrObj -> GsmNmrObj -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GsmNmrObj -> GsmNmrObj -> Bool
$c/= :: GsmNmrObj -> GsmNmrObj -> Bool
== :: GsmNmrObj -> GsmNmrObj -> Bool
$c== :: GsmNmrObj -> GsmNmrObj -> Bool
Prelude.Eq, ReadPrec [GsmNmrObj]
ReadPrec GsmNmrObj
Int -> ReadS GsmNmrObj
ReadS [GsmNmrObj]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GsmNmrObj]
$creadListPrec :: ReadPrec [GsmNmrObj]
readPrec :: ReadPrec GsmNmrObj
$creadPrec :: ReadPrec GsmNmrObj
readList :: ReadS [GsmNmrObj]
$creadList :: ReadS [GsmNmrObj]
readsPrec :: Int -> ReadS GsmNmrObj
$creadsPrec :: Int -> ReadS GsmNmrObj
Prelude.Read, Int -> GsmNmrObj -> ShowS
[GsmNmrObj] -> ShowS
GsmNmrObj -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GsmNmrObj] -> ShowS
$cshowList :: [GsmNmrObj] -> ShowS
show :: GsmNmrObj -> String
$cshow :: GsmNmrObj -> String
showsPrec :: Int -> GsmNmrObj -> ShowS
$cshowsPrec :: Int -> GsmNmrObj -> ShowS
Prelude.Show, forall x. Rep GsmNmrObj x -> GsmNmrObj
forall x. GsmNmrObj -> Rep GsmNmrObj x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GsmNmrObj x -> GsmNmrObj
$cfrom :: forall x. GsmNmrObj -> Rep GsmNmrObj x
Prelude.Generic)
newGsmNmrObj ::
Prelude.Natural ->
Prelude.Natural ->
GsmNmrObj
newGsmNmrObj :: Natural -> Natural -> GsmNmrObj
newGsmNmrObj Natural
pBsic_ Natural
pBcch_ =
GsmNmrObj'
{ $sel:globalIdentity:GsmNmrObj' :: Maybe GlobalIdentity
globalIdentity = forall a. Maybe a
Prelude.Nothing,
$sel:rxLevel:GsmNmrObj' :: Maybe Int
rxLevel = forall a. Maybe a
Prelude.Nothing,
$sel:bsic:GsmNmrObj' :: Natural
bsic = Natural
pBsic_,
$sel:bcch:GsmNmrObj' :: Natural
bcch = Natural
pBcch_
}
gsmNmrObj_globalIdentity :: Lens.Lens' GsmNmrObj (Prelude.Maybe GlobalIdentity)
gsmNmrObj_globalIdentity :: Lens' GsmNmrObj (Maybe GlobalIdentity)
gsmNmrObj_globalIdentity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GsmNmrObj' {Maybe GlobalIdentity
globalIdentity :: Maybe GlobalIdentity
$sel:globalIdentity:GsmNmrObj' :: GsmNmrObj -> Maybe GlobalIdentity
globalIdentity} -> Maybe GlobalIdentity
globalIdentity) (\s :: GsmNmrObj
s@GsmNmrObj' {} Maybe GlobalIdentity
a -> GsmNmrObj
s {$sel:globalIdentity:GsmNmrObj' :: Maybe GlobalIdentity
globalIdentity = Maybe GlobalIdentity
a} :: GsmNmrObj)
gsmNmrObj_rxLevel :: Lens.Lens' GsmNmrObj (Prelude.Maybe Prelude.Int)
gsmNmrObj_rxLevel :: Lens' GsmNmrObj (Maybe Int)
gsmNmrObj_rxLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GsmNmrObj' {Maybe Int
rxLevel :: Maybe Int
$sel:rxLevel:GsmNmrObj' :: GsmNmrObj -> Maybe Int
rxLevel} -> Maybe Int
rxLevel) (\s :: GsmNmrObj
s@GsmNmrObj' {} Maybe Int
a -> GsmNmrObj
s {$sel:rxLevel:GsmNmrObj' :: Maybe Int
rxLevel = Maybe Int
a} :: GsmNmrObj)
gsmNmrObj_bsic :: Lens.Lens' GsmNmrObj Prelude.Natural
gsmNmrObj_bsic :: Lens' GsmNmrObj Natural
gsmNmrObj_bsic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GsmNmrObj' {Natural
bsic :: Natural
$sel:bsic:GsmNmrObj' :: GsmNmrObj -> Natural
bsic} -> Natural
bsic) (\s :: GsmNmrObj
s@GsmNmrObj' {} Natural
a -> GsmNmrObj
s {$sel:bsic:GsmNmrObj' :: Natural
bsic = Natural
a} :: GsmNmrObj)
gsmNmrObj_bcch :: Lens.Lens' GsmNmrObj Prelude.Natural
gsmNmrObj_bcch :: Lens' GsmNmrObj Natural
gsmNmrObj_bcch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GsmNmrObj' {Natural
bcch :: Natural
$sel:bcch:GsmNmrObj' :: GsmNmrObj -> Natural
bcch} -> Natural
bcch) (\s :: GsmNmrObj
s@GsmNmrObj' {} Natural
a -> GsmNmrObj
s {$sel:bcch:GsmNmrObj' :: Natural
bcch = Natural
a} :: GsmNmrObj)
instance Prelude.Hashable GsmNmrObj where
hashWithSalt :: Int -> GsmNmrObj -> Int
hashWithSalt Int
_salt GsmNmrObj' {Natural
Maybe Int
Maybe GlobalIdentity
bcch :: Natural
bsic :: Natural
rxLevel :: Maybe Int
globalIdentity :: Maybe GlobalIdentity
$sel:bcch:GsmNmrObj' :: GsmNmrObj -> Natural
$sel:bsic:GsmNmrObj' :: GsmNmrObj -> Natural
$sel:rxLevel:GsmNmrObj' :: GsmNmrObj -> Maybe Int
$sel:globalIdentity:GsmNmrObj' :: GsmNmrObj -> Maybe GlobalIdentity
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GlobalIdentity
globalIdentity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
rxLevel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
bsic
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
bcch
instance Prelude.NFData GsmNmrObj where
rnf :: GsmNmrObj -> ()
rnf GsmNmrObj' {Natural
Maybe Int
Maybe GlobalIdentity
bcch :: Natural
bsic :: Natural
rxLevel :: Maybe Int
globalIdentity :: Maybe GlobalIdentity
$sel:bcch:GsmNmrObj' :: GsmNmrObj -> Natural
$sel:bsic:GsmNmrObj' :: GsmNmrObj -> Natural
$sel:rxLevel:GsmNmrObj' :: GsmNmrObj -> Maybe Int
$sel:globalIdentity:GsmNmrObj' :: GsmNmrObj -> Maybe GlobalIdentity
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe GlobalIdentity
globalIdentity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
rxLevel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
bsic
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
bcch
instance Data.ToJSON GsmNmrObj where
toJSON :: GsmNmrObj -> Value
toJSON GsmNmrObj' {Natural
Maybe Int
Maybe GlobalIdentity
bcch :: Natural
bsic :: Natural
rxLevel :: Maybe Int
globalIdentity :: Maybe GlobalIdentity
$sel:bcch:GsmNmrObj' :: GsmNmrObj -> Natural
$sel:bsic:GsmNmrObj' :: GsmNmrObj -> Natural
$sel:rxLevel:GsmNmrObj' :: GsmNmrObj -> Maybe Int
$sel:globalIdentity:GsmNmrObj' :: GsmNmrObj -> Maybe GlobalIdentity
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"GlobalIdentity" 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 GlobalIdentity
globalIdentity,
(Key
"RxLevel" 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
rxLevel,
forall a. a -> Maybe a
Prelude.Just (Key
"Bsic" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
bsic),
forall a. a -> Maybe a
Prelude.Just (Key
"Bcch" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
bcch)
]
)