module Network.AWS.EC2.CreateSpotDatafeedSubscription
(
createSpotDatafeedSubscription
, CreateSpotDatafeedSubscription
, csdsPrefix
, csdsDryRun
, csdsBucket
, createSpotDatafeedSubscriptionResponse
, CreateSpotDatafeedSubscriptionResponse
, csdsrsSpotDatafeedSubscription
, csdsrsResponseStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateSpotDatafeedSubscription = CreateSpotDatafeedSubscription'
{ _csdsPrefix :: !(Maybe Text)
, _csdsDryRun :: !(Maybe Bool)
, _csdsBucket :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createSpotDatafeedSubscription
:: Text
-> CreateSpotDatafeedSubscription
createSpotDatafeedSubscription pBucket_ =
CreateSpotDatafeedSubscription'
{ _csdsPrefix = Nothing
, _csdsDryRun = Nothing
, _csdsBucket = pBucket_
}
csdsPrefix :: Lens' CreateSpotDatafeedSubscription (Maybe Text)
csdsPrefix = lens _csdsPrefix (\ s a -> s{_csdsPrefix = a});
csdsDryRun :: Lens' CreateSpotDatafeedSubscription (Maybe Bool)
csdsDryRun = lens _csdsDryRun (\ s a -> s{_csdsDryRun = a});
csdsBucket :: Lens' CreateSpotDatafeedSubscription Text
csdsBucket = lens _csdsBucket (\ s a -> s{_csdsBucket = a});
instance AWSRequest CreateSpotDatafeedSubscription
where
type Rs CreateSpotDatafeedSubscription =
CreateSpotDatafeedSubscriptionResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
CreateSpotDatafeedSubscriptionResponse' <$>
(x .@? "spotDatafeedSubscription") <*>
(pure (fromEnum s)))
instance ToHeaders CreateSpotDatafeedSubscription
where
toHeaders = const mempty
instance ToPath CreateSpotDatafeedSubscription where
toPath = const "/"
instance ToQuery CreateSpotDatafeedSubscription where
toQuery CreateSpotDatafeedSubscription'{..}
= mconcat
["Action" =:
("CreateSpotDatafeedSubscription" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"Prefix" =: _csdsPrefix, "DryRun" =: _csdsDryRun,
"Bucket" =: _csdsBucket]
data CreateSpotDatafeedSubscriptionResponse = CreateSpotDatafeedSubscriptionResponse'
{ _csdsrsSpotDatafeedSubscription :: !(Maybe SpotDatafeedSubscription)
, _csdsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createSpotDatafeedSubscriptionResponse
:: Int
-> CreateSpotDatafeedSubscriptionResponse
createSpotDatafeedSubscriptionResponse pResponseStatus_ =
CreateSpotDatafeedSubscriptionResponse'
{ _csdsrsSpotDatafeedSubscription = Nothing
, _csdsrsResponseStatus = pResponseStatus_
}
csdsrsSpotDatafeedSubscription :: Lens' CreateSpotDatafeedSubscriptionResponse (Maybe SpotDatafeedSubscription)
csdsrsSpotDatafeedSubscription = lens _csdsrsSpotDatafeedSubscription (\ s a -> s{_csdsrsSpotDatafeedSubscription = a});
csdsrsResponseStatus :: Lens' CreateSpotDatafeedSubscriptionResponse Int
csdsrsResponseStatus = lens _csdsrsResponseStatus (\ s a -> s{_csdsrsResponseStatus = a});