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