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

-- | LoRaWANServiceProfile object.
--
-- /See:/ 'newLoRaWANServiceProfile' smart constructor.
data LoRaWANServiceProfile = LoRaWANServiceProfile'
  { -- | The AddGWMetaData value.
    LoRaWANServiceProfile -> Maybe Bool
addGwMetadata :: Prelude.Maybe Prelude.Bool,
    -- | The DrMax value.
    LoRaWANServiceProfile -> Maybe Natural
drMax :: Prelude.Maybe Prelude.Natural,
    -- | The DrMin value.
    LoRaWANServiceProfile -> Maybe Natural
drMin :: Prelude.Maybe Prelude.Natural
  }
  deriving (LoRaWANServiceProfile -> LoRaWANServiceProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoRaWANServiceProfile -> LoRaWANServiceProfile -> Bool
$c/= :: LoRaWANServiceProfile -> LoRaWANServiceProfile -> Bool
== :: LoRaWANServiceProfile -> LoRaWANServiceProfile -> Bool
$c== :: LoRaWANServiceProfile -> LoRaWANServiceProfile -> Bool
Prelude.Eq, ReadPrec [LoRaWANServiceProfile]
ReadPrec LoRaWANServiceProfile
Int -> ReadS LoRaWANServiceProfile
ReadS [LoRaWANServiceProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoRaWANServiceProfile]
$creadListPrec :: ReadPrec [LoRaWANServiceProfile]
readPrec :: ReadPrec LoRaWANServiceProfile
$creadPrec :: ReadPrec LoRaWANServiceProfile
readList :: ReadS [LoRaWANServiceProfile]
$creadList :: ReadS [LoRaWANServiceProfile]
readsPrec :: Int -> ReadS LoRaWANServiceProfile
$creadsPrec :: Int -> ReadS LoRaWANServiceProfile
Prelude.Read, Int -> LoRaWANServiceProfile -> ShowS
[LoRaWANServiceProfile] -> ShowS
LoRaWANServiceProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoRaWANServiceProfile] -> ShowS
$cshowList :: [LoRaWANServiceProfile] -> ShowS
show :: LoRaWANServiceProfile -> String
$cshow :: LoRaWANServiceProfile -> String
showsPrec :: Int -> LoRaWANServiceProfile -> ShowS
$cshowsPrec :: Int -> LoRaWANServiceProfile -> ShowS
Prelude.Show, forall x. Rep LoRaWANServiceProfile x -> LoRaWANServiceProfile
forall x. LoRaWANServiceProfile -> Rep LoRaWANServiceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoRaWANServiceProfile x -> LoRaWANServiceProfile
$cfrom :: forall x. LoRaWANServiceProfile -> Rep LoRaWANServiceProfile x
Prelude.Generic)

-- |
-- Create a value of 'LoRaWANServiceProfile' 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:
--
-- 'addGwMetadata', 'loRaWANServiceProfile_addGwMetadata' - The AddGWMetaData value.
--
-- 'drMax', 'loRaWANServiceProfile_drMax' - The DrMax value.
--
-- 'drMin', 'loRaWANServiceProfile_drMin' - The DrMin value.
newLoRaWANServiceProfile ::
  LoRaWANServiceProfile
newLoRaWANServiceProfile :: LoRaWANServiceProfile
newLoRaWANServiceProfile =
  LoRaWANServiceProfile'
    { $sel:addGwMetadata:LoRaWANServiceProfile' :: Maybe Bool
addGwMetadata =
        forall a. Maybe a
Prelude.Nothing,
      $sel:drMax:LoRaWANServiceProfile' :: Maybe Natural
drMax = forall a. Maybe a
Prelude.Nothing,
      $sel:drMin:LoRaWANServiceProfile' :: Maybe Natural
drMin = forall a. Maybe a
Prelude.Nothing
    }

