{-# 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.DeleteNamedQuery
(
deleteNamedQuery
, DeleteNamedQuery
, dnqNamedQueryId
, deleteNamedQueryResponse
, DeleteNamedQueryResponse
, dnqrsResponseStatus
) 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 DeleteNamedQuery = DeleteNamedQuery'
{ _dnqNamedQueryId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteNamedQuery
:: Text
-> DeleteNamedQuery
deleteNamedQuery pNamedQueryId_ =
DeleteNamedQuery' {_dnqNamedQueryId = pNamedQueryId_}
dnqNamedQueryId :: Lens' DeleteNamedQuery Text
dnqNamedQueryId = lens _dnqNamedQueryId (\ s a -> s{_dnqNamedQueryId = a})
instance AWSRequest DeleteNamedQuery where
type Rs DeleteNamedQuery = DeleteNamedQueryResponse
request = postJSON athena
response
= receiveEmpty
(\ s h x ->
DeleteNamedQueryResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteNamedQuery where
instance NFData DeleteNamedQuery where
instance ToHeaders DeleteNamedQuery where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonAthena.DeleteNamedQuery" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteNamedQuery where
toJSON DeleteNamedQuery'{..}
= object
(catMaybes
[Just ("NamedQueryId" .= _dnqNamedQueryId)])
instance ToPath DeleteNamedQuery where
toPath = const "/"
instance ToQuery DeleteNamedQuery where
toQuery = const mempty
newtype DeleteNamedQueryResponse = DeleteNamedQueryResponse'
{ _dnqrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteNamedQueryResponse
:: Int
-> DeleteNamedQueryResponse
deleteNamedQueryResponse pResponseStatus_ =
DeleteNamedQueryResponse' {_dnqrsResponseStatus = pResponseStatus_}
dnqrsResponseStatus :: Lens' DeleteNamedQueryResponse Int
dnqrsResponseStatus = lens _dnqrsResponseStatus (\ s a -> s{_dnqrsResponseStatus = a})
instance NFData DeleteNamedQueryResponse where