{-# 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.CloudFormation.EstimateTemplateCost
(
estimateTemplateCost
, EstimateTemplateCost
, etcParameters
, etcTemplateBody
, etcTemplateURL
, estimateTemplateCostResponse
, EstimateTemplateCostResponse
, etcrsURL
, etcrsResponseStatus
) where
import Network.AWS.CloudFormation.Types
import Network.AWS.CloudFormation.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data EstimateTemplateCost = EstimateTemplateCost'
{ _etcParameters :: !(Maybe [Parameter])
, _etcTemplateBody :: !(Maybe Text)
, _etcTemplateURL :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
estimateTemplateCost
:: EstimateTemplateCost
estimateTemplateCost =
EstimateTemplateCost'
{ _etcParameters = Nothing
, _etcTemplateBody = Nothing
, _etcTemplateURL = Nothing
}
etcParameters :: Lens' EstimateTemplateCost [Parameter]
etcParameters = lens _etcParameters (\ s a -> s{_etcParameters = a}) . _Default . _Coerce;
etcTemplateBody :: Lens' EstimateTemplateCost (Maybe Text)
etcTemplateBody = lens _etcTemplateBody (\ s a -> s{_etcTemplateBody = a});
etcTemplateURL :: Lens' EstimateTemplateCost (Maybe Text)
etcTemplateURL = lens _etcTemplateURL (\ s a -> s{_etcTemplateURL = a});
instance AWSRequest EstimateTemplateCost where
type Rs EstimateTemplateCost =
EstimateTemplateCostResponse
request = postQuery cloudFormation
response
= receiveXMLWrapper "EstimateTemplateCostResult"
(\ s h x ->
EstimateTemplateCostResponse' <$>
(x .@? "Url") <*> (pure (fromEnum s)))
instance Hashable EstimateTemplateCost
instance NFData EstimateTemplateCost
instance ToHeaders EstimateTemplateCost where
toHeaders = const mempty
instance ToPath EstimateTemplateCost where
toPath = const "/"
instance ToQuery EstimateTemplateCost where
toQuery EstimateTemplateCost'{..}
= mconcat
["Action" =: ("EstimateTemplateCost" :: ByteString),
"Version" =: ("2010-05-15" :: ByteString),
"Parameters" =:
toQuery (toQueryList "member" <$> _etcParameters),
"TemplateBody" =: _etcTemplateBody,
"TemplateURL" =: _etcTemplateURL]
data EstimateTemplateCostResponse = EstimateTemplateCostResponse'
{ _etcrsURL :: !(Maybe Text)
, _etcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
estimateTemplateCostResponse
:: Int
-> EstimateTemplateCostResponse
estimateTemplateCostResponse pResponseStatus_ =
EstimateTemplateCostResponse'
{ _etcrsURL = Nothing
, _etcrsResponseStatus = pResponseStatus_
}
etcrsURL :: Lens' EstimateTemplateCostResponse (Maybe Text)
etcrsURL = lens _etcrsURL (\ s a -> s{_etcrsURL = a});
etcrsResponseStatus :: Lens' EstimateTemplateCostResponse Int
etcrsResponseStatus = lens _etcrsResponseStatus (\ s a -> s{_etcrsResponseStatus = a});
instance NFData EstimateTemplateCostResponse