{-# 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.Config.DeleteStoredQuery
(
DeleteStoredQuery (..),
newDeleteStoredQuery,
deleteStoredQuery_queryName,
DeleteStoredQueryResponse (..),
newDeleteStoredQueryResponse,
deleteStoredQueryResponse_httpStatus,
)
where
import Amazonka.Config.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 DeleteStoredQuery = DeleteStoredQuery'
{
DeleteStoredQuery -> Text
queryName :: Prelude.Text
}
deriving (DeleteStoredQuery -> DeleteStoredQuery -> Bool
(DeleteStoredQuery -> DeleteStoredQuery -> Bool)
-> (DeleteStoredQuery -> DeleteStoredQuery -> Bool)
-> Eq DeleteStoredQuery
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStoredQuery -> DeleteStoredQuery -> Bool
$c/= :: DeleteStoredQuery -> DeleteStoredQuery -> Bool
== :: DeleteStoredQuery -> DeleteStoredQuery -> Bool
$c== :: DeleteStoredQuery -> DeleteStoredQuery -> Bool
Prelude.Eq, ReadPrec [DeleteStoredQuery]
ReadPrec DeleteStoredQuery
Int -> ReadS DeleteStoredQuery
ReadS [DeleteStoredQuery]
(Int -> ReadS DeleteStoredQuery)
-> ReadS [DeleteStoredQuery]
-> ReadPrec DeleteStoredQuery
-> ReadPrec [DeleteStoredQuery]
-> Read DeleteStoredQuery
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStoredQuery]
$creadListPrec :: ReadPrec [DeleteStoredQuery]
readPrec :: ReadPrec DeleteStoredQuery
$creadPrec :: ReadPrec DeleteStoredQuery
readList :: ReadS [DeleteStoredQuery]
$creadList :: ReadS [DeleteStoredQuery]
readsPrec :: Int -> ReadS DeleteStoredQuery
$creadsPrec :: Int -> ReadS DeleteStoredQuery
Prelude.Read, Int -> DeleteStoredQuery -> ShowS
[DeleteStoredQuery] -> ShowS
DeleteStoredQuery -> String
(Int -> DeleteStoredQuery -> ShowS)
-> (DeleteStoredQuery -> String)
-> ([DeleteStoredQuery] -> ShowS)
-> Show DeleteStoredQuery
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStoredQuery] -> ShowS
$cshowList :: [DeleteStoredQuery] -> ShowS
show :: DeleteStoredQuery -> String
$cshow :: DeleteStoredQuery -> String
showsPrec :: Int -> DeleteStoredQuery -> ShowS
$cshowsPrec :: Int -> DeleteStoredQuery -> ShowS
Prelude.Show, (forall x. DeleteStoredQuery -> Rep DeleteStoredQuery x)
-> (forall x. Rep DeleteStoredQuery x -> DeleteStoredQuery)
-> Generic DeleteStoredQuery
forall x. Rep DeleteStoredQuery x -> DeleteStoredQuery
forall x. DeleteStoredQuery -> Rep DeleteStoredQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStoredQuery x -> DeleteStoredQuery
$cfrom :: forall x. DeleteStoredQuery -> Rep DeleteStoredQuery x
Prelude.Generic)
newDeleteStoredQuery ::
Prelude.Text ->
DeleteStoredQuery
newDeleteStoredQuery :: Text -> DeleteStoredQuery
newDeleteStoredQuery Text
pQueryName_ =
DeleteStoredQuery' :: Text -> DeleteStoredQuery
DeleteStoredQuery' {$sel:queryName:DeleteStoredQuery' :: Text
queryName = Text
pQueryName_}
deleteStoredQuery_queryName :: Lens.Lens' DeleteStoredQuery Prelude.Text
deleteStoredQuery_queryName :: (Text -> f Text) -> DeleteStoredQuery -> f DeleteStoredQuery
deleteStoredQuery_queryName = (DeleteStoredQuery -> Text)
-> (DeleteStoredQuery -> Text -> DeleteStoredQuery)
-> Lens DeleteStoredQuery DeleteStoredQuery Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStoredQuery' {Text
queryName :: Text
$sel:queryName:DeleteStoredQuery' :: DeleteStoredQuery -> Text
queryName} -> Text
queryName) (\s :: DeleteStoredQuery
s@DeleteStoredQuery' {} Text
a -> DeleteStoredQuery
s {$sel:queryName:DeleteStoredQuery' :: Text
queryName = Text
a} :: DeleteStoredQuery)
instance Core.AWSRequest DeleteStoredQuery where
type
AWSResponse DeleteStoredQuery =
DeleteStoredQueryResponse
request :: DeleteStoredQuery -> Request DeleteStoredQuery
request = Service -> DeleteStoredQuery -> Request DeleteStoredQuery
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteStoredQuery
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteStoredQuery)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteStoredQuery))
-> Logger
-> Service
-> Proxy DeleteStoredQuery
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteStoredQuery)))
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 -> DeleteStoredQueryResponse
DeleteStoredQueryResponse'
(Int -> DeleteStoredQueryResponse)
-> Either String Int -> Either String DeleteStoredQueryResponse
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 DeleteStoredQuery
instance Prelude.NFData DeleteStoredQuery
instance Core.ToHeaders DeleteStoredQuery where
toHeaders :: DeleteStoredQuery -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteStoredQuery -> 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
"StarlingDoveService.DeleteStoredQuery" ::
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 DeleteStoredQuery where
toJSON :: DeleteStoredQuery -> Value
toJSON DeleteStoredQuery' {Text
queryName :: Text
$sel:queryName:DeleteStoredQuery' :: DeleteStoredQuery -> 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
"QueryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
queryName)]
)
instance Core.ToPath DeleteStoredQuery where
toPath :: DeleteStoredQuery -> ByteString
toPath = ByteString -> DeleteStoredQuery -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteStoredQuery where
toQuery :: DeleteStoredQuery -> QueryString
toQuery = QueryString -> DeleteStoredQuery -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteStoredQueryResponse = DeleteStoredQueryResponse'
{
DeleteStoredQueryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteStoredQueryResponse -> DeleteStoredQueryResponse -> Bool
(DeleteStoredQueryResponse -> DeleteStoredQueryResponse -> Bool)
-> (DeleteStoredQueryResponse -> DeleteStoredQueryResponse -> Bool)
-> Eq DeleteStoredQueryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStoredQueryResponse -> DeleteStoredQueryResponse -> Bool
$c/= :: DeleteStoredQueryResponse -> DeleteStoredQueryResponse -> Bool
== :: DeleteStoredQueryResponse -> DeleteStoredQueryResponse -> Bool
$c== :: DeleteStoredQueryResponse -> DeleteStoredQueryResponse -> Bool
Prelude.Eq, ReadPrec [DeleteStoredQueryResponse]
ReadPrec DeleteStoredQueryResponse
Int -> ReadS DeleteStoredQueryResponse
ReadS [DeleteStoredQueryResponse]
(Int -> ReadS DeleteStoredQueryResponse)
-> ReadS [DeleteStoredQueryResponse]
-> ReadPrec DeleteStoredQueryResponse
-> ReadPrec [DeleteStoredQueryResponse]
-> Read DeleteStoredQueryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStoredQueryResponse]
$creadListPrec :: ReadPrec [DeleteStoredQueryResponse]
readPrec :: ReadPrec DeleteStoredQueryResponse
$creadPrec :: ReadPrec DeleteStoredQueryResponse
readList :: ReadS [DeleteStoredQueryResponse]
$creadList :: ReadS [DeleteStoredQueryResponse]
readsPrec :: Int -> ReadS DeleteStoredQueryResponse
$creadsPrec :: Int -> ReadS DeleteStoredQueryResponse
Prelude.Read, Int -> DeleteStoredQueryResponse -> ShowS
[DeleteStoredQueryResponse] -> ShowS
DeleteStoredQueryResponse -> String
(Int -> DeleteStoredQueryResponse -> ShowS)
-> (DeleteStoredQueryResponse -> String)
-> ([DeleteStoredQueryResponse] -> ShowS)
-> Show DeleteStoredQueryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStoredQueryResponse] -> ShowS
$cshowList :: [DeleteStoredQueryResponse] -> ShowS
show :: DeleteStoredQueryResponse -> String
$cshow :: DeleteStoredQueryResponse -> String
showsPrec :: Int -> DeleteStoredQueryResponse -> ShowS
$cshowsPrec :: Int -> DeleteStoredQueryResponse -> ShowS
Prelude.Show, (forall x.
DeleteStoredQueryResponse -> Rep DeleteStoredQueryResponse x)
-> (forall x.
Rep DeleteStoredQueryResponse x -> DeleteStoredQueryResponse)
-> Generic DeleteStoredQueryResponse
forall x.
Rep DeleteStoredQueryResponse x -> DeleteStoredQueryResponse
forall x.
DeleteStoredQueryResponse -> Rep DeleteStoredQueryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteStoredQueryResponse x -> DeleteStoredQueryResponse
$cfrom :: forall x.
DeleteStoredQueryResponse -> Rep DeleteStoredQueryResponse x
Prelude.Generic)
newDeleteStoredQueryResponse ::
Prelude.Int ->
DeleteStoredQueryResponse
newDeleteStoredQueryResponse :: Int -> DeleteStoredQueryResponse
newDeleteStoredQueryResponse Int
pHttpStatus_ =
DeleteStoredQueryResponse' :: Int -> DeleteStoredQueryResponse
DeleteStoredQueryResponse'
{ $sel:httpStatus:DeleteStoredQueryResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteStoredQueryResponse_httpStatus :: Lens.Lens' DeleteStoredQueryResponse Prelude.Int
deleteStoredQueryResponse_httpStatus :: (Int -> f Int)
-> DeleteStoredQueryResponse -> f DeleteStoredQueryResponse
deleteStoredQueryResponse_httpStatus = (DeleteStoredQueryResponse -> Int)
-> (DeleteStoredQueryResponse -> Int -> DeleteStoredQueryResponse)
-> Lens DeleteStoredQueryResponse DeleteStoredQueryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStoredQueryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteStoredQueryResponse' :: DeleteStoredQueryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteStoredQueryResponse
s@DeleteStoredQueryResponse' {} Int
a -> DeleteStoredQueryResponse
s {$sel:httpStatus:DeleteStoredQueryResponse' :: Int
httpStatus = Int
a} :: DeleteStoredQueryResponse)
instance Prelude.NFData DeleteStoredQueryResponse