module Network.AWS.ElasticBeanstalk.CreateEnvironment
(
CreateEnvironment
, createEnvironment
, ceApplicationName
, ceCNAMEPrefix
, ceDescription
, ceEnvironmentName
, ceOptionSettings
, ceOptionsToRemove
, ceSolutionStackName
, ceTags
, ceTemplateName
, ceTier
, ceVersionLabel
, CreateEnvironmentResponse
, createEnvironmentResponse
, cerApplicationName
, cerCNAME
, cerDateCreated
, cerDateUpdated
, cerDescription
, cerEndpointURL
, cerEnvironmentId
, cerEnvironmentName
, cerHealth
, cerResources
, cerSolutionStackName
, cerStatus
, cerTemplateName
, cerTier
, cerVersionLabel
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.ElasticBeanstalk.Types
import qualified GHC.Exts
data CreateEnvironment = CreateEnvironment
{ _ceApplicationName :: Text
, _ceCNAMEPrefix :: Maybe Text
, _ceDescription :: Maybe Text
, _ceEnvironmentName :: Text
, _ceOptionSettings :: List "OptionSettings" ConfigurationOptionSetting
, _ceOptionsToRemove :: List "OptionsToRemove" OptionSpecification
, _ceSolutionStackName :: Maybe Text
, _ceTags :: List "Tags" Tag
, _ceTemplateName :: Maybe Text
, _ceTier :: Maybe EnvironmentTier
, _ceVersionLabel :: Maybe Text
} deriving (Eq, Show)
createEnvironment :: Text
-> Text
-> CreateEnvironment
createEnvironment p1 p2 = CreateEnvironment
{ _ceApplicationName = p1
, _ceEnvironmentName = p2
, _ceDescription = Nothing
, _ceCNAMEPrefix = Nothing
, _ceTier = Nothing
, _ceTags = mempty
, _ceVersionLabel = Nothing
, _ceTemplateName = Nothing
, _ceSolutionStackName = Nothing
, _ceOptionSettings = mempty
, _ceOptionsToRemove = mempty
}
ceApplicationName :: Lens' CreateEnvironment Text
ceApplicationName =
lens _ceApplicationName (\s a -> s { _ceApplicationName = a })
ceCNAMEPrefix :: Lens' CreateEnvironment (Maybe Text)
ceCNAMEPrefix = lens _ceCNAMEPrefix (\s a -> s { _ceCNAMEPrefix = a })
ceDescription :: Lens' CreateEnvironment (Maybe Text)
ceDescription = lens _ceDescription (\s a -> s { _ceDescription = a })
ceEnvironmentName :: Lens' CreateEnvironment Text
ceEnvironmentName =
lens _ceEnvironmentName (\s a -> s { _ceEnvironmentName = a })
ceOptionSettings :: Lens' CreateEnvironment [ConfigurationOptionSetting]
ceOptionSettings = lens _ceOptionSettings (\s a -> s { _ceOptionSettings = a }) . _List
ceOptionsToRemove :: Lens' CreateEnvironment [OptionSpecification]
ceOptionsToRemove =
lens _ceOptionsToRemove (\s a -> s { _ceOptionsToRemove = a })
. _List
ceSolutionStackName :: Lens' CreateEnvironment (Maybe Text)
ceSolutionStackName =
lens _ceSolutionStackName (\s a -> s { _ceSolutionStackName = a })
ceTags :: Lens' CreateEnvironment [Tag]
ceTags = lens _ceTags (\s a -> s { _ceTags = a }) . _List
ceTemplateName :: Lens' CreateEnvironment (Maybe Text)
ceTemplateName = lens _ceTemplateName (\s a -> s { _ceTemplateName = a })
ceTier :: Lens' CreateEnvironment (Maybe EnvironmentTier)
ceTier = lens _ceTier (\s a -> s { _ceTier = a })
ceVersionLabel :: Lens' CreateEnvironment (Maybe Text)
ceVersionLabel = lens _ceVersionLabel (\s a -> s { _ceVersionLabel = a })
data CreateEnvironmentResponse = CreateEnvironmentResponse
{ _cerApplicationName :: Maybe Text
, _cerCNAME :: Maybe Text
, _cerDateCreated :: Maybe RFC822
, _cerDateUpdated :: Maybe RFC822
, _cerDescription :: Maybe Text
, _cerEndpointURL :: Maybe Text
, _cerEnvironmentId :: Maybe Text
, _cerEnvironmentName :: Maybe Text
, _cerHealth :: Maybe Text
, _cerResources :: Maybe EnvironmentResourcesDescription
, _cerSolutionStackName :: Maybe Text
, _cerStatus :: Maybe Text
, _cerTemplateName :: Maybe Text
, _cerTier :: Maybe EnvironmentTier
, _cerVersionLabel :: Maybe Text
} deriving (Eq, Show)
createEnvironmentResponse :: CreateEnvironmentResponse
createEnvironmentResponse = CreateEnvironmentResponse
{ _cerEnvironmentName = Nothing
, _cerEnvironmentId = Nothing
, _cerApplicationName = Nothing
, _cerVersionLabel = Nothing
, _cerSolutionStackName = Nothing
, _cerTemplateName = Nothing
, _cerDescription = Nothing
, _cerEndpointURL = Nothing
, _cerCNAME = Nothing
, _cerDateCreated = Nothing
, _cerDateUpdated = Nothing
, _cerStatus = Nothing
, _cerHealth = Nothing
, _cerResources = Nothing
, _cerTier = Nothing
}
cerApplicationName :: Lens' CreateEnvironmentResponse (Maybe Text)
cerApplicationName =
lens _cerApplicationName (\s a -> s { _cerApplicationName = a })
cerCNAME :: Lens' CreateEnvironmentResponse (Maybe Text)
cerCNAME = lens _cerCNAME (\s a -> s { _cerCNAME = a })
cerDateCreated :: Lens' CreateEnvironmentResponse (Maybe UTCTime)
cerDateCreated = lens _cerDateCreated (\s a -> s { _cerDateCreated = a }) . mapping _Time
cerDateUpdated :: Lens' CreateEnvironmentResponse (Maybe UTCTime)
cerDateUpdated = lens _cerDateUpdated (\s a -> s { _cerDateUpdated = a }) . mapping _Time
cerDescription :: Lens' CreateEnvironmentResponse (Maybe Text)
cerDescription = lens _cerDescription (\s a -> s { _cerDescription = a })
cerEndpointURL :: Lens' CreateEnvironmentResponse (Maybe Text)
cerEndpointURL = lens _cerEndpointURL (\s a -> s { _cerEndpointURL = a })
cerEnvironmentId :: Lens' CreateEnvironmentResponse (Maybe Text)
cerEnvironmentId = lens _cerEnvironmentId (\s a -> s { _cerEnvironmentId = a })
cerEnvironmentName :: Lens' CreateEnvironmentResponse (Maybe Text)
cerEnvironmentName =
lens _cerEnvironmentName (\s a -> s { _cerEnvironmentName = a })
cerHealth :: Lens' CreateEnvironmentResponse (Maybe Text)
cerHealth = lens _cerHealth (\s a -> s { _cerHealth = a })
cerResources :: Lens' CreateEnvironmentResponse (Maybe EnvironmentResourcesDescription)
cerResources = lens _cerResources (\s a -> s { _cerResources = a })
cerSolutionStackName :: Lens' CreateEnvironmentResponse (Maybe Text)
cerSolutionStackName =
lens _cerSolutionStackName (\s a -> s { _cerSolutionStackName = a })
cerStatus :: Lens' CreateEnvironmentResponse (Maybe Text)
cerStatus = lens _cerStatus (\s a -> s { _cerStatus = a })
cerTemplateName :: Lens' CreateEnvironmentResponse (Maybe Text)
cerTemplateName = lens _cerTemplateName (\s a -> s { _cerTemplateName = a })
cerTier :: Lens' CreateEnvironmentResponse (Maybe EnvironmentTier)
cerTier = lens _cerTier (\s a -> s { _cerTier = a })
cerVersionLabel :: Lens' CreateEnvironmentResponse (Maybe Text)
cerVersionLabel = lens _cerVersionLabel (\s a -> s { _cerVersionLabel = a })
instance ToPath CreateEnvironment where
toPath = const "/"
instance ToQuery CreateEnvironment where
toQuery CreateEnvironment{..} = mconcat
[ "ApplicationName" =? _ceApplicationName
, "CNAMEPrefix" =? _ceCNAMEPrefix
, "Description" =? _ceDescription
, "EnvironmentName" =? _ceEnvironmentName
, "OptionSettings" =? _ceOptionSettings
, "OptionsToRemove" =? _ceOptionsToRemove
, "SolutionStackName" =? _ceSolutionStackName
, "Tags" =? _ceTags
, "TemplateName" =? _ceTemplateName
, "Tier" =? _ceTier
, "VersionLabel" =? _ceVersionLabel
]
instance ToHeaders CreateEnvironment
instance AWSRequest CreateEnvironment where
type Sv CreateEnvironment = ElasticBeanstalk
type Rs CreateEnvironment = CreateEnvironmentResponse
request = post "CreateEnvironment"
response = xmlResponse
instance FromXML CreateEnvironmentResponse where
parseXML = withElement "CreateEnvironmentResult" $ \x -> CreateEnvironmentResponse
<$> x .@? "ApplicationName"
<*> x .@? "CNAME"
<*> x .@? "DateCreated"
<*> x .@? "DateUpdated"
<*> x .@? "Description"
<*> x .@? "EndpointURL"
<*> x .@? "EnvironmentId"
<*> x .@? "EnvironmentName"
<*> x .@? "Health"
<*> x .@? "Resources"
<*> x .@? "SolutionStackName"
<*> x .@? "Status"
<*> x .@? "TemplateName"
<*> x .@? "Tier"
<*> x .@? "VersionLabel"