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

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

-- | Session keys for ABP v1.1
--
-- /See:/ 'newSessionKeysAbpV1_1' smart constructor.
data SessionKeysAbpV1_1 = SessionKeysAbpV1_1'
  { -- | The FNwkSIntKey value.
    SessionKeysAbpV1_1 -> Maybe Text
fNwkSIntKey :: Prelude.Maybe Prelude.Text,
    -- | The SNwkSIntKey value.
    SessionKeysAbpV1_1 -> Maybe Text
sNwkSIntKey :: Prelude.Maybe Prelude.Text,
    -- | The NwkSEncKey value.
    SessionKeysAbpV1_1 -> Maybe Text
nwkSEncKey :: Prelude.Maybe Prelude.Text,
    -- | The AppSKey value.
    SessionKeysAbpV1_1 -> Maybe Text
appSKey :: Prelude.Maybe Prelude.Text
  }
  deriving (SessionKeysAbpV1_1 -> SessionKeysAbpV1_1 -> Bool
(SessionKeysAbpV1_1 -> SessionKeysAbpV1_1 -> Bool)
-> (SessionKeysAbpV1_1 -> SessionKeysAbpV1_1 -> Bool)
-> Eq SessionKeysAbpV1_1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionKeysAbpV1_1 -> SessionKeysAbpV1_1 -> Bool
$c/= :: SessionKeysAbpV1_1 -> SessionKeysAbpV1_1 -> Bool
== :: SessionKeysAbpV1_1 -> SessionKeysAbpV1_1 -> Bool
$c== :: SessionKeysAbpV1_1 -> SessionKeysAbpV1_1 -> Bool
Prelude.Eq, ReadPrec [SessionKeysAbpV1_1]
ReadPrec SessionKeysAbpV1_1
Int -> ReadS SessionKeysAbpV1_1
ReadS [SessionKeysAbpV1_1]
(Int -> ReadS SessionKeysAbpV1_1)
-> ReadS [SessionKeysAbpV1_1]
-> ReadPrec SessionKeysAbpV1_1
-> ReadPrec [SessionKeysAbpV1_1]
-> Read SessionKeysAbpV1_1
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SessionKeysAbpV1_1]
$creadListPrec :: ReadPrec [SessionKeysAbpV1_1]
readPrec :: ReadPrec SessionKeysAbpV1_1
$creadPrec :: ReadPrec SessionKeysAbpV1_1
readList :: ReadS [SessionKeysAbpV1_1]
$creadList :: ReadS [SessionKeysAbpV1_1]
readsPrec :: Int -> ReadS SessionKeysAbpV1_1
$creadsPrec :: Int -> ReadS SessionKeysAbpV1_1
Prelude.Read, Int -> SessionKeysAbpV1_1 -> ShowS
[SessionKeysAbpV1_1] -> ShowS
SessionKeysAbpV1_1 -> String
(Int -> SessionKeysAbpV1_1 -> ShowS)
-> (SessionKeysAbpV1_1 -> String)
-> ([SessionKeysAbpV1_1] -> ShowS)
-> Show SessionKeysAbpV1_1
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionKeysAbpV1_1] -> ShowS
$cshowList :: [SessionKeysAbpV1_1] -> ShowS
show :: SessionKeysAbpV1_1 -> String
$cshow :: SessionKeysAbpV1_1 -> String
showsPrec :: Int -> SessionKeysAbpV1_1 -> ShowS
$cshowsPrec :: Int -> SessionKeysAbpV1_1 -> ShowS
Prelude.Show, (forall x. SessionKeysAbpV1_1 -> Rep SessionKeysAbpV1_1 x)
-> (forall x. Rep SessionKeysAbpV1_1 x -> SessionKeysAbpV1_1)
-> Generic SessionKeysAbpV1_1
forall x. Rep SessionKeysAbpV1_1 x -> SessionKeysAbpV1_1
forall x. SessionKeysAbpV1_1 -> Rep SessionKeysAbpV1_1 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SessionKeysAbpV1_1 x -> SessionKeysAbpV1_1
$cfrom :: forall x. SessionKeysAbpV1_1 -> Rep SessionKeysAbpV1_1 x
Prelude.Generic)

