{-# 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.Athena.StopQueryExecution
(
stopQueryExecution
, StopQueryExecution
, sqeQueryExecutionId
, stopQueryExecutionResponse
, StopQueryExecutionResponse
, srsResponseStatus
) where
import Network.AWS.Athena.Types
import Network.AWS.Athena.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype StopQueryExecution = StopQueryExecution'
{ _sqeQueryExecutionId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopQueryExecution
:: Text
-> StopQueryExecution
stopQueryExecution pQueryExecutionId_ =
StopQueryExecution' {_sqeQueryExecutionId = pQueryExecutionId_}
sqeQueryExecutionId :: Lens' StopQueryExecution Text
sqeQueryExecutionId = lens _sqeQueryExecutionId (\ s a -> s{_sqeQueryExecutionId = a})
instance AWSRequest StopQueryExecution where
type Rs StopQueryExecution =
StopQueryExecutionResponse
request = postJSON athena
response
= receiveEmpty
(\ s h x ->
StopQueryExecutionResponse' <$> (pure (fromEnum s)))
instance Hashable StopQueryExecution where
instance NFData StopQueryExecution where
instance ToHeaders StopQueryExecution where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonAthena.StopQueryExecution" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopQueryExecution where
toJSON StopQueryExecution'{..}
= object
(catMaybes
[Just ("QueryExecutionId" .= _sqeQueryExecutionId)])
instance ToPath StopQueryExecution where
toPath = const "/"
instance ToQuery StopQueryExecution where
toQuery = const mempty
newtype StopQueryExecutionResponse = StopQueryExecutionResponse'
{ _srsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopQueryExecutionResponse
:: Int
-> StopQueryExecutionResponse
stopQueryExecutionResponse pResponseStatus_ =
StopQueryExecutionResponse' {_srsResponseStatus = pResponseStatus_}
srsResponseStatus :: Lens' StopQueryExecutionResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a})
instance NFData StopQueryExecutionResponse where