{-# 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 #-}
module Amazonka.IAM.Types.PolicyGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PolicyGroup = PolicyGroup'
{
PolicyGroup -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
PolicyGroup -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text
}
deriving (PolicyGroup -> PolicyGroup -> Bool
(PolicyGroup -> PolicyGroup -> Bool)
-> (PolicyGroup -> PolicyGroup -> Bool) -> Eq PolicyGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyGroup -> PolicyGroup -> Bool
$c/= :: PolicyGroup -> PolicyGroup -> Bool
== :: PolicyGroup -> PolicyGroup -> Bool
$c== :: PolicyGroup -> PolicyGroup -> Bool
Prelude.Eq, ReadPrec [PolicyGroup]
ReadPrec PolicyGroup
Int -> ReadS PolicyGroup
ReadS [PolicyGroup]
(Int -> ReadS PolicyGroup)
-> ReadS [PolicyGroup]
-> ReadPrec PolicyGroup
-> ReadPrec [PolicyGroup]
-> Read PolicyGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyGroup]
$creadListPrec :: ReadPrec [PolicyGroup]
readPrec :: ReadPrec PolicyGroup
$creadPrec :: ReadPrec PolicyGroup
readList :: ReadS [PolicyGroup]
$creadList :: ReadS [PolicyGroup]
readsPrec :: Int -> ReadS PolicyGroup
$creadsPrec :: Int -> ReadS PolicyGroup
Prelude.Read, Int -> PolicyGroup -> ShowS
[PolicyGroup] -> ShowS
PolicyGroup -> String
(Int -> PolicyGroup -> ShowS)
-> (PolicyGroup -> String)
-> ([PolicyGroup] -> ShowS)
-> Show PolicyGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyGroup] -> ShowS
$cshowList :: [PolicyGroup] -> ShowS
show :: PolicyGroup -> String
$cshow :: PolicyGroup -> String
showsPrec :: Int -> PolicyGroup -> ShowS
$cshowsPrec :: Int -> PolicyGroup -> ShowS
Prelude.Show, (forall x. PolicyGroup -> Rep PolicyGroup x)
-> (forall x. Rep PolicyGroup x -> PolicyGroup)
-> Generic PolicyGroup
forall x. Rep PolicyGroup x -> PolicyGroup
forall x. PolicyGroup -> Rep PolicyGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyGroup x -> PolicyGroup
$cfrom :: forall x. PolicyGroup -> Rep PolicyGroup x
Prelude.Generic)
newPolicyGroup ::
PolicyGroup
newPolicyGroup :: PolicyGroup
newPolicyGroup =
PolicyGroup' :: Maybe Text -> Maybe Text -> PolicyGroup
PolicyGroup'
{ $sel:groupId:PolicyGroup' :: Maybe Text
groupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:groupName:PolicyGroup' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
policyGroup_groupId :: Lens.Lens' PolicyGroup (Prelude.Maybe Prelude.Text)
policyGroup_groupId :: (Maybe Text -> f (Maybe Text)) -> PolicyGroup -> f PolicyGroup
policyGroup_groupId = (PolicyGroup -> Maybe Text)
-> (PolicyGroup -> Maybe Text -> PolicyGroup)
-> Lens PolicyGroup PolicyGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGroup' {Maybe Text
groupId :: Maybe Text
$sel:groupId:PolicyGroup' :: PolicyGroup -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: PolicyGroup
s@PolicyGroup' {} Maybe Text
a -> PolicyGroup
s {$sel:groupId:PolicyGroup' :: Maybe Text
groupId = Maybe Text
a} :: PolicyGroup)
policyGroup_groupName :: Lens.Lens' PolicyGroup (Prelude.Maybe Prelude.Text)
policyGroup_groupName :: (Maybe Text -> f (Maybe Text)) -> PolicyGroup -> f PolicyGroup
policyGroup_groupName = (PolicyGroup -> Maybe Text)
-> (PolicyGroup -> Maybe Text -> PolicyGroup)
-> Lens PolicyGroup PolicyGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGroup' {Maybe Text
groupName :: Maybe Text
$sel:groupName:PolicyGroup' :: PolicyGroup -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: PolicyGroup
s@PolicyGroup' {} Maybe Text
a -> PolicyGroup
s {$sel:groupName:PolicyGroup' :: Maybe Text
groupName = Maybe Text
a} :: PolicyGroup)
instance Core.FromXML PolicyGroup where
parseXML :: [Node] -> Either String PolicyGroup
parseXML [Node]
x =
Maybe Text -> Maybe Text -> PolicyGroup
PolicyGroup'
(Maybe Text -> Maybe Text -> PolicyGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> PolicyGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GroupId")
Either String (Maybe Text -> PolicyGroup)
-> Either String (Maybe Text) -> Either String PolicyGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GroupName")
instance Prelude.Hashable PolicyGroup
instance Prelude.NFData PolicyGroup