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

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

-- | The LoRaWAN information used with the multicast session.
--
-- /See:/ 'newLoRaWANMulticastSession' smart constructor.
data LoRaWANMulticastSession = LoRaWANMulticastSession'
  { LoRaWANMulticastSession -> Maybe Natural
dlDr :: Prelude.Maybe Prelude.Natural,
    LoRaWANMulticastSession -> Maybe Natural
dlFreq :: Prelude.Maybe Prelude.Natural,
    LoRaWANMulticastSession -> Maybe ISO8601
sessionStartTime :: Prelude.Maybe Data.ISO8601,
    LoRaWANMulticastSession -> Maybe Natural
sessionTimeout :: Prelude.Maybe Prelude.Natural
  }
  deriving (LoRaWANMulticastSession -> LoRaWANMulticastSession -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoRaWANMulticastSession -> LoRaWANMulticastSession -> Bool
$c/= :: LoRaWANMulticastSession -> LoRaWANMulticastSession -> Bool
== :: LoRaWANMulticastSession -> LoRaWANMulticastSession -> Bool
$c== :: LoRaWANMulticastSession -> LoRaWANMulticastSession -> Bool
Prelude.Eq, ReadPrec [LoRaWANMulticastSession]
ReadPrec LoRaWANMulticastSession
Int -> ReadS LoRaWANMulticastSession
ReadS [LoRaWANMulticastSession]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoRaWANMulticastSession]
$creadListPrec :: ReadPrec [LoRaWANMulticastSession]
readPrec :: ReadPrec LoRaWANMulticastSession
$creadPrec :: ReadPrec LoRaWANMulticastSession
readList :: ReadS [LoRaWANMulticastSession]
$creadList :: ReadS [LoRaWANMulticastSession]
readsPrec :: Int -> ReadS LoRaWANMulticastSession
$creadsPrec :: Int -> ReadS LoRaWANMulticastSession
Prelude.Read, Int -> LoRaWANMulticastSession -> ShowS
[LoRaWANMulticastSession] -> ShowS
LoRaWANMulticastSession -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoRaWANMulticastSession] -> ShowS
$cshowList :: [LoRaWANMulticastSession] -> ShowS
show :: LoRaWANMulticastSession -> String
$cshow :: LoRaWANMulticastSession -> String
showsPrec :: Int -> LoRaWANMulticastSession -> ShowS
$cshowsPrec :: Int -> LoRaWANMulticastSession -> ShowS
Prelude.Show, forall x. Rep LoRaWANMulticastSession x -> LoRaWANMulticastSession
forall x. LoRaWANMulticastSession -> Rep LoRaWANMulticastSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoRaWANMulticastSession x -> LoRaWANMulticastSession
$cfrom :: forall x. LoRaWANMulticastSession -> Rep LoRaWANMulticastSession x
Prelude.Generic)

-- |
-- Create a value of 'LoRaWANMulticastSession' 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:
--
-- 'dlDr', 'loRaWANMulticastSession_dlDr' - Undocumented member.
--
-- 'dlFreq', 'loRaWANMulticastSession_dlFreq' - Undocumented member.
--
-- 'sessionStartTime', 'loRaWANMulticastSession_sessionStartTime' - Undocumented member.
--
-- 'sessionTimeout', 'loRaWANMulticastSession_sessionTimeout' - Undocumented member.
newLoRaWANMulticastSession ::
  LoRaWANMulticastSession
newLoRaWANMulticastSession :: LoRaWANMulticastSession
newLoRaWANMulticastSession =
  LoRaWANMulticastSession'
    { $sel:dlDr:LoRaWANMulticastSession' :: Maybe Natural
dlDr = forall a. Maybe a
Prelude.Nothing,
      $sel:dlFreq:LoRaWANMulticastSession' :: Maybe Natural
dlFreq = forall a. Maybe a
Prelude.Nothing,
      $sel:sessionStartTime:LoRaWANMulticastSession' :: Maybe ISO8601
sessionStartTime = forall a. Maybe a
Prelude.Nothing,
      $sel:sessionTimeout:LoRaWANMulticastSession' :: Maybe Natural
sessionTimeout = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
loRaWANMulticastSession_dlDr :: Lens.Lens' LoRaWANMulticastSession (Prelude.Maybe Prelude.Natural)
loRaWANMulticastSession_dlDr :: Lens' LoRaWANMulticastSession (Maybe Natural)
loRaWANMulticastSession_dlDr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANMulticastSession' {Maybe Natural
dlDr :: Maybe Natural
$sel:dlDr:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
dlDr} -> Maybe Natural
dlDr) (\s :: LoRaWANMulticastSession
s@LoRaWANMulticastSession' {} Maybe Natural
a -> LoRaWANMulticastSession
s {$sel:dlDr:LoRaWANMulticastSession' :: Maybe Natural
dlDr = Maybe Natural
a} :: LoRaWANMulticastSession)

