{-# 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.LoRaWANGatewayMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LoRaWANGatewayMetadata = LoRaWANGatewayMetadata'
{
LoRaWANGatewayMetadata -> Maybe Text
gatewayEui :: Prelude.Maybe Prelude.Text,
LoRaWANGatewayMetadata -> Maybe Double
snr :: Prelude.Maybe Prelude.Double,
:: Prelude.Maybe Prelude.Double
}
deriving (LoRaWANGatewayMetadata -> LoRaWANGatewayMetadata -> Bool
(LoRaWANGatewayMetadata -> LoRaWANGatewayMetadata -> Bool)
-> (LoRaWANGatewayMetadata -> LoRaWANGatewayMetadata -> Bool)
-> Eq LoRaWANGatewayMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoRaWANGatewayMetadata -> LoRaWANGatewayMetadata -> Bool
$c/= :: LoRaWANGatewayMetadata -> LoRaWANGatewayMetadata -> Bool
== :: LoRaWANGatewayMetadata -> LoRaWANGatewayMetadata -> Bool
$c== :: LoRaWANGatewayMetadata -> LoRaWANGatewayMetadata -> Bool
Prelude.Eq, ReadPrec [LoRaWANGatewayMetadata]
ReadPrec LoRaWANGatewayMetadata
Int -> ReadS LoRaWANGatewayMetadata
ReadS [LoRaWANGatewayMetadata]
(Int -> ReadS LoRaWANGatewayMetadata)
-> ReadS [LoRaWANGatewayMetadata]
-> ReadPrec LoRaWANGatewayMetadata
-> ReadPrec [LoRaWANGatewayMetadata]
-> Read LoRaWANGatewayMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoRaWANGatewayMetadata]
$creadListPrec :: ReadPrec [LoRaWANGatewayMetadata]
readPrec :: ReadPrec LoRaWANGatewayMetadata
$creadPrec :: ReadPrec LoRaWANGatewayMetadata
readList :: ReadS [LoRaWANGatewayMetadata]
$creadList :: ReadS [LoRaWANGatewayMetadata]
readsPrec :: Int -> ReadS LoRaWANGatewayMetadata
$creadsPrec :: Int -> ReadS LoRaWANGatewayMetadata
Prelude.Read, Int -> LoRaWANGatewayMetadata -> ShowS
[LoRaWANGatewayMetadata] -> ShowS
LoRaWANGatewayMetadata -> String
(Int -> LoRaWANGatewayMetadata -> ShowS)
-> (LoRaWANGatewayMetadata -> String)
-> ([LoRaWANGatewayMetadata] -> ShowS)
-> Show LoRaWANGatewayMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoRaWANGatewayMetadata] -> ShowS
$cshowList :: [LoRaWANGatewayMetadata] -> ShowS
show :: LoRaWANGatewayMetadata -> String
$cshow :: LoRaWANGatewayMetadata -> String
showsPrec :: Int -> LoRaWANGatewayMetadata -> ShowS
$cshowsPrec :: Int -> LoRaWANGatewayMetadata -> ShowS
Prelude.Show, (forall x. LoRaWANGatewayMetadata -> Rep LoRaWANGatewayMetadata x)
-> (forall x.
Rep LoRaWANGatewayMetadata x -> LoRaWANGatewayMetadata)
-> Generic LoRaWANGatewayMetadata
forall x. Rep LoRaWANGatewayMetadata x -> LoRaWANGatewayMetadata
forall x. LoRaWANGatewayMetadata -> Rep LoRaWANGatewayMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoRaWANGatewayMetadata x -> LoRaWANGatewayMetadata
$cfrom :: forall x. LoRaWANGatewayMetadata -> Rep LoRaWANGatewayMetadata x
Prelude.Generic)
newLoRaWANGatewayMetadata ::
LoRaWANGatewayMetadata
newLoRaWANGatewayMetadata :: LoRaWANGatewayMetadata
newLoRaWANGatewayMetadata =
LoRaWANGatewayMetadata' :: Maybe Text
-> Maybe Double -> Maybe Double -> LoRaWANGatewayMetadata
LoRaWANGatewayMetadata'
{ $sel:gatewayEui:LoRaWANGatewayMetadata' :: Maybe Text
gatewayEui =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snr:LoRaWANGatewayMetadata' :: Maybe Double
snr = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:rssi:LoRaWANGatewayMetadata' :: Maybe Double
rssi = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
loRaWANGatewayMetadata_gatewayEui :: Lens.Lens' LoRaWANGatewayMetadata (Prelude.Maybe Prelude.Text)
loRaWANGatewayMetadata_gatewayEui :: (Maybe Text -> f (Maybe Text))
-> LoRaWANGatewayMetadata -> f LoRaWANGatewayMetadata
loRaWANGatewayMetadata_gatewayEui = (LoRaWANGatewayMetadata -> Maybe Text)
-> (LoRaWANGatewayMetadata -> Maybe Text -> LoRaWANGatewayMetadata)
-> Lens
LoRaWANGatewayMetadata
LoRaWANGatewayMetadata
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANGatewayMetadata' {Maybe Text
gatewayEui :: Maybe Text
$sel:gatewayEui:LoRaWANGatewayMetadata' :: LoRaWANGatewayMetadata -> Maybe Text
gatewayEui} -> Maybe Text
gatewayEui) (\s :: LoRaWANGatewayMetadata
s@LoRaWANGatewayMetadata' {} Maybe Text
a -> LoRaWANGatewayMetadata
s {$sel:gatewayEui:LoRaWANGatewayMetadata' :: Maybe Text
gatewayEui = Maybe Text
a} :: LoRaWANGatewayMetadata)
loRaWANGatewayMetadata_snr :: Lens.Lens' LoRaWANGatewayMetadata (Prelude.Maybe Prelude.Double)
loRaWANGatewayMetadata_snr :: (Maybe Double -> f (Maybe Double))
-> LoRaWANGatewayMetadata -> f LoRaWANGatewayMetadata
loRaWANGatewayMetadata_snr = (LoRaWANGatewayMetadata -> Maybe Double)
-> (LoRaWANGatewayMetadata
-> Maybe Double -> LoRaWANGatewayMetadata)
-> Lens
LoRaWANGatewayMetadata
LoRaWANGatewayMetadata
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANGatewayMetadata' {Maybe Double
snr :: Maybe Double
$sel:snr:LoRaWANGatewayMetadata' :: LoRaWANGatewayMetadata -> Maybe Double
snr} -> Maybe Double
snr) (\s :: LoRaWANGatewayMetadata
s@LoRaWANGatewayMetadata' {} Maybe Double
a -> LoRaWANGatewayMetadata
s {$sel:snr:LoRaWANGatewayMetadata' :: Maybe Double
snr = Maybe Double
a} :: LoRaWANGatewayMetadata)
loRaWANGatewayMetadata_rssi :: Lens.Lens' LoRaWANGatewayMetadata (Prelude.Maybe Prelude.Double)
= (LoRaWANGatewayMetadata -> Maybe Double)
-> (LoRaWANGatewayMetadata
-> Maybe Double -> LoRaWANGatewayMetadata)
-> Lens
LoRaWANGatewayMetadata
LoRaWANGatewayMetadata
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoRaWANGatewayMetadata' {Maybe Double
rssi :: Maybe Double
$sel:rssi:LoRaWANGatewayMetadata' :: LoRaWANGatewayMetadata -> Maybe Double
rssi} -> Maybe Double
rssi) (\s :: LoRaWANGatewayMetadata
s@LoRaWANGatewayMetadata' {} Maybe Double
a -> LoRaWANGatewayMetadata
s {$sel:rssi:LoRaWANGatewayMetadata' :: Maybe Double
rssi = Maybe Double
a} :: LoRaWANGatewayMetadata)
instance Core.FromJSON LoRaWANGatewayMetadata where
parseJSON :: Value -> Parser LoRaWANGatewayMetadata
parseJSON =
String
-> (Object -> Parser LoRaWANGatewayMetadata)
-> Value
-> Parser LoRaWANGatewayMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LoRaWANGatewayMetadata"
( \Object
x ->
Maybe Text
-> Maybe Double -> Maybe Double -> LoRaWANGatewayMetadata
LoRaWANGatewayMetadata'
(Maybe Text
-> Maybe Double -> Maybe Double -> LoRaWANGatewayMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Double -> Maybe Double -> LoRaWANGatewayMetadata)
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
"GatewayEui")
Parser (Maybe Double -> Maybe Double -> LoRaWANGatewayMetadata)
-> Parser (Maybe Double)
-> Parser (Maybe Double -> LoRaWANGatewayMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Snr")
Parser (Maybe Double -> LoRaWANGatewayMetadata)
-> Parser (Maybe Double) -> Parser LoRaWANGatewayMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Rssi")
)
instance Prelude.Hashable LoRaWANGatewayMetadata
instance Prelude.NFData LoRaWANGatewayMetadata