-- |
-- Create a value of 'SessionKeysAbpV1_1' 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:
--
-- 'fNwkSIntKey', 'sessionKeysAbpV1_1_fNwkSIntKey' - The FNwkSIntKey value.
--
-- 'sNwkSIntKey', 'sessionKeysAbpV1_1_sNwkSIntKey' - The SNwkSIntKey value.
--
-- 'nwkSEncKey', 'sessionKeysAbpV1_1_nwkSEncKey' - The NwkSEncKey value.
--
-- 'appSKey', 'sessionKeysAbpV1_1_appSKey' - The AppSKey value.
newSessionKeysAbpV1_1 ::
  SessionKeysAbpV1_1
newSessionKeysAbpV1_1 :: SessionKeysAbpV1_1
newSessionKeysAbpV1_1 =
  SessionKeysAbpV1_1' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SessionKeysAbpV1_1
SessionKeysAbpV1_1'
    { $sel:fNwkSIntKey:SessionKeysAbpV1_1' :: Maybe Text
fNwkSIntKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sNwkSIntKey:SessionKeysAbpV1_1' :: Maybe Text
sNwkSIntKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nwkSEncKey:SessionKeysAbpV1_1' :: Maybe Text
nwkSEncKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appSKey:SessionKeysAbpV1_1' :: Maybe Text
appSKey = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The FNwkSIntKey value.
sessionKeysAbpV1_1_fNwkSIntKey :: Lens.Lens' SessionKeysAbpV1_1 (Prelude.Maybe Prelude.Text)
sessionKeysAbpV1_1_fNwkSIntKey :: (Maybe Text -> f (Maybe Text))
-> SessionKeysAbpV1_1 -> f SessionKeysAbpV1_1
sessionKeysAbpV1_1_fNwkSIntKey = (SessionKeysAbpV1_1 -> Maybe Text)
-> (SessionKeysAbpV1_1 -> Maybe Text -> SessionKeysAbpV1_1)
-> Lens
     SessionKeysAbpV1_1 SessionKeysAbpV1_1 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionKeysAbpV1_1' {Maybe Text
fNwkSIntKey :: Maybe Text
$sel:fNwkSIntKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
fNwkSIntKey} -> Maybe Text
fNwkSIntKey) (\s :: SessionKeysAbpV1_1
s@SessionKeysAbpV1_1' {} Maybe Text
a -> SessionKeysAbpV1_1
s {$sel:fNwkSIntKey:SessionKeysAbpV1_1' :: Maybe Text
fNwkSIntKey = Maybe Text
a} :: SessionKeysAbpV1_1)

-- | The SNwkSIntKey value.
sessionKeysAbpV1_1_sNwkSIntKey :: Lens.Lens' SessionKeysAbpV1_1 (Prelude.Maybe Prelude.Text)
sessionKeysAbpV1_1_sNwkSIntKey :: (Maybe Text -> f (Maybe Text))
-> SessionKeysAbpV1_1 -> f SessionKeysAbpV1_1
sessionKeysAbpV1_1_sNwkSIntKey = (SessionKeysAbpV1_1 -> Maybe Text)
-> (SessionKeysAbpV1_1 -> Maybe Text -> SessionKeysAbpV1_1)
-> Lens
     SessionKeysAbpV1_1 SessionKeysAbpV1_1 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionKeysAbpV1_1' {Maybe Text
sNwkSIntKey :: Maybe Text
$sel:sNwkSIntKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
sNwkSIntKey} -> Maybe Text
sNwkSIntKey) (\s :: SessionKeysAbpV1_1
s@SessionKeysAbpV1_1' {} Maybe Text
a -> SessionKeysAbpV1_1
s {$sel:sNwkSIntKey:SessionKeysAbpV1_1' :: Maybe Text
sNwkSIntKey = Maybe Text
a} :: SessionKeysAbpV1_1)

