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

import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.Types.LoRaWANGateway
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about a wireless gateway\'s operation.
--
-- /See:/ 'newWirelessGatewayStatistics' smart constructor.
data WirelessGatewayStatistics = WirelessGatewayStatistics'
  { -- | The Amazon Resource Name of the resource.
    WirelessGatewayStatistics -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | LoRaWAN gateway info.
    WirelessGatewayStatistics -> Maybe LoRaWANGateway
loRaWAN :: Prelude.Maybe LoRaWANGateway,
    -- | The name of the resource.
    WirelessGatewayStatistics -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the wireless gateway reporting the data.
    WirelessGatewayStatistics -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the most recent uplink was received.
    WirelessGatewayStatistics -> Maybe Text
lastUplinkReceivedAt :: Prelude.Maybe Prelude.Text,
    -- | The description of the resource.
    WirelessGatewayStatistics -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool
(WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool)
-> (WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool)
-> Eq WirelessGatewayStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool
$c/= :: WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool
== :: WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool
$c== :: WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool
Prelude.Eq, ReadPrec [WirelessGatewayStatistics]
ReadPrec WirelessGatewayStatistics
Int -> ReadS WirelessGatewayStatistics
ReadS [WirelessGatewayStatistics]
(Int -> ReadS WirelessGatewayStatistics)
-> ReadS [WirelessGatewayStatistics]
-> ReadPrec WirelessGatewayStatistics
-> ReadPrec [WirelessGatewayStatistics]
-> Read WirelessGatewayStatistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WirelessGatewayStatistics]
$creadListPrec :: ReadPrec [WirelessGatewayStatistics]
readPrec :: ReadPrec WirelessGatewayStatistics
$creadPrec :: ReadPrec WirelessGatewayStatistics
readList :: ReadS [WirelessGatewayStatistics]
$creadList :: ReadS [WirelessGatewayStatistics]
readsPrec :: Int -> ReadS WirelessGatewayStatistics
$creadsPrec :: Int -> ReadS WirelessGatewayStatistics
Prelude.Read, Int -> WirelessGatewayStatistics -> ShowS
[WirelessGatewayStatistics] -> ShowS
WirelessGatewayStatistics -> String
(Int -> WirelessGatewayStatistics -> ShowS)
-> (WirelessGatewayStatistics -> String)
-> ([WirelessGatewayStatistics] -> ShowS)
-> Show WirelessGatewayStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WirelessGatewayStatistics] -> ShowS
$cshowList :: [WirelessGatewayStatistics] -> ShowS
show :: WirelessGatewayStatistics -> String
$cshow :: WirelessGatewayStatistics -> String
showsPrec :: Int -> WirelessGatewayStatistics -> ShowS
$cshowsPrec :: Int -> WirelessGatewayStatistics -> ShowS
Prelude.Show, (forall x.
 WirelessGatewayStatistics -> Rep WirelessGatewayStatistics x)
-> (forall x.
    Rep WirelessGatewayStatistics x -> WirelessGatewayStatistics)
-> Generic WirelessGatewayStatistics
forall x.
Rep WirelessGatewayStatistics x -> WirelessGatewayStatistics
forall x.
WirelessGatewayStatistics -> Rep WirelessGatewayStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WirelessGatewayStatistics x -> WirelessGatewayStatistics
$cfrom :: forall x.
WirelessGatewayStatistics -> Rep WirelessGatewayStatistics x
Prelude.Generic)

-- |
-- Create a value of 'WirelessGatewayStatistics' 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:
--
-- 'arn', 'wirelessGatewayStatistics_arn' - The Amazon Resource Name of the resource.
--
-- 'loRaWAN', 'wirelessGatewayStatistics_loRaWAN' - LoRaWAN gateway info.
--
-- 'name', 'wirelessGatewayStatistics_name' - The name of the resource.
--
-- 'id', 'wirelessGatewayStatistics_id' - The ID of the wireless gateway reporting the data.
--
-- 'lastUplinkReceivedAt', 'wirelessGatewayStatistics_lastUplinkReceivedAt' - The date and time when the most recent uplink was received.
--
-- 'description', 'wirelessGatewayStatistics_description' - The description of the resource.
newWirelessGatewayStatistics ::
  WirelessGatewayStatistics
