{-# 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.AbpV1_0_x where
import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.Types.SessionKeysAbpV1_0_x
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AbpV1_0_x = AbpV1_0_x'
{
AbpV1_0_x -> Maybe Text
devAddr :: Prelude.Maybe Prelude.Text,
AbpV1_0_x -> Maybe SessionKeysAbpV1_0_x
sessionKeys :: Prelude.Maybe SessionKeysAbpV1_0_x
}
deriving (AbpV1_0_x -> AbpV1_0_x -> Bool
(AbpV1_0_x -> AbpV1_0_x -> Bool)
-> (AbpV1_0_x -> AbpV1_0_x -> Bool) -> Eq AbpV1_0_x
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AbpV1_0_x -> AbpV1_0_x -> Bool
$c/= :: AbpV1_0_x -> AbpV1_0_x -> Bool
== :: AbpV1_0_x -> AbpV1_0_x -> Bool
$c== :: AbpV1_0_x -> AbpV1_0_x -> Bool
Prelude.Eq, ReadPrec [AbpV1_0_x]
ReadPrec AbpV1_0_x
Int -> ReadS AbpV1_0_x
ReadS [AbpV1_0_x]
(Int -> ReadS AbpV1_0_x)
-> ReadS [AbpV1_0_x]
-> ReadPrec AbpV1_0_x
-> ReadPrec [AbpV1_0_x]
-> Read AbpV1_0_x
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AbpV1_0_x]
$creadListPrec :: ReadPrec [AbpV1_0_x]
readPrec :: ReadPrec AbpV1_0_x
$creadPrec :: ReadPrec AbpV1_0_x
readList :: ReadS [AbpV1_0_x]
$creadList :: ReadS [AbpV1_0_x]
readsPrec :: Int -> ReadS AbpV1_0_x
$creadsPrec :: Int -> ReadS AbpV1_0_x
Prelude.Read, Int -> AbpV1_0_x -> ShowS
[AbpV1_0_x] -> ShowS
AbpV1_0_x -> String
(Int -> AbpV1_0_x -> ShowS)
-> (AbpV1_0_x -> String)
-> ([AbpV1_0_x] -> ShowS)
-> Show AbpV1_0_x
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AbpV1_0_x] -> ShowS
$cshowList :: [AbpV1_0_x] -> ShowS
show :: AbpV1_0_x -> String
$cshow :: AbpV1_0_x -> String
showsPrec :: Int -> AbpV1_0_x -> ShowS
$cshowsPrec :: Int -> AbpV1_0_x -> ShowS
Prelude.Show, (forall x. AbpV1_0_x -> Rep AbpV1_0_x x)
-> (forall x. Rep AbpV1_0_x x -> AbpV1_0_x) -> Generic AbpV1_0_x
forall x. Rep AbpV1_0_x x -> AbpV1_0_x
forall x. AbpV1_0_x -> Rep AbpV1_0_x x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AbpV1_0_x x -> AbpV1_0_x
$cfrom :: forall x. AbpV1_0_x -> Rep AbpV1_0_x x
Prelude.Generic)
newAbpV1_0_x ::
AbpV1_0_x
newAbpV1_0_x :: AbpV1_0_x
newAbpV1_0_x =
AbpV1_0_x' :: Maybe Text -> Maybe SessionKeysAbpV1_0_x -> AbpV1_0_x
AbpV1_0_x'
{ $sel:devAddr:AbpV1_0_x' :: Maybe Text
devAddr = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sessionKeys:AbpV1_0_x' :: Maybe SessionKeysAbpV1_0_x
sessionKeys = Maybe SessionKeysAbpV1_0_x
forall a. Maybe a
Prelude.Nothing
}
abpV1_0_x_devAddr :: Lens.Lens' AbpV1_0_x (Prelude.Maybe Prelude.Text)
abpV1_0_x_devAddr :: (Maybe Text -> f (Maybe Text)) -> AbpV1_0_x -> f AbpV1_0_x
abpV1_0_x_devAddr = (AbpV1_0_x -> Maybe Text)
-> (AbpV1_0_x -> Maybe Text -> AbpV1_0_x)
-> Lens AbpV1_0_x AbpV1_0_x (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbpV1_0_x' {Maybe Text
devAddr :: Maybe Text
$sel:devAddr:AbpV1_0_x' :: AbpV1_0_x -> Maybe Text
devAddr} -> Maybe Text
devAddr) (\s :: AbpV1_0_x
s@AbpV1_0_x' {} Maybe Text
a -> AbpV1_0_x
s {$sel:devAddr:AbpV1_0_x' :: Maybe Text
devAddr = Maybe Text
a} :: AbpV1_0_x)
abpV1_0_x_sessionKeys :: Lens.Lens' AbpV1_0_x (Prelude.Maybe SessionKeysAbpV1_0_x)
abpV1_0_x_sessionKeys :: (Maybe SessionKeysAbpV1_0_x -> f (Maybe SessionKeysAbpV1_0_x))
-> AbpV1_0_x -> f AbpV1_0_x
abpV1_0_x_sessionKeys = (AbpV1_0_x -> Maybe SessionKeysAbpV1_0_x)
-> (AbpV1_0_x -> Maybe SessionKeysAbpV1_0_x -> AbpV1_0_x)
-> Lens
AbpV1_0_x
AbpV1_0_x
(Maybe SessionKeysAbpV1_0_x)
(Maybe SessionKeysAbpV1_0_x)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbpV1_0_x' {Maybe SessionKeysAbpV1_0_x
sessionKeys :: Maybe SessionKeysAbpV1_0_x
$sel:sessionKeys:AbpV1_0_x' :: AbpV1_0_x -> Maybe SessionKeysAbpV1_0_x
sessionKeys} -> Maybe SessionKeysAbpV1_0_x
sessionKeys) (\s :: AbpV1_0_x
s@AbpV1_0_x' {} Maybe SessionKeysAbpV1_0_x
a -> AbpV1_0_x
s {$sel:sessionKeys:AbpV1_0_x' :: Maybe SessionKeysAbpV1_0_x
sessionKeys = Maybe SessionKeysAbpV1_0_x
a} :: AbpV1_0_x)
instance Core.FromJSON AbpV1_0_x where
parseJSON :: Value -> Parser AbpV1_0_x
parseJSON =
String -> (Object -> Parser AbpV1_0_x) -> Value -> Parser AbpV1_0_x
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AbpV1_0_x"
( \Object
x ->
Maybe Text -> Maybe SessionKeysAbpV1_0_x -> AbpV1_0_x
AbpV1_0_x'
(Maybe Text -> Maybe SessionKeysAbpV1_0_x -> AbpV1_0_x)
-> Parser (Maybe Text)
-> Parser (Maybe SessionKeysAbpV1_0_x -> AbpV1_0_x)
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
"DevAddr")
Parser (Maybe SessionKeysAbpV1_0_x -> AbpV1_0_x)
-> Parser (Maybe SessionKeysAbpV1_0_x) -> Parser AbpV1_0_x
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SessionKeysAbpV1_0_x)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SessionKeys")
)
instance Prelude.Hashable AbpV1_0_x
instance Prelude.NFData AbpV1_0_x
instance Core.ToJSON AbpV1_0_x where
toJSON :: AbpV1_0_x -> Value
toJSON AbpV1_0_x' {Maybe Text
Maybe SessionKeysAbpV1_0_x
sessionKeys :: Maybe SessionKeysAbpV1_0_x
devAddr :: Maybe Text
$sel:sessionKeys:AbpV1_0_x' :: AbpV1_0_x -> Maybe SessionKeysAbpV1_0_x
$sel:devAddr:AbpV1_0_x' :: AbpV1_0_x -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DevAddr" 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
devAddr,
(Text
"SessionKeys" Text -> SessionKeysAbpV1_0_x -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SessionKeysAbpV1_0_x -> Pair)
-> Maybe SessionKeysAbpV1_0_x -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SessionKeysAbpV1_0_x
sessionKeys
]
)