{-# 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.ElasticBeanstalk.ValidateConfigurationSettings
(
validateConfigurationSettings
, ValidateConfigurationSettings
, vcsTemplateName
, vcsEnvironmentName
, vcsApplicationName
, vcsOptionSettings
, validateConfigurationSettingsResponse
, ValidateConfigurationSettingsResponse
, vcsrsMessages
, vcsrsResponseStatus
) where
import Network.AWS.ElasticBeanstalk.Types
import Network.AWS.ElasticBeanstalk.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ValidateConfigurationSettings = ValidateConfigurationSettings'
{ _vcsTemplateName :: !(Maybe Text)
, _vcsEnvironmentName :: !(Maybe Text)
, _vcsApplicationName :: !Text
, _vcsOptionSettings :: ![ConfigurationOptionSetting]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
validateConfigurationSettings
:: Text
-> ValidateConfigurationSettings
validateConfigurationSettings pApplicationName_ =
ValidateConfigurationSettings'
{ _vcsTemplateName = Nothing
, _vcsEnvironmentName = Nothing
, _vcsApplicationName = pApplicationName_
, _vcsOptionSettings = mempty
}
vcsTemplateName :: Lens' ValidateConfigurationSettings (Maybe Text)
vcsTemplateName = lens _vcsTemplateName (\ s a -> s{_vcsTemplateName = a})
vcsEnvironmentName :: Lens' ValidateConfigurationSettings (Maybe Text)
vcsEnvironmentName = lens _vcsEnvironmentName (\ s a -> s{_vcsEnvironmentName = a})
vcsApplicationName :: Lens' ValidateConfigurationSettings Text
vcsApplicationName = lens _vcsApplicationName (\ s a -> s{_vcsApplicationName = a})
vcsOptionSettings :: Lens' ValidateConfigurationSettings [ConfigurationOptionSetting]
vcsOptionSettings = lens _vcsOptionSettings (\ s a -> s{_vcsOptionSettings = a}) . _Coerce
instance AWSRequest ValidateConfigurationSettings
where
type Rs ValidateConfigurationSettings =
ValidateConfigurationSettingsResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper
"ValidateConfigurationSettingsResult"
(\ s h x ->
ValidateConfigurationSettingsResponse' <$>
(x .@? "Messages" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable ValidateConfigurationSettings where
instance NFData ValidateConfigurationSettings where
instance ToHeaders ValidateConfigurationSettings
where
toHeaders = const mempty
instance ToPath ValidateConfigurationSettings where
toPath = const "/"
instance ToQuery ValidateConfigurationSettings where
toQuery ValidateConfigurationSettings'{..}
= mconcat
["Action" =:
("ValidateConfigurationSettings" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"TemplateName" =: _vcsTemplateName,
"EnvironmentName" =: _vcsEnvironmentName,
"ApplicationName" =: _vcsApplicationName,
"OptionSettings" =:
toQueryList "member" _vcsOptionSettings]
data ValidateConfigurationSettingsResponse = ValidateConfigurationSettingsResponse'
{ _vcsrsMessages :: !(Maybe [ValidationMessage])
, _vcsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
validateConfigurationSettingsResponse
:: Int
-> ValidateConfigurationSettingsResponse
validateConfigurationSettingsResponse pResponseStatus_ =
ValidateConfigurationSettingsResponse'
{_vcsrsMessages = Nothing, _vcsrsResponseStatus = pResponseStatus_}
vcsrsMessages :: Lens' ValidateConfigurationSettingsResponse [ValidationMessage]
vcsrsMessages = lens _vcsrsMessages (\ s a -> s{_vcsrsMessages = a}) . _Default . _Coerce
vcsrsResponseStatus :: Lens' ValidateConfigurationSettingsResponse Int
vcsrsResponseStatus = lens _vcsrsResponseStatus (\ s a -> s{_vcsrsResponseStatus = a})
instance NFData ValidateConfigurationSettingsResponse
where