{-# 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
, usFeedbackURL
, usAttributesToDelete
, usDeleteStorageConnectors
, usStorageConnectors
, usDisplayName
, usDescription
, usRedirectURL
, 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'
{ _usFeedbackURL :: !(Maybe Text)
, _usAttributesToDelete :: !(Maybe [StackAttribute])
, _usDeleteStorageConnectors :: !(Maybe Bool)
, _usStorageConnectors :: !(Maybe [StorageConnector])
, _usDisplayName :: !(Maybe Text)
, _usDescription :: !(Maybe Text)
, _usRedirectURL :: !(Maybe Text)
, _usName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateStack
:: Text
-> UpdateStack
updateStack pName_ =
UpdateStack'
{ _usFeedbackURL = Nothing
, _usAttributesToDelete = Nothing
, _usDeleteStorageConnectors = Nothing
, _usStorageConnectors = Nothing
, _usDisplayName = Nothing
, _usDescription = Nothing
, _usRedirectURL = Nothing
, _usName = pName_
}
usFeedbackURL :: Lens' UpdateStack (Maybe Text)
usFeedbackURL = lens _usFeedbackURL (\ s a -> s{_usFeedbackURL = a})
usAttributesToDelete :: Lens' UpdateStack [StackAttribute]
usAttributesToDelete = lens _usAttributesToDelete (\ s a -> s{_usAttributesToDelete = a}) . _Default . _Coerce
usDeleteStorageConnectors :: Lens' UpdateStack (Maybe Bool)
usDeleteStorageConnectors = lens _usDeleteStorageConnectors (\ s a -> s{_usDeleteStorageConnectors = a})
usStorageConnectors :: Lens' UpdateStack [StorageConnector]
usStorageConnectors = lens _usStorageConnectors (\ s a -> s{_usStorageConnectors = a}) . _Default . _Coerce
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})
usRedirectURL :: Lens' UpdateStack (Maybe Text)
usRedirectURL = lens _usRedirectURL (\ s a -> s{_usRedirectURL = 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 where
instance NFData UpdateStack where
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
[("FeedbackURL" .=) <$> _usFeedbackURL,
("AttributesToDelete" .=) <$> _usAttributesToDelete,
("DeleteStorageConnectors" .=) <$>
_usDeleteStorageConnectors,
("StorageConnectors" .=) <$> _usStorageConnectors,
("DisplayName" .=) <$> _usDisplayName,
("Description" .=) <$> _usDescription,
("RedirectURL" .=) <$> _usRedirectURL,
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 where