{-# 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.LoRaWANSendDataToDevice
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTWireless.Types.LoRaWANSendDataToDevice where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | LoRaWAN router info.
--
-- /See:/ 'newLoRaWANSendDataToDevice' smart constructor.
data LoRaWANSendDataToDevice = LoRaWANSendDataToDevice'
  { -- | The Fport value.
    LoRaWANSendDataToDevice -> Maybe Natural
fPort :: Prelude.Maybe Prelude.Natural
  }
  deriving (LoRaWANSendDataToDevice -> LoRaWANSendDataToDevice -> Bool
(LoRaWANSendDataToDevice -> LoRaWANSendDataToDevice -> Bool)
-> (LoRaWANSendDataToDevice -> LoRaWANSendDataToDevice -> Bool)
-> Eq LoRaWANSendDataToDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoRaWANSendDataToDevice -> LoRaWANSendDataToDevice -> Bool
$c/= :: LoRaWANSendDataToDevice -> LoRaWANSendDataToDevice -> Bool
== :: LoRaWANSendDataToDevice -> LoRaWANSendDataToDevice -> Bool
$c== :: LoRaWANSendDataToDevice -> LoRaWANSendDataToDevice -> Bool
Prelude.Eq, ReadPrec [LoRaWANSendDataToDevice]
ReadPrec LoRaWANSendDataToDevice
Int -> ReadS LoRaWANSendDataToDevice
ReadS [LoRaWANSendDataToDevice]
(Int -> ReadS LoRaWANSendDataToDevice)
-> ReadS [LoRaWANSendDataToDevice]
-> ReadPrec LoRaWANSendDataToDevice
-> ReadPrec [LoRaWANSendDataToDevice]
-> Read LoRaWANSendDataToDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoRaWANSendDataToDevice]
$creadListPrec :: ReadPrec [LoRaWANSendDataToDevice]
readPrec :: ReadPrec LoRaWANSendDataToDevice
$creadPrec :: ReadPrec LoRaWANSendDataToDevice
readList :: ReadS [LoRaWANSendDataToDevice]
$creadList :: ReadS [LoRaWANSendDataToDevice]
readsPrec :: Int -> ReadS LoRaWANSendDataToDevice
$creadsPrec :: Int -> ReadS LoRaWANSendDataToDevice
Prelude.Read, Int -> LoRaWANSendDataToDevice -> ShowS
[LoRaWANSendDataToDevice] -> ShowS
LoRaWANSendDataToDevice -> String
(Int -> LoRaWANSendDataToDevice -> ShowS)
-> (LoRaWANSendDataToDevice -> String)
-> ([LoRaWANSendDataToDevice] -> ShowS)
-> Show LoRaWANSendDataToDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoRaWANSendDataToDevice] -> ShowS
$cshowList :: [LoRaWANSendDataToDevice] -> ShowS
show :: LoRaWANSendDataToDevice -> String
$cshow :: LoRaWANSendDataToDevice -> String
showsPrec :: Int -> LoRaWANSendDataToDevice -> ShowS
$cshowsPrec :: Int -> LoRaWANSendDataToDevice -> ShowS
Prelude.Show, (forall x.
 LoRaWANSendDataToDevice -> Rep LoRaWANSendDataToDevice x)
-> (forall x.
    Rep LoRaWANSendDataToDevice x -> LoRaWANSendDataToDevice)
-> Generic LoRaWANSendDataToDevice
forall x. Rep LoRaWANSendDataToDevice x -> LoRaWANSendDataToDevice
forall x. LoRaWANSendDataToDevice -> Rep LoRaWANSendDataToDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoRaWANSendDataToDevice x -> LoRaWANSendDataToDevice
$cfrom :: forall x. LoRaWANSendDataToDevice -> Rep LoRaWANSendDataToDevice x
Prelude.Generic)

-- |
-- Create a value of 'LoRaWANSendDataToDevice' 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:
--
-- 'fPort', 'loRaWANSendDataToDevice_fPort' - The Fport value.
newLoRaWANSendDataToDevice ::
  LoRaWANSendDataToDevice
newLoRaWANSendDataToDevice :: LoRaWANSendDataToDevice
newLoRaWANSendDataToDevice =
  LoRaWANSendDataToDevice' :: Maybe Natural -> LoRaWANSendDataToDevice
LoRaWANSendDataToDevice' {$sel:fPort:LoRaWANSendDataToDevice' :: Maybe Natural
fPort = Maybe Natural
forall a. Maybe a
Prelude.Nothing}

-- | The Fport value.
loRaWANSendDataToDevice_fPort :: Lens.Lens' LoRaWANSendDataToDevice (Prelude.Maybe Prelude.Natural)
loRaWANSendDataToDevice_fPort :: (Maybe Natural -> f (Maybe Natural))
-> LoRaWANSendDataToDevice -> f LoRaWANSendDataToDevice
loRaWANSendDataToDevice_fPort = (LoRaWANSendDataToDevice -> Maybe Natural)
-> (LoRaWANSendDataToDevice
    -> Maybe Natural -> LoRaWANSendDataToDevice)
-> Lens
     LoRaWANSendDataToDevice
     LoRaWANSendDataToDevice
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANSendDataToDevice' {Maybe Natural
fPort :: Maybe Natural
$sel:fPort:LoRaWANSendDataToDevice' :: LoRaWANSendDataToDevice -> Maybe Natural
fPort} -> Maybe Natural
fPort) (\s :: LoRaWANSendDataToDevice
s@LoRaWANSendDataToDevice' {} Maybe Natural
a -> LoRaWANSendDataToDevice
s {$sel:fPort:LoRaWANSendDataToDevice' :: Maybe Natural
fPort = Maybe Natural
a} :: LoRaWANSendDataToDevice)

instance Prelude.Hashable LoRaWANSendDataToDevice

instance Prelude.NFData LoRaWANSendDataToDevice

instance Core.ToJSON LoRaWANSendDataToDevice where
  toJSON :: LoRaWANSendDataToDevice -> Value
toJSON LoRaWANSendDataToDevice' {Maybe Natural
fPort :: Maybe Natural
$sel:fPort:LoRaWANSendDataToDevice' :: LoRaWANSendDataToDevice -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"FPort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
fPort]
      )