{-# 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.WorkDocs.Types.UserMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserMetadata = UserMetadata'
{
UserMetadata -> Maybe Text
givenName :: Prelude.Maybe Prelude.Text,
UserMetadata -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
UserMetadata -> Maybe Text
emailAddress :: Prelude.Maybe Prelude.Text,
UserMetadata -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
UserMetadata -> Maybe Text
surname :: Prelude.Maybe Prelude.Text
}
deriving (UserMetadata -> UserMetadata -> Bool
(UserMetadata -> UserMetadata -> Bool)
-> (UserMetadata -> UserMetadata -> Bool) -> Eq UserMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserMetadata -> UserMetadata -> Bool
$c/= :: UserMetadata -> UserMetadata -> Bool
== :: UserMetadata -> UserMetadata -> Bool
$c== :: UserMetadata -> UserMetadata -> Bool
Prelude.Eq, ReadPrec [UserMetadata]
ReadPrec UserMetadata
Int -> ReadS UserMetadata
ReadS [UserMetadata]
(Int -> ReadS UserMetadata)
-> ReadS [UserMetadata]
-> ReadPrec UserMetadata
-> ReadPrec [UserMetadata]
-> Read UserMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserMetadata]
$creadListPrec :: ReadPrec [UserMetadata]
readPrec :: ReadPrec UserMetadata
$creadPrec :: ReadPrec UserMetadata
readList :: ReadS [UserMetadata]
$creadList :: ReadS [UserMetadata]
readsPrec :: Int -> ReadS UserMetadata
$creadsPrec :: Int -> ReadS UserMetadata
Prelude.Read, Int -> UserMetadata -> ShowS
[UserMetadata] -> ShowS
UserMetadata -> String
(Int -> UserMetadata -> ShowS)
-> (UserMetadata -> String)
-> ([UserMetadata] -> ShowS)
-> Show UserMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserMetadata] -> ShowS
$cshowList :: [UserMetadata] -> ShowS
show :: UserMetadata -> String
$cshow :: UserMetadata -> String
showsPrec :: Int -> UserMetadata -> ShowS
$cshowsPrec :: Int -> UserMetadata -> ShowS
Prelude.Show, (forall x. UserMetadata -> Rep UserMetadata x)
-> (forall x. Rep UserMetadata x -> UserMetadata)
-> Generic UserMetadata
forall x. Rep UserMetadata x -> UserMetadata
forall x. UserMetadata -> Rep UserMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserMetadata x -> UserMetadata
$cfrom :: forall x. UserMetadata -> Rep UserMetadata x
Prelude.Generic)
newUserMetadata ::
UserMetadata
newUserMetadata :: UserMetadata
newUserMetadata =
UserMetadata' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> UserMetadata
UserMetadata'
{ $sel:givenName:UserMetadata' :: Maybe Text
givenName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:username:UserMetadata' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:emailAddress:UserMetadata' :: Maybe Text
emailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:UserMetadata' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:surname:UserMetadata' :: Maybe Text
surname = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
userMetadata_givenName :: Lens.Lens' UserMetadata (Prelude.Maybe Prelude.Text)
userMetadata_givenName :: (Maybe Text -> f (Maybe Text)) -> UserMetadata -> f UserMetadata
userMetadata_givenName = (UserMetadata -> Maybe Text)
-> (UserMetadata -> Maybe Text -> UserMetadata)
-> Lens UserMetadata UserMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserMetadata' {Maybe Text
givenName :: Maybe Text
$sel:givenName:UserMetadata' :: UserMetadata -> Maybe Text
givenName} -> Maybe Text
givenName) (\s :: UserMetadata
s@UserMetadata' {} Maybe Text
a -> UserMetadata
s {$sel:givenName:UserMetadata' :: Maybe Text
givenName = Maybe Text
a} :: UserMetadata)
userMetadata_username :: Lens.Lens' UserMetadata (Prelude.Maybe Prelude.Text)
userMetadata_username :: (Maybe Text -> f (Maybe Text)) -> UserMetadata -> f UserMetadata
userMetadata_username = (UserMetadata -> Maybe Text)
-> (UserMetadata -> Maybe Text -> UserMetadata)
-> Lens UserMetadata UserMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserMetadata' {Maybe Text
username :: Maybe Text
$sel:username:UserMetadata' :: UserMetadata -> Maybe Text
username} -> Maybe Text
username) (\s :: UserMetadata
s@UserMetadata' {} Maybe Text
a -> UserMetadata
s {$sel:username:UserMetadata' :: Maybe Text
username = Maybe Text
a} :: UserMetadata)
userMetadata_emailAddress :: Lens.Lens' UserMetadata (Prelude.Maybe Prelude.Text)
userMetadata_emailAddress :: (Maybe Text -> f (Maybe Text)) -> UserMetadata -> f UserMetadata
userMetadata_emailAddress = (UserMetadata -> Maybe Text)
-> (UserMetadata -> Maybe Text -> UserMetadata)
-> Lens UserMetadata UserMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserMetadata' {Maybe Text
emailAddress :: Maybe Text
$sel:emailAddress:UserMetadata' :: UserMetadata -> Maybe Text
emailAddress} -> Maybe Text
emailAddress) (\s :: UserMetadata
s@UserMetadata' {} Maybe Text
a -> UserMetadata
s {$sel:emailAddress:UserMetadata' :: Maybe Text
emailAddress = Maybe Text
a} :: UserMetadata)
userMetadata_id :: Lens.Lens' UserMetadata (Prelude.Maybe Prelude.Text)
userMetadata_id :: (Maybe Text -> f (Maybe Text)) -> UserMetadata -> f UserMetadata
userMetadata_id = (UserMetadata -> Maybe Text)
-> (UserMetadata -> Maybe Text -> UserMetadata)
-> Lens UserMetadata UserMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserMetadata' {Maybe Text
id :: Maybe Text
$sel:id:UserMetadata' :: UserMetadata -> Maybe Text
id} -> Maybe Text
id) (\s :: UserMetadata
s@UserMetadata' {} Maybe Text
a -> UserMetadata
s {$sel:id:UserMetadata' :: Maybe Text
id = Maybe Text
a} :: UserMetadata)
userMetadata_surname :: Lens.Lens' UserMetadata (Prelude.Maybe Prelude.Text)
userMetadata_surname :: (Maybe Text -> f (Maybe Text)) -> UserMetadata -> f UserMetadata
userMetadata_surname = (UserMetadata -> Maybe Text)
-> (UserMetadata -> Maybe Text -> UserMetadata)
-> Lens UserMetadata UserMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserMetadata' {Maybe Text
surname :: Maybe Text
$sel:surname:UserMetadata' :: UserMetadata -> Maybe Text
surname} -> Maybe Text
surname) (\s :: UserMetadata
s@UserMetadata' {} Maybe Text
a -> UserMetadata
s {$sel:surname:UserMetadata' :: Maybe Text
surname = Maybe Text
a} :: UserMetadata)
instance Core.FromJSON UserMetadata where
parseJSON :: Value -> Parser UserMetadata
parseJSON =
String
-> (Object -> Parser UserMetadata) -> Value -> Parser UserMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserMetadata"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> UserMetadata
UserMetadata'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> UserMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> UserMetadata)
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
"GivenName")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> UserMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> UserMetadata)
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
"Username")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> UserMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> UserMetadata)
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
"EmailAddress")
Parser (Maybe Text -> Maybe Text -> UserMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> UserMetadata)
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
"Id")
Parser (Maybe Text -> UserMetadata)
-> Parser (Maybe Text) -> Parser UserMetadata
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
"Surname")
)
instance Prelude.Hashable UserMetadata
instance Prelude.NFData UserMetadata