{-# 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.SidewalkSendDataToDevice
-- 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.SidewalkSendDataToDevice where

import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.Types.MessageType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a Sidewalk router.
--
-- /See:/ 'newSidewalkSendDataToDevice' smart constructor.
data SidewalkSendDataToDevice = SidewalkSendDataToDevice'
  { SidewalkSendDataToDevice -> Maybe MessageType
messageType :: Prelude.Maybe MessageType,
    -- | The sequence number.
    SidewalkSendDataToDevice -> Maybe Natural
seq :: Prelude.Maybe Prelude.Natural
  }
  deriving (SidewalkSendDataToDevice -> SidewalkSendDataToDevice -> Bool
(SidewalkSendDataToDevice -> SidewalkSendDataToDevice -> Bool)
-> (SidewalkSendDataToDevice -> SidewalkSendDataToDevice -> Bool)
-> Eq SidewalkSendDataToDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SidewalkSendDataToDevice -> SidewalkSendDataToDevice -> Bool
$c/= :: SidewalkSendDataToDevice -> SidewalkSendDataToDevice -> Bool
== :: SidewalkSendDataToDevice -> SidewalkSendDataToDevice -> Bool
$c== :: SidewalkSendDataToDevice -> SidewalkSendDataToDevice -> Bool
Prelude.Eq, ReadPrec [SidewalkSendDataToDevice]
ReadPrec SidewalkSendDataToDevice
Int -> ReadS SidewalkSendDataToDevice
ReadS [SidewalkSendDataToDevice]
(Int -> ReadS SidewalkSendDataToDevice)
-> ReadS [SidewalkSendDataToDevice]
-> ReadPrec SidewalkSendDataToDevice
-> ReadPrec [SidewalkSendDataToDevice]
-> Read SidewalkSendDataToDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SidewalkSendDataToDevice]
$creadListPrec :: ReadPrec [SidewalkSendDataToDevice]
readPrec :: ReadPrec SidewalkSendDataToDevice
$creadPrec :: ReadPrec SidewalkSendDataToDevice
readList :: ReadS [SidewalkSendDataToDevice]
$creadList :: ReadS [SidewalkSendDataToDevice]
readsPrec :: Int -> ReadS SidewalkSendDataToDevice
$creadsPrec :: Int -> ReadS SidewalkSendDataToDevice
Prelude.Read, Int -> SidewalkSendDataToDevice -> ShowS
[SidewalkSendDataToDevice] -> ShowS
SidewalkSendDataToDevice -> String
(Int -> SidewalkSendDataToDevice -> ShowS)
-> (SidewalkSendDataToDevice -> String)
-> ([SidewalkSendDataToDevice] -> ShowS)
-> Show SidewalkSendDataToDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SidewalkSendDataToDevice] -> ShowS
$cshowList :: [SidewalkSendDataToDevice] -> ShowS
show :: SidewalkSendDataToDevice -> String
$cshow :: SidewalkSendDataToDevice -> String
showsPrec :: Int -> SidewalkSendDataToDevice -> ShowS
$cshowsPrec :: Int -> SidewalkSendDataToDevice -> ShowS
Prelude.Show, (forall x.
 SidewalkSendDataToDevice -> Rep SidewalkSendDataToDevice x)
-> (forall x.
    Rep SidewalkSendDataToDevice x -> SidewalkSendDataToDevice)
-> Generic SidewalkSendDataToDevice
forall x.
Rep SidewalkSendDataToDevice x -> SidewalkSendDataToDevice
forall x.
SidewalkSendDataToDevice -> Rep SidewalkSendDataToDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SidewalkSendDataToDevice x -> SidewalkSendDataToDevice
$cfrom :: forall x.
SidewalkSendDataToDevice -> Rep SidewalkSendDataToDevice x
Prelude.Generic)

-- |
-- Create a value of 'SidewalkSendDataToDevice' 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:
--
-- 'messageType', 'sidewalkSendDataToDevice_messageType' - Undocumented member.
--
-- 'seq', 'sidewalkSendDataToDevice_seq' - The sequence number.
newSidewalkSendDataToDevice ::
  SidewalkSendDataToDevice
