{-# 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.UserSummary 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 UserSummary = UserSummary'
{
UserSummary -> Maybe ChangeType
pendingChange :: Prelude.Maybe ChangeType,
UserSummary -> Text
username :: Prelude.Text
}
deriving (UserSummary -> UserSummary -> Bool
(UserSummary -> UserSummary -> Bool)
-> (UserSummary -> UserSummary -> Bool) -> Eq UserSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserSummary -> UserSummary -> Bool
$c/= :: UserSummary -> UserSummary -> Bool
== :: UserSummary -> UserSummary -> Bool
$c== :: UserSummary -> UserSummary -> Bool
Prelude.Eq, ReadPrec [UserSummary]
ReadPrec UserSummary
Int -> ReadS UserSummary
ReadS [UserSummary]
(Int -> ReadS UserSummary)
-> ReadS [UserSummary]
-> ReadPrec UserSummary
-> ReadPrec [UserSummary]
-> Read UserSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserSummary]
$creadListPrec :: ReadPrec [UserSummary]
readPrec :: ReadPrec UserSummary
$creadPrec :: ReadPrec UserSummary
readList :: ReadS [UserSummary]
$creadList :: ReadS [UserSummary]
readsPrec :: Int -> ReadS UserSummary
$creadsPrec :: Int -> ReadS UserSummary
Prelude.Read, Int -> UserSummary -> ShowS
[UserSummary] -> ShowS
UserSummary -> String
(Int -> UserSummary -> ShowS)
-> (UserSummary -> String)
-> ([UserSummary] -> ShowS)
-> Show UserSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserSummary] -> ShowS
$cshowList :: [UserSummary] -> ShowS
show :: UserSummary -> String
$cshow :: UserSummary -> String
showsPrec :: Int -> UserSummary -> ShowS
$cshowsPrec :: Int -> UserSummary -> ShowS
Prelude.Show, (forall x. UserSummary -> Rep UserSummary x)
-> (forall x. Rep UserSummary x -> UserSummary)
-> Generic UserSummary
forall x. Rep UserSummary x -> UserSummary
forall x. UserSummary -> Rep UserSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserSummary x -> UserSummary
$cfrom :: forall x. UserSummary -> Rep UserSummary x
Prelude.Generic)
newUserSummary ::
Prelude.Text ->
UserSummary
newUserSummary :: Text -> UserSummary
newUserSummary Text
pUsername_ =
UserSummary' :: Maybe ChangeType -> Text -> UserSummary
UserSummary'
{ $sel:pendingChange:UserSummary' :: Maybe ChangeType
pendingChange = Maybe ChangeType
forall a. Maybe a
Prelude.Nothing,
$sel:username:UserSummary' :: Text
username = Text
pUsername_
}
userSummary_pendingChange :: Lens.Lens' UserSummary (Prelude.Maybe ChangeType)
userSummary_pendingChange :: (Maybe ChangeType -> f (Maybe ChangeType))
-> UserSummary -> f UserSummary
userSummary_pendingChange = (UserSummary -> Maybe ChangeType)
-> (UserSummary -> Maybe ChangeType -> UserSummary)
-> Lens
UserSummary UserSummary (Maybe ChangeType) (Maybe ChangeType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSummary' {Maybe ChangeType
pendingChange :: Maybe ChangeType
$sel:pendingChange:UserSummary' :: UserSummary -> Maybe ChangeType
pendingChange} -> Maybe ChangeType
pendingChange) (\s :: UserSummary
s@UserSummary' {} Maybe ChangeType
a -> UserSummary
s {$sel:pendingChange:UserSummary' :: Maybe ChangeType
pendingChange = Maybe ChangeType
a} :: UserSummary)
userSummary_username :: Lens.Lens' UserSummary Prelude.Text
userSummary_username :: (Text -> f Text) -> UserSummary -> f UserSummary
userSummary_username = (UserSummary -> Text)
-> (UserSummary -> Text -> UserSummary)
-> Lens UserSummary UserSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSummary' {Text
username :: Text
$sel:username:UserSummary' :: UserSummary -> Text
username} -> Text
username) (\s :: UserSummary
s@UserSummary' {} Text
a -> UserSummary
s {$sel:username:UserSummary' :: Text
username = Text
a} :: UserSummary)
instance Core.FromJSON UserSummary where
parseJSON :: Value -> Parser UserSummary
parseJSON =
String
-> (Object -> Parser UserSummary) -> Value -> Parser UserSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserSummary"
( \Object
x ->
Maybe ChangeType -> Text -> UserSummary
UserSummary'
(Maybe ChangeType -> Text -> UserSummary)
-> Parser (Maybe ChangeType) -> Parser (Text -> UserSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ChangeType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pendingChange")
Parser (Text -> UserSummary) -> Parser Text -> Parser UserSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"username")
)
instance Prelude.Hashable UserSummary
instance Prelude.NFData UserSummary