module Network.AWS.OpsWorks.UpdateApp
(
updateApp
, UpdateApp
, uaSSLConfiguration
, uaEnableSSL
, uaEnvironment
, uaDataSources
, uaAppSource
, uaName
, uaAttributes
, uaType
, uaDomains
, uaDescription
, uaAppId
, updateAppResponse
, UpdateAppResponse
) where
import Network.AWS.OpsWorks.Types
import Network.AWS.OpsWorks.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateApp = UpdateApp'
{ _uaSSLConfiguration :: !(Maybe SSLConfiguration)
, _uaEnableSSL :: !(Maybe Bool)
, _uaEnvironment :: !(Maybe [EnvironmentVariable])
, _uaDataSources :: !(Maybe [DataSource])
, _uaAppSource :: !(Maybe Source)
, _uaName :: !(Maybe Text)
, _uaAttributes :: !(Maybe (Map AppAttributesKeys Text))
, _uaType :: !(Maybe AppType)
, _uaDomains :: !(Maybe [Text])
, _uaDescription :: !(Maybe Text)
, _uaAppId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateApp
:: Text
-> UpdateApp
updateApp pAppId_ =
UpdateApp'
{ _uaSSLConfiguration = Nothing
, _uaEnableSSL = Nothing
, _uaEnvironment = Nothing
, _uaDataSources = Nothing
, _uaAppSource = Nothing
, _uaName = Nothing
, _uaAttributes = Nothing
, _uaType = Nothing
, _uaDomains = Nothing
, _uaDescription = Nothing
, _uaAppId = pAppId_
}
uaSSLConfiguration :: Lens' UpdateApp (Maybe SSLConfiguration)
uaSSLConfiguration = lens _uaSSLConfiguration (\ s a -> s{_uaSSLConfiguration = a});
uaEnableSSL :: Lens' UpdateApp (Maybe Bool)
uaEnableSSL = lens _uaEnableSSL (\ s a -> s{_uaEnableSSL = a});
uaEnvironment :: Lens' UpdateApp [EnvironmentVariable]
uaEnvironment = lens _uaEnvironment (\ s a -> s{_uaEnvironment = a}) . _Default . _Coerce;
uaDataSources :: Lens' UpdateApp [DataSource]
uaDataSources = lens _uaDataSources (\ s a -> s{_uaDataSources = a}) . _Default . _Coerce;
uaAppSource :: Lens' UpdateApp (Maybe Source)
uaAppSource = lens _uaAppSource (\ s a -> s{_uaAppSource = a});
uaName :: Lens' UpdateApp (Maybe Text)
uaName = lens _uaName (\ s a -> s{_uaName = a});
uaAttributes :: Lens' UpdateApp (HashMap AppAttributesKeys Text)
uaAttributes = lens _uaAttributes (\ s a -> s{_uaAttributes = a}) . _Default . _Map;
uaType :: Lens' UpdateApp (Maybe AppType)
uaType = lens _uaType (\ s a -> s{_uaType = a});
uaDomains :: Lens' UpdateApp [Text]
uaDomains = lens _uaDomains (\ s a -> s{_uaDomains = a}) . _Default . _Coerce;
uaDescription :: Lens' UpdateApp (Maybe Text)
uaDescription = lens _uaDescription (\ s a -> s{_uaDescription = a});
uaAppId :: Lens' UpdateApp Text
uaAppId = lens _uaAppId (\ s a -> s{_uaAppId = a});
instance AWSRequest UpdateApp where
type Rs UpdateApp = UpdateAppResponse
request = postJSON opsWorks
response = receiveNull UpdateAppResponse'
instance ToHeaders UpdateApp where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.UpdateApp" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateApp where
toJSON UpdateApp'{..}
= object
(catMaybes
[("SslConfiguration" .=) <$> _uaSSLConfiguration,
("EnableSsl" .=) <$> _uaEnableSSL,
("Environment" .=) <$> _uaEnvironment,
("DataSources" .=) <$> _uaDataSources,
("AppSource" .=) <$> _uaAppSource,
("Name" .=) <$> _uaName,
("Attributes" .=) <$> _uaAttributes,
("Type" .=) <$> _uaType,
("Domains" .=) <$> _uaDomains,
("Description" .=) <$> _uaDescription,
Just ("AppId" .= _uaAppId)])
instance ToPath UpdateApp where
toPath = const "/"
instance ToQuery UpdateApp where
toQuery = const mempty
data UpdateAppResponse =
UpdateAppResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
updateAppResponse
:: UpdateAppResponse
updateAppResponse = UpdateAppResponse'