module Network.AWS.EC2.CancelSpotInstanceRequests
(
CancelSpotInstanceRequests
, cancelSpotInstanceRequests
, csirDryRun
, csirSpotInstanceRequestIds
, CancelSpotInstanceRequestsResponse
, cancelSpotInstanceRequestsResponse
, csirrCancelledSpotInstanceRequests
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.EC2.Types
import qualified GHC.Exts
data CancelSpotInstanceRequests = CancelSpotInstanceRequests
{ _csirDryRun :: Maybe Bool
, _csirSpotInstanceRequestIds :: List "SpotInstanceRequestId" Text
} deriving (Eq, Ord, Show)
cancelSpotInstanceRequests :: CancelSpotInstanceRequests
cancelSpotInstanceRequests = CancelSpotInstanceRequests
{ _csirDryRun = Nothing
, _csirSpotInstanceRequestIds = mempty
}
csirDryRun :: Lens' CancelSpotInstanceRequests (Maybe Bool)
csirDryRun = lens _csirDryRun (\s a -> s { _csirDryRun = a })
csirSpotInstanceRequestIds :: Lens' CancelSpotInstanceRequests [Text]
csirSpotInstanceRequestIds =
lens _csirSpotInstanceRequestIds
(\s a -> s { _csirSpotInstanceRequestIds = a })
. _List
newtype CancelSpotInstanceRequestsResponse = CancelSpotInstanceRequestsResponse
{ _csirrCancelledSpotInstanceRequests :: List "item" CancelledSpotInstanceRequest
} deriving (Eq, Show, Monoid, Semigroup)
cancelSpotInstanceRequestsResponse :: CancelSpotInstanceRequestsResponse
cancelSpotInstanceRequestsResponse = CancelSpotInstanceRequestsResponse
{ _csirrCancelledSpotInstanceRequests = mempty
}
csirrCancelledSpotInstanceRequests :: Lens' CancelSpotInstanceRequestsResponse [CancelledSpotInstanceRequest]
csirrCancelledSpotInstanceRequests =
lens _csirrCancelledSpotInstanceRequests
(\s a -> s { _csirrCancelledSpotInstanceRequests = a })
. _List
instance ToPath CancelSpotInstanceRequests where
toPath = const "/"
instance ToQuery CancelSpotInstanceRequests where
toQuery CancelSpotInstanceRequests{..} = mconcat
[ "dryRun" =? _csirDryRun
, toQuery _csirSpotInstanceRequestIds
]
instance ToHeaders CancelSpotInstanceRequests
instance AWSRequest CancelSpotInstanceRequests where
type Sv CancelSpotInstanceRequests = EC2
type Rs CancelSpotInstanceRequests = CancelSpotInstanceRequestsResponse
request = post "CancelSpotInstanceRequests"
response = xmlResponse
instance FromXML CancelSpotInstanceRequestsResponse where
parseXML x = CancelSpotInstanceRequestsResponse
<$> parseXML x