{-# 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.GlobalIdentity
-- 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.GlobalIdentity 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

-- | Global identity information.
--
-- /See:/ 'newGlobalIdentity' smart constructor.
data GlobalIdentity = GlobalIdentity'
  { -- | Location area code of the global identity.
    GlobalIdentity -> Natural
lac :: Prelude.Natural,
    -- | GERAN (GSM EDGE Radio Access Network) cell global identifier.
    GlobalIdentity -> Natural
geranCid :: Prelude.Natural
  }
  deriving (GlobalIdentity -> GlobalIdentity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalIdentity -> GlobalIdentity -> Bool
$c/= :: GlobalIdentity -> GlobalIdentity -> Bool
== :: GlobalIdentity -> GlobalIdentity -> Bool
$c== :: GlobalIdentity -> GlobalIdentity -> Bool
Prelude.Eq, ReadPrec [GlobalIdentity]
ReadPrec GlobalIdentity
Int -> ReadS GlobalIdentity
ReadS [GlobalIdentity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlobalIdentity]
$creadListPrec :: ReadPrec [GlobalIdentity]
readPrec :: ReadPrec GlobalIdentity
$creadPrec :: ReadPrec GlobalIdentity
readList :: ReadS [GlobalIdentity]
$creadList :: ReadS [GlobalIdentity]
readsPrec :: Int -> ReadS GlobalIdentity
$creadsPrec :: Int -> ReadS GlobalIdentity
Prelude.Read, Int -> GlobalIdentity -> ShowS
[GlobalIdentity] -> ShowS
GlobalIdentity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalIdentity] -> ShowS
$cshowList :: [GlobalIdentity] -> ShowS
show :: GlobalIdentity -> String
$cshow :: GlobalIdentity -> String
showsPrec :: Int -> GlobalIdentity -> ShowS
$cshowsPrec :: Int -> GlobalIdentity -> ShowS
Prelude.Show, forall x. Rep GlobalIdentity x -> GlobalIdentity
forall x. GlobalIdentity -> Rep GlobalIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GlobalIdentity x -> GlobalIdentity
$cfrom :: forall x. GlobalIdentity -> Rep GlobalIdentity x
Prelude.Generic)

-- |
-- Create a value of 'GlobalIdentity' 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', 'globalIdentity_lac' - Location area code of the global identity.
--
-- 'geranCid', 'globalIdentity_geranCid' - GERAN (GSM EDGE Radio Access Network) cell global identifier.
newGlobalIdentity ::
  -- | 'lac'
  Prelude.Natural ->
  -- | 'geranCid'
  Prelude.Natural ->
  GlobalIdentity
newGlobalIdentity :: Natural -> Natural -> GlobalIdentity
newGlobalIdentity Natural
pLac_ Natural
pGeranCid_ =
  GlobalIdentity' {$sel:lac:GlobalIdentity' :: Natural
lac = Natural
pLac_, $sel:geranCid:GlobalIdentity' :: Natural
geranCid = Natural
pGeranCid_}

-- | Location area code of the global identity.
globalIdentity_lac :: Lens.Lens' GlobalIdentity Prelude.Natural
globalIdentity_lac :: Lens' GlobalIdentity Natural
globalIdentity_lac = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalIdentity' {Natural
lac :: Natural
$sel:lac:GlobalIdentity' :: GlobalIdentity -> Natural
lac} -> Natural
lac) (\s :: GlobalIdentity
s@GlobalIdentity' {} Natural
a -> GlobalIdentity
s {$sel:lac:GlobalIdentity' :: Natural
lac = Natural
a} :: GlobalIdentity)

-- | GERAN (GSM EDGE Radio Access Network) cell global identifier.
globalIdentity_geranCid :: Lens.Lens' GlobalIdentity Prelude.Natural
globalIdentity_geranCid :: Lens' GlobalIdentity Natural
globalIdentity_geranCid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalIdentity' {Natural
geranCid :: Natural
$sel:geranCid:GlobalIdentity' :: GlobalIdentity -> Natural
geranCid} -> Natural
geranCid) (\s :: GlobalIdentity
s@GlobalIdentity' {} Natural
a -> GlobalIdentity
s {$sel:geranCid:GlobalIdentity' :: Natural
geranCid = Natural
a} :: GlobalIdentity)

instance Prelude.Hashable GlobalIdentity where
  hashWithSalt :: Int -> GlobalIdentity -> Int
hashWithSalt Int
_salt GlobalIdentity' {Natural
geranCid :: Natural
lac :: Natural
$sel:geranCid:GlobalIdentity' :: GlobalIdentity -> Natural
$sel:lac:GlobalIdentity' :: GlobalIdentity -> Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
lac
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
geranCid

instance Prelude.NFData GlobalIdentity where
  rnf :: GlobalIdentity -> ()
rnf GlobalIdentity' {Natural
geranCid :: Natural
lac :: Natural
$sel:geranCid:GlobalIdentity' :: GlobalIdentity -> Natural
$sel:lac:GlobalIdentity' :: GlobalIdentity -> Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Natural
lac seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
geranCid

instance Data.ToJSON GlobalIdentity where
  toJSON :: GlobalIdentity -> Value
toJSON GlobalIdentity' {Natural
geranCid :: Natural
lac :: Natural
$sel:geranCid:GlobalIdentity' :: GlobalIdentity -> Natural
$sel:lac:GlobalIdentity' :: GlobalIdentity -> Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"Lac" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
lac),
            forall a. a -> Maybe a
Prelude.Just (Key
"GeranCid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
geranCid)
          ]
      )