{-# 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.GatewayListItem 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
data GatewayListItem = GatewayListItem'
{
GatewayListItem -> Text
gatewayId :: Prelude.Text,
GatewayListItem -> Natural
downlinkFrequency :: Prelude.Natural
}
deriving (GatewayListItem -> GatewayListItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewayListItem -> GatewayListItem -> Bool
$c/= :: GatewayListItem -> GatewayListItem -> Bool
== :: GatewayListItem -> GatewayListItem -> Bool
$c== :: GatewayListItem -> GatewayListItem -> Bool
Prelude.Eq, ReadPrec [GatewayListItem]
ReadPrec GatewayListItem
Int -> ReadS GatewayListItem
ReadS [GatewayListItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewayListItem]
$creadListPrec :: ReadPrec [GatewayListItem]
readPrec :: ReadPrec GatewayListItem
$creadPrec :: ReadPrec GatewayListItem
readList :: ReadS [GatewayListItem]
$creadList :: ReadS [GatewayListItem]
readsPrec :: Int -> ReadS GatewayListItem
$creadsPrec :: Int -> ReadS GatewayListItem
Prelude.Read, Int -> GatewayListItem -> ShowS
[GatewayListItem] -> ShowS
GatewayListItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewayListItem] -> ShowS
$cshowList :: [GatewayListItem] -> ShowS
show :: GatewayListItem -> String
$cshow :: GatewayListItem -> String
showsPrec :: Int -> GatewayListItem -> ShowS
$cshowsPrec :: Int -> GatewayListItem -> ShowS
Prelude.Show, forall x. Rep GatewayListItem x -> GatewayListItem
forall x. GatewayListItem -> Rep GatewayListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatewayListItem x -> GatewayListItem
$cfrom :: forall x. GatewayListItem -> Rep GatewayListItem x
Prelude.Generic)
newGatewayListItem ::
Prelude.Text ->
Prelude.Natural ->
GatewayListItem
newGatewayListItem :: Text -> Natural -> GatewayListItem
newGatewayListItem Text
pGatewayId_ Natural
pDownlinkFrequency_ =
GatewayListItem'
{ $sel:gatewayId:GatewayListItem' :: Text
gatewayId = Text
pGatewayId_,
$sel:downlinkFrequency:GatewayListItem' :: Natural
downlinkFrequency = Natural
pDownlinkFrequency_
}
gatewayListItem_gatewayId :: Lens.Lens' GatewayListItem Prelude.Text
gatewayListItem_gatewayId :: Lens' GatewayListItem Text
gatewayListItem_gatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayListItem' {Text
gatewayId :: Text
$sel:gatewayId:GatewayListItem' :: GatewayListItem -> Text
gatewayId} -> Text
gatewayId) (\s :: GatewayListItem
s@GatewayListItem' {} Text
a -> GatewayListItem
s {$sel:gatewayId:GatewayListItem' :: Text
gatewayId = Text
a} :: GatewayListItem)
gatewayListItem_downlinkFrequency :: Lens.Lens' GatewayListItem Prelude.Natural
gatewayListItem_downlinkFrequency :: Lens' GatewayListItem Natural
gatewayListItem_downlinkFrequency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewayListItem' {Natural
downlinkFrequency :: Natural
$sel:downlinkFrequency:GatewayListItem' :: GatewayListItem -> Natural
downlinkFrequency} -> Natural
downlinkFrequency) (\s :: GatewayListItem
s@GatewayListItem' {} Natural
a -> GatewayListItem
s {$sel:downlinkFrequency:GatewayListItem' :: Natural
downlinkFrequency = Natural
a} :: GatewayListItem)
instance Data.FromJSON GatewayListItem where
parseJSON :: Value -> Parser GatewayListItem
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GatewayListItem"
( \Object
x ->
Text -> Natural -> GatewayListItem
GatewayListItem'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"GatewayId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"DownlinkFrequency")
)
instance Prelude.Hashable GatewayListItem where
hashWithSalt :: Int -> GatewayListItem -> Int
hashWithSalt Int
_salt GatewayListItem' {Natural
Text
downlinkFrequency :: Natural
gatewayId :: Text
$sel:downlinkFrequency:GatewayListItem' :: GatewayListItem -> Natural
$sel:gatewayId:GatewayListItem' :: GatewayListItem -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
downlinkFrequency
instance Prelude.NFData GatewayListItem where
rnf :: GatewayListItem -> ()
rnf GatewayListItem' {Natural
Text
downlinkFrequency :: Natural
gatewayId :: Text
$sel:downlinkFrequency:GatewayListItem' :: GatewayListItem -> Natural
$sel:gatewayId:GatewayListItem' :: GatewayListItem -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
gatewayId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
downlinkFrequency
instance Data.ToJSON GatewayListItem where
toJSON :: GatewayListItem -> Value
toJSON GatewayListItem' {Natural
Text
downlinkFrequency :: Natural
gatewayId :: Text
$sel:downlinkFrequency:GatewayListItem' :: GatewayListItem -> Natural
$sel:gatewayId:GatewayListItem' :: GatewayListItem -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"GatewayId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gatewayId),
forall a. a -> Maybe a
Prelude.Just
(Key
"DownlinkFrequency" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
downlinkFrequency)
]
)