-- | Undocumented member.
loRaWANMulticastSession_dlFreq :: Lens.Lens' LoRaWANMulticastSession (Prelude.Maybe Prelude.Natural)
loRaWANMulticastSession_dlFreq :: Lens' LoRaWANMulticastSession (Maybe Natural)
loRaWANMulticastSession_dlFreq = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANMulticastSession' {Maybe Natural
dlFreq :: Maybe Natural
$sel:dlFreq:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
dlFreq} -> Maybe Natural
dlFreq) (\s :: LoRaWANMulticastSession
s@LoRaWANMulticastSession' {} Maybe Natural
a -> LoRaWANMulticastSession
s {$sel:dlFreq:LoRaWANMulticastSession' :: Maybe Natural
dlFreq = Maybe Natural
a} :: LoRaWANMulticastSession)

-- | Undocumented member.
loRaWANMulticastSession_sessionStartTime :: Lens.Lens' LoRaWANMulticastSession (Prelude.Maybe Prelude.UTCTime)
loRaWANMulticastSession_sessionStartTime :: Lens' LoRaWANMulticastSession (Maybe UTCTime)
loRaWANMulticastSession_sessionStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANMulticastSession' {Maybe ISO8601
sessionStartTime :: Maybe ISO8601
$sel:sessionStartTime:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe ISO8601
sessionStartTime} -> Maybe ISO8601
sessionStartTime) (\s :: LoRaWANMulticastSession
s@LoRaWANMulticastSession' {} Maybe ISO8601
a -> LoRaWANMulticastSession
s {$sel:sessionStartTime:LoRaWANMulticastSession' :: Maybe ISO8601
sessionStartTime = Maybe ISO8601
a} :: LoRaWANMulticastSession) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Undocumented member.
loRaWANMulticastSession_sessionTimeout :: Lens.Lens' LoRaWANMulticastSession (Prelude.Maybe Prelude.Natural)
loRaWANMulticastSession_sessionTimeout :: Lens' LoRaWANMulticastSession (Maybe Natural)
loRaWANMulticastSession_sessionTimeout = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANMulticastSession' {Maybe Natural
sessionTimeout :: Maybe Natural
$sel:sessionTimeout:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
sessionTimeout} -> Maybe Natural
sessionTimeout) (\s :: LoRaWANMulticastSession
s@LoRaWANMulticastSession' {} Maybe Natural
a -> LoRaWANMulticastSession
s {$sel:sessionTimeout:LoRaWANMulticastSession' :: Maybe Natural
sessionTimeout = Maybe Natural
a} :: LoRaWANMulticastSession)

instance Data.FromJSON LoRaWANMulticastSession where
  parseJSON :: Value -> Parser LoRaWANMulticastSession
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LoRaWANMulticastSession"
      ( \Object
x ->
          Maybe Natural
-> Maybe Natural
-> Maybe ISO8601
-> Maybe Natural
-> LoRaWANMulticastSession
LoRaWANMulticastSession'
            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
"DlDr")
            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
"DlFreq")
            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
"SessionStartTime")
            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
"SessionTimeout")
      )

instance Prelude.Hashable LoRaWANMulticastSession where
  hashWithSalt :: Int -> LoRaWANMulticastSession -> Int
hashWithSalt Int
_salt LoRaWANMulticastSession' {Maybe Natural
Maybe ISO8601
sessionTimeout :: Maybe Natural
sessionStartTime :: Maybe ISO8601
dlFreq :: Maybe Natural
dlDr :: Maybe Natural
$sel:sessionTimeout:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
$sel:sessionStartTime:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe ISO8601
$sel:dlFreq:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
$sel:dlDr:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
dlDr
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
dlFreq
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
sessionStartTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sessionTimeout

instance Prelude.NFData LoRaWANMulticastSession where
  rnf :: LoRaWANMulticastSession -> ()
rnf LoRaWANMulticastSession' {Maybe Natural
Maybe ISO8601
sessionTimeout :: Maybe Natural
sessionStartTime :: Maybe ISO8601
dlFreq :: Maybe Natural
dlDr :: Maybe Natural
$sel:sessionTimeout:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
$sel:sessionStartTime:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe ISO8601
$sel:dlFreq:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
$sel:dlDr:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
dlDr
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
dlFreq
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
sessionStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
sessionTimeout

instance Data.ToJSON LoRaWANMulticastSession where
  toJSON :: LoRaWANMulticastSession -> Value
toJSON LoRaWANMulticastSession' {Maybe Natural
Maybe ISO8601
sessionTimeout :: Maybe Natural
sessionStartTime :: Maybe ISO8601
dlFreq :: Maybe Natural
dlDr :: Maybe Natural
$sel:sessionTimeout:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
$sel:sessionStartTime:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe ISO8601
$sel:dlFreq:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
$sel:dlDr:LoRaWANMulticastSession' :: LoRaWANMulticastSession -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DlDr" 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 Natural
dlDr,
            (Key
"DlFreq" 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 Natural
dlFreq,
            (Key
"SessionStartTime" 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 ISO8601
sessionStartTime,
            (Key
"SessionTimeout" 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 Natural
sessionTimeout
          ]
      )