{-# 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.ServerlessApplicationRepository.CreateCloudFormationChangeSet
(
createCloudFormationChangeSet
, CreateCloudFormationChangeSet
, ccfcsSemanticVersion
, ccfcsParameterOverrides
, ccfcsStackName
, ccfcsApplicationId
, createCloudFormationChangeSetResponse
, CreateCloudFormationChangeSetResponse
, ccfcsrsSemanticVersion
, ccfcsrsChangeSetId
, ccfcsrsApplicationId
, ccfcsrsStackId
, ccfcsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.ServerlessApplicationRepository.Types
import Network.AWS.ServerlessApplicationRepository.Types.Product
data CreateCloudFormationChangeSet = CreateCloudFormationChangeSet'
{ _ccfcsSemanticVersion :: !(Maybe Text)
, _ccfcsParameterOverrides :: !(Maybe [ParameterValue])
, _ccfcsStackName :: !(Maybe Text)
, _ccfcsApplicationId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createCloudFormationChangeSet
:: Text
-> CreateCloudFormationChangeSet
createCloudFormationChangeSet pApplicationId_ =
CreateCloudFormationChangeSet'
{ _ccfcsSemanticVersion = Nothing
, _ccfcsParameterOverrides = Nothing
, _ccfcsStackName = Nothing
, _ccfcsApplicationId = pApplicationId_
}
ccfcsSemanticVersion :: Lens' CreateCloudFormationChangeSet (Maybe Text)
ccfcsSemanticVersion = lens _ccfcsSemanticVersion (\ s a -> s{_ccfcsSemanticVersion = a})
ccfcsParameterOverrides :: Lens' CreateCloudFormationChangeSet [ParameterValue]
ccfcsParameterOverrides = lens _ccfcsParameterOverrides (\ s a -> s{_ccfcsParameterOverrides = a}) . _Default . _Coerce
ccfcsStackName :: Lens' CreateCloudFormationChangeSet (Maybe Text)
ccfcsStackName = lens _ccfcsStackName (\ s a -> s{_ccfcsStackName = a})
ccfcsApplicationId :: Lens' CreateCloudFormationChangeSet Text
ccfcsApplicationId = lens _ccfcsApplicationId (\ s a -> s{_ccfcsApplicationId = a})
instance AWSRequest CreateCloudFormationChangeSet
where
type Rs CreateCloudFormationChangeSet =
CreateCloudFormationChangeSetResponse
request = postJSON serverlessApplicationRepository
response
= receiveJSON
(\ s h x ->
CreateCloudFormationChangeSetResponse' <$>
(x .?> "semanticVersion") <*> (x .?> "changeSetId")
<*> (x .?> "applicationId")
<*> (x .?> "stackId")
<*> (pure (fromEnum s)))
instance Hashable CreateCloudFormationChangeSet where
instance NFData CreateCloudFormationChangeSet where
instance ToHeaders CreateCloudFormationChangeSet
where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateCloudFormationChangeSet where
toJSON CreateCloudFormationChangeSet'{..}
= object
(catMaybes
[("semanticVersion" .=) <$> _ccfcsSemanticVersion,
("parameterOverrides" .=) <$>
_ccfcsParameterOverrides,
("stackName" .=) <$> _ccfcsStackName])
instance ToPath CreateCloudFormationChangeSet where
toPath CreateCloudFormationChangeSet'{..}
= mconcat
["/applications/", toBS _ccfcsApplicationId,
"/changesets"]
instance ToQuery CreateCloudFormationChangeSet where
toQuery = const mempty
data CreateCloudFormationChangeSetResponse = CreateCloudFormationChangeSetResponse'
{ _ccfcsrsSemanticVersion :: !(Maybe Text)
, _ccfcsrsChangeSetId :: !(Maybe Text)
, _ccfcsrsApplicationId :: !(Maybe Text)
, _ccfcsrsStackId :: !(Maybe Text)
, _ccfcsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createCloudFormationChangeSetResponse
:: Int
-> CreateCloudFormationChangeSetResponse
createCloudFormationChangeSetResponse pResponseStatus_ =
CreateCloudFormationChangeSetResponse'
{ _ccfcsrsSemanticVersion = Nothing
, _ccfcsrsChangeSetId = Nothing
, _ccfcsrsApplicationId = Nothing
, _ccfcsrsStackId = Nothing
, _ccfcsrsResponseStatus = pResponseStatus_
}
ccfcsrsSemanticVersion :: Lens' CreateCloudFormationChangeSetResponse (Maybe Text)
ccfcsrsSemanticVersion = lens _ccfcsrsSemanticVersion (\ s a -> s{_ccfcsrsSemanticVersion = a})
ccfcsrsChangeSetId :: Lens' CreateCloudFormationChangeSetResponse (Maybe Text)
ccfcsrsChangeSetId = lens _ccfcsrsChangeSetId (\ s a -> s{_ccfcsrsChangeSetId = a})
ccfcsrsApplicationId :: Lens' CreateCloudFormationChangeSetResponse (Maybe Text)
ccfcsrsApplicationId = lens _ccfcsrsApplicationId (\ s a -> s{_ccfcsrsApplicationId = a})
ccfcsrsStackId :: Lens' CreateCloudFormationChangeSetResponse (Maybe Text)
ccfcsrsStackId = lens _ccfcsrsStackId (\ s a -> s{_ccfcsrsStackId = a})
ccfcsrsResponseStatus :: Lens' CreateCloudFormationChangeSetResponse Int
ccfcsrsResponseStatus = lens _ccfcsrsResponseStatus (\ s a -> s{_ccfcsrsResponseStatus = a})
instance NFData CreateCloudFormationChangeSetResponse
where