-- | The NwkSEncKey value.
sessionKeysAbpV1_1_nwkSEncKey :: Lens.Lens' SessionKeysAbpV1_1 (Prelude.Maybe Prelude.Text)
sessionKeysAbpV1_1_nwkSEncKey :: (Maybe Text -> f (Maybe Text))
-> SessionKeysAbpV1_1 -> f SessionKeysAbpV1_1
sessionKeysAbpV1_1_nwkSEncKey = (SessionKeysAbpV1_1 -> Maybe Text)
-> (SessionKeysAbpV1_1 -> Maybe Text -> SessionKeysAbpV1_1)
-> Lens
     SessionKeysAbpV1_1 SessionKeysAbpV1_1 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionKeysAbpV1_1' {Maybe Text
nwkSEncKey :: Maybe Text
$sel:nwkSEncKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
nwkSEncKey} -> Maybe Text
nwkSEncKey) (\s :: SessionKeysAbpV1_1
s@SessionKeysAbpV1_1' {} Maybe Text
a -> SessionKeysAbpV1_1
s {$sel:nwkSEncKey:SessionKeysAbpV1_1' :: Maybe Text
nwkSEncKey = Maybe Text
a} :: SessionKeysAbpV1_1)

-- | The AppSKey value.
sessionKeysAbpV1_1_appSKey :: Lens.Lens' SessionKeysAbpV1_1 (Prelude.Maybe Prelude.Text)
sessionKeysAbpV1_1_appSKey :: (Maybe Text -> f (Maybe Text))
-> SessionKeysAbpV1_1 -> f SessionKeysAbpV1_1
sessionKeysAbpV1_1_appSKey = (SessionKeysAbpV1_1 -> Maybe Text)
-> (SessionKeysAbpV1_1 -> Maybe Text -> SessionKeysAbpV1_1)
-> Lens
     SessionKeysAbpV1_1 SessionKeysAbpV1_1 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionKeysAbpV1_1' {Maybe Text
appSKey :: Maybe Text
$sel:appSKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
appSKey} -> Maybe Text
appSKey) (\s :: SessionKeysAbpV1_1
s@SessionKeysAbpV1_1' {} Maybe Text
a -> SessionKeysAbpV1_1
s {$sel:appSKey:SessionKeysAbpV1_1' :: Maybe Text
appSKey = Maybe Text
a} :: SessionKeysAbpV1_1)

instance Core.FromJSON SessionKeysAbpV1_1 where
  parseJSON :: Value -> Parser SessionKeysAbpV1_1
parseJSON =
    String
-> (Object -> Parser SessionKeysAbpV1_1)
-> Value
-> Parser SessionKeysAbpV1_1
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SessionKeysAbpV1_1"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> SessionKeysAbpV1_1
SessionKeysAbpV1_1'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> SessionKeysAbpV1_1)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> SessionKeysAbpV1_1)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FNwkSIntKey")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> SessionKeysAbpV1_1)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SessionKeysAbpV1_1)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SNwkSIntKey")
            Parser (Maybe Text -> Maybe Text -> SessionKeysAbpV1_1)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SessionKeysAbpV1_1)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NwkSEncKey")
            Parser (Maybe Text -> SessionKeysAbpV1_1)
-> Parser (Maybe Text) -> Parser SessionKeysAbpV1_1
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AppSKey")
      )

instance Prelude.Hashable SessionKeysAbpV1_1

instance Prelude.NFData SessionKeysAbpV1_1

instance Core.ToJSON SessionKeysAbpV1_1 where
  toJSON :: SessionKeysAbpV1_1 -> Value
toJSON SessionKeysAbpV1_1' {Maybe Text
appSKey :: Maybe Text
nwkSEncKey :: Maybe Text
sNwkSIntKey :: Maybe Text
fNwkSIntKey :: Maybe Text
$sel:appSKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
$sel:nwkSEncKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
$sel:sNwkSIntKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
$sel:fNwkSIntKey:SessionKeysAbpV1_1' :: SessionKeysAbpV1_1 -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FNwkSIntKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fNwkSIntKey,
            (Text
"SNwkSIntKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sNwkSIntKey,
            (Text
"NwkSEncKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nwkSEncKey,
            (Text
"AppSKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appSKey
          ]
      )