{-# 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.LoRaWANConnectionStatusEventNotificationConfigurations
-- 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.LoRaWANConnectionStatusEventNotificationConfigurations 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 qualified Amazonka.Prelude as Prelude

-- | Object for LoRaWAN connection status resource type event configuration.
--
-- /See:/ 'newLoRaWANConnectionStatusEventNotificationConfigurations' smart constructor.
data LoRaWANConnectionStatusEventNotificationConfigurations = LoRaWANConnectionStatusEventNotificationConfigurations'
  { -- | Denotes whether the gateway EUI connection status event topic is enabled
    -- or disabled.
    LoRaWANConnectionStatusEventNotificationConfigurations
-> Maybe EventNotificationTopicStatus
gatewayEuiEventTopic :: Prelude.Maybe EventNotificationTopicStatus
  }
  deriving (LoRaWANConnectionStatusEventNotificationConfigurations
-> LoRaWANConnectionStatusEventNotificationConfigurations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoRaWANConnectionStatusEventNotificationConfigurations
-> LoRaWANConnectionStatusEventNotificationConfigurations -> Bool
$c/= :: LoRaWANConnectionStatusEventNotificationConfigurations
-> LoRaWANConnectionStatusEventNotificationConfigurations -> Bool
== :: LoRaWANConnectionStatusEventNotificationConfigurations
-> LoRaWANConnectionStatusEventNotificationConfigurations -> Bool
$c== :: LoRaWANConnectionStatusEventNotificationConfigurations
-> LoRaWANConnectionStatusEventNotificationConfigurations -> Bool
Prelude.Eq, ReadPrec [LoRaWANConnectionStatusEventNotificationConfigurations]
ReadPrec LoRaWANConnectionStatusEventNotificationConfigurations
Int -> ReadS LoRaWANConnectionStatusEventNotificationConfigurations
ReadS [LoRaWANConnectionStatusEventNotificationConfigurations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoRaWANConnectionStatusEventNotificationConfigurations]
$creadListPrec :: ReadPrec [LoRaWANConnectionStatusEventNotificationConfigurations]
readPrec :: ReadPrec LoRaWANConnectionStatusEventNotificationConfigurations
$creadPrec :: ReadPrec LoRaWANConnectionStatusEventNotificationConfigurations
readList :: ReadS [LoRaWANConnectionStatusEventNotificationConfigurations]
$creadList :: ReadS [LoRaWANConnectionStatusEventNotificationConfigurations]
readsPrec :: Int -> ReadS LoRaWANConnectionStatusEventNotificationConfigurations
$creadsPrec :: Int -> ReadS LoRaWANConnectionStatusEventNotificationConfigurations
Prelude.Read, Int
-> LoRaWANConnectionStatusEventNotificationConfigurations -> ShowS
[LoRaWANConnectionStatusEventNotificationConfigurations] -> ShowS
LoRaWANConnectionStatusEventNotificationConfigurations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoRaWANConnectionStatusEventNotificationConfigurations] -> ShowS
$cshowList :: [LoRaWANConnectionStatusEventNotificationConfigurations] -> ShowS
show :: LoRaWANConnectionStatusEventNotificationConfigurations -> String
$cshow :: LoRaWANConnectionStatusEventNotificationConfigurations -> String
showsPrec :: Int
-> LoRaWANConnectionStatusEventNotificationConfigurations -> ShowS
$cshowsPrec :: Int
-> LoRaWANConnectionStatusEventNotificationConfigurations -> ShowS
Prelude.Show, forall x.
Rep LoRaWANConnectionStatusEventNotificationConfigurations x
-> LoRaWANConnectionStatusEventNotificationConfigurations
forall x.
LoRaWANConnectionStatusEventNotificationConfigurations
-> Rep LoRaWANConnectionStatusEventNotificationConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LoRaWANConnectionStatusEventNotificationConfigurations x
-> LoRaWANConnectionStatusEventNotificationConfigurations
$cfrom :: forall x.
LoRaWANConnectionStatusEventNotificationConfigurations
-> Rep LoRaWANConnectionStatusEventNotificationConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'LoRaWANConnectionStatusEventNotificationConfigurations' 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:
--
-- 'gatewayEuiEventTopic', 'loRaWANConnectionStatusEventNotificationConfigurations_gatewayEuiEventTopic' - Denotes whether the gateway EUI connection status event topic is enabled
-- or disabled.
newLoRaWANConnectionStatusEventNotificationConfigurations ::
  LoRaWANConnectionStatusEventNotificationConfigurations
newLoRaWANConnectionStatusEventNotificationConfigurations :: LoRaWANConnectionStatusEventNotificationConfigurations
newLoRaWANConnectionStatusEventNotificationConfigurations =
  LoRaWANConnectionStatusEventNotificationConfigurations'
    { $sel:gatewayEuiEventTopic:LoRaWANConnectionStatusEventNotificationConfigurations' :: Maybe EventNotificationTopicStatus
gatewayEuiEventTopic =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Denotes whether the gateway EUI connection status event topic is enabled
-- or disabled.
loRaWANConnectionStatusEventNotificationConfigurations_gatewayEuiEventTopic :: Lens.Lens' LoRaWANConnectionStatusEventNotificationConfigurations (Prelude.Maybe EventNotificationTopicStatus)
loRaWANConnectionStatusEventNotificationConfigurations_gatewayEuiEventTopic :: Lens'
  LoRaWANConnectionStatusEventNotificationConfigurations
  (Maybe EventNotificationTopicStatus)
loRaWANConnectionStatusEventNotificationConfigurations_gatewayEuiEventTopic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANConnectionStatusEventNotificationConfigurations' {Maybe EventNotificationTopicStatus
gatewayEuiEventTopic :: Maybe EventNotificationTopicStatus
$sel:gatewayEuiEventTopic:LoRaWANConnectionStatusEventNotificationConfigurations' :: LoRaWANConnectionStatusEventNotificationConfigurations
-> Maybe EventNotificationTopicStatus
gatewayEuiEventTopic} -> Maybe EventNotificationTopicStatus
gatewayEuiEventTopic) (\s :: LoRaWANConnectionStatusEventNotificationConfigurations
s@LoRaWANConnectionStatusEventNotificationConfigurations' {} Maybe EventNotificationTopicStatus
a -> LoRaWANConnectionStatusEventNotificationConfigurations
s {$sel:gatewayEuiEventTopic:LoRaWANConnectionStatusEventNotificationConfigurations' :: Maybe EventNotificationTopicStatus
gatewayEuiEventTopic = Maybe EventNotificationTopicStatus
a} :: LoRaWANConnectionStatusEventNotificationConfigurations)

