{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.AppStream.ExpireSession
(
expireSession
, ExpireSession
, esSessionId
, expireSessionResponse
, ExpireSessionResponse
, esrsResponseStatus
) where
import Network.AWS.AppStream.Types
import Network.AWS.AppStream.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ExpireSession = ExpireSession'
{ _esSessionId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
expireSession
:: Text
-> ExpireSession
expireSession pSessionId_ = ExpireSession' {_esSessionId = pSessionId_}
esSessionId :: Lens' ExpireSession Text
esSessionId = lens _esSessionId (\ s a -> s{_esSessionId = a})
instance AWSRequest ExpireSession where
type Rs ExpireSession = ExpireSessionResponse
request = postJSON appStream
response
= receiveEmpty
(\ s h x ->
ExpireSessionResponse' <$> (pure (fromEnum s)))
instance Hashable ExpireSession where
instance NFData ExpireSession where
instance ToHeaders ExpireSession where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.ExpireSession" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ExpireSession where
toJSON ExpireSession'{..}
= object
(catMaybes [Just ("SessionId" .= _esSessionId)])
instance ToPath ExpireSession where
toPath = const "/"
instance ToQuery ExpireSession where
toQuery = const mempty
newtype ExpireSessionResponse = ExpireSessionResponse'
{ _esrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
expireSessionResponse
:: Int
-> ExpireSessionResponse
expireSessionResponse pResponseStatus_ =
ExpireSessionResponse' {_esrsResponseStatus = pResponseStatus_}
esrsResponseStatus :: Lens' ExpireSessionResponse Int
esrsResponseStatus = lens _esrsResponseStatus (\ s a -> s{_esrsResponseStatus = a})
instance NFData ExpireSessionResponse where