{-# 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.ElastiCache.Types.User where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types.Authentication
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data User = User'
{
User -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
User -> Maybe [Text]
userGroupIds :: Prelude.Maybe [Prelude.Text],
User -> Maybe Authentication
authentication :: Prelude.Maybe Authentication,
User -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
accessString :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
userId :: Prelude.Maybe Prelude.Text
}
deriving (User -> User -> Bool
(User -> User -> Bool) -> (User -> User -> Bool) -> Eq User
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: User -> User -> Bool
$c/= :: User -> User -> Bool
== :: User -> User -> Bool
$c== :: User -> User -> Bool
Prelude.Eq, ReadPrec [User]
ReadPrec User
Int -> ReadS User
ReadS [User]
(Int -> ReadS User)
-> ReadS [User] -> ReadPrec User -> ReadPrec [User] -> Read User
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [User]
$creadListPrec :: ReadPrec [User]
readPrec :: ReadPrec User
$creadPrec :: ReadPrec User
readList :: ReadS [User]
$creadList :: ReadS [User]
readsPrec :: Int -> ReadS User
$creadsPrec :: Int -> ReadS User
Prelude.Read, Int -> User -> ShowS
[User] -> ShowS
User -> String
(Int -> User -> ShowS)
-> (User -> String) -> ([User] -> ShowS) -> Show User
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [User] -> ShowS
$cshowList :: [User] -> ShowS
show :: User -> String
$cshow :: User -> String
showsPrec :: Int -> User -> ShowS
$cshowsPrec :: Int -> User -> ShowS
Prelude.Show, (forall x. User -> Rep User x)
-> (forall x. Rep User x -> User) -> Generic User
forall x. Rep User x -> User
forall x. User -> Rep User x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep User x -> User
$cfrom :: forall x. User -> Rep User x
Prelude.Generic)
newUser ::
User
newUser :: User
newUser =
User' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> User
User'
{ $sel:status:User' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:User' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userGroupIds:User' :: Maybe [Text]
userGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:authentication:User' :: Maybe Authentication
authentication = Maybe Authentication
forall a. Maybe a
Prelude.Nothing,
$sel:engine:User' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userName:User' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accessString:User' :: Maybe Text
accessString = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userId:User' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
user_status :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_status :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_status = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
status :: Maybe Text
$sel:status:User' :: User -> Maybe Text
status} -> Maybe Text
status) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:status:User' :: Maybe Text
status = Maybe Text
a} :: User)
user_arn :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_arn :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_arn = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
arn :: Maybe Text
$sel:arn:User' :: User -> Maybe Text
arn} -> Maybe Text
arn) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:arn:User' :: Maybe Text
arn = Maybe Text
a} :: User)
user_userGroupIds :: Lens.Lens' User (Prelude.Maybe [Prelude.Text])
user_userGroupIds :: (Maybe [Text] -> f (Maybe [Text])) -> User -> f User
user_userGroupIds = (User -> Maybe [Text])
-> (User -> Maybe [Text] -> User)
-> Lens User User (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe [Text]
userGroupIds :: Maybe [Text]
$sel:userGroupIds:User' :: User -> Maybe [Text]
userGroupIds} -> Maybe [Text]
userGroupIds) (\s :: User
s@User' {} Maybe [Text]
a -> User
s {$sel:userGroupIds:User' :: Maybe [Text]
userGroupIds = Maybe [Text]
a} :: User) ((Maybe [Text] -> f (Maybe [Text])) -> User -> f User)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> User
-> f User
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
user_authentication :: Lens.Lens' User (Prelude.Maybe Authentication)
user_authentication :: (Maybe Authentication -> f (Maybe Authentication))
-> User -> f User
user_authentication = (User -> Maybe Authentication)
-> (User -> Maybe Authentication -> User)
-> Lens User User (Maybe Authentication) (Maybe Authentication)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Authentication
authentication :: Maybe Authentication
$sel:authentication:User' :: User -> Maybe Authentication
authentication} -> Maybe Authentication
authentication) (\s :: User
s@User' {} Maybe Authentication
a -> User
s {$sel:authentication:User' :: Maybe Authentication
authentication = Maybe Authentication
a} :: User)
user_engine :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_engine :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_engine = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
engine :: Maybe Text
$sel:engine:User' :: User -> Maybe Text
engine} -> Maybe Text
engine) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:engine:User' :: Maybe Text
engine = Maybe Text
a} :: User)
user_userName :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_userName :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_userName = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
userName :: Maybe Text
$sel:userName:User' :: User -> Maybe Text
userName} -> Maybe Text
userName) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:userName:User' :: Maybe Text
userName = Maybe Text
a} :: User)
user_accessString :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_accessString :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_accessString = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
accessString :: Maybe Text
$sel:accessString:User' :: User -> Maybe Text
accessString} -> Maybe Text
accessString) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:accessString:User' :: Maybe Text
accessString = Maybe Text
a} :: User)
user_userId :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_userId :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_userId = (User -> Maybe Text)
-> (User -> Maybe Text -> User)
-> Lens User User (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\User' {Maybe Text
userId :: Maybe Text
$sel:userId:User' :: User -> Maybe Text
userId} -> Maybe Text
userId) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:userId:User' :: Maybe Text
userId = Maybe Text
a} :: User)
instance Core.FromXML User where
parseXML :: [Node] -> Either String User
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> User
User'
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> User)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe [Text]
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> User)
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
"Status")
Either
String
(Maybe Text
-> Maybe [Text]
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> User)
-> Either String (Maybe Text)
-> Either
String
(Maybe [Text]
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> User)
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
"ARN")
Either
String
(Maybe [Text]
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> User)
-> Either String (Maybe [Text])
-> Either
String
(Maybe Authentication
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UserGroupIds" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String
(Maybe Authentication
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> User)
-> Either String (Maybe Authentication)
-> Either
String
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Authentication)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Authentication")
Either
String
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> User)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> Maybe Text -> User)
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
"Engine")
Either String (Maybe Text -> Maybe Text -> Maybe Text -> User)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> User)
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
"UserName")
Either String (Maybe Text -> Maybe Text -> User)
-> Either String (Maybe Text) -> Either String (Maybe Text -> User)
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
"AccessString")
Either String (Maybe Text -> User)
-> Either String (Maybe Text) -> Either String User
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 User
instance Prelude.NFData User