{-# 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.MQ.Types.UserPendingChanges where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MQ.Types.ChangeType
import qualified Amazonka.Prelude as Prelude
data UserPendingChanges = UserPendingChanges'
{
UserPendingChanges -> Maybe [Text]
groups :: Prelude.Maybe [Prelude.Text],
UserPendingChanges -> Maybe Bool
consoleAccess :: Prelude.Maybe Prelude.Bool,
UserPendingChanges -> ChangeType
pendingChange :: ChangeType
}
deriving (UserPendingChanges -> UserPendingChanges -> Bool
(UserPendingChanges -> UserPendingChanges -> Bool)
-> (UserPendingChanges -> UserPendingChanges -> Bool)
-> Eq UserPendingChanges
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserPendingChanges -> UserPendingChanges -> Bool
$c/= :: UserPendingChanges -> UserPendingChanges -> Bool
== :: UserPendingChanges -> UserPendingChanges -> Bool
$c== :: UserPendingChanges -> UserPendingChanges -> Bool
Prelude.Eq, ReadPrec [UserPendingChanges]
ReadPrec UserPendingChanges
Int -> ReadS UserPendingChanges
ReadS [UserPendingChanges]
(Int -> ReadS UserPendingChanges)
-> ReadS [UserPendingChanges]
-> ReadPrec UserPendingChanges
-> ReadPrec [UserPendingChanges]
-> Read UserPendingChanges
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserPendingChanges]
$creadListPrec :: ReadPrec [UserPendingChanges]
readPrec :: ReadPrec UserPendingChanges
$creadPrec :: ReadPrec UserPendingChanges
readList :: ReadS [UserPendingChanges]
$creadList :: ReadS [UserPendingChanges]
readsPrec :: Int -> ReadS UserPendingChanges
$creadsPrec :: Int -> ReadS UserPendingChanges
Prelude.Read, Int -> UserPendingChanges -> ShowS
[UserPendingChanges] -> ShowS
UserPendingChanges -> String
(Int -> UserPendingChanges -> ShowS)
-> (UserPendingChanges -> String)
-> ([UserPendingChanges] -> ShowS)
-> Show UserPendingChanges
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserPendingChanges] -> ShowS
$cshowList :: [UserPendingChanges] -> ShowS
show :: UserPendingChanges -> String
$cshow :: UserPendingChanges -> String
showsPrec :: Int -> UserPendingChanges -> ShowS
$cshowsPrec :: Int -> UserPendingChanges -> ShowS
Prelude.Show, (forall x. UserPendingChanges -> Rep UserPendingChanges x)
-> (forall x. Rep UserPendingChanges x -> UserPendingChanges)
-> Generic UserPendingChanges
forall x. Rep UserPendingChanges x -> UserPendingChanges
forall x. UserPendingChanges -> Rep UserPendingChanges x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserPendingChanges x -> UserPendingChanges
$cfrom :: forall x. UserPendingChanges -> Rep UserPendingChanges x
Prelude.Generic)
newUserPendingChanges ::
ChangeType ->
UserPendingChanges
newUserPendingChanges :: ChangeType -> UserPendingChanges
newUserPendingChanges ChangeType
pPendingChange_ =
UserPendingChanges' :: Maybe [Text] -> Maybe Bool -> ChangeType -> UserPendingChanges
UserPendingChanges'
{ $sel:groups:UserPendingChanges' :: Maybe [Text]
groups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:consoleAccess:UserPendingChanges' :: Maybe Bool
consoleAccess = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:pendingChange:UserPendingChanges' :: ChangeType
pendingChange = ChangeType
pPendingChange_
}
userPendingChanges_groups :: Lens.Lens' UserPendingChanges (Prelude.Maybe [Prelude.Text])
userPendingChanges_groups :: (Maybe [Text] -> f (Maybe [Text]))
-> UserPendingChanges -> f UserPendingChanges
userPendingChanges_groups = (UserPendingChanges -> Maybe [Text])
-> (UserPendingChanges -> Maybe [Text] -> UserPendingChanges)
-> Lens
UserPendingChanges UserPendingChanges (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPendingChanges' {Maybe [Text]
groups :: Maybe [Text]
$sel:groups:UserPendingChanges' :: UserPendingChanges -> Maybe [Text]
groups} -> Maybe [Text]
groups) (\s :: UserPendingChanges
s@UserPendingChanges' {} Maybe [Text]
a -> UserPendingChanges
s {$sel:groups:UserPendingChanges' :: Maybe [Text]
groups = Maybe [Text]
a} :: UserPendingChanges) ((Maybe [Text] -> f (Maybe [Text]))
-> UserPendingChanges -> f UserPendingChanges)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UserPendingChanges
-> f UserPendingChanges
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
userPendingChanges_consoleAccess :: Lens.Lens' UserPendingChanges (Prelude.Maybe Prelude.Bool)
userPendingChanges_consoleAccess :: (Maybe Bool -> f (Maybe Bool))
-> UserPendingChanges -> f UserPendingChanges
userPendingChanges_consoleAccess = (UserPendingChanges -> Maybe Bool)
-> (UserPendingChanges -> Maybe Bool -> UserPendingChanges)
-> Lens
UserPendingChanges UserPendingChanges (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPendingChanges' {Maybe Bool
consoleAccess :: Maybe Bool
$sel:consoleAccess:UserPendingChanges' :: UserPendingChanges -> Maybe Bool
consoleAccess} -> Maybe Bool
consoleAccess) (\s :: UserPendingChanges
s@UserPendingChanges' {} Maybe Bool
a -> UserPendingChanges
s {$sel:consoleAccess:UserPendingChanges' :: Maybe Bool
consoleAccess = Maybe Bool
a} :: UserPendingChanges)
userPendingChanges_pendingChange :: Lens.Lens' UserPendingChanges ChangeType
userPendingChanges_pendingChange :: (ChangeType -> f ChangeType)
-> UserPendingChanges -> f UserPendingChanges
userPendingChanges_pendingChange = (UserPendingChanges -> ChangeType)
-> (UserPendingChanges -> ChangeType -> UserPendingChanges)
-> Lens UserPendingChanges UserPendingChanges ChangeType ChangeType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPendingChanges' {ChangeType
pendingChange :: ChangeType
$sel:pendingChange:UserPendingChanges' :: UserPendingChanges -> ChangeType
pendingChange} -> ChangeType
pendingChange) (\s :: UserPendingChanges
s@UserPendingChanges' {} ChangeType
a -> UserPendingChanges
s {$sel:pendingChange:UserPendingChanges' :: ChangeType
pendingChange = ChangeType
a} :: UserPendingChanges)
instance Core.FromJSON UserPendingChanges where
parseJSON :: Value -> Parser UserPendingChanges
parseJSON =
String
-> (Object -> Parser UserPendingChanges)
-> Value
-> Parser UserPendingChanges
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserPendingChanges"
( \Object
x ->
Maybe [Text] -> Maybe Bool -> ChangeType -> UserPendingChanges
UserPendingChanges'
(Maybe [Text] -> Maybe Bool -> ChangeType -> UserPendingChanges)
-> Parser (Maybe [Text])
-> Parser (Maybe Bool -> ChangeType -> UserPendingChanges)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"groups" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Bool -> ChangeType -> UserPendingChanges)
-> Parser (Maybe Bool) -> Parser (ChangeType -> UserPendingChanges)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"consoleAccess")
Parser (ChangeType -> UserPendingChanges)
-> Parser ChangeType -> Parser UserPendingChanges
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ChangeType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"pendingChange")
)
instance Prelude.Hashable UserPendingChanges
instance Prelude.NFData UserPendingChanges