-- | The AddGWMetaData value.
loRaWANServiceProfile_addGwMetadata :: Lens.Lens' LoRaWANServiceProfile (Prelude.Maybe Prelude.Bool)
loRaWANServiceProfile_addGwMetadata :: Lens' LoRaWANServiceProfile (Maybe Bool)
loRaWANServiceProfile_addGwMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANServiceProfile' {Maybe Bool
addGwMetadata :: Maybe Bool
$sel:addGwMetadata:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Bool
addGwMetadata} -> Maybe Bool
addGwMetadata) (\s :: LoRaWANServiceProfile
s@LoRaWANServiceProfile' {} Maybe Bool
a -> LoRaWANServiceProfile
s {$sel:addGwMetadata:LoRaWANServiceProfile' :: Maybe Bool
addGwMetadata = Maybe Bool
a} :: LoRaWANServiceProfile)

-- | The DrMax value.
loRaWANServiceProfile_drMax :: Lens.Lens' LoRaWANServiceProfile (Prelude.Maybe Prelude.Natural)
loRaWANServiceProfile_drMax :: Lens' LoRaWANServiceProfile (Maybe Natural)
loRaWANServiceProfile_drMax = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANServiceProfile' {Maybe Natural
drMax :: Maybe Natural
$sel:drMax:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
drMax} -> Maybe Natural
drMax) (\s :: LoRaWANServiceProfile
s@LoRaWANServiceProfile' {} Maybe Natural
a -> LoRaWANServiceProfile
s {$sel:drMax:LoRaWANServiceProfile' :: Maybe Natural
drMax = Maybe Natural
a} :: LoRaWANServiceProfile)

-- | The DrMin value.
loRaWANServiceProfile_drMin :: Lens.Lens' LoRaWANServiceProfile (Prelude.Maybe Prelude.Natural)
loRaWANServiceProfile_drMin :: Lens' LoRaWANServiceProfile (Maybe Natural)
loRaWANServiceProfile_drMin = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANServiceProfile' {Maybe Natural
drMin :: Maybe Natural
$sel:drMin:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
drMin} -> Maybe Natural
drMin) (\s :: LoRaWANServiceProfile
s@LoRaWANServiceProfile' {} Maybe Natural
a -> LoRaWANServiceProfile
s {$sel:drMin:LoRaWANServiceProfile' :: Maybe Natural
drMin = Maybe Natural
a} :: LoRaWANServiceProfile)

instance Prelude.Hashable LoRaWANServiceProfile where
  hashWithSalt :: Int -> LoRaWANServiceProfile -> Int
hashWithSalt Int
_salt LoRaWANServiceProfile' {Maybe Bool
Maybe Natural
drMin :: Maybe Natural
drMax :: Maybe Natural
addGwMetadata :: Maybe Bool
$sel:drMin:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
$sel:drMax:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
$sel:addGwMetadata:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
addGwMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
drMax
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
drMin

instance Prelude.NFData LoRaWANServiceProfile where
  rnf :: LoRaWANServiceProfile -> ()
rnf LoRaWANServiceProfile' {Maybe Bool
Maybe Natural
drMin :: Maybe Natural
drMax :: Maybe Natural
addGwMetadata :: Maybe Bool
$sel:drMin:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
$sel:drMax:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
$sel:addGwMetadata:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
addGwMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
drMax
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
drMin

instance Data.ToJSON LoRaWANServiceProfile where
  toJSON :: LoRaWANServiceProfile -> Value
toJSON LoRaWANServiceProfile' {Maybe Bool
Maybe Natural
drMin :: Maybe Natural
drMax :: Maybe Natural
addGwMetadata :: Maybe Bool
$sel:drMin:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
$sel:drMax:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Natural
$sel:addGwMetadata:LoRaWANServiceProfile' :: LoRaWANServiceProfile -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AddGwMetadata" 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 Bool
addGwMetadata,
            (Key
"DrMax" 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
drMax,
            (Key
"DrMin" 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
drMin
          ]
      )