{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Transfer.CreateUser
(
CreateUser (..),
newCreateUser,
createUser_homeDirectoryType,
createUser_sshPublicKeyBody,
createUser_posixProfile,
createUser_homeDirectoryMappings,
createUser_policy,
createUser_homeDirectory,
createUser_tags,
createUser_role,
createUser_serverId,
createUser_userName,
CreateUserResponse (..),
newCreateUserResponse,
createUserResponse_httpStatus,
createUserResponse_serverId,
createUserResponse_userName,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transfer.Types
data CreateUser = CreateUser'
{
CreateUser -> Maybe HomeDirectoryType
homeDirectoryType :: Prelude.Maybe HomeDirectoryType,
CreateUser -> Maybe Text
sshPublicKeyBody :: Prelude.Maybe Prelude.Text,
CreateUser -> Maybe PosixProfile
posixProfile :: Prelude.Maybe PosixProfile,
CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry),
CreateUser -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
CreateUser -> Maybe Text
homeDirectory :: Prelude.Maybe Prelude.Text,
CreateUser -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateUser -> Text
role' :: Prelude.Text,
CreateUser -> Text
serverId :: Prelude.Text,
CreateUser -> Text
userName :: Prelude.Text
}
deriving (CreateUser -> CreateUser -> Bool
(CreateUser -> CreateUser -> Bool)
-> (CreateUser -> CreateUser -> Bool) -> Eq CreateUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUser -> CreateUser -> Bool
$c/= :: CreateUser -> CreateUser -> Bool
== :: CreateUser -> CreateUser -> Bool
$c== :: CreateUser -> CreateUser -> Bool
Prelude.Eq, ReadPrec [CreateUser]
ReadPrec CreateUser
Int -> ReadS CreateUser
ReadS [CreateUser]
(Int -> ReadS CreateUser)
-> ReadS [CreateUser]
-> ReadPrec CreateUser
-> ReadPrec [CreateUser]
-> Read CreateUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUser]
$creadListPrec :: ReadPrec [CreateUser]
readPrec :: ReadPrec CreateUser
$creadPrec :: ReadPrec CreateUser
readList :: ReadS [CreateUser]
$creadList :: ReadS [CreateUser]
readsPrec :: Int -> ReadS CreateUser
$creadsPrec :: Int -> ReadS CreateUser
Prelude.Read, Int -> CreateUser -> ShowS
[CreateUser] -> ShowS
CreateUser -> String
(Int -> CreateUser -> ShowS)
-> (CreateUser -> String)
-> ([CreateUser] -> ShowS)
-> Show CreateUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUser] -> ShowS
$cshowList :: [CreateUser] -> ShowS
show :: CreateUser -> String
$cshow :: CreateUser -> String
showsPrec :: Int -> CreateUser -> ShowS
$cshowsPrec :: Int -> CreateUser -> ShowS
Prelude.Show, (forall x. CreateUser -> Rep CreateUser x)
-> (forall x. Rep CreateUser x -> CreateUser) -> Generic CreateUser
forall x. Rep CreateUser x -> CreateUser
forall x. CreateUser -> Rep CreateUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUser x -> CreateUser
$cfrom :: forall x. CreateUser -> Rep CreateUser x
Prelude.Generic)
newCreateUser ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateUser
newCreateUser :: Text -> Text -> Text -> CreateUser
newCreateUser Text
pRole_ Text
pServerId_ Text
pUserName_ =
CreateUser' :: Maybe HomeDirectoryType
-> Maybe Text
-> Maybe PosixProfile
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> Text
-> CreateUser
CreateUser'
{ $sel:homeDirectoryType:CreateUser' :: Maybe HomeDirectoryType
homeDirectoryType = Maybe HomeDirectoryType
forall a. Maybe a
Prelude.Nothing,
$sel:sshPublicKeyBody:CreateUser' :: Maybe Text
sshPublicKeyBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:posixProfile:CreateUser' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
forall a. Maybe a
Prelude.Nothing,
$sel:homeDirectoryMappings:CreateUser' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
forall a. Maybe a
Prelude.Nothing,
$sel:policy:CreateUser' :: Maybe Text
policy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:homeDirectory:CreateUser' :: Maybe Text
homeDirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateUser' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:role':CreateUser' :: Text
role' = Text
pRole_,
$sel:serverId:CreateUser' :: Text
serverId = Text
pServerId_,
$sel:userName:CreateUser' :: Text
userName = Text
pUserName_
}
createUser_homeDirectoryType :: Lens.Lens' CreateUser (Prelude.Maybe HomeDirectoryType)
createUser_homeDirectoryType :: (Maybe HomeDirectoryType -> f (Maybe HomeDirectoryType))
-> CreateUser -> f CreateUser
createUser_homeDirectoryType = (CreateUser -> Maybe HomeDirectoryType)
-> (CreateUser -> Maybe HomeDirectoryType -> CreateUser)
-> Lens
CreateUser
CreateUser
(Maybe HomeDirectoryType)
(Maybe HomeDirectoryType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe HomeDirectoryType
homeDirectoryType :: Maybe HomeDirectoryType
$sel:homeDirectoryType:CreateUser' :: CreateUser -> Maybe HomeDirectoryType
homeDirectoryType} -> Maybe HomeDirectoryType
homeDirectoryType) (\s :: CreateUser
s@CreateUser' {} Maybe HomeDirectoryType
a -> CreateUser
s {$sel:homeDirectoryType:CreateUser' :: Maybe HomeDirectoryType
homeDirectoryType = Maybe HomeDirectoryType
a} :: CreateUser)
createUser_sshPublicKeyBody :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_sshPublicKeyBody :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_sshPublicKeyBody = (CreateUser -> Maybe Text)
-> (CreateUser -> Maybe Text -> CreateUser)
-> Lens CreateUser CreateUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe Text
sshPublicKeyBody :: Maybe Text
$sel:sshPublicKeyBody:CreateUser' :: CreateUser -> Maybe Text
sshPublicKeyBody} -> Maybe Text
sshPublicKeyBody) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:sshPublicKeyBody:CreateUser' :: Maybe Text
sshPublicKeyBody = Maybe Text
a} :: CreateUser)
createUser_posixProfile :: Lens.Lens' CreateUser (Prelude.Maybe PosixProfile)
createUser_posixProfile :: (Maybe PosixProfile -> f (Maybe PosixProfile))
-> CreateUser -> f CreateUser
createUser_posixProfile = (CreateUser -> Maybe PosixProfile)
-> (CreateUser -> Maybe PosixProfile -> CreateUser)
-> Lens
CreateUser CreateUser (Maybe PosixProfile) (Maybe PosixProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe PosixProfile
posixProfile :: Maybe PosixProfile
$sel:posixProfile:CreateUser' :: CreateUser -> Maybe PosixProfile
posixProfile} -> Maybe PosixProfile
posixProfile) (\s :: CreateUser
s@CreateUser' {} Maybe PosixProfile
a -> CreateUser
s {$sel:posixProfile:CreateUser' :: Maybe PosixProfile
posixProfile = Maybe PosixProfile
a} :: CreateUser)
createUser_homeDirectoryMappings :: Lens.Lens' CreateUser (Prelude.Maybe (Prelude.NonEmpty HomeDirectoryMapEntry))
createUser_homeDirectoryMappings :: (Maybe (NonEmpty HomeDirectoryMapEntry)
-> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> CreateUser -> f CreateUser
createUser_homeDirectoryMappings = (CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry))
-> (CreateUser
-> Maybe (NonEmpty HomeDirectoryMapEntry) -> CreateUser)
-> Lens
CreateUser
CreateUser
(Maybe (NonEmpty HomeDirectoryMapEntry))
(Maybe (NonEmpty HomeDirectoryMapEntry))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:homeDirectoryMappings:CreateUser' :: CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings} -> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings) (\s :: CreateUser
s@CreateUser' {} Maybe (NonEmpty HomeDirectoryMapEntry)
a -> CreateUser
s {$sel:homeDirectoryMappings:CreateUser' :: Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings = Maybe (NonEmpty HomeDirectoryMapEntry)
a} :: CreateUser) ((Maybe (NonEmpty HomeDirectoryMapEntry)
-> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> CreateUser -> f CreateUser)
-> ((Maybe (NonEmpty HomeDirectoryMapEntry)
-> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> Maybe (NonEmpty HomeDirectoryMapEntry)
-> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> (Maybe (NonEmpty HomeDirectoryMapEntry)
-> f (Maybe (NonEmpty HomeDirectoryMapEntry)))
-> CreateUser
-> f CreateUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty HomeDirectoryMapEntry)
(NonEmpty HomeDirectoryMapEntry)
(NonEmpty HomeDirectoryMapEntry)
(NonEmpty HomeDirectoryMapEntry)
-> Iso
(Maybe (NonEmpty HomeDirectoryMapEntry))
(Maybe (NonEmpty HomeDirectoryMapEntry))
(Maybe (NonEmpty HomeDirectoryMapEntry))
(Maybe (NonEmpty HomeDirectoryMapEntry))
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
(NonEmpty HomeDirectoryMapEntry)
(NonEmpty HomeDirectoryMapEntry)
(NonEmpty HomeDirectoryMapEntry)
(NonEmpty HomeDirectoryMapEntry)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createUser_policy :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_policy :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_policy = (CreateUser -> Maybe Text)
-> (CreateUser -> Maybe Text -> CreateUser)
-> Lens CreateUser CreateUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe Text
policy :: Maybe Text
$sel:policy:CreateUser' :: CreateUser -> Maybe Text
policy} -> Maybe Text
policy) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:policy:CreateUser' :: Maybe Text
policy = Maybe Text
a} :: CreateUser)
createUser_homeDirectory :: Lens.Lens' CreateUser (Prelude.Maybe Prelude.Text)
createUser_homeDirectory :: (Maybe Text -> f (Maybe Text)) -> CreateUser -> f CreateUser
createUser_homeDirectory = (CreateUser -> Maybe Text)
-> (CreateUser -> Maybe Text -> CreateUser)
-> Lens CreateUser CreateUser (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe Text
homeDirectory :: Maybe Text
$sel:homeDirectory:CreateUser' :: CreateUser -> Maybe Text
homeDirectory} -> Maybe Text
homeDirectory) (\s :: CreateUser
s@CreateUser' {} Maybe Text
a -> CreateUser
s {$sel:homeDirectory:CreateUser' :: Maybe Text
homeDirectory = Maybe Text
a} :: CreateUser)
createUser_tags :: Lens.Lens' CreateUser (Prelude.Maybe (Prelude.NonEmpty Tag))
createUser_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateUser -> f CreateUser
createUser_tags = (CreateUser -> Maybe (NonEmpty Tag))
-> (CreateUser -> Maybe (NonEmpty Tag) -> CreateUser)
-> Lens
CreateUser CreateUser (Maybe (NonEmpty Tag)) (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateUser' :: CreateUser -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateUser
s@CreateUser' {} Maybe (NonEmpty Tag)
a -> CreateUser
s {$sel:tags:CreateUser' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateUser) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateUser -> f CreateUser)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateUser
-> f CreateUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createUser_role :: Lens.Lens' CreateUser Prelude.Text
createUser_role :: (Text -> f Text) -> CreateUser -> f CreateUser
createUser_role = (CreateUser -> Text)
-> (CreateUser -> Text -> CreateUser)
-> Lens CreateUser CreateUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Text
role' :: Text
$sel:role':CreateUser' :: CreateUser -> Text
role'} -> Text
role') (\s :: CreateUser
s@CreateUser' {} Text
a -> CreateUser
s {$sel:role':CreateUser' :: Text
role' = Text
a} :: CreateUser)
createUser_serverId :: Lens.Lens' CreateUser Prelude.Text
createUser_serverId :: (Text -> f Text) -> CreateUser -> f CreateUser
createUser_serverId = (CreateUser -> Text)
-> (CreateUser -> Text -> CreateUser)
-> Lens CreateUser CreateUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Text
serverId :: Text
$sel:serverId:CreateUser' :: CreateUser -> Text
serverId} -> Text
serverId) (\s :: CreateUser
s@CreateUser' {} Text
a -> CreateUser
s {$sel:serverId:CreateUser' :: Text
serverId = Text
a} :: CreateUser)
createUser_userName :: Lens.Lens' CreateUser Prelude.Text
createUser_userName :: (Text -> f Text) -> CreateUser -> f CreateUser
createUser_userName = (CreateUser -> Text)
-> (CreateUser -> Text -> CreateUser)
-> Lens CreateUser CreateUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUser' {Text
userName :: Text
$sel:userName:CreateUser' :: CreateUser -> Text
userName} -> Text
userName) (\s :: CreateUser
s@CreateUser' {} Text
a -> CreateUser
s {$sel:userName:CreateUser' :: Text
userName = Text
a} :: CreateUser)
instance Core.AWSRequest CreateUser where
type AWSResponse CreateUser = CreateUserResponse
request :: CreateUser -> Request CreateUser
request = Service -> CreateUser -> Request CreateUser
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateUser)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateUser))
-> Logger
-> Service
-> Proxy CreateUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateUser)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Text -> Text -> CreateUserResponse
CreateUserResponse'
(Int -> Text -> Text -> CreateUserResponse)
-> Either String Int
-> Either String (Text -> Text -> CreateUserResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (Text -> Text -> CreateUserResponse)
-> Either String Text -> Either String (Text -> CreateUserResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ServerId")
Either String (Text -> CreateUserResponse)
-> Either String Text -> Either String CreateUserResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UserName")
)
instance Prelude.Hashable CreateUser
instance Prelude.NFData CreateUser
instance Core.ToHeaders CreateUser where
toHeaders :: CreateUser -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateUser -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"TransferService.CreateUser" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateUser where
toJSON :: CreateUser -> Value
toJSON CreateUser' {Maybe (NonEmpty HomeDirectoryMapEntry)
Maybe (NonEmpty Tag)
Maybe Text
Maybe HomeDirectoryType
Maybe PosixProfile
Text
userName :: Text
serverId :: Text
role' :: Text
tags :: Maybe (NonEmpty Tag)
homeDirectory :: Maybe Text
policy :: Maybe Text
homeDirectoryMappings :: Maybe (NonEmpty HomeDirectoryMapEntry)
posixProfile :: Maybe PosixProfile
sshPublicKeyBody :: Maybe Text
homeDirectoryType :: Maybe HomeDirectoryType
$sel:userName:CreateUser' :: CreateUser -> Text
$sel:serverId:CreateUser' :: CreateUser -> Text
$sel:role':CreateUser' :: CreateUser -> Text
$sel:tags:CreateUser' :: CreateUser -> Maybe (NonEmpty Tag)
$sel:homeDirectory:CreateUser' :: CreateUser -> Maybe Text
$sel:policy:CreateUser' :: CreateUser -> Maybe Text
$sel:homeDirectoryMappings:CreateUser' :: CreateUser -> Maybe (NonEmpty HomeDirectoryMapEntry)
$sel:posixProfile:CreateUser' :: CreateUser -> Maybe PosixProfile
$sel:sshPublicKeyBody:CreateUser' :: CreateUser -> Maybe Text
$sel:homeDirectoryType:CreateUser' :: CreateUser -> Maybe HomeDirectoryType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"HomeDirectoryType" Text -> HomeDirectoryType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HomeDirectoryType -> Pair)
-> Maybe HomeDirectoryType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HomeDirectoryType
homeDirectoryType,
(Text
"SshPublicKeyBody" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sshPublicKeyBody,
(Text
"PosixProfile" Text -> PosixProfile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PosixProfile -> Pair) -> Maybe PosixProfile -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PosixProfile
posixProfile,
(Text
"HomeDirectoryMappings" Text -> NonEmpty HomeDirectoryMapEntry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty HomeDirectoryMapEntry -> Pair)
-> Maybe (NonEmpty HomeDirectoryMapEntry) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty HomeDirectoryMapEntry)
homeDirectoryMappings,
(Text
"Policy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policy,
(Text
"HomeDirectory" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
homeDirectory,
(Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Role" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
role'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userName)
]
)
instance Core.ToPath CreateUser where
toPath :: CreateUser -> ByteString
toPath = ByteString -> CreateUser -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateUser where
toQuery :: CreateUser -> QueryString
toQuery = QueryString -> CreateUser -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateUserResponse = CreateUserResponse'
{
CreateUserResponse -> Int
httpStatus :: Prelude.Int,
CreateUserResponse -> Text
serverId :: Prelude.Text,
CreateUserResponse -> Text
userName :: Prelude.Text
}
deriving (CreateUserResponse -> CreateUserResponse -> Bool
(CreateUserResponse -> CreateUserResponse -> Bool)
-> (CreateUserResponse -> CreateUserResponse -> Bool)
-> Eq CreateUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUserResponse -> CreateUserResponse -> Bool
$c/= :: CreateUserResponse -> CreateUserResponse -> Bool
== :: CreateUserResponse -> CreateUserResponse -> Bool
$c== :: CreateUserResponse -> CreateUserResponse -> Bool
Prelude.Eq, ReadPrec [CreateUserResponse]
ReadPrec CreateUserResponse
Int -> ReadS CreateUserResponse
ReadS [CreateUserResponse]
(Int -> ReadS CreateUserResponse)
-> ReadS [CreateUserResponse]
-> ReadPrec CreateUserResponse
-> ReadPrec [CreateUserResponse]
-> Read CreateUserResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUserResponse]
$creadListPrec :: ReadPrec [CreateUserResponse]
readPrec :: ReadPrec CreateUserResponse
$creadPrec :: ReadPrec CreateUserResponse
readList :: ReadS [CreateUserResponse]
$creadList :: ReadS [CreateUserResponse]
readsPrec :: Int -> ReadS CreateUserResponse
$creadsPrec :: Int -> ReadS CreateUserResponse
Prelude.Read, Int -> CreateUserResponse -> ShowS
[CreateUserResponse] -> ShowS
CreateUserResponse -> String
(Int -> CreateUserResponse -> ShowS)
-> (CreateUserResponse -> String)
-> ([CreateUserResponse] -> ShowS)
-> Show CreateUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUserResponse] -> ShowS
$cshowList :: [CreateUserResponse] -> ShowS
show :: CreateUserResponse -> String
$cshow :: CreateUserResponse -> String
showsPrec :: Int -> CreateUserResponse -> ShowS
$cshowsPrec :: Int -> CreateUserResponse -> ShowS
Prelude.Show, (forall x. CreateUserResponse -> Rep CreateUserResponse x)
-> (forall x. Rep CreateUserResponse x -> CreateUserResponse)
-> Generic CreateUserResponse
forall x. Rep CreateUserResponse x -> CreateUserResponse
forall x. CreateUserResponse -> Rep CreateUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUserResponse x -> CreateUserResponse
$cfrom :: forall x. CreateUserResponse -> Rep CreateUserResponse x
Prelude.Generic)
newCreateUserResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
CreateUserResponse
newCreateUserResponse :: Int -> Text -> Text -> CreateUserResponse
newCreateUserResponse
Int
pHttpStatus_
Text
pServerId_
Text
pUserName_ =
CreateUserResponse' :: Int -> Text -> Text -> CreateUserResponse
CreateUserResponse'
{ $sel:httpStatus:CreateUserResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:serverId:CreateUserResponse' :: Text
serverId = Text
pServerId_,
$sel:userName:CreateUserResponse' :: Text
userName = Text
pUserName_
}
createUserResponse_httpStatus :: Lens.Lens' CreateUserResponse Prelude.Int
createUserResponse_httpStatus :: (Int -> f Int) -> CreateUserResponse -> f CreateUserResponse
createUserResponse_httpStatus = (CreateUserResponse -> Int)
-> (CreateUserResponse -> Int -> CreateUserResponse)
-> Lens CreateUserResponse CreateUserResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateUserResponse' :: CreateUserResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateUserResponse
s@CreateUserResponse' {} Int
a -> CreateUserResponse
s {$sel:httpStatus:CreateUserResponse' :: Int
httpStatus = Int
a} :: CreateUserResponse)
createUserResponse_serverId :: Lens.Lens' CreateUserResponse Prelude.Text
createUserResponse_serverId :: (Text -> f Text) -> CreateUserResponse -> f CreateUserResponse
createUserResponse_serverId = (CreateUserResponse -> Text)
-> (CreateUserResponse -> Text -> CreateUserResponse)
-> Lens CreateUserResponse CreateUserResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserResponse' {Text
serverId :: Text
$sel:serverId:CreateUserResponse' :: CreateUserResponse -> Text
serverId} -> Text
serverId) (\s :: CreateUserResponse
s@CreateUserResponse' {} Text
a -> CreateUserResponse
s {$sel:serverId:CreateUserResponse' :: Text
serverId = Text
a} :: CreateUserResponse)
createUserResponse_userName :: Lens.Lens' CreateUserResponse Prelude.Text
createUserResponse_userName :: (Text -> f Text) -> CreateUserResponse -> f CreateUserResponse
createUserResponse_userName = (CreateUserResponse -> Text)
-> (CreateUserResponse -> Text -> CreateUserResponse)
-> Lens CreateUserResponse CreateUserResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserResponse' {Text
userName :: Text
$sel:userName:CreateUserResponse' :: CreateUserResponse -> Text
userName} -> Text
userName) (\s :: CreateUserResponse
s@CreateUserResponse' {} Text
a -> CreateUserResponse
s {$sel:userName:CreateUserResponse' :: Text
userName = Text
a} :: CreateUserResponse)
instance Prelude.NFData CreateUserResponse