{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Athena.DeleteNamedQuery
(
DeleteNamedQuery (..),
newDeleteNamedQuery,
deleteNamedQuery_namedQueryId,
DeleteNamedQueryResponse (..),
newDeleteNamedQueryResponse,
deleteNamedQueryResponse_httpStatus,
)
where
import Amazonka.Athena.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteNamedQuery = DeleteNamedQuery'
{
DeleteNamedQuery -> Text
namedQueryId :: Prelude.Text
}
deriving (DeleteNamedQuery -> DeleteNamedQuery -> Bool
(DeleteNamedQuery -> DeleteNamedQuery -> Bool)
-> (DeleteNamedQuery -> DeleteNamedQuery -> Bool)
-> Eq DeleteNamedQuery
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNamedQuery -> DeleteNamedQuery -> Bool
$c/= :: DeleteNamedQuery -> DeleteNamedQuery -> Bool
== :: DeleteNamedQuery -> DeleteNamedQuery -> Bool
$c== :: DeleteNamedQuery -> DeleteNamedQuery -> Bool
Prelude.Eq, ReadPrec [DeleteNamedQuery]
ReadPrec DeleteNamedQuery
Int -> ReadS DeleteNamedQuery
ReadS [DeleteNamedQuery]
(Int -> ReadS DeleteNamedQuery)
-> ReadS [DeleteNamedQuery]
-> ReadPrec DeleteNamedQuery
-> ReadPrec [DeleteNamedQuery]
-> Read DeleteNamedQuery
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNamedQuery]
$creadListPrec :: ReadPrec [DeleteNamedQuery]
readPrec :: ReadPrec DeleteNamedQuery
$creadPrec :: ReadPrec DeleteNamedQuery
readList :: ReadS [DeleteNamedQuery]
$creadList :: ReadS [DeleteNamedQuery]
readsPrec :: Int -> ReadS DeleteNamedQuery
$creadsPrec :: Int -> ReadS DeleteNamedQuery
Prelude.Read, Int -> DeleteNamedQuery -> ShowS
[DeleteNamedQuery] -> ShowS
DeleteNamedQuery -> String
(Int -> DeleteNamedQuery -> ShowS)
-> (DeleteNamedQuery -> String)
-> ([DeleteNamedQuery] -> ShowS)
-> Show DeleteNamedQuery
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNamedQuery] -> ShowS
$cshowList :: [DeleteNamedQuery] -> ShowS
show :: DeleteNamedQuery -> String
$cshow :: DeleteNamedQuery -> String
showsPrec :: Int -> DeleteNamedQuery -> ShowS
$cshowsPrec :: Int -> DeleteNamedQuery -> ShowS
Prelude.Show, (forall x. DeleteNamedQuery -> Rep DeleteNamedQuery x)
-> (forall x. Rep DeleteNamedQuery x -> DeleteNamedQuery)
-> Generic DeleteNamedQuery
forall x. Rep DeleteNamedQuery x -> DeleteNamedQuery
forall x. DeleteNamedQuery -> Rep DeleteNamedQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteNamedQuery x -> DeleteNamedQuery
$cfrom :: forall x. DeleteNamedQuery -> Rep DeleteNamedQuery x
Prelude.Generic)
newDeleteNamedQuery ::
Prelude.Text ->
DeleteNamedQuery
newDeleteNamedQuery :: Text -> DeleteNamedQuery
newDeleteNamedQuery Text
pNamedQueryId_ =
DeleteNamedQuery' :: Text -> DeleteNamedQuery
DeleteNamedQuery' {$sel:namedQueryId:DeleteNamedQuery' :: Text
namedQueryId = Text
pNamedQueryId_}
deleteNamedQuery_namedQueryId :: Lens.Lens' DeleteNamedQuery Prelude.Text
deleteNamedQuery_namedQueryId :: (Text -> f Text) -> DeleteNamedQuery -> f DeleteNamedQuery
deleteNamedQuery_namedQueryId = (DeleteNamedQuery -> Text)
-> (DeleteNamedQuery -> Text -> DeleteNamedQuery)
-> Lens DeleteNamedQuery DeleteNamedQuery Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNamedQuery' {Text
namedQueryId :: Text
$sel:namedQueryId:DeleteNamedQuery' :: DeleteNamedQuery -> Text
namedQueryId} -> Text
namedQueryId) (\s :: DeleteNamedQuery
s@DeleteNamedQuery' {} Text
a -> DeleteNamedQuery
s {$sel:namedQueryId:DeleteNamedQuery' :: Text
namedQueryId = Text
a} :: DeleteNamedQuery)
instance Core.AWSRequest DeleteNamedQuery where
type
AWSResponse DeleteNamedQuery =
DeleteNamedQueryResponse
request :: DeleteNamedQuery -> Request DeleteNamedQuery
request = Service -> DeleteNamedQuery -> Request DeleteNamedQuery
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteNamedQuery
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteNamedQuery)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteNamedQuery))
-> Logger
-> Service
-> Proxy DeleteNamedQuery
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteNamedQuery)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteNamedQueryResponse
DeleteNamedQueryResponse'
(Int -> DeleteNamedQueryResponse)
-> Either String Int -> Either String DeleteNamedQueryResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteNamedQuery
instance Prelude.NFData DeleteNamedQuery
instance Core.ToHeaders DeleteNamedQuery where
toHeaders :: DeleteNamedQuery -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteNamedQuery -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonAthena.DeleteNamedQuery" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteNamedQuery where
toJSON :: DeleteNamedQuery -> Value
toJSON DeleteNamedQuery' {Text
namedQueryId :: Text
$sel:namedQueryId:DeleteNamedQuery' :: DeleteNamedQuery -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"NamedQueryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
namedQueryId)]
)
instance Core.ToPath DeleteNamedQuery where
toPath :: DeleteNamedQuery -> ByteString
toPath = ByteString -> DeleteNamedQuery -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteNamedQuery where
toQuery :: DeleteNamedQuery -> QueryString
toQuery = QueryString -> DeleteNamedQuery -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteNamedQueryResponse = DeleteNamedQueryResponse'
{
DeleteNamedQueryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteNamedQueryResponse -> DeleteNamedQueryResponse -> Bool
(DeleteNamedQueryResponse -> DeleteNamedQueryResponse -> Bool)
-> (DeleteNamedQueryResponse -> DeleteNamedQueryResponse -> Bool)
-> Eq DeleteNamedQueryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNamedQueryResponse -> DeleteNamedQueryResponse -> Bool
$c/= :: DeleteNamedQueryResponse -> DeleteNamedQueryResponse -> Bool
== :: DeleteNamedQueryResponse -> DeleteNamedQueryResponse -> Bool
$c== :: DeleteNamedQueryResponse -> DeleteNamedQueryResponse -> Bool
Prelude.Eq, ReadPrec [DeleteNamedQueryResponse]
ReadPrec DeleteNamedQueryResponse
Int -> ReadS DeleteNamedQueryResponse
ReadS [DeleteNamedQueryResponse]
(Int -> ReadS DeleteNamedQueryResponse)
-> ReadS [DeleteNamedQueryResponse]
-> ReadPrec DeleteNamedQueryResponse
-> ReadPrec [DeleteNamedQueryResponse]
-> Read DeleteNamedQueryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNamedQueryResponse]
$creadListPrec :: ReadPrec [DeleteNamedQueryResponse]
readPrec :: ReadPrec DeleteNamedQueryResponse
$creadPrec :: ReadPrec DeleteNamedQueryResponse
readList :: ReadS [DeleteNamedQueryResponse]
$creadList :: ReadS [DeleteNamedQueryResponse]
readsPrec :: Int -> ReadS DeleteNamedQueryResponse
$creadsPrec :: Int -> ReadS DeleteNamedQueryResponse
Prelude.Read, Int -> DeleteNamedQueryResponse -> ShowS
[DeleteNamedQueryResponse] -> ShowS
DeleteNamedQueryResponse -> String
(Int -> DeleteNamedQueryResponse -> ShowS)
-> (DeleteNamedQueryResponse -> String)
-> ([DeleteNamedQueryResponse] -> ShowS)
-> Show DeleteNamedQueryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNamedQueryResponse] -> ShowS
$cshowList :: [DeleteNamedQueryResponse] -> ShowS
show :: DeleteNamedQueryResponse -> String
$cshow :: DeleteNamedQueryResponse -> String
showsPrec :: Int -> DeleteNamedQueryResponse -> ShowS
$cshowsPrec :: Int -> DeleteNamedQueryResponse -> ShowS
Prelude.Show, (forall x.
DeleteNamedQueryResponse -> Rep DeleteNamedQueryResponse x)
-> (forall x.
Rep DeleteNamedQueryResponse x -> DeleteNamedQueryResponse)
-> Generic DeleteNamedQueryResponse
forall x.
Rep DeleteNamedQueryResponse x -> DeleteNamedQueryResponse
forall x.
DeleteNamedQueryResponse -> Rep DeleteNamedQueryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteNamedQueryResponse x -> DeleteNamedQueryResponse
$cfrom :: forall x.
DeleteNamedQueryResponse -> Rep DeleteNamedQueryResponse x
Prelude.Generic)
newDeleteNamedQueryResponse ::
Prelude.Int ->
DeleteNamedQueryResponse
newDeleteNamedQueryResponse :: Int -> DeleteNamedQueryResponse
newDeleteNamedQueryResponse Int
pHttpStatus_ =
DeleteNamedQueryResponse' :: Int -> DeleteNamedQueryResponse
DeleteNamedQueryResponse'
{ $sel:httpStatus:DeleteNamedQueryResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteNamedQueryResponse_httpStatus :: Lens.Lens' DeleteNamedQueryResponse Prelude.Int
deleteNamedQueryResponse_httpStatus :: (Int -> f Int)
-> DeleteNamedQueryResponse -> f DeleteNamedQueryResponse
deleteNamedQueryResponse_httpStatus = (DeleteNamedQueryResponse -> Int)
-> (DeleteNamedQueryResponse -> Int -> DeleteNamedQueryResponse)
-> Lens DeleteNamedQueryResponse DeleteNamedQueryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNamedQueryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteNamedQueryResponse' :: DeleteNamedQueryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteNamedQueryResponse
s@DeleteNamedQueryResponse' {} Int
a -> DeleteNamedQueryResponse
s {$sel:httpStatus:DeleteNamedQueryResponse' :: Int
httpStatus = Int
a} :: DeleteNamedQueryResponse)
instance Prelude.NFData DeleteNamedQueryResponse