{-# 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.CreatePlatformVersion
(
createPlatformVersion
, CreatePlatformVersion
, cpvOptionSettings
, cpvEnvironmentName
, cpvPlatformName
, cpvPlatformVersion
, cpvPlatformDefinitionBundle
, createPlatformVersionResponse
, CreatePlatformVersionResponse
, cpvrsBuilder
, cpvrsPlatformSummary
, cpvrsResponseStatus
) 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 CreatePlatformVersion = CreatePlatformVersion'
{ _cpvOptionSettings :: !(Maybe [ConfigurationOptionSetting])
, _cpvEnvironmentName :: !(Maybe Text)
, _cpvPlatformName :: !Text
, _cpvPlatformVersion :: !Text
, _cpvPlatformDefinitionBundle :: !S3Location
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createPlatformVersion
:: Text
-> Text
-> S3Location
-> CreatePlatformVersion
createPlatformVersion pPlatformName_ pPlatformVersion_ pPlatformDefinitionBundle_ =
CreatePlatformVersion'
{ _cpvOptionSettings = Nothing
, _cpvEnvironmentName = Nothing
, _cpvPlatformName = pPlatformName_
, _cpvPlatformVersion = pPlatformVersion_
, _cpvPlatformDefinitionBundle = pPlatformDefinitionBundle_
}
cpvOptionSettings :: Lens' CreatePlatformVersion [ConfigurationOptionSetting]
cpvOptionSettings = lens _cpvOptionSettings (\ s a -> s{_cpvOptionSettings = a}) . _Default . _Coerce
cpvEnvironmentName :: Lens' CreatePlatformVersion (Maybe Text)
cpvEnvironmentName = lens _cpvEnvironmentName (\ s a -> s{_cpvEnvironmentName = a})
cpvPlatformName :: Lens' CreatePlatformVersion Text
cpvPlatformName = lens _cpvPlatformName (\ s a -> s{_cpvPlatformName = a})
cpvPlatformVersion :: Lens' CreatePlatformVersion Text
cpvPlatformVersion = lens _cpvPlatformVersion (\ s a -> s{_cpvPlatformVersion = a})
cpvPlatformDefinitionBundle :: Lens' CreatePlatformVersion S3Location
cpvPlatformDefinitionBundle = lens _cpvPlatformDefinitionBundle (\ s a -> s{_cpvPlatformDefinitionBundle = a})
instance AWSRequest CreatePlatformVersion where
type Rs CreatePlatformVersion =
CreatePlatformVersionResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper "CreatePlatformVersionResult"
(\ s h x ->
CreatePlatformVersionResponse' <$>
(x .@? "Builder") <*> (x .@? "PlatformSummary") <*>
(pure (fromEnum s)))
instance Hashable CreatePlatformVersion where
instance NFData CreatePlatformVersion where
instance ToHeaders CreatePlatformVersion where
toHeaders = const mempty
instance ToPath CreatePlatformVersion where
toPath = const "/"
instance ToQuery CreatePlatformVersion where
toQuery CreatePlatformVersion'{..}
= mconcat
["Action" =: ("CreatePlatformVersion" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"OptionSettings" =:
toQuery
(toQueryList "member" <$> _cpvOptionSettings),
"EnvironmentName" =: _cpvEnvironmentName,
"PlatformName" =: _cpvPlatformName,
"PlatformVersion" =: _cpvPlatformVersion,
"PlatformDefinitionBundle" =:
_cpvPlatformDefinitionBundle]
data CreatePlatformVersionResponse = CreatePlatformVersionResponse'
{ _cpvrsBuilder :: !(Maybe Builder)
, _cpvrsPlatformSummary :: !(Maybe PlatformSummary)
, _cpvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createPlatformVersionResponse
:: Int
-> CreatePlatformVersionResponse
createPlatformVersionResponse pResponseStatus_ =
CreatePlatformVersionResponse'
{ _cpvrsBuilder = Nothing
, _cpvrsPlatformSummary = Nothing
, _cpvrsResponseStatus = pResponseStatus_
}
cpvrsBuilder :: Lens' CreatePlatformVersionResponse (Maybe Builder)
cpvrsBuilder = lens _cpvrsBuilder (\ s a -> s{_cpvrsBuilder = a})
cpvrsPlatformSummary :: Lens' CreatePlatformVersionResponse (Maybe PlatformSummary)
cpvrsPlatformSummary = lens _cpvrsPlatformSummary (\ s a -> s{_cpvrsPlatformSummary = a})
cpvrsResponseStatus :: Lens' CreatePlatformVersionResponse Int
cpvrsResponseStatus = lens _cpvrsResponseStatus (\ s a -> s{_cpvrsResponseStatus = a})
instance NFData CreatePlatformVersionResponse where