{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTWireless.Types.WirelessGatewayStatistics where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types.LoRaWANGateway
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,
    -- | The description of the resource.
    WirelessGatewayStatistics -> Maybe Text
description :: 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,
    -- | LoRaWAN gateway info.
    WirelessGatewayStatistics -> Maybe LoRaWANGateway
loRaWAN :: Prelude.Maybe LoRaWANGateway,
    -- | The name of the resource.
    WirelessGatewayStatistics -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (WirelessGatewayStatistics -> WirelessGatewayStatistics -> Bool
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]
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
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.
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.
--
-- 'description', 'wirelessGatewayStatistics_description' - The description 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.
--
-- 'loRaWAN', 'wirelessGatewayStatistics_loRaWAN' - LoRaWAN gateway info.
--
-- 'name', 'wirelessGatewayStatistics_name' - The name of the resource.
newWirelessGatewayStatistics ::
  WirelessGatewayStatistics
newWirelessGatewayStatistics :: WirelessGatewayStatistics
newWirelessGatewayStatistics =
  WirelessGatewayStatistics'
    { $sel:arn:WirelessGatewayStatistics' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:WirelessGatewayStatistics' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:WirelessGatewayStatistics' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUplinkReceivedAt:WirelessGatewayStatistics' :: Maybe Text
lastUplinkReceivedAt = forall a. Maybe a
Prelude.Nothing,
      $sel:loRaWAN:WirelessGatewayStatistics' :: Maybe LoRaWANGateway
loRaWAN = forall a. Maybe a
Prelude.Nothing,
      $sel:name:WirelessGatewayStatistics' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name of the resource.
wirelessGatewayStatistics_arn :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_arn :: Lens' WirelessGatewayStatistics (Maybe Text)
wirelessGatewayStatistics_arn = 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)

-- | The description of the resource.
wirelessGatewayStatistics_description :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_description :: Lens' WirelessGatewayStatistics (Maybe Text)
wirelessGatewayStatistics_description = 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)

-- | The ID of the wireless gateway reporting the data.
wirelessGatewayStatistics_id :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe Prelude.Text)
wirelessGatewayStatistics_id :: Lens' WirelessGatewayStatistics (Maybe Text)
wirelessGatewayStatistics_id = 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 :: Lens' WirelessGatewayStatistics (Maybe Text)
wirelessGatewayStatistics_lastUplinkReceivedAt = 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)

-- | LoRaWAN gateway info.
wirelessGatewayStatistics_loRaWAN :: Lens.Lens' WirelessGatewayStatistics (Prelude.Maybe LoRaWANGateway)
wirelessGatewayStatistics_loRaWAN :: Lens' WirelessGatewayStatistics (Maybe LoRaWANGateway)
wirelessGatewayStatistics_loRaWAN = 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 :: Lens' WirelessGatewayStatistics (Maybe Text)
wirelessGatewayStatistics_name = 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)

instance Data.FromJSON WirelessGatewayStatistics where
  parseJSON :: Value -> Parser WirelessGatewayStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WirelessGatewayStatistics"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LoRaWANGateway
-> Maybe Text
-> WirelessGatewayStatistics
WirelessGatewayStatistics'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastUplinkReceivedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LoRaWAN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
      )

instance Prelude.Hashable WirelessGatewayStatistics where
  hashWithSalt :: Int -> WirelessGatewayStatistics -> Int
hashWithSalt Int
_salt WirelessGatewayStatistics' {Maybe Text
Maybe LoRaWANGateway
name :: Maybe Text
loRaWAN :: Maybe LoRaWANGateway
lastUplinkReceivedAt :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:name:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:loRaWAN:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe LoRaWANGateway
$sel:lastUplinkReceivedAt:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:id:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:description:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:arn:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUplinkReceivedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoRaWANGateway
loRaWAN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData WirelessGatewayStatistics where
  rnf :: WirelessGatewayStatistics -> ()
rnf WirelessGatewayStatistics' {Maybe Text
Maybe LoRaWANGateway
name :: Maybe Text
loRaWAN :: Maybe LoRaWANGateway
lastUplinkReceivedAt :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:name:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:loRaWAN:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe LoRaWANGateway
$sel:lastUplinkReceivedAt:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:id:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:description:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
$sel:arn:WirelessGatewayStatistics' :: WirelessGatewayStatistics -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastUplinkReceivedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LoRaWANGateway
loRaWAN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name