newWirelessGatewayStatistics :: WirelessGatewayStatistics
newWirelessGatewayStatistics =
  WirelessGatewayStatistics' :: Maybe Text
-> Maybe LoRaWANGateway
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WirelessGatewayStatistics
WirelessGatewayStatistics'
    { $sel:arn:WirelessGatewayStatistics' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:loRaWAN:WirelessGatewayStatistics' :: Maybe LoRaWANGateway
loRaWAN = Maybe LoRaWANGateway
forall a. Maybe a
Prelude.Nothing,
      $sel:name:WirelessGatewayStatistics' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:WirelessGatewayStatistics' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUplinkReceivedAt:WirelessGatewayStatistics' :: Maybe Text
lastUplinkReceivedAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:WirelessGatewayStatistics' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name of the resource.
wirelessGatewayStatistics_arn :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_arn :: (Maybe Text -> f (Maybe Text))
-> WirelessGatewayStatistics -> f WirelessGatewayStatistics
wirelessGatewayStatistics_arn = (WirelessGatewayStatistics -> Maybe Text)
-> (WirelessGatewayStatistics
    -> Maybe Text -> WirelessGatewayStatistics)
-> Lens
     WirelessGatewayStatistics
     WirelessGatewayStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayStatistics' {Maybe Text
arn :: Maybe Text
$sel:arn:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
arn} -> Maybe Text
arn) (\s :: WirelessGatewayStatistics
s@WirelessGatewayStatistics' {} Maybe Text
a -> WirelessGatewayStatistics
s {$sel:arn:WirelessGatewayStatistics' :: Maybe Text
arn = Maybe Text
a} :: WirelessGatewayStatistics)

-- | LoRaWAN gateway info.
wirelessGatewayStatistics_loRaWAN :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe LoRaWANGateway)
wirelessGatewayStatistics_loRaWAN :: (Maybe LoRaWANGateway -> f (Maybe LoRaWANGateway))
-> WirelessGatewayStatistics -> f WirelessGatewayStatistics
wirelessGatewayStatistics_loRaWAN = (WirelessGatewayStatistics -> Maybe LoRaWANGateway)
-> (WirelessGatewayStatistics
    -> Maybe LoRaWANGateway -> WirelessGatewayStatistics)
-> Lens
     WirelessGatewayStatistics
     WirelessGatewayStatistics
     (Maybe LoRaWANGateway)
     (Maybe LoRaWANGateway)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayStatistics' {Maybe LoRaWANGateway
loRaWAN :: Maybe LoRaWANGateway
$sel:loRaWAN:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe LoRaWANGateway
loRaWAN} -> Maybe LoRaWANGateway
loRaWAN) (\s :: WirelessGatewayStatistics
s@WirelessGatewayStatistics' {} Maybe LoRaWANGateway
a -> WirelessGatewayStatistics
s {$sel:loRaWAN:WirelessGatewayStatistics' :: Maybe LoRaWANGateway
loRaWAN = Maybe LoRaWANGateway
a} :: WirelessGatewayStatistics)

-- | The name of the resource.
wirelessGatewayStatistics_name :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_name :: (Maybe Text -> f (Maybe Text))
-> WirelessGatewayStatistics -> f WirelessGatewayStatistics
wirelessGatewayStatistics_name = (WirelessGatewayStatistics -> Maybe Text)
-> (WirelessGatewayStatistics
    -> Maybe Text -> WirelessGatewayStatistics)
-> Lens
     WirelessGatewayStatistics
     WirelessGatewayStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayStatistics' {Maybe Text
name :: Maybe Text
$sel:name:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
name} -> Maybe Text
name) (\s :: WirelessGatewayStatistics
s@WirelessGatewayStatistics' {} Maybe Text
a -> WirelessGatewayStatistics
s {$sel:name:WirelessGatewayStatistics' :: Maybe Text
name = Maybe Text
a} :: WirelessGatewayStatistics)

-- | The ID of the wireless gateway reporting the data.
wirelessGatewayStatistics_id :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_id :: (Maybe Text -> f (Maybe Text))
-> WirelessGatewayStatistics -> f WirelessGatewayStatistics
wirelessGatewayStatistics_id = (WirelessGatewayStatistics -> Maybe Text)
-> (WirelessGatewayStatistics
    -> Maybe Text -> WirelessGatewayStatistics)
