{-# 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.PolicyRole where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PolicyRole = PolicyRole'
{
PolicyRole -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
PolicyRole -> Maybe Text
roleId :: Prelude.Maybe Prelude.Text
}
deriving (PolicyRole -> PolicyRole -> Bool
(PolicyRole -> PolicyRole -> Bool)
-> (PolicyRole -> PolicyRole -> Bool) -> Eq PolicyRole
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyRole -> PolicyRole -> Bool
$c/= :: PolicyRole -> PolicyRole -> Bool
== :: PolicyRole -> PolicyRole -> Bool
$c== :: PolicyRole -> PolicyRole -> Bool
Prelude.Eq, ReadPrec [PolicyRole]
ReadPrec PolicyRole
Int -> ReadS PolicyRole
ReadS [PolicyRole]
(Int -> ReadS PolicyRole)
-> ReadS [PolicyRole]
-> ReadPrec PolicyRole
-> ReadPrec [PolicyRole]
-> Read PolicyRole
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyRole]
$creadListPrec :: ReadPrec [PolicyRole]
readPrec :: ReadPrec PolicyRole
$creadPrec :: ReadPrec PolicyRole
readList :: ReadS [PolicyRole]
$creadList :: ReadS [PolicyRole]
readsPrec :: Int -> ReadS PolicyRole
$creadsPrec :: Int -> ReadS PolicyRole
Prelude.Read, Int -> PolicyRole -> ShowS
[PolicyRole] -> ShowS
PolicyRole -> String
(Int -> PolicyRole -> ShowS)
-> (PolicyRole -> String)
-> ([PolicyRole] -> ShowS)
-> Show PolicyRole
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyRole] -> ShowS
$cshowList :: [PolicyRole] -> ShowS
show :: PolicyRole -> String
$cshow :: PolicyRole -> String
showsPrec :: Int -> PolicyRole -> ShowS
$cshowsPrec :: Int -> PolicyRole -> ShowS
Prelude.Show, (forall x. PolicyRole -> Rep PolicyRole x)
-> (forall x. Rep PolicyRole x -> PolicyRole) -> Generic PolicyRole
forall x. Rep PolicyRole x -> PolicyRole
forall x. PolicyRole -> Rep PolicyRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyRole x -> PolicyRole
$cfrom :: forall x. PolicyRole -> Rep PolicyRole x
Prelude.Generic)
newPolicyRole ::
PolicyRole
newPolicyRole :: PolicyRole
newPolicyRole =
PolicyRole' :: Maybe Text -> Maybe Text -> PolicyRole
PolicyRole'
{ $sel:roleName:PolicyRole' :: Maybe Text
roleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roleId:PolicyRole' :: Maybe Text
roleId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
policyRole_roleName :: Lens.Lens' PolicyRole (Prelude.Maybe Prelude.Text)
policyRole_roleName :: (Maybe Text -> f (Maybe Text)) -> PolicyRole -> f PolicyRole
policyRole_roleName = (PolicyRole -> Maybe Text)
-> (PolicyRole -> Maybe Text -> PolicyRole)
-> Lens PolicyRole PolicyRole (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyRole' {Maybe Text
roleName :: Maybe Text
$sel:roleName:PolicyRole' :: PolicyRole -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: PolicyRole
s@PolicyRole' {} Maybe Text
a -> PolicyRole
s {$sel:roleName:PolicyRole' :: Maybe Text
roleName = Maybe Text
a} :: PolicyRole)
policyRole_roleId :: Lens.Lens' PolicyRole (Prelude.Maybe Prelude.Text)
policyRole_roleId :: (Maybe Text -> f (Maybe Text)) -> PolicyRole -> f PolicyRole
policyRole_roleId = (PolicyRole -> Maybe Text)
-> (PolicyRole -> Maybe Text -> PolicyRole)
-> Lens PolicyRole PolicyRole (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyRole' {Maybe Text
roleId :: Maybe Text
$sel:roleId:PolicyRole' :: PolicyRole -> Maybe Text
roleId} -> Maybe Text
roleId) (\s :: PolicyRole
s@PolicyRole' {} Maybe Text
a -> PolicyRole
s {$sel:roleId:PolicyRole' :: Maybe Text
roleId = Maybe Text
a} :: PolicyRole)
instance Core.FromXML PolicyRole where
parseXML :: [Node] -> Either String PolicyRole
parseXML [Node]
x =
Maybe Text -> Maybe Text -> PolicyRole
PolicyRole'
(Maybe Text -> Maybe Text -> PolicyRole)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> PolicyRole)
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
"RoleName")
Either String (Maybe Text -> PolicyRole)
-> Either String (Maybe Text) -> Either String PolicyRole
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
"RoleId")
instance Prelude.Hashable PolicyRole
instance Prelude.NFData PolicyRole