{-# 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.Synthetics.Types.GroupSummary
-- 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.Synthetics.Types.GroupSummary 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

-- | A structure containing some information about a group.
--
-- /See:/ 'newGroupSummary' smart constructor.
data GroupSummary = GroupSummary'
  { -- | The ARN of the group.
    GroupSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of the group.
    GroupSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the group.
    GroupSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (GroupSummary -> GroupSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupSummary -> GroupSummary -> Bool
$c/= :: GroupSummary -> GroupSummary -> Bool
== :: GroupSummary -> GroupSummary -> Bool
$c== :: GroupSummary -> GroupSummary -> Bool
Prelude.Eq, ReadPrec [GroupSummary]
ReadPrec GroupSummary
Int -> ReadS GroupSummary
ReadS [GroupSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupSummary]
$creadListPrec :: ReadPrec [GroupSummary]
readPrec :: ReadPrec GroupSummary
$creadPrec :: ReadPrec GroupSummary
readList :: ReadS [GroupSummary]
$creadList :: ReadS [GroupSummary]
readsPrec :: Int -> ReadS GroupSummary
$creadsPrec :: Int -> ReadS GroupSummary
Prelude.Read, Int -> GroupSummary -> ShowS
[GroupSummary] -> ShowS
GroupSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupSummary] -> ShowS
$cshowList :: [GroupSummary] -> ShowS
show :: GroupSummary -> String
$cshow :: GroupSummary -> String
showsPrec :: Int -> GroupSummary -> ShowS
$cshowsPrec :: Int -> GroupSummary -> ShowS
Prelude.Show, forall x. Rep GroupSummary x -> GroupSummary
forall x. GroupSummary -> Rep GroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupSummary x -> GroupSummary
$cfrom :: forall x. GroupSummary -> Rep GroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'GroupSummary' 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', 'groupSummary_arn' - The ARN of the group.
--
-- 'id', 'groupSummary_id' - The unique ID of the group.
--
-- 'name', 'groupSummary_name' - The name of the group.
newGroupSummary ::
  GroupSummary
newGroupSummary :: GroupSummary
newGroupSummary =
  GroupSummary'
    { $sel:arn:GroupSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:GroupSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:GroupSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The unique ID of the group.
groupSummary_id :: Lens.Lens' GroupSummary (Prelude.Maybe Prelude.Text)
groupSummary_id :: Lens' GroupSummary (Maybe Text)
groupSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GroupSummary' {Maybe Text
id :: Maybe Text
$sel:id:GroupSummary' :: GroupSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: GroupSummary
s@GroupSummary' {} Maybe Text
a -> GroupSummary
s {$sel:id:GroupSummary' :: Maybe Text
id = Maybe Text
a} :: GroupSummary)

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

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

instance Prelude.Hashable GroupSummary where
  hashWithSalt :: Int -> GroupSummary -> Int
hashWithSalt Int
_salt GroupSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:GroupSummary' :: GroupSummary -> Maybe Text
$sel:id:GroupSummary' :: GroupSummary -> Maybe Text
$sel:arn:GroupSummary' :: GroupSummary -> 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
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData GroupSummary where
  rnf :: GroupSummary -> ()
rnf GroupSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:GroupSummary' :: GroupSummary -> Maybe Text
$sel:id:GroupSummary' :: GroupSummary -> Maybe Text
$sel:arn:GroupSummary' :: GroupSummary -> 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
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name