-> Lens
     WirelessGatewayStatistics
     WirelessGatewayStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayStatistics' {Maybe Text
id :: Maybe Text
$sel:id:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
id} -> Maybe Text
id) (\s :: WirelessGatewayStatistics
s@WirelessGatewayStatistics' {} Maybe Text
a -> WirelessGatewayStatistics
s {$sel:id:WirelessGatewayStatistics' :: Maybe Text
id = Maybe Text
a} :: WirelessGatewayStatistics)

-- | The date and time when the most recent uplink was received.
wirelessGatewayStatistics_lastUplinkReceivedAt :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_lastUplinkReceivedAt :: (Maybe Text -> f (Maybe Text))
-> WirelessGatewayStatistics -> f WirelessGatewayStatistics
wirelessGatewayStatistics_lastUplinkReceivedAt = (WirelessGatewayStatistics -> Maybe Text)
-> (WirelessGatewayStatistics
    -> Maybe Text -> WirelessGatewayStatistics)
-> Lens
     WirelessGatewayStatistics
     WirelessGatewayStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayStatistics' {Maybe Text
lastUplinkReceivedAt :: Maybe Text
$sel:lastUplinkReceivedAt:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
lastUplinkReceivedAt} -> Maybe Text
lastUplinkReceivedAt) (\s :: WirelessGatewayStatistics
s@WirelessGatewayStatistics' {} Maybe Text
a -> WirelessGatewayStatistics
s {$sel:lastUplinkReceivedAt:WirelessGatewayStatistics' :: Maybe Text
lastUplinkReceivedAt = Maybe Text
a} :: WirelessGatewayStatistics)

-- | The description of the resource.
wirelessGatewayStatistics_description :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_description :: (Maybe Text -> f (Maybe Text))
-> WirelessGatewayStatistics -> f WirelessGatewayStatistics
wirelessGatewayStatistics_description = (WirelessGatewayStatistics -> Maybe Text)
-> (WirelessGatewayStatistics
    -> Maybe Text -> WirelessGatewayStatistics)
-> Lens
     WirelessGatewayStatistics
     WirelessGatewayStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WirelessGatewayStatistics' {Maybe Text
description :: Maybe Text
$sel:description:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
description} -> Maybe Text
description) (\s :: WirelessGatewayStatistics
s@WirelessGatewayStatistics' {} Maybe Text
a -> WirelessGatewayStatistics
s {$sel:description:WirelessGatewayStatistics' :: Maybe Text
description = Maybe Text
a} :: WirelessGatewayStatistics)

instance Core.FromJSON WirelessGatewayStatistics where
  parseJSON :: Value -> Parser WirelessGatewayStatistics
parseJSON =
    String
-> (Object -> Parser WirelessGatewayStatistics)
-> Value
-> Parser WirelessGatewayStatistics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WirelessGatewayStatistics"
      ( \Object
x ->
          Maybe Text
-> Maybe LoRaWANGateway
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WirelessGatewayStatistics
WirelessGatewayStatistics'
            (Maybe Text
 -> Maybe LoRaWANGateway
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> WirelessGatewayStatistics)
-> Parser (Maybe Text)
-> Parser
     (Maybe LoRaWANGateway
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> WirelessGatewayStatistics)
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
"Arn")
            Parser
  (Maybe LoRaWANGateway
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> WirelessGatewayStatistics)
-> Parser (Maybe LoRaWANGateway)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> WirelessGatewayStatistics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LoRaWANGateway)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LoRaWAN")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> WirelessGatewayStatistics)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> WirelessGatewayStatistics)
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
"Name")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> WirelessGatewayStatistics)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> WirelessGatewayStatistics)
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
"Id")
            Parser (Maybe Text -> Maybe Text -> WirelessGatewayStatistics)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> WirelessGatewayStatistics)
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
"LastUplinkReceivedAt")
            Parser (Maybe Text -> WirelessGatewayStatistics)
-> Parser (Maybe Text) -> Parser WirelessGatewayStatistics
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
"Description")
      )

instance Prelude.Hashable WirelessGatewayStatistics

instance Prelude.NFData WirelessGatewayStatistics