{-# 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 #-}
module Amazonka.IoTWireless.Types.ParticipatingGateways where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types.DownlinkMode
import Amazonka.IoTWireless.Types.GatewayListItem
import qualified Amazonka.Prelude as Prelude
data ParticipatingGateways = ParticipatingGateways'
{
ParticipatingGateways -> DownlinkMode
downlinkMode :: DownlinkMode,
ParticipatingGateways -> [GatewayListItem]
gatewayList :: [GatewayListItem],
ParticipatingGateways -> Natural
transmissionInterval :: Prelude.Natural
}
deriving (ParticipatingGateways -> ParticipatingGateways -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParticipatingGateways -> ParticipatingGateways -> Bool
$c/= :: ParticipatingGateways -> ParticipatingGateways -> Bool
== :: ParticipatingGateways -> ParticipatingGateways -> Bool
$c== :: ParticipatingGateways -> ParticipatingGateways -> Bool
Prelude.Eq, ReadPrec [ParticipatingGateways]
ReadPrec ParticipatingGateways
Int -> ReadS ParticipatingGateways
ReadS [ParticipatingGateways]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParticipatingGateways]
$creadListPrec :: ReadPrec [ParticipatingGateways]
readPrec :: ReadPrec ParticipatingGateways
$creadPrec :: ReadPrec ParticipatingGateways
readList :: ReadS [ParticipatingGateways]
$creadList :: ReadS [ParticipatingGateways]
readsPrec :: Int -> ReadS ParticipatingGateways
$creadsPrec :: Int -> ReadS ParticipatingGateways
Prelude.Read, Int -> ParticipatingGateways -> ShowS
[ParticipatingGateways] -> ShowS
ParticipatingGateways -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParticipatingGateways] -> ShowS
$cshowList :: [ParticipatingGateways] -> ShowS
show :: ParticipatingGateways -> String
$cshow :: ParticipatingGateways -> String
showsPrec :: Int -> ParticipatingGateways -> ShowS
$cshowsPrec :: Int -> ParticipatingGateways -> ShowS
Prelude.Show, forall x. Rep ParticipatingGateways x -> ParticipatingGateways
forall x. ParticipatingGateways -> Rep ParticipatingGateways x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParticipatingGateways x -> ParticipatingGateways
$cfrom :: forall x. ParticipatingGateways -> Rep ParticipatingGateways x
Prelude.Generic)
newParticipatingGateways ::
DownlinkMode ->
Prelude.Natural ->
ParticipatingGateways
newParticipatingGateways :: DownlinkMode -> Natural -> ParticipatingGateways
newParticipatingGateways
DownlinkMode
pDownlinkMode_
Natural
pTransmissionInterval_ =
ParticipatingGateways'
{ $sel:downlinkMode:ParticipatingGateways' :: DownlinkMode
downlinkMode =
DownlinkMode
pDownlinkMode_,
$sel:gatewayList:ParticipatingGateways' :: [GatewayListItem]
gatewayList = forall a. Monoid a => a
Prelude.mempty,
$sel:transmissionInterval:ParticipatingGateways' :: Natural
transmissionInterval = Natural
pTransmissionInterval_
}
participatingGateways_downlinkMode :: Lens.Lens' ParticipatingGateways DownlinkMode
participatingGateways_downlinkMode :: Lens' ParticipatingGateways DownlinkMode
participatingGateways_downlinkMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipatingGateways' {DownlinkMode
downlinkMode :: DownlinkMode
$sel:downlinkMode:ParticipatingGateways' :: ParticipatingGateways -> DownlinkMode
downlinkMode} -> DownlinkMode
downlinkMode) (\s :: ParticipatingGateways
s@ParticipatingGateways' {} DownlinkMode
a -> ParticipatingGateways
s {$sel:downlinkMode:ParticipatingGateways' :: DownlinkMode
downlinkMode = DownlinkMode
a} :: ParticipatingGateways)
participatingGateways_gatewayList :: Lens.Lens' ParticipatingGateways [GatewayListItem]
participatingGateways_gatewayList :: Lens' ParticipatingGateways [GatewayListItem]
participatingGateways_gatewayList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipatingGateways' {[GatewayListItem]
gatewayList :: [GatewayListItem]
$sel:gatewayList:ParticipatingGateways' :: ParticipatingGateways -> [GatewayListItem]
gatewayList} -> [GatewayListItem]
gatewayList) (\s :: ParticipatingGateways
s@ParticipatingGateways' {} [GatewayListItem]
a -> ParticipatingGateways
s {$sel:gatewayList:ParticipatingGateways' :: [GatewayListItem]
gatewayList = [GatewayListItem]
a} :: ParticipatingGateways) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
participatingGateways_transmissionInterval :: Lens.Lens' ParticipatingGateways Prelude.Natural
participatingGateways_transmissionInterval :: Lens' ParticipatingGateways Natural
participatingGateways_transmissionInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParticipatingGateways' {Natural
transmissionInterval :: Natural
$sel:transmissionInterval:ParticipatingGateways' :: ParticipatingGateways -> Natural
transmissionInterval} -> Natural
transmissionInterval) (\s :: ParticipatingGateways
s@ParticipatingGateways' {} Natural
a -> ParticipatingGateways
s {$sel:transmissionInterval:ParticipatingGateways' :: Natural
transmissionInterval = Natural
a} :: ParticipatingGateways)
instance Data.FromJSON ParticipatingGateways where
parseJSON :: Value -> Parser ParticipatingGateways
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ParticipatingGateways"
( \Object
x ->
DownlinkMode
-> [GatewayListItem] -> Natural -> ParticipatingGateways
ParticipatingGateways'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"DownlinkMode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GatewayList" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TransmissionInterval")
)
instance Prelude.Hashable ParticipatingGateways where
hashWithSalt :: Int -> ParticipatingGateways -> Int
hashWithSalt Int
_salt ParticipatingGateways' {Natural
[GatewayListItem]
DownlinkMode
transmissionInterval :: Natural
gatewayList :: [GatewayListItem]
downlinkMode :: DownlinkMode
$sel:transmissionInterval:ParticipatingGateways' :: ParticipatingGateways -> Natural
$sel:gatewayList:ParticipatingGateways' :: ParticipatingGateways -> [GatewayListItem]
$sel:downlinkMode:ParticipatingGateways' :: ParticipatingGateways -> DownlinkMode
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DownlinkMode
downlinkMode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [GatewayListItem]
gatewayList
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
transmissionInterval
instance Prelude.NFData ParticipatingGateways where
rnf :: ParticipatingGateways -> ()
rnf ParticipatingGateways' {Natural
[GatewayListItem]
DownlinkMode
transmissionInterval :: Natural
gatewayList :: [GatewayListItem]
downlinkMode :: DownlinkMode
$sel:transmissionInterval:ParticipatingGateways' :: ParticipatingGateways -> Natural
$sel:gatewayList:ParticipatingGateways' :: ParticipatingGateways -> [GatewayListItem]
$sel:downlinkMode:ParticipatingGateways' :: ParticipatingGateways -> DownlinkMode
..} =
forall a. NFData a => a -> ()
Prelude.rnf DownlinkMode
downlinkMode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [GatewayListItem]
gatewayList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
transmissionInterval
instance Data.ToJSON ParticipatingGateways where
toJSON :: ParticipatingGateways -> Value
toJSON ParticipatingGateways' {Natural
[GatewayListItem]
DownlinkMode
transmissionInterval :: Natural
gatewayList :: [GatewayListItem]
downlinkMode :: DownlinkMode
$sel:transmissionInterval:ParticipatingGateways' :: ParticipatingGateways -> Natural
$sel:gatewayList:ParticipatingGateways' :: ParticipatingGateways -> [GatewayListItem]
$sel:downlinkMode:ParticipatingGateways' :: ParticipatingGateways -> DownlinkMode
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"DownlinkMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DownlinkMode
downlinkMode),
forall a. a -> Maybe a
Prelude.Just (Key
"GatewayList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [GatewayListItem]
gatewayList),
forall a. a -> Maybe a
Prelude.Just
( Key
"TransmissionInterval"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
transmissionInterval
)
]
)