module Network.AWS.EC2.CreateSpotDatafeedSubscription
(
CreateSpotDatafeedSubscription
, createSpotDatafeedSubscription
, csdsBucket
, csdsDryRun
, csdsPrefix
, CreateSpotDatafeedSubscriptionResponse
, createSpotDatafeedSubscriptionResponse
, csdsrSpotDatafeedSubscription
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data CreateSpotDatafeedSubscription = CreateSpotDatafeedSubscription
{ _csdsBucket :: Text
, _csdsDryRun :: Maybe Bool
, _csdsPrefix :: Maybe Text
} deriving (Eq, Ord, Read, Show)
createSpotDatafeedSubscription :: Text
-> CreateSpotDatafeedSubscription
createSpotDatafeedSubscription p1 = CreateSpotDatafeedSubscription
{ _csdsBucket = p1
, _csdsDryRun = Nothing
, _csdsPrefix = Nothing
}
csdsBucket :: Lens' CreateSpotDatafeedSubscription Text
csdsBucket = lens _csdsBucket (\s a -> s { _csdsBucket = a })
csdsDryRun :: Lens' CreateSpotDatafeedSubscription (Maybe Bool)
csdsDryRun = lens _csdsDryRun (\s a -> s { _csdsDryRun = a })
csdsPrefix :: Lens' CreateSpotDatafeedSubscription (Maybe Text)
csdsPrefix = lens _csdsPrefix (\s a -> s { _csdsPrefix = a })
newtype CreateSpotDatafeedSubscriptionResponse = CreateSpotDatafeedSubscriptionResponse
{ _csdsrSpotDatafeedSubscription :: Maybe SpotDatafeedSubscription
} deriving (Eq, Read, Show)
createSpotDatafeedSubscriptionResponse :: CreateSpotDatafeedSubscriptionResponse
createSpotDatafeedSubscriptionResponse = CreateSpotDatafeedSubscriptionResponse
{ _csdsrSpotDatafeedSubscription = Nothing
}
csdsrSpotDatafeedSubscription :: Lens' CreateSpotDatafeedSubscriptionResponse (Maybe SpotDatafeedSubscription)
csdsrSpotDatafeedSubscription =
lens _csdsrSpotDatafeedSubscription
(\s a -> s { _csdsrSpotDatafeedSubscription = a })
instance ToPath CreateSpotDatafeedSubscription where
toPath = const "/"
instance ToQuery CreateSpotDatafeedSubscription where
toQuery CreateSpotDatafeedSubscription{..} = mconcat
[ "Bucket" =? _csdsBucket
, "DryRun" =? _csdsDryRun
, "Prefix" =? _csdsPrefix
]
instance ToHeaders CreateSpotDatafeedSubscription
instance AWSRequest CreateSpotDatafeedSubscription where
type Sv CreateSpotDatafeedSubscription = EC2
type Rs CreateSpotDatafeedSubscription = CreateSpotDatafeedSubscriptionResponse
request = post "CreateSpotDatafeedSubscription"
response = xmlResponse
instance FromXML CreateSpotDatafeedSubscriptionResponse where
parseXML x = CreateSpotDatafeedSubscriptionResponse
<$> x .@? "spotDatafeedSubscription"