{-# 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.Chime.Types.SigninDelegateGroup
-- 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.Chime.Types.SigninDelegateGroup 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

-- | An Active Directory (AD) group whose members are granted permission to
-- act as delegates.
--
-- /See:/ 'newSigninDelegateGroup' smart constructor.
data SigninDelegateGroup = SigninDelegateGroup'
  { -- | The group name.
    SigninDelegateGroup -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text
  }
  deriving (SigninDelegateGroup -> SigninDelegateGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SigninDelegateGroup -> SigninDelegateGroup -> Bool
$c/= :: SigninDelegateGroup -> SigninDelegateGroup -> Bool
== :: SigninDelegateGroup -> SigninDelegateGroup -> Bool
$c== :: SigninDelegateGroup -> SigninDelegateGroup -> Bool
Prelude.Eq, ReadPrec [SigninDelegateGroup]
ReadPrec SigninDelegateGroup
Int -> ReadS SigninDelegateGroup
ReadS [SigninDelegateGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SigninDelegateGroup]
$creadListPrec :: ReadPrec [SigninDelegateGroup]
readPrec :: ReadPrec SigninDelegateGroup
$creadPrec :: ReadPrec SigninDelegateGroup
readList :: ReadS [SigninDelegateGroup]
$creadList :: ReadS [SigninDelegateGroup]
readsPrec :: Int -> ReadS SigninDelegateGroup
$creadsPrec :: Int -> ReadS SigninDelegateGroup
Prelude.Read, Int -> SigninDelegateGroup -> ShowS
[SigninDelegateGroup] -> ShowS
SigninDelegateGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigninDelegateGroup] -> ShowS
$cshowList :: [SigninDelegateGroup] -> ShowS
show :: SigninDelegateGroup -> String
$cshow :: SigninDelegateGroup -> String
showsPrec :: Int -> SigninDelegateGroup -> ShowS
$cshowsPrec :: Int -> SigninDelegateGroup -> ShowS
Prelude.Show, forall x. Rep SigninDelegateGroup x -> SigninDelegateGroup
forall x. SigninDelegateGroup -> Rep SigninDelegateGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SigninDelegateGroup x -> SigninDelegateGroup
$cfrom :: forall x. SigninDelegateGroup -> Rep SigninDelegateGroup x
Prelude.Generic)

-- |
-- Create a value of 'SigninDelegateGroup' 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:
--
-- 'groupName', 'signinDelegateGroup_groupName' - The group name.
newSigninDelegateGroup ::
  SigninDelegateGroup
newSigninDelegateGroup :: SigninDelegateGroup
newSigninDelegateGroup =
  SigninDelegateGroup' {$sel:groupName:SigninDelegateGroup' :: Maybe Text
groupName = forall a. Maybe a
Prelude.Nothing}

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

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

instance Prelude.Hashable SigninDelegateGroup where
  hashWithSalt :: Int -> SigninDelegateGroup -> Int
hashWithSalt Int
_salt SigninDelegateGroup' {Maybe Text
groupName :: Maybe Text
$sel:groupName:SigninDelegateGroup' :: SigninDelegateGroup -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupName

instance Prelude.NFData SigninDelegateGroup where
  rnf :: SigninDelegateGroup -> ()
rnf SigninDelegateGroup' {Maybe Text
groupName :: Maybe Text
$sel:groupName:SigninDelegateGroup' :: SigninDelegateGroup -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupName

instance Data.ToJSON SigninDelegateGroup where
  toJSON :: SigninDelegateGroup -> Value
toJSON SigninDelegateGroup' {Maybe Text
groupName :: Maybe Text
$sel:groupName:SigninDelegateGroup' :: SigninDelegateGroup -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"GroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupName]
      )