{-# 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.AppStream.DeleteUser
(
DeleteUser (..),
newDeleteUser,
deleteUser_userName,
deleteUser_authenticationType,
DeleteUserResponse (..),
newDeleteUserResponse,
deleteUserResponse_httpStatus,
)
where
import Amazonka.AppStream.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteUser = DeleteUser'
{
DeleteUser -> Sensitive Text
userName :: Data.Sensitive Prelude.Text,
DeleteUser -> AuthenticationType
authenticationType :: AuthenticationType
}
deriving (DeleteUser -> DeleteUser -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUser -> DeleteUser -> Bool
$c/= :: DeleteUser -> DeleteUser -> Bool
== :: DeleteUser -> DeleteUser -> Bool
$c== :: DeleteUser -> DeleteUser -> Bool
Prelude.Eq, Int -> DeleteUser -> ShowS
[DeleteUser] -> ShowS
DeleteUser -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUser] -> ShowS
$cshowList :: [DeleteUser] -> ShowS
show :: DeleteUser -> String
$cshow :: DeleteUser -> String
showsPrec :: Int -> DeleteUser -> ShowS
$cshowsPrec :: Int -> DeleteUser -> ShowS
Prelude.Show, forall x. Rep DeleteUser x -> DeleteUser
forall x. DeleteUser -> Rep DeleteUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUser x -> DeleteUser
$cfrom :: forall x. DeleteUser -> Rep DeleteUser x
Prelude.Generic)
newDeleteUser ::
Prelude.Text ->
AuthenticationType ->
DeleteUser
newDeleteUser :: Text -> AuthenticationType -> DeleteUser
newDeleteUser Text
pUserName_ AuthenticationType
pAuthenticationType_ =
DeleteUser'
{ $sel:userName:DeleteUser' :: Sensitive Text
userName =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pUserName_,
$sel:authenticationType:DeleteUser' :: AuthenticationType
authenticationType = AuthenticationType
pAuthenticationType_
}
deleteUser_userName :: Lens.Lens' DeleteUser Prelude.Text
deleteUser_userName :: Lens' DeleteUser Text
deleteUser_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUser' {Sensitive Text
userName :: Sensitive Text
$sel:userName:DeleteUser' :: DeleteUser -> Sensitive Text
userName} -> Sensitive Text
userName) (\s :: DeleteUser
s@DeleteUser' {} Sensitive Text
a -> DeleteUser
s {$sel:userName:DeleteUser' :: Sensitive Text
userName = Sensitive Text
a} :: DeleteUser) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
deleteUser_authenticationType :: Lens.Lens' DeleteUser AuthenticationType
deleteUser_authenticationType :: Lens' DeleteUser AuthenticationType
deleteUser_authenticationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUser' {AuthenticationType
authenticationType :: AuthenticationType
$sel:authenticationType:DeleteUser' :: DeleteUser -> AuthenticationType
authenticationType} -> AuthenticationType
authenticationType) (\s :: DeleteUser
s@DeleteUser' {} AuthenticationType
a -> DeleteUser
s {$sel:authenticationType:DeleteUser' :: AuthenticationType
authenticationType = AuthenticationType
a} :: DeleteUser)
instance Core.AWSRequest DeleteUser where
type AWSResponse DeleteUser = DeleteUserResponse
request :: (Service -> Service) -> DeleteUser -> Request DeleteUser
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUser)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteUserResponse
DeleteUserResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteUser where
hashWithSalt :: Int -> DeleteUser -> Int
hashWithSalt Int
_salt DeleteUser' {Sensitive Text
AuthenticationType
authenticationType :: AuthenticationType
userName :: Sensitive Text
$sel:authenticationType:DeleteUser' :: DeleteUser -> AuthenticationType
$sel:userName:DeleteUser' :: DeleteUser -> Sensitive Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AuthenticationType
authenticationType
instance Prelude.NFData DeleteUser where
rnf :: DeleteUser -> ()
rnf DeleteUser' {Sensitive Text
AuthenticationType
authenticationType :: AuthenticationType
userName :: Sensitive Text
$sel:authenticationType:DeleteUser' :: DeleteUser -> AuthenticationType
$sel:userName:DeleteUser' :: DeleteUser -> Sensitive Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AuthenticationType
authenticationType
instance Data.ToHeaders DeleteUser where
toHeaders :: DeleteUser -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"PhotonAdminProxyService.DeleteUser" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteUser where
toJSON :: DeleteUser -> Value
toJSON DeleteUser' {Sensitive Text
AuthenticationType
authenticationType :: AuthenticationType
userName :: Sensitive Text
$sel:authenticationType:DeleteUser' :: DeleteUser -> AuthenticationType
$sel:userName:DeleteUser' :: DeleteUser -> Sensitive Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"UserName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
userName),
forall a. a -> Maybe a
Prelude.Just
(Key
"AuthenticationType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AuthenticationType
authenticationType)
]
)
instance Data.ToPath DeleteUser where
toPath :: DeleteUser -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteUser where
toQuery :: DeleteUser -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteUserResponse = DeleteUserResponse'
{
DeleteUserResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteUserResponse -> DeleteUserResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUserResponse -> DeleteUserResponse -> Bool
$c/= :: DeleteUserResponse -> DeleteUserResponse -> Bool
== :: DeleteUserResponse -> DeleteUserResponse -> Bool
$c== :: DeleteUserResponse -> DeleteUserResponse -> Bool
Prelude.Eq, ReadPrec [DeleteUserResponse]
ReadPrec DeleteUserResponse
Int -> ReadS DeleteUserResponse
ReadS [DeleteUserResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUserResponse]
$creadListPrec :: ReadPrec [DeleteUserResponse]
readPrec :: ReadPrec DeleteUserResponse
$creadPrec :: ReadPrec DeleteUserResponse
readList :: ReadS [DeleteUserResponse]
$creadList :: ReadS [DeleteUserResponse]
readsPrec :: Int -> ReadS DeleteUserResponse
$creadsPrec :: Int -> ReadS DeleteUserResponse
Prelude.Read, Int -> DeleteUserResponse -> ShowS
[DeleteUserResponse] -> ShowS
DeleteUserResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUserResponse] -> ShowS
$cshowList :: [DeleteUserResponse] -> ShowS
show :: DeleteUserResponse -> String
$cshow :: DeleteUserResponse -> String
showsPrec :: Int -> DeleteUserResponse -> ShowS
$cshowsPrec :: Int -> DeleteUserResponse -> ShowS
Prelude.Show, forall x. Rep DeleteUserResponse x -> DeleteUserResponse
forall x. DeleteUserResponse -> Rep DeleteUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUserResponse x -> DeleteUserResponse
$cfrom :: forall x. DeleteUserResponse -> Rep DeleteUserResponse x
Prelude.Generic)
newDeleteUserResponse ::
Prelude.Int ->
DeleteUserResponse
newDeleteUserResponse :: Int -> DeleteUserResponse
newDeleteUserResponse Int
pHttpStatus_ =
DeleteUserResponse' {$sel:httpStatus:DeleteUserResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteUserResponse_httpStatus :: Lens.Lens' DeleteUserResponse Prelude.Int
deleteUserResponse_httpStatus :: Lens' DeleteUserResponse Int
deleteUserResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUserResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteUserResponse' :: DeleteUserResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteUserResponse
s@DeleteUserResponse' {} Int
a -> DeleteUserResponse
s {$sel:httpStatus:DeleteUserResponse' :: Int
httpStatus = Int
a} :: DeleteUserResponse)
instance Prelude.NFData DeleteUserResponse where
rnf :: DeleteUserResponse -> ()
rnf DeleteUserResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteUserResponse' :: DeleteUserResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus