{-# 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.MemoryDb.Types.User where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.Authentication
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 Authentication
authentication :: Prelude.Maybe Authentication,
User -> Maybe Text
accessString :: Prelude.Maybe Prelude.Text,
User -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
User -> Maybe [Text]
aCLNames :: Prelude.Maybe [Prelude.Text],
User -> Maybe Text
minimumEngineVersion :: 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 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:authentication:User' :: Maybe Authentication
authentication = Maybe Authentication
forall a. Maybe a
Prelude.Nothing,
$sel:accessString:User' :: Maybe Text
accessString = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:User' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aCLNames:User' :: Maybe [Text]
aCLNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:minimumEngineVersion:User' :: Maybe Text
minimumEngineVersion = 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_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_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_name :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_name :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_name = (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
name :: Maybe Text
$sel:name:User' :: User -> Maybe Text
name} -> Maybe Text
name) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:name:User' :: Maybe Text
name = Maybe Text
a} :: User)
user_aCLNames :: Lens.Lens' User (Prelude.Maybe [Prelude.Text])
user_aCLNames :: (Maybe [Text] -> f (Maybe [Text])) -> User -> f User
user_aCLNames = (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]
aCLNames :: Maybe [Text]
$sel:aCLNames:User' :: User -> Maybe [Text]
aCLNames} -> Maybe [Text]
aCLNames) (\s :: User
s@User' {} Maybe [Text]
a -> User
s {$sel:aCLNames:User' :: Maybe [Text]
aCLNames = 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_minimumEngineVersion :: Lens.Lens' User (Prelude.Maybe Prelude.Text)
user_minimumEngineVersion :: (Maybe Text -> f (Maybe Text)) -> User -> f User
user_minimumEngineVersion = (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
minimumEngineVersion :: Maybe Text
$sel:minimumEngineVersion:User' :: User -> Maybe Text
minimumEngineVersion} -> Maybe Text
minimumEngineVersion) (\s :: User
s@User' {} Maybe Text
a -> User
s {$sel:minimumEngineVersion:User' :: Maybe Text
minimumEngineVersion = Maybe Text
a} :: User)
instance Core.FromJSON User where
parseJSON :: Value -> Parser User
parseJSON =
String -> (Object -> Parser User) -> Value -> Parser User
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"User"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> User
User'
(Maybe Text
-> Maybe Text
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(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.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Authentication
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> User)
-> Parser (Maybe Text)
-> Parser
(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.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ARN")
Parser
(Maybe Authentication
-> Maybe Text -> Maybe Text -> Maybe [Text] -> Maybe Text -> User)
-> Parser (Maybe Authentication)
-> Parser
(Maybe Text -> Maybe Text -> Maybe [Text] -> Maybe Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Authentication)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Authentication")
Parser
(Maybe Text -> Maybe Text -> Maybe [Text] -> Maybe Text -> User)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Text] -> Maybe Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AccessString")
Parser (Maybe Text -> Maybe [Text] -> Maybe Text -> User)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> User)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser (Maybe [Text] -> Maybe Text -> User)
-> Parser (Maybe [Text]) -> Parser (Maybe Text -> User)
forall (f :: * -> *) a b. Applicative f => 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
"ACLNames" 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 Text -> User) -> Parser (Maybe Text) -> Parser User
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MinimumEngineVersion")
)
instance Prelude.Hashable User
instance Prelude.NFData User