{-# 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.UpdateStack
(
updateStack
, UpdateStack
, usDisplayName
, usDescription
, usName
, updateStackResponse
, UpdateStackResponse
, usrsStack
, usrsResponseStatus
) 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
data UpdateStack = UpdateStack'
{ _usDisplayName :: !(Maybe Text)
, _usDescription :: !(Maybe Text)
, _usName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateStack
:: Text
-> UpdateStack
updateStack pName_ =
UpdateStack'
{ _usDisplayName = Nothing
, _usDescription = Nothing
, _usName = pName_
}
usDisplayName :: Lens' UpdateStack (Maybe Text)
usDisplayName = lens _usDisplayName (\ s a -> s{_usDisplayName = a});
usDescription :: Lens' UpdateStack (Maybe Text)
usDescription = lens _usDescription (\ s a -> s{_usDescription = a});
usName :: Lens' UpdateStack Text
usName = lens _usName (\ s a -> s{_usName = a});
instance AWSRequest UpdateStack where
type Rs UpdateStack = UpdateStackResponse
request = postJSON appStream
response
= receiveJSON
(\ s h x ->
UpdateStackResponse' <$>
(x .?> "Stack") <*> (pure (fromEnum s)))
instance Hashable UpdateStack
instance NFData UpdateStack
instance ToHeaders UpdateStack where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("PhotonAdminProxyService.UpdateStack" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateStack where
toJSON UpdateStack'{..}
= object
(catMaybes
[("DisplayName" .=) <$> _usDisplayName,
("Description" .=) <$> _usDescription,
Just ("Name" .= _usName)])
instance ToPath UpdateStack where
toPath = const "/"
instance ToQuery UpdateStack where
toQuery = const mempty
data UpdateStackResponse = UpdateStackResponse'
{ _usrsStack :: !(Maybe Stack)
, _usrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateStackResponse
:: Int
-> UpdateStackResponse
updateStackResponse pResponseStatus_ =
UpdateStackResponse'
{ _usrsStack = Nothing
, _usrsResponseStatus = pResponseStatus_
}
usrsStack :: Lens' UpdateStackResponse (Maybe Stack)
usrsStack = lens _usrsStack (\ s a -> s{_usrsStack = a});
usrsResponseStatus :: Lens' UpdateStackResponse Int
usrsResponseStatus = lens _usrsResponseStatus (\ s a -> s{_usrsResponseStatus = a});
instance NFData UpdateStackResponse