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