instance
  Data.FromJSON
    LoRaWANConnectionStatusEventNotificationConfigurations
  where
  parseJSON :: Value
-> Parser LoRaWANConnectionStatusEventNotificationConfigurations
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LoRaWANConnectionStatusEventNotificationConfigurations"
      ( \Object
x ->
          Maybe EventNotificationTopicStatus
-> LoRaWANConnectionStatusEventNotificationConfigurations
LoRaWANConnectionStatusEventNotificationConfigurations'
            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
"GatewayEuiEventTopic")
      )

instance
  Prelude.Hashable
    LoRaWANConnectionStatusEventNotificationConfigurations
  where
  hashWithSalt :: Int
-> LoRaWANConnectionStatusEventNotificationConfigurations -> Int
hashWithSalt
    Int
_salt
    LoRaWANConnectionStatusEventNotificationConfigurations' {Maybe EventNotificationTopicStatus
gatewayEuiEventTopic :: Maybe EventNotificationTopicStatus
$sel:gatewayEuiEventTopic:LoRaWANConnectionStatusEventNotificationConfigurations' :: LoRaWANConnectionStatusEventNotificationConfigurations
-> Maybe EventNotificationTopicStatus
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EventNotificationTopicStatus
gatewayEuiEventTopic

instance
  Prelude.NFData
    LoRaWANConnectionStatusEventNotificationConfigurations
  where
  rnf :: LoRaWANConnectionStatusEventNotificationConfigurations -> ()
rnf
    LoRaWANConnectionStatusEventNotificationConfigurations' {Maybe EventNotificationTopicStatus
gatewayEuiEventTopic :: Maybe EventNotificationTopicStatus
$sel:gatewayEuiEventTopic:LoRaWANConnectionStatusEventNotificationConfigurations' :: LoRaWANConnectionStatusEventNotificationConfigurations
-> Maybe EventNotificationTopicStatus
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe EventNotificationTopicStatus
gatewayEuiEventTopic

instance
  Data.ToJSON
    LoRaWANConnectionStatusEventNotificationConfigurations
  where
  toJSON :: LoRaWANConnectionStatusEventNotificationConfigurations -> Value
toJSON
    LoRaWANConnectionStatusEventNotificationConfigurations' {Maybe EventNotificationTopicStatus
gatewayEuiEventTopic :: Maybe EventNotificationTopicStatus
$sel:gatewayEuiEventTopic:LoRaWANConnectionStatusEventNotificationConfigurations' :: LoRaWANConnectionStatusEventNotificationConfigurations
-> Maybe EventNotificationTopicStatus
..} =
      [Pair] -> Value
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Key
"GatewayEuiEventTopic" 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
gatewayEuiEventTopic
            ]
        )