{-# 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.UserGroup where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types.UserGroupPendingChanges
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserGroup = UserGroup'
{
UserGroup -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
UserGroup -> Maybe [Text]
userIds :: Prelude.Maybe [Prelude.Text],
UserGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
UserGroup -> Maybe Text
userGroupId :: Prelude.Maybe Prelude.Text,
UserGroup -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
UserGroup -> Maybe UserGroupPendingChanges
pendingChanges :: Prelude.Maybe UserGroupPendingChanges,
UserGroup -> Maybe [Text]
replicationGroups :: Prelude.Maybe [Prelude.Text]
}
deriving (UserGroup -> UserGroup -> Bool
(UserGroup -> UserGroup -> Bool)
-> (UserGroup -> UserGroup -> Bool) -> Eq UserGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserGroup -> UserGroup -> Bool
$c/= :: UserGroup -> UserGroup -> Bool
== :: UserGroup -> UserGroup -> Bool
$c== :: UserGroup -> UserGroup -> Bool
Prelude.Eq, ReadPrec [UserGroup]
ReadPrec UserGroup
Int -> ReadS UserGroup
ReadS [UserGroup]
(Int -> ReadS UserGroup)
-> ReadS [UserGroup]
-> ReadPrec UserGroup
-> ReadPrec [UserGroup]
-> Read UserGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserGroup]
$creadListPrec :: ReadPrec [UserGroup]
readPrec :: ReadPrec UserGroup
$creadPrec :: ReadPrec UserGroup
readList :: ReadS [UserGroup]
$creadList :: ReadS [UserGroup]
readsPrec :: Int -> ReadS UserGroup
$creadsPrec :: Int -> ReadS UserGroup
Prelude.Read, Int -> UserGroup -> ShowS
[UserGroup] -> ShowS
UserGroup -> String
(Int -> UserGroup -> ShowS)
-> (UserGroup -> String)
-> ([UserGroup] -> ShowS)
-> Show UserGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserGroup] -> ShowS
$cshowList :: [UserGroup] -> ShowS
show :: UserGroup -> String
$cshow :: UserGroup -> String
showsPrec :: Int -> UserGroup -> ShowS
$cshowsPrec :: Int -> UserGroup -> ShowS
Prelude.Show, (forall x. UserGroup -> Rep UserGroup x)
-> (forall x. Rep UserGroup x -> UserGroup) -> Generic UserGroup
forall x. Rep UserGroup x -> UserGroup
forall x. UserGroup -> Rep UserGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserGroup x -> UserGroup
$cfrom :: forall x. UserGroup -> Rep UserGroup x
Prelude.Generic)
newUserGroup ::
UserGroup
newUserGroup :: UserGroup
newUserGroup =
UserGroup' :: Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup
UserGroup'
{ $sel:status:UserGroup' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userIds:UserGroup' :: Maybe [Text]
userIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:arn:UserGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userGroupId:UserGroup' :: Maybe Text
userGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:engine:UserGroup' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pendingChanges:UserGroup' :: Maybe UserGroupPendingChanges
pendingChanges = Maybe UserGroupPendingChanges
forall a. Maybe a
Prelude.Nothing,
$sel:replicationGroups:UserGroup' :: Maybe [Text]
replicationGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
userGroup_status :: Lens.Lens' UserGroup (Prelude.Maybe Prelude.Text)
userGroup_status :: (Maybe Text -> f (Maybe Text)) -> UserGroup -> f UserGroup
userGroup_status = (UserGroup -> Maybe Text)
-> (UserGroup -> Maybe Text -> UserGroup)
-> Lens UserGroup UserGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserGroup' {Maybe Text
status :: Maybe Text
$sel:status:UserGroup' :: UserGroup -> Maybe Text
status} -> Maybe Text
status) (\s :: UserGroup
s@UserGroup' {} Maybe Text
a -> UserGroup
s {$sel:status:UserGroup' :: Maybe Text
status = Maybe Text
a} :: UserGroup)
userGroup_userIds :: Lens.Lens' UserGroup (Prelude.Maybe [Prelude.Text])
userGroup_userIds :: (Maybe [Text] -> f (Maybe [Text])) -> UserGroup -> f UserGroup
userGroup_userIds = (UserGroup -> Maybe [Text])
-> (UserGroup -> Maybe [Text] -> UserGroup)
-> Lens UserGroup UserGroup (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserGroup' {Maybe [Text]
userIds :: Maybe [Text]
$sel:userIds:UserGroup' :: UserGroup -> Maybe [Text]
userIds} -> Maybe [Text]
userIds) (\s :: UserGroup
s@UserGroup' {} Maybe [Text]
a -> UserGroup
s {$sel:userIds:UserGroup' :: Maybe [Text]
userIds = Maybe [Text]
a} :: UserGroup) ((Maybe [Text] -> f (Maybe [Text])) -> UserGroup -> f UserGroup)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UserGroup
-> f UserGroup
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
userGroup_arn :: Lens.Lens' UserGroup (Prelude.Maybe Prelude.Text)
userGroup_arn :: (Maybe Text -> f (Maybe Text)) -> UserGroup -> f UserGroup
userGroup_arn = (UserGroup -> Maybe Text)
-> (UserGroup -> Maybe Text -> UserGroup)
-> Lens UserGroup UserGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:UserGroup' :: UserGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UserGroup
s@UserGroup' {} Maybe Text
a -> UserGroup
s {$sel:arn:UserGroup' :: Maybe Text
arn = Maybe Text
a} :: UserGroup)
userGroup_userGroupId :: Lens.Lens' UserGroup (Prelude.Maybe Prelude.Text)
userGroup_userGroupId :: (Maybe Text -> f (Maybe Text)) -> UserGroup -> f UserGroup
userGroup_userGroupId = (UserGroup -> Maybe Text)
-> (UserGroup -> Maybe Text -> UserGroup)
-> Lens UserGroup UserGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserGroup' {Maybe Text
userGroupId :: Maybe Text
$sel:userGroupId:UserGroup' :: UserGroup -> Maybe Text
userGroupId} -> Maybe Text
userGroupId) (\s :: UserGroup
s@UserGroup' {} Maybe Text
a -> UserGroup
s {$sel:userGroupId:UserGroup' :: Maybe Text
userGroupId = Maybe Text
a} :: UserGroup)
userGroup_engine :: Lens.Lens' UserGroup (Prelude.Maybe Prelude.Text)
userGroup_engine :: (Maybe Text -> f (Maybe Text)) -> UserGroup -> f UserGroup
userGroup_engine = (UserGroup -> Maybe Text)
-> (UserGroup -> Maybe Text -> UserGroup)
-> Lens UserGroup UserGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserGroup' {Maybe Text
engine :: Maybe Text
$sel:engine:UserGroup' :: UserGroup -> Maybe Text
engine} -> Maybe Text
engine) (\s :: UserGroup
s@UserGroup' {} Maybe Text
a -> UserGroup
s {$sel:engine:UserGroup' :: Maybe Text
engine = Maybe Text
a} :: UserGroup)
userGroup_pendingChanges :: Lens.Lens' UserGroup (Prelude.Maybe UserGroupPendingChanges)
userGroup_pendingChanges :: (Maybe UserGroupPendingChanges
-> f (Maybe UserGroupPendingChanges))
-> UserGroup -> f UserGroup
userGroup_pendingChanges = (UserGroup -> Maybe UserGroupPendingChanges)
-> (UserGroup -> Maybe UserGroupPendingChanges -> UserGroup)
-> Lens
UserGroup
UserGroup
(Maybe UserGroupPendingChanges)
(Maybe UserGroupPendingChanges)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserGroup' {Maybe UserGroupPendingChanges
pendingChanges :: Maybe UserGroupPendingChanges
$sel:pendingChanges:UserGroup' :: UserGroup -> Maybe UserGroupPendingChanges
pendingChanges} -> Maybe UserGroupPendingChanges
pendingChanges) (\s :: UserGroup
s@UserGroup' {} Maybe UserGroupPendingChanges
a -> UserGroup
s {$sel:pendingChanges:UserGroup' :: Maybe UserGroupPendingChanges
pendingChanges = Maybe UserGroupPendingChanges
a} :: UserGroup)
userGroup_replicationGroups :: Lens.Lens' UserGroup (Prelude.Maybe [Prelude.Text])
userGroup_replicationGroups :: (Maybe [Text] -> f (Maybe [Text])) -> UserGroup -> f UserGroup
userGroup_replicationGroups = (UserGroup -> Maybe [Text])
-> (UserGroup -> Maybe [Text] -> UserGroup)
-> Lens UserGroup UserGroup (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserGroup' {Maybe [Text]
replicationGroups :: Maybe [Text]
$sel:replicationGroups:UserGroup' :: UserGroup -> Maybe [Text]
replicationGroups} -> Maybe [Text]
replicationGroups) (\s :: UserGroup
s@UserGroup' {} Maybe [Text]
a -> UserGroup
s {$sel:replicationGroups:UserGroup' :: Maybe [Text]
replicationGroups = Maybe [Text]
a} :: UserGroup) ((Maybe [Text] -> f (Maybe [Text])) -> UserGroup -> f UserGroup)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UserGroup
-> f UserGroup
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
instance Core.FromXML UserGroup where
parseXML :: [Node] -> Either String UserGroup
parseXML [Node]
x =
Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup
UserGroup'
(Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup)
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 Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup)
-> Either String (Maybe [Text])
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup)
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
"UserIds" 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 Text
-> Maybe Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup)
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 Text
-> Maybe UserGroupPendingChanges
-> Maybe [Text]
-> UserGroup)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe UserGroupPendingChanges -> Maybe [Text] -> UserGroup)
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
"UserGroupId")
Either
String
(Maybe Text
-> Maybe UserGroupPendingChanges -> Maybe [Text] -> UserGroup)
-> Either String (Maybe Text)
-> Either
String (Maybe UserGroupPendingChanges -> Maybe [Text] -> UserGroup)
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 UserGroupPendingChanges -> Maybe [Text] -> UserGroup)
-> Either String (Maybe UserGroupPendingChanges)
-> Either String (Maybe [Text] -> UserGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe UserGroupPendingChanges)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PendingChanges")
Either String (Maybe [Text] -> UserGroup)
-> Either String (Maybe [Text]) -> Either String UserGroup
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
"ReplicationGroups"
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")
)
instance Prelude.Hashable UserGroup
instance Prelude.NFData UserGroup