{-# 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.CreateHIT
(
CreateHIT (..),
newCreateHIT,
createHIT_hITReviewPolicy,
createHIT_uniqueRequestToken,
createHIT_autoApprovalDelayInSeconds,
createHIT_requesterAnnotation,
createHIT_maxAssignments,
createHIT_keywords,
createHIT_hITLayoutId,
createHIT_hITLayoutParameters,
createHIT_qualificationRequirements,
createHIT_question,
createHIT_assignmentReviewPolicy,
createHIT_lifetimeInSeconds,
createHIT_assignmentDurationInSeconds,
createHIT_reward,
createHIT_title,
createHIT_description,
CreateHITResponse (..),
newCreateHITResponse,
createHITResponse_hit,
createHITResponse_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 CreateHIT = CreateHIT'
{
CreateHIT -> Maybe ReviewPolicy
hITReviewPolicy :: Prelude.Maybe ReviewPolicy,
CreateHIT -> Maybe Text
uniqueRequestToken :: Prelude.Maybe Prelude.Text,
CreateHIT -> Maybe Integer
autoApprovalDelayInSeconds :: Prelude.Maybe Prelude.Integer,
CreateHIT -> Maybe Text
requesterAnnotation :: Prelude.Maybe Prelude.Text,
CreateHIT -> Maybe Int
maxAssignments :: Prelude.Maybe Prelude.Int,
CreateHIT -> Maybe Text
keywords :: Prelude.Maybe Prelude.Text,
CreateHIT -> Maybe Text
hITLayoutId :: Prelude.Maybe Prelude.Text,
CreateHIT -> Maybe [HITLayoutParameter]
hITLayoutParameters :: Prelude.Maybe [HITLayoutParameter],
CreateHIT -> Maybe [QualificationRequirement]
qualificationRequirements :: Prelude.Maybe [QualificationRequirement],
CreateHIT -> Maybe Text
question :: Prelude.Maybe Prelude.Text,
CreateHIT -> Maybe ReviewPolicy
assignmentReviewPolicy :: Prelude.Maybe ReviewPolicy,
CreateHIT -> Integer
lifetimeInSeconds :: Prelude.Integer,
CreateHIT -> Integer
assignmentDurationInSeconds :: Prelude.Integer,
CreateHIT -> Text
reward :: Prelude.Text,
CreateHIT -> Text
title :: Prelude.Text,
CreateHIT -> Text
description :: Prelude.Text
}
deriving (CreateHIT -> CreateHIT -> Bool
(CreateHIT -> CreateHIT -> Bool)
-> (CreateHIT -> CreateHIT -> Bool) -> Eq CreateHIT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHIT -> CreateHIT -> Bool
$c/= :: CreateHIT -> CreateHIT -> Bool
== :: CreateHIT -> CreateHIT -> Bool
$c== :: CreateHIT -> CreateHIT -> Bool
Prelude.Eq, ReadPrec [CreateHIT]
ReadPrec CreateHIT
Int -> ReadS CreateHIT
ReadS [CreateHIT]
(Int -> ReadS CreateHIT)
-> ReadS [CreateHIT]
-> ReadPrec CreateHIT
-> ReadPrec [CreateHIT]
-> Read CreateHIT
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHIT]
$creadListPrec :: ReadPrec [CreateHIT]
readPrec :: ReadPrec CreateHIT
$creadPrec :: ReadPrec CreateHIT
readList :: ReadS [CreateHIT]
$creadList :: ReadS [CreateHIT]
readsPrec :: Int -> ReadS CreateHIT
$creadsPrec :: Int -> ReadS CreateHIT
Prelude.Read, Int -> CreateHIT -> ShowS
[CreateHIT] -> ShowS
CreateHIT -> String
(Int -> CreateHIT -> ShowS)
-> (CreateHIT -> String)
-> ([CreateHIT] -> ShowS)
-> Show CreateHIT
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHIT] -> ShowS
$cshowList :: [CreateHIT] -> ShowS
show :: CreateHIT -> String
$cshow :: CreateHIT -> String
showsPrec :: Int -> CreateHIT -> ShowS
$cshowsPrec :: Int -> CreateHIT -> ShowS
Prelude.Show, (forall x. CreateHIT -> Rep CreateHIT x)
-> (forall x. Rep CreateHIT x -> CreateHIT) -> Generic CreateHIT
forall x. Rep CreateHIT x -> CreateHIT
forall x. CreateHIT -> Rep CreateHIT x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHIT x -> CreateHIT
$cfrom :: forall x. CreateHIT -> Rep CreateHIT x
Prelude.Generic)
newCreateHIT ::
Prelude.Integer ->
Prelude.Integer ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
CreateHIT
newCreateHIT :: Integer -> Integer -> Text -> Text -> Text -> CreateHIT
newCreateHIT
Integer
pLifetimeInSeconds_
Integer
pAssignmentDurationInSeconds_
Text
pReward_
Text
pTitle_
Text
pDescription_ =
CreateHIT' :: Maybe ReviewPolicy
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe [HITLayoutParameter]
-> Maybe [QualificationRequirement]
-> Maybe Text
-> Maybe ReviewPolicy
-> Integer
-> Integer
-> Text
-> Text
-> Text
-> CreateHIT
CreateHIT'
{ $sel:hITReviewPolicy:CreateHIT' :: Maybe ReviewPolicy
hITReviewPolicy = Maybe ReviewPolicy
forall a. Maybe a
Prelude.Nothing,
$sel:uniqueRequestToken:CreateHIT' :: Maybe Text
uniqueRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoApprovalDelayInSeconds:CreateHIT' :: Maybe Integer
autoApprovalDelayInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:requesterAnnotation:CreateHIT' :: Maybe Text
requesterAnnotation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxAssignments:CreateHIT' :: Maybe Int
maxAssignments = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:keywords:CreateHIT' :: Maybe Text
keywords = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hITLayoutId:CreateHIT' :: Maybe Text
hITLayoutId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hITLayoutParameters:CreateHIT' :: Maybe [HITLayoutParameter]
hITLayoutParameters = Maybe [HITLayoutParameter]
forall a. Maybe a
Prelude.Nothing,
$sel:qualificationRequirements:CreateHIT' :: Maybe [QualificationRequirement]
qualificationRequirements = Maybe [QualificationRequirement]
forall a. Maybe a
Prelude.Nothing,
$sel:question:CreateHIT' :: Maybe Text
question = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assignmentReviewPolicy:CreateHIT' :: Maybe ReviewPolicy
assignmentReviewPolicy = Maybe ReviewPolicy
forall a. Maybe a
Prelude.Nothing,
$sel:lifetimeInSeconds:CreateHIT' :: Integer
lifetimeInSeconds = Integer
pLifetimeInSeconds_,
$sel:assignmentDurationInSeconds:CreateHIT' :: Integer
assignmentDurationInSeconds =
Integer
pAssignmentDurationInSeconds_,
$sel:reward:CreateHIT' :: Text
reward = Text
pReward_,
$sel:title:CreateHIT' :: Text
title = Text
pTitle_,
$sel:description:CreateHIT' :: Text
description = Text
pDescription_
}
createHIT_hITReviewPolicy :: Lens.Lens' CreateHIT (Prelude.Maybe ReviewPolicy)
createHIT_hITReviewPolicy :: (Maybe ReviewPolicy -> f (Maybe ReviewPolicy))
-> CreateHIT -> f CreateHIT
createHIT_hITReviewPolicy = (CreateHIT -> Maybe ReviewPolicy)
-> (CreateHIT -> Maybe ReviewPolicy -> CreateHIT)
-> Lens
CreateHIT CreateHIT (Maybe ReviewPolicy) (Maybe ReviewPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe ReviewPolicy
hITReviewPolicy :: Maybe ReviewPolicy
$sel:hITReviewPolicy:CreateHIT' :: CreateHIT -> Maybe ReviewPolicy
hITReviewPolicy} -> Maybe ReviewPolicy
hITReviewPolicy) (\s :: CreateHIT
s@CreateHIT' {} Maybe ReviewPolicy
a -> CreateHIT
s {$sel:hITReviewPolicy:CreateHIT' :: Maybe ReviewPolicy
hITReviewPolicy = Maybe ReviewPolicy
a} :: CreateHIT)
createHIT_uniqueRequestToken :: Lens.Lens' CreateHIT (Prelude.Maybe Prelude.Text)
createHIT_uniqueRequestToken :: (Maybe Text -> f (Maybe Text)) -> CreateHIT -> f CreateHIT
createHIT_uniqueRequestToken = (CreateHIT -> Maybe Text)
-> (CreateHIT -> Maybe Text -> CreateHIT)
-> Lens CreateHIT CreateHIT (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe Text
uniqueRequestToken :: Maybe Text
$sel:uniqueRequestToken:CreateHIT' :: CreateHIT -> Maybe Text
uniqueRequestToken} -> Maybe Text
uniqueRequestToken) (\s :: CreateHIT
s@CreateHIT' {} Maybe Text
a -> CreateHIT
s {$sel:uniqueRequestToken:CreateHIT' :: Maybe Text
uniqueRequestToken = Maybe Text
a} :: CreateHIT)
createHIT_autoApprovalDelayInSeconds :: Lens.Lens' CreateHIT (Prelude.Maybe Prelude.Integer)
createHIT_autoApprovalDelayInSeconds :: (Maybe Integer -> f (Maybe Integer)) -> CreateHIT -> f CreateHIT
createHIT_autoApprovalDelayInSeconds = (CreateHIT -> Maybe Integer)
-> (CreateHIT -> Maybe Integer -> CreateHIT)
-> Lens CreateHIT CreateHIT (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe Integer
autoApprovalDelayInSeconds :: Maybe Integer
$sel:autoApprovalDelayInSeconds:CreateHIT' :: CreateHIT -> Maybe Integer
autoApprovalDelayInSeconds} -> Maybe Integer
autoApprovalDelayInSeconds) (\s :: CreateHIT
s@CreateHIT' {} Maybe Integer
a -> CreateHIT
s {$sel:autoApprovalDelayInSeconds:CreateHIT' :: Maybe Integer
autoApprovalDelayInSeconds = Maybe Integer
a} :: CreateHIT)
createHIT_requesterAnnotation :: Lens.Lens' CreateHIT (Prelude.Maybe Prelude.Text)
createHIT_requesterAnnotation :: (Maybe Text -> f (Maybe Text)) -> CreateHIT -> f CreateHIT
createHIT_requesterAnnotation = (CreateHIT -> Maybe Text)
-> (CreateHIT -> Maybe Text -> CreateHIT)
-> Lens CreateHIT CreateHIT (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe Text
requesterAnnotation :: Maybe Text
$sel:requesterAnnotation:CreateHIT' :: CreateHIT -> Maybe Text
requesterAnnotation} -> Maybe Text
requesterAnnotation) (\s :: CreateHIT
s@CreateHIT' {} Maybe Text
a -> CreateHIT
s {$sel:requesterAnnotation:CreateHIT' :: Maybe Text
requesterAnnotation = Maybe Text
a} :: CreateHIT)
createHIT_maxAssignments :: Lens.Lens' CreateHIT (Prelude.Maybe Prelude.Int)
createHIT_maxAssignments :: (Maybe Int -> f (Maybe Int)) -> CreateHIT -> f CreateHIT
createHIT_maxAssignments = (CreateHIT -> Maybe Int)
-> (CreateHIT -> Maybe Int -> CreateHIT)
-> Lens CreateHIT CreateHIT (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe Int
maxAssignments :: Maybe Int
$sel:maxAssignments:CreateHIT' :: CreateHIT -> Maybe Int
maxAssignments} -> Maybe Int
maxAssignments) (\s :: CreateHIT
s@CreateHIT' {} Maybe Int
a -> CreateHIT
s {$sel:maxAssignments:CreateHIT' :: Maybe Int
maxAssignments = Maybe Int
a} :: CreateHIT)
createHIT_keywords :: Lens.Lens' CreateHIT (Prelude.Maybe Prelude.Text)
createHIT_keywords :: (Maybe Text -> f (Maybe Text)) -> CreateHIT -> f CreateHIT
createHIT_keywords = (CreateHIT -> Maybe Text)
-> (CreateHIT -> Maybe Text -> CreateHIT)
-> Lens CreateHIT CreateHIT (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe Text
keywords :: Maybe Text
$sel:keywords:CreateHIT' :: CreateHIT -> Maybe Text
keywords} -> Maybe Text
keywords) (\s :: CreateHIT
s@CreateHIT' {} Maybe Text
a -> CreateHIT
s {$sel:keywords:CreateHIT' :: Maybe Text
keywords = Maybe Text
a} :: CreateHIT)
createHIT_hITLayoutId :: Lens.Lens' CreateHIT (Prelude.Maybe Prelude.Text)
createHIT_hITLayoutId :: (Maybe Text -> f (Maybe Text)) -> CreateHIT -> f CreateHIT
createHIT_hITLayoutId = (CreateHIT -> Maybe Text)
-> (CreateHIT -> Maybe Text -> CreateHIT)
-> Lens CreateHIT CreateHIT (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe Text
hITLayoutId :: Maybe Text
$sel:hITLayoutId:CreateHIT' :: CreateHIT -> Maybe Text
hITLayoutId} -> Maybe Text
hITLayoutId) (\s :: CreateHIT
s@CreateHIT' {} Maybe Text
a -> CreateHIT
s {$sel:hITLayoutId:CreateHIT' :: Maybe Text
hITLayoutId = Maybe Text
a} :: CreateHIT)
createHIT_hITLayoutParameters :: Lens.Lens' CreateHIT (Prelude.Maybe [HITLayoutParameter])
createHIT_hITLayoutParameters :: (Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> CreateHIT -> f CreateHIT
createHIT_hITLayoutParameters = (CreateHIT -> Maybe [HITLayoutParameter])
-> (CreateHIT -> Maybe [HITLayoutParameter] -> CreateHIT)
-> Lens
CreateHIT
CreateHIT
(Maybe [HITLayoutParameter])
(Maybe [HITLayoutParameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe [HITLayoutParameter]
hITLayoutParameters :: Maybe [HITLayoutParameter]
$sel:hITLayoutParameters:CreateHIT' :: CreateHIT -> Maybe [HITLayoutParameter]
hITLayoutParameters} -> Maybe [HITLayoutParameter]
hITLayoutParameters) (\s :: CreateHIT
s@CreateHIT' {} Maybe [HITLayoutParameter]
a -> CreateHIT
s {$sel:hITLayoutParameters:CreateHIT' :: Maybe [HITLayoutParameter]
hITLayoutParameters = Maybe [HITLayoutParameter]
a} :: CreateHIT) ((Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> CreateHIT -> f CreateHIT)
-> ((Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> (Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> CreateHIT
-> f CreateHIT
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[HITLayoutParameter]
[HITLayoutParameter]
[HITLayoutParameter]
[HITLayoutParameter]
-> Iso
(Maybe [HITLayoutParameter])
(Maybe [HITLayoutParameter])
(Maybe [HITLayoutParameter])
(Maybe [HITLayoutParameter])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[HITLayoutParameter]
[HITLayoutParameter]
[HITLayoutParameter]
[HITLayoutParameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createHIT_qualificationRequirements :: Lens.Lens' CreateHIT (Prelude.Maybe [QualificationRequirement])
createHIT_qualificationRequirements :: (Maybe [QualificationRequirement]
-> f (Maybe [QualificationRequirement]))
-> CreateHIT -> f CreateHIT
createHIT_qualificationRequirements = (CreateHIT -> Maybe [QualificationRequirement])
-> (CreateHIT -> Maybe [QualificationRequirement] -> CreateHIT)
-> Lens
CreateHIT
CreateHIT
(Maybe [QualificationRequirement])
(Maybe [QualificationRequirement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe [QualificationRequirement]
qualificationRequirements :: Maybe [QualificationRequirement]
$sel:qualificationRequirements:CreateHIT' :: CreateHIT -> Maybe [QualificationRequirement]
qualificationRequirements} -> Maybe [QualificationRequirement]
qualificationRequirements) (\s :: CreateHIT
s@CreateHIT' {} Maybe [QualificationRequirement]
a -> CreateHIT
s {$sel:qualificationRequirements:CreateHIT' :: Maybe [QualificationRequirement]
qualificationRequirements = Maybe [QualificationRequirement]
a} :: CreateHIT) ((Maybe [QualificationRequirement]
-> f (Maybe [QualificationRequirement]))
-> CreateHIT -> f CreateHIT)
-> ((Maybe [QualificationRequirement]
-> f (Maybe [QualificationRequirement]))
-> Maybe [QualificationRequirement]
-> f (Maybe [QualificationRequirement]))
-> (Maybe [QualificationRequirement]
-> f (Maybe [QualificationRequirement]))
-> CreateHIT
-> f CreateHIT
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[QualificationRequirement]
[QualificationRequirement]
[QualificationRequirement]
[QualificationRequirement]
-> Iso
(Maybe [QualificationRequirement])
(Maybe [QualificationRequirement])
(Maybe [QualificationRequirement])
(Maybe [QualificationRequirement])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[QualificationRequirement]
[QualificationRequirement]
[QualificationRequirement]
[QualificationRequirement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createHIT_question :: Lens.Lens' CreateHIT (Prelude.Maybe Prelude.Text)
createHIT_question :: (Maybe Text -> f (Maybe Text)) -> CreateHIT -> f CreateHIT
createHIT_question = (CreateHIT -> Maybe Text)
-> (CreateHIT -> Maybe Text -> CreateHIT)
-> Lens CreateHIT CreateHIT (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe Text
question :: Maybe Text
$sel:question:CreateHIT' :: CreateHIT -> Maybe Text
question} -> Maybe Text
question) (\s :: CreateHIT
s@CreateHIT' {} Maybe Text
a -> CreateHIT
s {$sel:question:CreateHIT' :: Maybe Text
question = Maybe Text
a} :: CreateHIT)
createHIT_assignmentReviewPolicy :: Lens.Lens' CreateHIT (Prelude.Maybe ReviewPolicy)
createHIT_assignmentReviewPolicy :: (Maybe ReviewPolicy -> f (Maybe ReviewPolicy))
-> CreateHIT -> f CreateHIT
createHIT_assignmentReviewPolicy = (CreateHIT -> Maybe ReviewPolicy)
-> (CreateHIT -> Maybe ReviewPolicy -> CreateHIT)
-> Lens
CreateHIT CreateHIT (Maybe ReviewPolicy) (Maybe ReviewPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Maybe ReviewPolicy
assignmentReviewPolicy :: Maybe ReviewPolicy
$sel:assignmentReviewPolicy:CreateHIT' :: CreateHIT -> Maybe ReviewPolicy
assignmentReviewPolicy} -> Maybe ReviewPolicy
assignmentReviewPolicy) (\s :: CreateHIT
s@CreateHIT' {} Maybe ReviewPolicy
a -> CreateHIT
s {$sel:assignmentReviewPolicy:CreateHIT' :: Maybe ReviewPolicy
assignmentReviewPolicy = Maybe ReviewPolicy
a} :: CreateHIT)
createHIT_lifetimeInSeconds :: Lens.Lens' CreateHIT Prelude.Integer
createHIT_lifetimeInSeconds :: (Integer -> f Integer) -> CreateHIT -> f CreateHIT
createHIT_lifetimeInSeconds = (CreateHIT -> Integer)
-> (CreateHIT -> Integer -> CreateHIT)
-> Lens CreateHIT CreateHIT Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Integer
lifetimeInSeconds :: Integer
$sel:lifetimeInSeconds:CreateHIT' :: CreateHIT -> Integer
lifetimeInSeconds} -> Integer
lifetimeInSeconds) (\s :: CreateHIT
s@CreateHIT' {} Integer
a -> CreateHIT
s {$sel:lifetimeInSeconds:CreateHIT' :: Integer
lifetimeInSeconds = Integer
a} :: CreateHIT)
createHIT_assignmentDurationInSeconds :: Lens.Lens' CreateHIT Prelude.Integer
createHIT_assignmentDurationInSeconds :: (Integer -> f Integer) -> CreateHIT -> f CreateHIT
createHIT_assignmentDurationInSeconds = (CreateHIT -> Integer)
-> (CreateHIT -> Integer -> CreateHIT)
-> Lens CreateHIT CreateHIT Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Integer
assignmentDurationInSeconds :: Integer
$sel:assignmentDurationInSeconds:CreateHIT' :: CreateHIT -> Integer
assignmentDurationInSeconds} -> Integer
assignmentDurationInSeconds) (\s :: CreateHIT
s@CreateHIT' {} Integer
a -> CreateHIT
s {$sel:assignmentDurationInSeconds:CreateHIT' :: Integer
assignmentDurationInSeconds = Integer
a} :: CreateHIT)
createHIT_reward :: Lens.Lens' CreateHIT Prelude.Text
createHIT_reward :: (Text -> f Text) -> CreateHIT -> f CreateHIT
createHIT_reward = (CreateHIT -> Text)
-> (CreateHIT -> Text -> CreateHIT)
-> Lens CreateHIT CreateHIT Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Text
reward :: Text
$sel:reward:CreateHIT' :: CreateHIT -> Text
reward} -> Text
reward) (\s :: CreateHIT
s@CreateHIT' {} Text
a -> CreateHIT
s {$sel:reward:CreateHIT' :: Text
reward = Text
a} :: CreateHIT)
createHIT_title :: Lens.Lens' CreateHIT Prelude.Text
createHIT_title :: (Text -> f Text) -> CreateHIT -> f CreateHIT
createHIT_title = (CreateHIT -> Text)
-> (CreateHIT -> Text -> CreateHIT)
-> Lens CreateHIT CreateHIT Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Text
title :: Text
$sel:title:CreateHIT' :: CreateHIT -> Text
title} -> Text
title) (\s :: CreateHIT
s@CreateHIT' {} Text
a -> CreateHIT
s {$sel:title:CreateHIT' :: Text
title = Text
a} :: CreateHIT)
createHIT_description :: Lens.Lens' CreateHIT Prelude.Text
createHIT_description :: (Text -> f Text) -> CreateHIT -> f CreateHIT
createHIT_description = (CreateHIT -> Text)
-> (CreateHIT -> Text -> CreateHIT)
-> Lens CreateHIT CreateHIT Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHIT' {Text
description :: Text
$sel:description:CreateHIT' :: CreateHIT -> Text
description} -> Text
description) (\s :: CreateHIT
s@CreateHIT' {} Text
a -> CreateHIT
s {$sel:description:CreateHIT' :: Text
description = Text
a} :: CreateHIT)
instance Core.AWSRequest CreateHIT where
type AWSResponse CreateHIT = CreateHITResponse
request :: CreateHIT -> Request CreateHIT
request = Service -> CreateHIT -> Request CreateHIT
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateHIT
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateHIT)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateHIT))
-> Logger
-> Service
-> Proxy CreateHIT
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateHIT)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe HIT -> Int -> CreateHITResponse
CreateHITResponse'
(Maybe HIT -> Int -> CreateHITResponse)
-> Either String (Maybe HIT)
-> Either String (Int -> CreateHITResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe HIT)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HIT")
Either String (Int -> CreateHITResponse)
-> Either String Int -> Either String CreateHITResponse
forall (f :: * -> *) a b. Applicative f => 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 CreateHIT
instance Prelude.NFData CreateHIT
instance Core.ToHeaders CreateHIT where
toHeaders :: CreateHIT -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateHIT -> 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.CreateHIT" ::
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 CreateHIT where
toJSON :: CreateHIT -> Value
toJSON CreateHIT' {Integer
Maybe Int
Maybe Integer
Maybe [HITLayoutParameter]
Maybe [QualificationRequirement]
Maybe Text
Maybe ReviewPolicy
Text
description :: Text
title :: Text
reward :: Text
assignmentDurationInSeconds :: Integer
lifetimeInSeconds :: Integer
assignmentReviewPolicy :: Maybe ReviewPolicy
question :: Maybe Text
qualificationRequirements :: Maybe [QualificationRequirement]
hITLayoutParameters :: Maybe [HITLayoutParameter]
hITLayoutId :: Maybe Text
keywords :: Maybe Text
maxAssignments :: Maybe Int
requesterAnnotation :: Maybe Text
autoApprovalDelayInSeconds :: Maybe Integer
uniqueRequestToken :: Maybe Text
hITReviewPolicy :: Maybe ReviewPolicy
$sel:description:CreateHIT' :: CreateHIT -> Text
$sel:title:CreateHIT' :: CreateHIT -> Text
$sel:reward:CreateHIT' :: CreateHIT -> Text
$sel:assignmentDurationInSeconds:CreateHIT' :: CreateHIT -> Integer
$sel:lifetimeInSeconds:CreateHIT' :: CreateHIT -> Integer
$sel:assignmentReviewPolicy:CreateHIT' :: CreateHIT -> Maybe ReviewPolicy
$sel:question:CreateHIT' :: CreateHIT -> Maybe Text
$sel:qualificationRequirements:CreateHIT' :: CreateHIT -> Maybe [QualificationRequirement]
$sel:hITLayoutParameters:CreateHIT' :: CreateHIT -> Maybe [HITLayoutParameter]
$sel:hITLayoutId:CreateHIT' :: CreateHIT -> Maybe Text
$sel:keywords:CreateHIT' :: CreateHIT -> Maybe Text
$sel:maxAssignments:CreateHIT' :: CreateHIT -> Maybe Int
$sel:requesterAnnotation:CreateHIT' :: CreateHIT -> Maybe Text
$sel:autoApprovalDelayInSeconds:CreateHIT' :: CreateHIT -> Maybe Integer
$sel:uniqueRequestToken:CreateHIT' :: CreateHIT -> Maybe Text
$sel:hITReviewPolicy:CreateHIT' :: CreateHIT -> Maybe ReviewPolicy
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"HITReviewPolicy" Text -> ReviewPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ReviewPolicy -> Pair) -> Maybe ReviewPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReviewPolicy
hITReviewPolicy,
(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,
(Text
"AutoApprovalDelayInSeconds" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
autoApprovalDelayInSeconds,
(Text
"RequesterAnnotation" 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
requesterAnnotation,
(Text
"MaxAssignments" 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
maxAssignments,
(Text
"Keywords" 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
keywords,
(Text
"HITLayoutId" 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
hITLayoutId,
(Text
"HITLayoutParameters" Text -> [HITLayoutParameter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([HITLayoutParameter] -> Pair)
-> Maybe [HITLayoutParameter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [HITLayoutParameter]
hITLayoutParameters,
(Text
"QualificationRequirements" Text -> [QualificationRequirement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([QualificationRequirement] -> Pair)
-> Maybe [QualificationRequirement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [QualificationRequirement]
qualificationRequirements,
(Text
"Question" 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
question,
(Text
"AssignmentReviewPolicy" Text -> ReviewPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ReviewPolicy -> Pair) -> Maybe ReviewPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReviewPolicy
assignmentReviewPolicy,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"LifetimeInSeconds" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Integer
lifetimeInSeconds),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"AssignmentDurationInSeconds"
Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Integer
assignmentDurationInSeconds
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Reward" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reward),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Title" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
title),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
description)
]
)
instance Core.ToPath CreateHIT where
toPath :: CreateHIT -> ByteString
toPath = ByteString -> CreateHIT -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateHIT where
toQuery :: CreateHIT -> QueryString
toQuery = QueryString -> CreateHIT -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateHITResponse = CreateHITResponse'
{
CreateHITResponse -> Maybe HIT
hit :: Prelude.Maybe HIT,
CreateHITResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateHITResponse -> CreateHITResponse -> Bool
(CreateHITResponse -> CreateHITResponse -> Bool)
-> (CreateHITResponse -> CreateHITResponse -> Bool)
-> Eq CreateHITResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHITResponse -> CreateHITResponse -> Bool
$c/= :: CreateHITResponse -> CreateHITResponse -> Bool
== :: CreateHITResponse -> CreateHITResponse -> Bool
$c== :: CreateHITResponse -> CreateHITResponse -> Bool
Prelude.Eq, ReadPrec [CreateHITResponse]
ReadPrec CreateHITResponse
Int -> ReadS CreateHITResponse
ReadS [CreateHITResponse]
(Int -> ReadS CreateHITResponse)
-> ReadS [CreateHITResponse]
-> ReadPrec CreateHITResponse
-> ReadPrec [CreateHITResponse]
-> Read CreateHITResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHITResponse]
$creadListPrec :: ReadPrec [CreateHITResponse]
readPrec :: ReadPrec CreateHITResponse
$creadPrec :: ReadPrec CreateHITResponse
readList :: ReadS [CreateHITResponse]
$creadList :: ReadS [CreateHITResponse]
readsPrec :: Int -> ReadS CreateHITResponse
$creadsPrec :: Int -> ReadS CreateHITResponse
Prelude.Read, Int -> CreateHITResponse -> ShowS
[CreateHITResponse] -> ShowS
CreateHITResponse -> String
(Int -> CreateHITResponse -> ShowS)
-> (CreateHITResponse -> String)
-> ([CreateHITResponse] -> ShowS)
-> Show CreateHITResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHITResponse] -> ShowS
$cshowList :: [CreateHITResponse] -> ShowS
show :: CreateHITResponse -> String
$cshow :: CreateHITResponse -> String
showsPrec :: Int -> CreateHITResponse -> ShowS
$cshowsPrec :: Int -> CreateHITResponse -> ShowS
Prelude.Show, (forall x. CreateHITResponse -> Rep CreateHITResponse x)
-> (forall x. Rep CreateHITResponse x -> CreateHITResponse)
-> Generic CreateHITResponse
forall x. Rep CreateHITResponse x -> CreateHITResponse
forall x. CreateHITResponse -> Rep CreateHITResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHITResponse x -> CreateHITResponse
$cfrom :: forall x. CreateHITResponse -> Rep CreateHITResponse x
Prelude.Generic)
newCreateHITResponse ::
Prelude.Int ->
CreateHITResponse
newCreateHITResponse :: Int -> CreateHITResponse
newCreateHITResponse Int
pHttpStatus_ =
CreateHITResponse' :: Maybe HIT -> Int -> CreateHITResponse
CreateHITResponse'
{ $sel:hit:CreateHITResponse' :: Maybe HIT
hit = Maybe HIT
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateHITResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createHITResponse_hit :: Lens.Lens' CreateHITResponse (Prelude.Maybe HIT)
createHITResponse_hit :: (Maybe HIT -> f (Maybe HIT))
-> CreateHITResponse -> f CreateHITResponse
createHITResponse_hit = (CreateHITResponse -> Maybe HIT)
-> (CreateHITResponse -> Maybe HIT -> CreateHITResponse)
-> Lens CreateHITResponse CreateHITResponse (Maybe HIT) (Maybe HIT)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITResponse' {Maybe HIT
hit :: Maybe HIT
$sel:hit:CreateHITResponse' :: CreateHITResponse -> Maybe HIT
hit} -> Maybe HIT
hit) (\s :: CreateHITResponse
s@CreateHITResponse' {} Maybe HIT
a -> CreateHITResponse
s {$sel:hit:CreateHITResponse' :: Maybe HIT
hit = Maybe HIT
a} :: CreateHITResponse)
createHITResponse_httpStatus :: Lens.Lens' CreateHITResponse Prelude.Int
createHITResponse_httpStatus :: (Int -> f Int) -> CreateHITResponse -> f CreateHITResponse
createHITResponse_httpStatus = (CreateHITResponse -> Int)
-> (CreateHITResponse -> Int -> CreateHITResponse)
-> Lens CreateHITResponse CreateHITResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateHITResponse' :: CreateHITResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateHITResponse
s@CreateHITResponse' {} Int
a -> CreateHITResponse
s {$sel:httpStatus:CreateHITResponse' :: Int
httpStatus = Int
a} :: CreateHITResponse)
instance Prelude.NFData CreateHITResponse