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