{-# 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.CreateEnvironment
(
createEnvironment
, CreateEnvironment
, cCNAMEPrefix
, cTemplateName
, cOptionsToRemove
, cOptionSettings
, cVersionLabel
, cTier
, cEnvironmentName
, cSolutionStackName
, cGroupName
, cDescription
, cTags
, cApplicationName
, environmentDescription
, EnvironmentDescription
, eStatus
, eCNAME
, eTemplateName
, eAbortableOperationInProgress
, eEndpointURL
, eResources
, eDateUpdated
, eDateCreated
, eHealth
, eVersionLabel
, eTier
, eEnvironmentName
, eApplicationName
, eSolutionStackName
, eEnvironmentId
, eHealthStatus
, eEnvironmentLinks
, eDescription
) 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 CreateEnvironment = CreateEnvironment'
{ _cCNAMEPrefix :: !(Maybe Text)
, _cTemplateName :: !(Maybe Text)
, _cOptionsToRemove :: !(Maybe [OptionSpecification])
, _cOptionSettings :: !(Maybe [ConfigurationOptionSetting])
, _cVersionLabel :: !(Maybe Text)
, _cTier :: !(Maybe EnvironmentTier)
, _cEnvironmentName :: !(Maybe Text)
, _cSolutionStackName :: !(Maybe Text)
, _cGroupName :: !(Maybe Text)
, _cDescription :: !(Maybe Text)
, _cTags :: !(Maybe [Tag])
, _cApplicationName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createEnvironment
:: Text
-> CreateEnvironment
createEnvironment pApplicationName_ =
CreateEnvironment'
{ _cCNAMEPrefix = Nothing
, _cTemplateName = Nothing
, _cOptionsToRemove = Nothing
, _cOptionSettings = Nothing
, _cVersionLabel = Nothing
, _cTier = Nothing
, _cEnvironmentName = Nothing
, _cSolutionStackName = Nothing
, _cGroupName = Nothing
, _cDescription = Nothing
, _cTags = Nothing
, _cApplicationName = pApplicationName_
}
cCNAMEPrefix :: Lens' CreateEnvironment (Maybe Text)
cCNAMEPrefix = lens _cCNAMEPrefix (\ s a -> s{_cCNAMEPrefix = a});
cTemplateName :: Lens' CreateEnvironment (Maybe Text)
cTemplateName = lens _cTemplateName (\ s a -> s{_cTemplateName = a});
cOptionsToRemove :: Lens' CreateEnvironment [OptionSpecification]
cOptionsToRemove = lens _cOptionsToRemove (\ s a -> s{_cOptionsToRemove = a}) . _Default . _Coerce;
cOptionSettings :: Lens' CreateEnvironment [ConfigurationOptionSetting]
cOptionSettings = lens _cOptionSettings (\ s a -> s{_cOptionSettings = a}) . _Default . _Coerce;
cVersionLabel :: Lens' CreateEnvironment (Maybe Text)
cVersionLabel = lens _cVersionLabel (\ s a -> s{_cVersionLabel = a});
cTier :: Lens' CreateEnvironment (Maybe EnvironmentTier)
cTier = lens _cTier (\ s a -> s{_cTier = a});
cEnvironmentName :: Lens' CreateEnvironment (Maybe Text)
cEnvironmentName = lens _cEnvironmentName (\ s a -> s{_cEnvironmentName = a});
cSolutionStackName :: Lens' CreateEnvironment (Maybe Text)
cSolutionStackName = lens _cSolutionStackName (\ s a -> s{_cSolutionStackName = a});
cGroupName :: Lens' CreateEnvironment (Maybe Text)
cGroupName = lens _cGroupName (\ s a -> s{_cGroupName = a});
cDescription :: Lens' CreateEnvironment (Maybe Text)
cDescription = lens _cDescription (\ s a -> s{_cDescription = a});
cTags :: Lens' CreateEnvironment [Tag]
cTags = lens _cTags (\ s a -> s{_cTags = a}) . _Default . _Coerce;
cApplicationName :: Lens' CreateEnvironment Text
cApplicationName = lens _cApplicationName (\ s a -> s{_cApplicationName = a});
instance AWSRequest CreateEnvironment where
type Rs CreateEnvironment = EnvironmentDescription
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper "CreateEnvironmentResult"
(\ s h x -> parseXML x)
instance Hashable CreateEnvironment
instance NFData CreateEnvironment
instance ToHeaders CreateEnvironment where
toHeaders = const mempty
instance ToPath CreateEnvironment where
toPath = const "/"
instance ToQuery CreateEnvironment where
toQuery CreateEnvironment'{..}
= mconcat
["Action" =: ("CreateEnvironment" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"CNAMEPrefix" =: _cCNAMEPrefix,
"TemplateName" =: _cTemplateName,
"OptionsToRemove" =:
toQuery (toQueryList "member" <$> _cOptionsToRemove),
"OptionSettings" =:
toQuery (toQueryList "member" <$> _cOptionSettings),
"VersionLabel" =: _cVersionLabel, "Tier" =: _cTier,
"EnvironmentName" =: _cEnvironmentName,
"SolutionStackName" =: _cSolutionStackName,
"GroupName" =: _cGroupName,
"Description" =: _cDescription,
"Tags" =: toQuery (toQueryList "member" <$> _cTags),
"ApplicationName" =: _cApplicationName]