{-# 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.AlexaBusiness.Types.GatewaySummary
-- 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.AlexaBusiness.Types.GatewaySummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The summary of a gateway.
--
-- /See:/ 'newGatewaySummary' smart constructor.
data GatewaySummary = GatewaySummary'
  { -- | The ARN of the gateway.
    GatewaySummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the gateway.
    GatewaySummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the gateway group that the gateway is associated to.
    GatewaySummary -> Maybe Text
gatewayGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The software version of the gateway. The gateway automatically updates
    -- its software version during normal operation.
    GatewaySummary -> Maybe Text
softwareVersion :: Prelude.Maybe Prelude.Text,
    -- | The description of the gateway.
    GatewaySummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (GatewaySummary -> GatewaySummary -> Bool
(GatewaySummary -> GatewaySummary -> Bool)
-> (GatewaySummary -> GatewaySummary -> Bool) -> Eq GatewaySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewaySummary -> GatewaySummary -> Bool
$c/= :: GatewaySummary -> GatewaySummary -> Bool
== :: GatewaySummary -> GatewaySummary -> Bool
$c== :: GatewaySummary -> GatewaySummary -> Bool
Prelude.Eq, ReadPrec [GatewaySummary]
ReadPrec GatewaySummary
Int -> ReadS GatewaySummary
ReadS [GatewaySummary]
(Int -> ReadS GatewaySummary)
-> ReadS [GatewaySummary]
-> ReadPrec GatewaySummary
-> ReadPrec [GatewaySummary]
-> Read GatewaySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewaySummary]
$creadListPrec :: ReadPrec [GatewaySummary]
readPrec :: ReadPrec GatewaySummary
$creadPrec :: ReadPrec GatewaySummary
readList :: ReadS [GatewaySummary]
$creadList :: ReadS [GatewaySummary]
readsPrec :: Int -> ReadS GatewaySummary
$creadsPrec :: Int -> ReadS GatewaySummary
Prelude.Read, Int -> GatewaySummary -> ShowS
[GatewaySummary] -> ShowS
GatewaySummary -> String
(Int -> GatewaySummary -> ShowS)
-> (GatewaySummary -> String)
-> ([GatewaySummary] -> ShowS)
-> Show GatewaySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewaySummary] -> ShowS
$cshowList :: [GatewaySummary] -> ShowS
show :: GatewaySummary -> String
$cshow :: GatewaySummary -> String
showsPrec :: Int -> GatewaySummary -> ShowS
$cshowsPrec :: Int -> GatewaySummary -> ShowS
Prelude.Show, (forall x. GatewaySummary -> Rep GatewaySummary x)
-> (forall x. Rep GatewaySummary x -> GatewaySummary)
-> Generic GatewaySummary
forall x. Rep GatewaySummary x -> GatewaySummary
forall x. GatewaySummary -> Rep GatewaySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatewaySummary x -> GatewaySummary
$cfrom :: forall x. GatewaySummary -> Rep GatewaySummary x
Prelude.Generic)

-- |
-- Create a value of 'GatewaySummary' 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', 'gatewaySummary_arn' - The ARN of the gateway.
--
-- 'name', 'gatewaySummary_name' - The name of the gateway.
--
-- 'gatewayGroupArn', 'gatewaySummary_gatewayGroupArn' - The ARN of the gateway group that the gateway is associated to.
--
-- 'softwareVersion', 'gatewaySummary_softwareVersion' - The software version of the gateway. The gateway automatically updates
-- its software version during normal operation.
--
-- 'description', 'gatewaySummary_description' - The description of the gateway.
newGatewaySummary ::
  GatewaySummary
newGatewaySummary :: GatewaySummary
newGatewaySummary =
  GatewaySummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewaySummary
GatewaySummary'
    { $sel:arn:GatewaySummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GatewaySummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayGroupArn:GatewaySummary' :: Maybe Text
gatewayGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:softwareVersion:GatewaySummary' :: Maybe Text
softwareVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:GatewaySummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the gateway.
gatewaySummary_arn :: Lens.Lens' GatewaySummary (Prelude.Maybe Prelude.Text)
gatewaySummary_arn :: (Maybe Text -> f (Maybe Text))
-> GatewaySummary -> f GatewaySummary
gatewaySummary_arn = (GatewaySummary -> Maybe Text)
-> (GatewaySummary -> Maybe Text -> GatewaySummary)
-> Lens GatewaySummary GatewaySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewaySummary' {Maybe Text
arn :: Maybe Text
$sel:arn:GatewaySummary' :: GatewaySummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GatewaySummary
s@GatewaySummary' {} Maybe Text
a -> GatewaySummary
s {$sel:arn:GatewaySummary' :: Maybe Text
arn = Maybe Text
a} :: GatewaySummary)

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

-- | The ARN of the gateway group that the gateway is associated to.
gatewaySummary_gatewayGroupArn :: Lens.Lens' GatewaySummary (Prelude.Maybe Prelude.Text)
gatewaySummary_gatewayGroupArn :: (Maybe Text -> f (Maybe Text))
-> GatewaySummary -> f GatewaySummary
gatewaySummary_gatewayGroupArn = (GatewaySummary -> Maybe Text)
-> (GatewaySummary -> Maybe Text -> GatewaySummary)
-> Lens GatewaySummary GatewaySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewaySummary' {Maybe Text
gatewayGroupArn :: Maybe Text
$sel:gatewayGroupArn:GatewaySummary' :: GatewaySummary -> Maybe Text
gatewayGroupArn} -> Maybe Text
gatewayGroupArn) (\s :: GatewaySummary
s@GatewaySummary' {} Maybe Text
a -> GatewaySummary
s {$sel:gatewayGroupArn:GatewaySummary' :: Maybe Text
gatewayGroupArn = Maybe Text
a} :: GatewaySummary)

-- | The software version of the gateway. The gateway automatically updates
-- its software version during normal operation.
gatewaySummary_softwareVersion :: Lens.Lens' GatewaySummary (Prelude.Maybe Prelude.Text)
gatewaySummary_softwareVersion :: (Maybe Text -> f (Maybe Text))
-> GatewaySummary -> f GatewaySummary
gatewaySummary_softwareVersion = (GatewaySummary -> Maybe Text)
-> (GatewaySummary -> Maybe Text -> GatewaySummary)
-> Lens GatewaySummary GatewaySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GatewaySummary' {Maybe Text
softwareVersion :: Maybe Text
$sel:softwareVersion:GatewaySummary' :: GatewaySummary -> Maybe Text
softwareVersion} -> Maybe Text
softwareVersion) (\s :: GatewaySummary
s@GatewaySummary' {} Maybe Text
a -> GatewaySummary
s {$sel:softwareVersion:GatewaySummary' :: Maybe Text
softwareVersion = Maybe Text
a} :: GatewaySummary)

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

instance Core.FromJSON GatewaySummary where
  parseJSON :: Value -> Parser GatewaySummary
parseJSON =
    String
-> (Object -> Parser GatewaySummary)
-> Value
-> Parser GatewaySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GatewaySummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GatewaySummary
GatewaySummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> GatewaySummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> GatewaySummary)
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 Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> GatewaySummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> GatewaySummary)
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 -> GatewaySummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> GatewaySummary)
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
"GatewayGroupArn")
            Parser (Maybe Text -> Maybe Text -> GatewaySummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> GatewaySummary)
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
"SoftwareVersion")
            Parser (Maybe Text -> GatewaySummary)
-> Parser (Maybe Text) -> Parser GatewaySummary
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 GatewaySummary

instance Prelude.NFData GatewaySummary