module Network.AWS.ElasticBeanstalk.UpdateApplication
(
UpdateApplication
, updateApplication
, uaApplicationName
, uaDescription
, UpdateApplicationResponse
, updateApplicationResponse
, uarApplication
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElasticBeanstalk.Types
import qualified GHC.Exts
data UpdateApplication = UpdateApplication
{ _uaApplicationName :: Text
, _uaDescription :: Maybe Text
} deriving (Eq, Ord, Show)
updateApplication :: Text
-> UpdateApplication
updateApplication p1 = UpdateApplication
{ _uaApplicationName = p1
, _uaDescription = Nothing
}
uaApplicationName :: Lens' UpdateApplication Text
uaApplicationName =
lens _uaApplicationName (\s a -> s { _uaApplicationName = a })
uaDescription :: Lens' UpdateApplication (Maybe Text)
uaDescription = lens _uaDescription (\s a -> s { _uaDescription = a })
newtype UpdateApplicationResponse = UpdateApplicationResponse
{ _uarApplication :: Maybe ApplicationDescription
} deriving (Eq, Show)
updateApplicationResponse :: UpdateApplicationResponse
updateApplicationResponse = UpdateApplicationResponse
{ _uarApplication = Nothing
}
uarApplication :: Lens' UpdateApplicationResponse (Maybe ApplicationDescription)
uarApplication = lens _uarApplication (\s a -> s { _uarApplication = a })
instance ToPath UpdateApplication where
toPath = const "/"
instance ToQuery UpdateApplication where
toQuery UpdateApplication{..} = mconcat
[ "ApplicationName" =? _uaApplicationName
, "Description" =? _uaDescription
]
instance ToHeaders UpdateApplication
instance AWSRequest UpdateApplication where
type Sv UpdateApplication = ElasticBeanstalk
type Rs UpdateApplication = UpdateApplicationResponse
request = post "UpdateApplication"
response = xmlResponse
instance FromXML UpdateApplicationResponse where
parseXML = withElement "UpdateApplicationResult" $ \x -> UpdateApplicationResponse
<$> x .@? "Application"