{-# 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_0_x
-- 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_0_x 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.0.x
--
-- /See:/ 'newUpdateAbpV1_0_x' smart constructor.
data UpdateAbpV1_0_x = UpdateAbpV1_0_x'
  { -- | The FCnt init value.
    UpdateAbpV1_0_x -> Maybe Natural
fCntStart :: Prelude.Maybe Prelude.Natural
  }
  deriving (UpdateAbpV1_0_x -> UpdateAbpV1_0_x -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAbpV1_0_x -> UpdateAbpV1_0_x -> Bool
$c/= :: UpdateAbpV1_0_x -> UpdateAbpV1_0_x -> Bool
== :: UpdateAbpV1_0_x -> UpdateAbpV1_0_x -> Bool
$c== :: UpdateAbpV1_0_x -> UpdateAbpV1_0_x -> Bool
Prelude.Eq, ReadPrec [UpdateAbpV1_0_x]
ReadPrec UpdateAbpV1_0_x
Int -> ReadS UpdateAbpV1_0_x
ReadS [UpdateAbpV1_0_x]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAbpV1_0_x]
$creadListPrec :: ReadPrec [UpdateAbpV1_0_x]
readPrec :: ReadPrec UpdateAbpV1_0_x
$creadPrec :: ReadPrec UpdateAbpV1_0_x
readList :: ReadS [UpdateAbpV1_0_x]
$creadList :: ReadS [UpdateAbpV1_0_x]
readsPrec :: Int -> ReadS UpdateAbpV1_0_x
$creadsPrec :: Int -> ReadS UpdateAbpV1_0_x
Prelude.Read, Int -> UpdateAbpV1_0_x -> ShowS
[UpdateAbpV1_0_x] -> ShowS
UpdateAbpV1_0_x -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAbpV1_0_x] -> ShowS
$cshowList :: [UpdateAbpV1_0_x] -> ShowS
show :: UpdateAbpV1_0_x -> String
$cshow :: UpdateAbpV1_0_x -> String
showsPrec :: Int -> UpdateAbpV1_0_x -> ShowS
$cshowsPrec :: Int -> UpdateAbpV1_0_x -> ShowS
Prelude.Show, forall x. Rep UpdateAbpV1_0_x x -> UpdateAbpV1_0_x
forall x. UpdateAbpV1_0_x -> Rep UpdateAbpV1_0_x x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAbpV1_0_x x -> UpdateAbpV1_0_x
$cfrom :: forall x. UpdateAbpV1_0_x -> Rep UpdateAbpV1_0_x x
Prelude.Generic)

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

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

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

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

instance Data.ToJSON UpdateAbpV1_0_x where
  toJSON :: UpdateAbpV1_0_x -> Value
toJSON UpdateAbpV1_0_x' {Maybe Natural
fCntStart :: Maybe Natural
$sel:fCntStart:UpdateAbpV1_0_x' :: UpdateAbpV1_0_x -> 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]
      )