{-# 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.AcceptQualificationRequest
(
AcceptQualificationRequest (..),
newAcceptQualificationRequest,
acceptQualificationRequest_integerValue,
acceptQualificationRequest_qualificationRequestId,
AcceptQualificationRequestResponse (..),
newAcceptQualificationRequestResponse,
acceptQualificationRequestResponse_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 AcceptQualificationRequest = AcceptQualificationRequest'
{
AcceptQualificationRequest -> Maybe Int
integerValue :: Prelude.Maybe Prelude.Int,
AcceptQualificationRequest -> Text
qualificationRequestId :: Prelude.Text
}
deriving (AcceptQualificationRequest -> AcceptQualificationRequest -> Bool
(AcceptQualificationRequest -> AcceptQualificationRequest -> Bool)
-> (AcceptQualificationRequest
-> AcceptQualificationRequest -> Bool)
-> Eq AcceptQualificationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptQualificationRequest -> AcceptQualificationRequest -> Bool
$c/= :: AcceptQualificationRequest -> AcceptQualificationRequest -> Bool
== :: AcceptQualificationRequest -> AcceptQualificationRequest -> Bool
$c== :: AcceptQualificationRequest -> AcceptQualificationRequest -> Bool
Prelude.Eq, ReadPrec [AcceptQualificationRequest]
ReadPrec AcceptQualificationRequest
Int -> ReadS AcceptQualificationRequest
ReadS [AcceptQualificationRequest]
(Int -> ReadS AcceptQualificationRequest)
-> ReadS [AcceptQualificationRequest]
-> ReadPrec AcceptQualificationRequest
-> ReadPrec [AcceptQualificationRequest]
-> Read AcceptQualificationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptQualificationRequest]
$creadListPrec :: ReadPrec [AcceptQualificationRequest]
readPrec :: ReadPrec AcceptQualificationRequest
$creadPrec :: ReadPrec AcceptQualificationRequest
readList :: ReadS [AcceptQualificationRequest]
$creadList :: ReadS [AcceptQualificationRequest]
readsPrec :: Int -> ReadS AcceptQualificationRequest
$creadsPrec :: Int -> ReadS AcceptQualificationRequest
Prelude.Read, Int -> AcceptQualificationRequest -> ShowS
[AcceptQualificationRequest] -> ShowS
AcceptQualificationRequest -> String
(Int -> AcceptQualificationRequest -> ShowS)
-> (AcceptQualificationRequest -> String)
-> ([AcceptQualificationRequest] -> ShowS)
-> Show AcceptQualificationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptQualificationRequest] -> ShowS
$cshowList :: [AcceptQualificationRequest] -> ShowS
show :: AcceptQualificationRequest -> String
$cshow :: AcceptQualificationRequest -> String
showsPrec :: Int -> AcceptQualificationRequest -> ShowS
$cshowsPrec :: Int -> AcceptQualificationRequest -> ShowS
Prelude.Show, (forall x.
AcceptQualificationRequest -> Rep AcceptQualificationRequest x)
-> (forall x.
Rep AcceptQualificationRequest x -> AcceptQualificationRequest)
-> Generic AcceptQualificationRequest
forall x.
Rep AcceptQualificationRequest x -> AcceptQualificationRequest
forall x.
AcceptQualificationRequest -> Rep AcceptQualificationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcceptQualificationRequest x -> AcceptQualificationRequest
$cfrom :: forall x.
AcceptQualificationRequest -> Rep AcceptQualificationRequest x
Prelude.Generic)
newAcceptQualificationRequest ::
Prelude.Text ->
AcceptQualificationRequest
newAcceptQualificationRequest :: Text -> AcceptQualificationRequest
newAcceptQualificationRequest
Text
pQualificationRequestId_ =
AcceptQualificationRequest' :: Maybe Int -> Text -> AcceptQualificationRequest
AcceptQualificationRequest'
{ $sel:integerValue:AcceptQualificationRequest' :: Maybe Int
integerValue =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:qualificationRequestId:AcceptQualificationRequest' :: Text
qualificationRequestId =
Text
pQualificationRequestId_
}
acceptQualificationRequest_integerValue :: Lens.Lens' AcceptQualificationRequest (Prelude.Maybe Prelude.Int)
acceptQualificationRequest_integerValue :: (Maybe Int -> f (Maybe Int))
-> AcceptQualificationRequest -> f AcceptQualificationRequest
acceptQualificationRequest_integerValue = (AcceptQualificationRequest -> Maybe Int)
-> (AcceptQualificationRequest
-> Maybe Int -> AcceptQualificationRequest)
-> Lens
AcceptQualificationRequest
AcceptQualificationRequest
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptQualificationRequest' {Maybe Int
integerValue :: Maybe Int
$sel:integerValue:AcceptQualificationRequest' :: AcceptQualificationRequest -> Maybe Int
integerValue} -> Maybe Int
integerValue) (\s :: AcceptQualificationRequest
s@AcceptQualificationRequest' {} Maybe Int
a -> AcceptQualificationRequest
s {$sel:integerValue:AcceptQualificationRequest' :: Maybe Int
integerValue = Maybe Int
a} :: AcceptQualificationRequest)
acceptQualificationRequest_qualificationRequestId :: Lens.Lens' AcceptQualificationRequest Prelude.Text
acceptQualificationRequest_qualificationRequestId :: (Text -> f Text)
-> AcceptQualificationRequest -> f AcceptQualificationRequest
acceptQualificationRequest_qualificationRequestId = (AcceptQualificationRequest -> Text)
-> (AcceptQualificationRequest
-> Text -> AcceptQualificationRequest)
-> Lens
AcceptQualificationRequest AcceptQualificationRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptQualificationRequest' {Text
qualificationRequestId :: Text
$sel:qualificationRequestId:AcceptQualificationRequest' :: AcceptQualificationRequest -> Text
qualificationRequestId} -> Text
qualificationRequestId) (\s :: AcceptQualificationRequest
s@AcceptQualificationRequest' {} Text
a -> AcceptQualificationRequest
s {$sel:qualificationRequestId:AcceptQualificationRequest' :: Text
qualificationRequestId = Text
a} :: AcceptQualificationRequest)
instance Core.AWSRequest AcceptQualificationRequest where
type
AWSResponse AcceptQualificationRequest =
AcceptQualificationRequestResponse
request :: AcceptQualificationRequest -> Request AcceptQualificationRequest
request = Service
-> AcceptQualificationRequest -> Request AcceptQualificationRequest
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AcceptQualificationRequest
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AcceptQualificationRequest)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AcceptQualificationRequest))
-> Logger
-> Service
-> Proxy AcceptQualificationRequest
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AcceptQualificationRequest)))
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 -> AcceptQualificationRequestResponse
AcceptQualificationRequestResponse'
(Int -> AcceptQualificationRequestResponse)
-> Either String Int
-> Either String AcceptQualificationRequestResponse
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 AcceptQualificationRequest
instance Prelude.NFData AcceptQualificationRequest
instance Core.ToHeaders AcceptQualificationRequest where
toHeaders :: AcceptQualificationRequest -> ResponseHeaders
toHeaders =
ResponseHeaders -> AcceptQualificationRequest -> 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.AcceptQualificationRequest" ::
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 AcceptQualificationRequest where
toJSON :: AcceptQualificationRequest -> Value
toJSON AcceptQualificationRequest' {Maybe Int
Text
qualificationRequestId :: Text
integerValue :: Maybe Int
$sel:qualificationRequestId:AcceptQualificationRequest' :: AcceptQualificationRequest -> Text
$sel:integerValue:AcceptQualificationRequest' :: AcceptQualificationRequest -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IntegerValue" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
integerValue,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"QualificationRequestId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
qualificationRequestId
)
]
)
instance Core.ToPath AcceptQualificationRequest where
toPath :: AcceptQualificationRequest -> ByteString
toPath = ByteString -> AcceptQualificationRequest -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AcceptQualificationRequest where
toQuery :: AcceptQualificationRequest -> QueryString
toQuery = QueryString -> AcceptQualificationRequest -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AcceptQualificationRequestResponse = AcceptQualificationRequestResponse'
{
AcceptQualificationRequestResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AcceptQualificationRequestResponse
-> AcceptQualificationRequestResponse -> Bool
(AcceptQualificationRequestResponse
-> AcceptQualificationRequestResponse -> Bool)
-> (AcceptQualificationRequestResponse
-> AcceptQualificationRequestResponse -> Bool)
-> Eq AcceptQualificationRequestResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptQualificationRequestResponse
-> AcceptQualificationRequestResponse -> Bool
$c/= :: AcceptQualificationRequestResponse
-> AcceptQualificationRequestResponse -> Bool
== :: AcceptQualificationRequestResponse
-> AcceptQualificationRequestResponse -> Bool
$c== :: AcceptQualificationRequestResponse
-> AcceptQualificationRequestResponse -> Bool
Prelude.Eq, ReadPrec [AcceptQualificationRequestResponse]
ReadPrec AcceptQualificationRequestResponse
Int -> ReadS AcceptQualificationRequestResponse
ReadS [AcceptQualificationRequestResponse]
(Int -> ReadS AcceptQualificationRequestResponse)
-> ReadS [AcceptQualificationRequestResponse]
-> ReadPrec AcceptQualificationRequestResponse
-> ReadPrec [AcceptQualificationRequestResponse]
-> Read AcceptQualificationRequestResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptQualificationRequestResponse]
$creadListPrec :: ReadPrec [AcceptQualificationRequestResponse]
readPrec :: ReadPrec AcceptQualificationRequestResponse
$creadPrec :: ReadPrec AcceptQualificationRequestResponse
readList :: ReadS [AcceptQualificationRequestResponse]
$creadList :: ReadS [AcceptQualificationRequestResponse]
readsPrec :: Int -> ReadS AcceptQualificationRequestResponse
$creadsPrec :: Int -> ReadS AcceptQualificationRequestResponse
Prelude.Read, Int -> AcceptQualificationRequestResponse -> ShowS
[AcceptQualificationRequestResponse] -> ShowS
AcceptQualificationRequestResponse -> String
(Int -> AcceptQualificationRequestResponse -> ShowS)
-> (AcceptQualificationRequestResponse -> String)
-> ([AcceptQualificationRequestResponse] -> ShowS)
-> Show AcceptQualificationRequestResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptQualificationRequestResponse] -> ShowS
$cshowList :: [AcceptQualificationRequestResponse] -> ShowS
show :: AcceptQualificationRequestResponse -> String
$cshow :: AcceptQualificationRequestResponse -> String
showsPrec :: Int -> AcceptQualificationRequestResponse -> ShowS
$cshowsPrec :: Int -> AcceptQualificationRequestResponse -> ShowS
Prelude.Show, (forall x.
AcceptQualificationRequestResponse
-> Rep AcceptQualificationRequestResponse x)
-> (forall x.
Rep AcceptQualificationRequestResponse x
-> AcceptQualificationRequestResponse)
-> Generic AcceptQualificationRequestResponse
forall x.
Rep AcceptQualificationRequestResponse x
-> AcceptQualificationRequestResponse
forall x.
AcceptQualificationRequestResponse
-> Rep AcceptQualificationRequestResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcceptQualificationRequestResponse x
-> AcceptQualificationRequestResponse
$cfrom :: forall x.
AcceptQualificationRequestResponse
-> Rep AcceptQualificationRequestResponse x
Prelude.Generic)
newAcceptQualificationRequestResponse ::
Prelude.Int ->
AcceptQualificationRequestResponse
newAcceptQualificationRequestResponse :: Int -> AcceptQualificationRequestResponse
newAcceptQualificationRequestResponse Int
pHttpStatus_ =
AcceptQualificationRequestResponse' :: Int -> AcceptQualificationRequestResponse
AcceptQualificationRequestResponse'
{ $sel:httpStatus:AcceptQualificationRequestResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
acceptQualificationRequestResponse_httpStatus :: Lens.Lens' AcceptQualificationRequestResponse Prelude.Int
acceptQualificationRequestResponse_httpStatus :: (Int -> f Int)
-> AcceptQualificationRequestResponse
-> f AcceptQualificationRequestResponse
acceptQualificationRequestResponse_httpStatus = (AcceptQualificationRequestResponse -> Int)
-> (AcceptQualificationRequestResponse
-> Int -> AcceptQualificationRequestResponse)
-> Lens
AcceptQualificationRequestResponse
AcceptQualificationRequestResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptQualificationRequestResponse' {Int
httpStatus :: Int
$sel:httpStatus:AcceptQualificationRequestResponse' :: AcceptQualificationRequestResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AcceptQualificationRequestResponse
s@AcceptQualificationRequestResponse' {} Int
a -> AcceptQualificationRequestResponse
s {$sel:httpStatus:AcceptQualificationRequestResponse' :: Int
httpStatus = Int
a} :: AcceptQualificationRequestResponse)
instance
Prelude.NFData
AcceptQualificationRequestResponse