newSidewalkSendDataToDevice :: SidewalkSendDataToDevice
newSidewalkSendDataToDevice =
  SidewalkSendDataToDevice' :: Maybe MessageType -> Maybe Natural -> SidewalkSendDataToDevice
SidewalkSendDataToDevice'
    { $sel:messageType:SidewalkSendDataToDevice' :: Maybe MessageType
messageType =
        Maybe MessageType
forall a. Maybe a
Prelude.Nothing,
      $sel:seq:SidewalkSendDataToDevice' :: Maybe Natural
seq = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
sidewalkSendDataToDevice_messageType :: Lens.Lens' SidewalkSendDataToDevice (Prelude.Maybe MessageType)
sidewalkSendDataToDevice_messageType :: (Maybe MessageType -> f (Maybe MessageType))
-> SidewalkSendDataToDevice -> f SidewalkSendDataToDevice
sidewalkSendDataToDevice_messageType = (SidewalkSendDataToDevice -> Maybe MessageType)
-> (SidewalkSendDataToDevice
    -> Maybe MessageType -> SidewalkSendDataToDevice)
-> Lens
     SidewalkSendDataToDevice
     SidewalkSendDataToDevice
     (Maybe MessageType)
     (Maybe MessageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SidewalkSendDataToDevice' {Maybe MessageType
messageType :: Maybe MessageType
$sel:messageType:SidewalkSendDataToDevice' :: SidewalkSendDataToDevice -> Maybe MessageType
messageType} -> Maybe MessageType
messageType) (\s :: SidewalkSendDataToDevice
s@SidewalkSendDataToDevice' {} Maybe MessageType
a -> SidewalkSendDataToDevice
s {$sel:messageType:SidewalkSendDataToDevice' :: Maybe MessageType
messageType = Maybe MessageType
a} :: SidewalkSendDataToDevice)

-- | The sequence number.
sidewalkSendDataToDevice_seq :: Lens.Lens' SidewalkSendDataToDevice (Prelude.Maybe Prelude.Natural)
sidewalkSendDataToDevice_seq :: (Maybe Natural -> f (Maybe Natural))
-> SidewalkSendDataToDevice -> f SidewalkSendDataToDevice
sidewalkSendDataToDevice_seq = (SidewalkSendDataToDevice -> Maybe Natural)
-> (SidewalkSendDataToDevice
    -> Maybe Natural -> SidewalkSendDataToDevice)
-> Lens
     SidewalkSendDataToDevice
     SidewalkSendDataToDevice
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SidewalkSendDataToDevice' {Maybe Natural
seq :: Maybe Natural
$sel:seq:SidewalkSendDataToDevice' :: SidewalkSendDataToDevice -> Maybe Natural
seq} -> Maybe Natural
seq) (\s :: SidewalkSendDataToDevice
s@SidewalkSendDataToDevice' {} Maybe Natural
a -> SidewalkSendDataToDevice
s {$sel:seq:SidewalkSendDataToDevice' :: Maybe Natural
seq = Maybe Natural
a} :: SidewalkSendDataToDevice)

instance Prelude.Hashable SidewalkSendDataToDevice

instance Prelude.NFData SidewalkSendDataToDevice

instance Core.ToJSON SidewalkSendDataToDevice where
  toJSON :: SidewalkSendDataToDevice -> Value
toJSON SidewalkSendDataToDevice' {Maybe Natural
Maybe MessageType
seq :: Maybe Natural
messageType :: Maybe MessageType
$sel:seq:SidewalkSendDataToDevice' :: SidewalkSendDataToDevice -> Maybe Natural
$sel:messageType:SidewalkSendDataToDevice' :: SidewalkSendDataToDevice -> Maybe MessageType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MessageType" Text -> MessageType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MessageType -> Pair) -> Maybe MessageType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MessageType
messageType,
            (Text
"Seq" 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
seq
          ]
      )