{-# 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.JoinEventConfiguration 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.EventNotificationTopicStatus
import Amazonka.IoTWireless.Types.LoRaWANJoinEventNotificationConfigurations
import qualified Amazonka.Prelude as Prelude
data JoinEventConfiguration = JoinEventConfiguration'
{
JoinEventConfiguration
-> Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN :: Prelude.Maybe LoRaWANJoinEventNotificationConfigurations,
JoinEventConfiguration -> Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic :: Prelude.Maybe EventNotificationTopicStatus
}
deriving (JoinEventConfiguration -> JoinEventConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JoinEventConfiguration -> JoinEventConfiguration -> Bool
$c/= :: JoinEventConfiguration -> JoinEventConfiguration -> Bool
== :: JoinEventConfiguration -> JoinEventConfiguration -> Bool
$c== :: JoinEventConfiguration -> JoinEventConfiguration -> Bool
Prelude.Eq, ReadPrec [JoinEventConfiguration]
ReadPrec JoinEventConfiguration
Int -> ReadS JoinEventConfiguration
ReadS [JoinEventConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JoinEventConfiguration]
$creadListPrec :: ReadPrec [JoinEventConfiguration]
readPrec :: ReadPrec JoinEventConfiguration
$creadPrec :: ReadPrec JoinEventConfiguration
readList :: ReadS [JoinEventConfiguration]
$creadList :: ReadS [JoinEventConfiguration]
readsPrec :: Int -> ReadS JoinEventConfiguration
$creadsPrec :: Int -> ReadS JoinEventConfiguration
Prelude.Read, Int -> JoinEventConfiguration -> ShowS
[JoinEventConfiguration] -> ShowS
JoinEventConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JoinEventConfiguration] -> ShowS
$cshowList :: [JoinEventConfiguration] -> ShowS
show :: JoinEventConfiguration -> String
$cshow :: JoinEventConfiguration -> String
showsPrec :: Int -> JoinEventConfiguration -> ShowS
$cshowsPrec :: Int -> JoinEventConfiguration -> ShowS
Prelude.Show, forall x. Rep JoinEventConfiguration x -> JoinEventConfiguration
forall x. JoinEventConfiguration -> Rep JoinEventConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JoinEventConfiguration x -> JoinEventConfiguration
$cfrom :: forall x. JoinEventConfiguration -> Rep JoinEventConfiguration x
Prelude.Generic)
newJoinEventConfiguration ::
JoinEventConfiguration
newJoinEventConfiguration :: JoinEventConfiguration
newJoinEventConfiguration =
JoinEventConfiguration'
{ $sel:loRaWAN:JoinEventConfiguration' :: Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN = forall a. Maybe a
Prelude.Nothing,
$sel:wirelessDeviceIdEventTopic:JoinEventConfiguration' :: Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic = forall a. Maybe a
Prelude.Nothing
}
joinEventConfiguration_loRaWAN :: Lens.Lens' JoinEventConfiguration (Prelude.Maybe LoRaWANJoinEventNotificationConfigurations)
joinEventConfiguration_loRaWAN :: Lens'
JoinEventConfiguration
(Maybe LoRaWANJoinEventNotificationConfigurations)
joinEventConfiguration_loRaWAN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JoinEventConfiguration' {Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN :: Maybe LoRaWANJoinEventNotificationConfigurations
$sel:loRaWAN:JoinEventConfiguration' :: JoinEventConfiguration
-> Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN} -> Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN) (\s :: JoinEventConfiguration
s@JoinEventConfiguration' {} Maybe LoRaWANJoinEventNotificationConfigurations
a -> JoinEventConfiguration
s {$sel:loRaWAN:JoinEventConfiguration' :: Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN = Maybe LoRaWANJoinEventNotificationConfigurations
a} :: JoinEventConfiguration)
joinEventConfiguration_wirelessDeviceIdEventTopic :: Lens.Lens' JoinEventConfiguration (Prelude.Maybe EventNotificationTopicStatus)
joinEventConfiguration_wirelessDeviceIdEventTopic :: Lens' JoinEventConfiguration (Maybe EventNotificationTopicStatus)
joinEventConfiguration_wirelessDeviceIdEventTopic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JoinEventConfiguration' {Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic :: Maybe EventNotificationTopicStatus
$sel:wirelessDeviceIdEventTopic:JoinEventConfiguration' :: JoinEventConfiguration -> Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic} -> Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic) (\s :: JoinEventConfiguration
s@JoinEventConfiguration' {} Maybe EventNotificationTopicStatus
a -> JoinEventConfiguration
s {$sel:wirelessDeviceIdEventTopic:JoinEventConfiguration' :: Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic = Maybe EventNotificationTopicStatus
a} :: JoinEventConfiguration)
instance Data.FromJSON JoinEventConfiguration where
parseJSON :: Value -> Parser JoinEventConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"JoinEventConfiguration"
( \Object
x ->
Maybe LoRaWANJoinEventNotificationConfigurations
-> Maybe EventNotificationTopicStatus -> JoinEventConfiguration
JoinEventConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LoRaWAN")
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
"WirelessDeviceIdEventTopic")
)
instance Prelude.Hashable JoinEventConfiguration where
hashWithSalt :: Int -> JoinEventConfiguration -> Int
hashWithSalt Int
_salt JoinEventConfiguration' {Maybe EventNotificationTopicStatus
Maybe LoRaWANJoinEventNotificationConfigurations
wirelessDeviceIdEventTopic :: Maybe EventNotificationTopicStatus
loRaWAN :: Maybe LoRaWANJoinEventNotificationConfigurations
$sel:wirelessDeviceIdEventTopic:JoinEventConfiguration' :: JoinEventConfiguration -> Maybe EventNotificationTopicStatus
$sel:loRaWAN:JoinEventConfiguration' :: JoinEventConfiguration
-> Maybe LoRaWANJoinEventNotificationConfigurations
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic
instance Prelude.NFData JoinEventConfiguration where
rnf :: JoinEventConfiguration -> ()
rnf JoinEventConfiguration' {Maybe EventNotificationTopicStatus
Maybe LoRaWANJoinEventNotificationConfigurations
wirelessDeviceIdEventTopic :: Maybe EventNotificationTopicStatus
loRaWAN :: Maybe LoRaWANJoinEventNotificationConfigurations
$sel:wirelessDeviceIdEventTopic:JoinEventConfiguration' :: JoinEventConfiguration -> Maybe EventNotificationTopicStatus
$sel:loRaWAN:JoinEventConfiguration' :: JoinEventConfiguration
-> Maybe LoRaWANJoinEventNotificationConfigurations
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe LoRaWANJoinEventNotificationConfigurations
loRaWAN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EventNotificationTopicStatus
wirelessDeviceIdEventTopic
instance Data.ToJSON JoinEventConfiguration where
toJSON :: JoinEventConfiguration -> Value
toJSON JoinEventConfiguration' {Maybe EventNotificationTopicStatus
Maybe LoRaWANJoinEventNotificationConfigurations
wirelessDeviceIdEventTopic :: Maybe EventNotificationTopicStatus
loRaWAN :: Maybe LoRaWANJoinEventNotificationConfigurations
$sel:wirelessDeviceIdEventTopic:JoinEventConfiguration' :: JoinEventConfiguration -> Maybe EventNotificationTopicStatus
$sel:loRaWAN:JoinEventConfiguration' :: JoinEventConfiguration
-> Maybe LoRaWANJoinEventNotificationConfigurations
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"LoRaWAN" 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 LoRaWANJoinEventNotificationConfigurations
loRaWAN,
(Key
"WirelessDeviceIdEventTopic" 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 EventNotificationTopicStatus
wirelessDeviceIdEventTopic
]
)