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