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

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

-- | The details of the gateway group.
--
-- /See:/ 'newGatewayGroup' smart constructor.
data GatewayGroup = GatewayGroup'
  { -- | The ARN of the gateway group.
    GatewayGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the gateway group.
    GatewayGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description of the gateway group.
    GatewayGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (GatewayGroup -> GatewayGroup -> Bool
(GatewayGroup -> GatewayGroup -> Bool)
-> (GatewayGroup -> GatewayGroup -> Bool) -> Eq GatewayGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GatewayGroup -> GatewayGroup -> Bool
$c/= :: GatewayGroup -> GatewayGroup -> Bool
== :: GatewayGroup -> GatewayGroup -> Bool
$c== :: GatewayGroup -> GatewayGroup -> Bool
Prelude.Eq, ReadPrec [GatewayGroup]
ReadPrec GatewayGroup
Int -> ReadS GatewayGroup
ReadS [GatewayGroup]
(Int -> ReadS GatewayGroup)
-> ReadS [GatewayGroup]
-> ReadPrec GatewayGroup
-> ReadPrec [GatewayGroup]
-> Read GatewayGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GatewayGroup]
$creadListPrec :: ReadPrec [GatewayGroup]
readPrec :: ReadPrec GatewayGroup
$creadPrec :: ReadPrec GatewayGroup
readList :: ReadS [GatewayGroup]
$creadList :: ReadS [GatewayGroup]
readsPrec :: Int -> ReadS GatewayGroup
$creadsPrec :: Int -> ReadS GatewayGroup
Prelude.Read, Int -> GatewayGroup -> ShowS
[GatewayGroup] -> ShowS
GatewayGroup -> String
(Int -> GatewayGroup -> ShowS)
-> (GatewayGroup -> String)
-> ([GatewayGroup] -> ShowS)
-> Show GatewayGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GatewayGroup] -> ShowS
$cshowList :: [GatewayGroup] -> ShowS
show :: GatewayGroup -> String
$cshow :: GatewayGroup -> String
showsPrec :: Int -> GatewayGroup -> ShowS
$cshowsPrec :: Int -> GatewayGroup -> ShowS
Prelude.Show, (forall x. GatewayGroup -> Rep GatewayGroup x)
-> (forall x. Rep GatewayGroup x -> GatewayGroup)
-> Generic GatewayGroup
forall x. Rep GatewayGroup x -> GatewayGroup
forall x. GatewayGroup -> Rep GatewayGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GatewayGroup x -> GatewayGroup
$cfrom :: forall x. GatewayGroup -> Rep GatewayGroup x
Prelude.Generic)

-- |
-- Create a value of 'GatewayGroup' 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', 'gatewayGroup_arn' - The ARN of the gateway group.
--
-- 'name', 'gatewayGroup_name' - The name of the gateway group.
--
-- 'description', 'gatewayGroup_description' - The description of the gateway group.
newGatewayGroup ::
  GatewayGroup
newGatewayGroup :: GatewayGroup
newGatewayGroup =
  GatewayGroup' :: Maybe Text -> Maybe Text -> Maybe Text -> GatewayGroup
GatewayGroup'
    { $sel:arn:GatewayGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GatewayGroup' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:GatewayGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

instance Prelude.NFData GatewayGroup