{-# 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.Transfer.Types.UserDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserDetails = UserDetails'
{
UserDetails -> Maybe Text
sessionId :: Prelude.Maybe Prelude.Text,
UserDetails -> Text
userName :: Prelude.Text,
UserDetails -> Text
serverId :: Prelude.Text
}
deriving (UserDetails -> UserDetails -> Bool
(UserDetails -> UserDetails -> Bool)
-> (UserDetails -> UserDetails -> Bool) -> Eq UserDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserDetails -> UserDetails -> Bool
$c/= :: UserDetails -> UserDetails -> Bool
== :: UserDetails -> UserDetails -> Bool
$c== :: UserDetails -> UserDetails -> Bool
Prelude.Eq, ReadPrec [UserDetails]
ReadPrec UserDetails
Int -> ReadS UserDetails
ReadS [UserDetails]
(Int -> ReadS UserDetails)
-> ReadS [UserDetails]
-> ReadPrec UserDetails
-> ReadPrec [UserDetails]
-> Read UserDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserDetails]
$creadListPrec :: ReadPrec [UserDetails]
readPrec :: ReadPrec UserDetails
$creadPrec :: ReadPrec UserDetails
readList :: ReadS [UserDetails]
$creadList :: ReadS [UserDetails]
readsPrec :: Int -> ReadS UserDetails
$creadsPrec :: Int -> ReadS UserDetails
Prelude.Read, Int -> UserDetails -> ShowS
[UserDetails] -> ShowS
UserDetails -> String
(Int -> UserDetails -> ShowS)
-> (UserDetails -> String)
-> ([UserDetails] -> ShowS)
-> Show UserDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserDetails] -> ShowS
$cshowList :: [UserDetails] -> ShowS
show :: UserDetails -> String
$cshow :: UserDetails -> String
showsPrec :: Int -> UserDetails -> ShowS
$cshowsPrec :: Int -> UserDetails -> ShowS
Prelude.Show, (forall x. UserDetails -> Rep UserDetails x)
-> (forall x. Rep UserDetails x -> UserDetails)
-> Generic UserDetails
forall x. Rep UserDetails x -> UserDetails
forall x. UserDetails -> Rep UserDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserDetails x -> UserDetails
$cfrom :: forall x. UserDetails -> Rep UserDetails x
Prelude.Generic)
newUserDetails ::
Prelude.Text ->
Prelude.Text ->
UserDetails
newUserDetails :: Text -> Text -> UserDetails
newUserDetails Text
pUserName_ Text
pServerId_ =
UserDetails' :: Maybe Text -> Text -> Text -> UserDetails
UserDetails'
{ $sel:sessionId:UserDetails' :: Maybe Text
sessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userName:UserDetails' :: Text
userName = Text
pUserName_,
$sel:serverId:UserDetails' :: Text
serverId = Text
pServerId_
}
userDetails_sessionId :: Lens.Lens' UserDetails (Prelude.Maybe Prelude.Text)
userDetails_sessionId :: (Maybe Text -> f (Maybe Text)) -> UserDetails -> f UserDetails
userDetails_sessionId = (UserDetails -> Maybe Text)
-> (UserDetails -> Maybe Text -> UserDetails)
-> Lens UserDetails UserDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserDetails' {Maybe Text
sessionId :: Maybe Text
$sel:sessionId:UserDetails' :: UserDetails -> Maybe Text
sessionId} -> Maybe Text
sessionId) (\s :: UserDetails
s@UserDetails' {} Maybe Text
a -> UserDetails
s {$sel:sessionId:UserDetails' :: Maybe Text
sessionId = Maybe Text
a} :: UserDetails)
userDetails_userName :: Lens.Lens' UserDetails Prelude.Text
userDetails_userName :: (Text -> f Text) -> UserDetails -> f UserDetails
userDetails_userName = (UserDetails -> Text)
-> (UserDetails -> Text -> UserDetails)
-> Lens UserDetails UserDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserDetails' {Text
userName :: Text
$sel:userName:UserDetails' :: UserDetails -> Text
userName} -> Text
userName) (\s :: UserDetails
s@UserDetails' {} Text
a -> UserDetails
s {$sel:userName:UserDetails' :: Text
userName = Text
a} :: UserDetails)
userDetails_serverId :: Lens.Lens' UserDetails Prelude.Text
userDetails_serverId :: (Text -> f Text) -> UserDetails -> f UserDetails
userDetails_serverId = (UserDetails -> Text)
-> (UserDetails -> Text -> UserDetails)
-> Lens UserDetails UserDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserDetails' {Text
serverId :: Text
$sel:serverId:UserDetails' :: UserDetails -> Text
serverId} -> Text
serverId) (\s :: UserDetails
s@UserDetails' {} Text
a -> UserDetails
s {$sel:serverId:UserDetails' :: Text
serverId = Text
a} :: UserDetails)
instance Core.FromJSON UserDetails where
parseJSON :: Value -> Parser UserDetails
parseJSON =
String
-> (Object -> Parser UserDetails) -> Value -> Parser UserDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserDetails"
( \Object
x ->
Maybe Text -> Text -> Text -> UserDetails
UserDetails'
(Maybe Text -> Text -> Text -> UserDetails)
-> Parser (Maybe Text) -> Parser (Text -> Text -> UserDetails)
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
"SessionId")
Parser (Text -> Text -> UserDetails)
-> Parser Text -> Parser (Text -> UserDetails)
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")
Parser (Text -> UserDetails) -> Parser Text -> Parser UserDetails
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
"ServerId")
)
instance Prelude.Hashable UserDetails
instance Prelude.NFData UserDetails