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

-- | ABP device object for LoRaWAN specification v1.1
--
-- /See:/ 'newUpdateAbpV1_1' smart constructor.
data UpdateAbpV1_1 = UpdateAbpV1_1'
  { -- | The FCnt init value.
    UpdateAbpV1_1 -> Maybe Natural
fCntStart :: Prelude.Maybe Prelude.Natural
  }
  deriving (UpdateAbpV1_1 -> UpdateAbpV1_1 -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAbpV1_1 -> UpdateAbpV1_1 -> Bool
$c/= :: UpdateAbpV1_1 -> UpdateAbpV1_1 -> Bool
== :: UpdateAbpV1_1 -> UpdateAbpV1_1 -> Bool
$c== :: UpdateAbpV1_1 -> UpdateAbpV1_1 -> Bool
Prelude.Eq, ReadPrec [UpdateAbpV1_1]
ReadPrec UpdateAbpV1_1
Int -> ReadS UpdateAbpV1_1
ReadS [UpdateAbpV1_1]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAbpV1_1]
$creadListPrec :: ReadPrec [UpdateAbpV1_1]
readPrec :: ReadPrec UpdateAbpV1_1
$creadPrec :: ReadPrec UpdateAbpV1_1
readList :: ReadS [UpdateAbpV1_1]
$creadList :: ReadS [UpdateAbpV1_1]
readsPrec :: Int -> ReadS UpdateAbpV1_1
$creadsPrec :: Int -> ReadS UpdateAbpV1_1
Prelude.Read, Int -> UpdateAbpV1_1 -> ShowS
[UpdateAbpV1_1] -> ShowS
UpdateAbpV1_1 -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAbpV1_1] -> ShowS
$cshowList :: [UpdateAbpV1_1] -> ShowS
show :: UpdateAbpV1_1 -> String
$cshow :: UpdateAbpV1_1 -> String
showsPrec :: Int -> UpdateAbpV1_1 -> ShowS
$cshowsPrec :: Int -> UpdateAbpV1_1 -> ShowS
Prelude.Show, forall x. Rep UpdateAbpV1_1 x -> UpdateAbpV1_1
forall x. UpdateAbpV1_1 -> Rep UpdateAbpV1_1 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAbpV1_1 x -> UpdateAbpV1_1
$cfrom :: forall x. UpdateAbpV1_1 -> Rep UpdateAbpV1_1 x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAbpV1_1' 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:
--
-- 'fCntStart', 'updateAbpV1_1_fCntStart' - The FCnt init value.
newUpdateAbpV1_1 ::
  UpdateAbpV1_1
newUpdateAbpV1_1 :: UpdateAbpV1_1
newUpdateAbpV1_1 =
  UpdateAbpV1_1' {$sel:fCntStart:UpdateAbpV1_1' :: Maybe Natural
fCntStart = forall a. Maybe a
Prelude.Nothing}

-- | The FCnt init value.
updateAbpV1_1_fCntStart :: Lens.Lens' UpdateAbpV1_1 (Prelude.Maybe Prelude.Natural)
updateAbpV1_1_fCntStart :: Lens' UpdateAbpV1_1 (Maybe Natural)
updateAbpV1_1_fCntStart = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAbpV1_1' {Maybe Natural
fCntStart :: Maybe Natural
$sel:fCntStart:UpdateAbpV1_1' :: UpdateAbpV1_1 -> Maybe Natural
fCntStart} -> Maybe Natural
fCntStart) (\s :: UpdateAbpV1_1
s@UpdateAbpV1_1' {} Maybe Natural
a -> UpdateAbpV1_1
s {$sel:fCntStart:UpdateAbpV1_1' :: Maybe Natural
fCntStart = Maybe Natural
a} :: UpdateAbpV1_1)

instance Prelude.Hashable UpdateAbpV1_1 where
  hashWithSalt :: Int -> UpdateAbpV1_1 -> Int
hashWithSalt Int
_salt UpdateAbpV1_1' {Maybe Natural
fCntStart :: Maybe Natural
$sel:fCntStart:UpdateAbpV1_1' :: UpdateAbpV1_1 -> Maybe Natural
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
fCntStart

instance Prelude.NFData UpdateAbpV1_1 where
  rnf :: UpdateAbpV1_1 -> ()
rnf UpdateAbpV1_1' {Maybe Natural
fCntStart :: Maybe Natural
$sel:fCntStart:UpdateAbpV1_1' :: UpdateAbpV1_1 -> Maybe Natural
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
fCntStart

instance Data.ToJSON UpdateAbpV1_1 where
  toJSON :: UpdateAbpV1_1 -> Value
toJSON UpdateAbpV1_1' {Maybe Natural
fCntStart :: Maybe Natural
$sel:fCntStart:UpdateAbpV1_1' :: UpdateAbpV1_1 -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"FCntStart" 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
fCntStart]
      )