{-# 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.CreateHITWithHITType
(
CreateHITWithHITType (..),
newCreateHITWithHITType,
createHITWithHITType_assignmentReviewPolicy,
createHITWithHITType_hITLayoutId,
createHITWithHITType_hITLayoutParameters,
createHITWithHITType_hITReviewPolicy,
createHITWithHITType_maxAssignments,
createHITWithHITType_question,
createHITWithHITType_requesterAnnotation,
createHITWithHITType_uniqueRequestToken,
createHITWithHITType_hITTypeId,
createHITWithHITType_lifetimeInSeconds,
CreateHITWithHITTypeResponse (..),
newCreateHITWithHITTypeResponse,
createHITWithHITTypeResponse_hit,
createHITWithHITTypeResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MechanicalTurk.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateHITWithHITType = CreateHITWithHITType'
{
CreateHITWithHITType -> Maybe ReviewPolicy
assignmentReviewPolicy :: Prelude.Maybe ReviewPolicy,
CreateHITWithHITType -> Maybe Text
hITLayoutId :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Maybe [HITLayoutParameter]
hITLayoutParameters :: Prelude.Maybe [HITLayoutParameter],
CreateHITWithHITType -> Maybe ReviewPolicy
hITReviewPolicy :: Prelude.Maybe ReviewPolicy,
CreateHITWithHITType -> Maybe Int
maxAssignments :: Prelude.Maybe Prelude.Int,
CreateHITWithHITType -> Maybe Text
question :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Maybe Text
requesterAnnotation :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Maybe Text
uniqueRequestToken :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Text
hITTypeId :: Prelude.Text,
CreateHITWithHITType -> Integer
lifetimeInSeconds :: Prelude.Integer
}
deriving (CreateHITWithHITType -> CreateHITWithHITType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHITWithHITType -> CreateHITWithHITType -> Bool
$c/= :: CreateHITWithHITType -> CreateHITWithHITType -> Bool
== :: CreateHITWithHITType -> CreateHITWithHITType -> Bool
$c== :: CreateHITWithHITType -> CreateHITWithHITType -> Bool
Prelude.Eq, ReadPrec [CreateHITWithHITType]
ReadPrec CreateHITWithHITType
Int -> ReadS CreateHITWithHITType
ReadS [CreateHITWithHITType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHITWithHITType]
$creadListPrec :: ReadPrec [CreateHITWithHITType]
readPrec :: ReadPrec CreateHITWithHITType
$creadPrec :: ReadPrec CreateHITWithHITType
readList :: ReadS [CreateHITWithHITType]
$creadList :: ReadS [CreateHITWithHITType]
readsPrec :: Int -> ReadS CreateHITWithHITType
$creadsPrec :: Int -> ReadS CreateHITWithHITType
Prelude.Read, Int -> CreateHITWithHITType -> ShowS
[CreateHITWithHITType] -> ShowS
CreateHITWithHITType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHITWithHITType] -> ShowS
$cshowList :: [CreateHITWithHITType] -> ShowS
show :: CreateHITWithHITType -> String
$cshow :: CreateHITWithHITType -> String
showsPrec :: Int -> CreateHITWithHITType -> ShowS
$cshowsPrec :: Int -> CreateHITWithHITType -> ShowS
Prelude.Show, forall x. Rep CreateHITWithHITType x -> CreateHITWithHITType
forall x. CreateHITWithHITType -> Rep CreateHITWithHITType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHITWithHITType x -> CreateHITWithHITType
$cfrom :: forall x. CreateHITWithHITType -> Rep CreateHITWithHITType x
Prelude.Generic)
newCreateHITWithHITType ::
Prelude.Text ->
Prelude.Integer ->
CreateHITWithHITType
newCreateHITWithHITType :: Text -> Integer -> CreateHITWithHITType
newCreateHITWithHITType
Text
pHITTypeId_
Integer
pLifetimeInSeconds_ =
CreateHITWithHITType'
{ $sel:assignmentReviewPolicy:CreateHITWithHITType' :: Maybe ReviewPolicy
assignmentReviewPolicy =
forall a. Maybe a
Prelude.Nothing,
$sel:hITLayoutId:CreateHITWithHITType' :: Maybe Text
hITLayoutId = forall a. Maybe a
Prelude.Nothing,
$sel:hITLayoutParameters:CreateHITWithHITType' :: Maybe [HITLayoutParameter]
hITLayoutParameters = forall a. Maybe a
Prelude.Nothing,
$sel:hITReviewPolicy:CreateHITWithHITType' :: Maybe ReviewPolicy
hITReviewPolicy = forall a. Maybe a
Prelude.Nothing,
$sel:maxAssignments:CreateHITWithHITType' :: Maybe Int
maxAssignments = forall a. Maybe a
Prelude.Nothing,
$sel:question:CreateHITWithHITType' :: Maybe Text
question = forall a. Maybe a
Prelude.Nothing,
$sel:requesterAnnotation:CreateHITWithHITType' :: Maybe Text
requesterAnnotation = forall a. Maybe a
Prelude.Nothing,
$sel:uniqueRequestToken:CreateHITWithHITType' :: Maybe Text
uniqueRequestToken = forall a. Maybe a
Prelude.Nothing,
$sel:hITTypeId:CreateHITWithHITType' :: Text
hITTypeId = Text
pHITTypeId_,
$sel:lifetimeInSeconds:CreateHITWithHITType' :: Integer
lifetimeInSeconds = Integer
pLifetimeInSeconds_
}
createHITWithHITType_assignmentReviewPolicy :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe ReviewPolicy)
createHITWithHITType_assignmentReviewPolicy :: Lens' CreateHITWithHITType (Maybe ReviewPolicy)
createHITWithHITType_assignmentReviewPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe ReviewPolicy
assignmentReviewPolicy :: Maybe ReviewPolicy
$sel:assignmentReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
assignmentReviewPolicy} -> Maybe ReviewPolicy
assignmentReviewPolicy) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe ReviewPolicy
a -> CreateHITWithHITType
s {$sel:assignmentReviewPolicy:CreateHITWithHITType' :: Maybe ReviewPolicy
assignmentReviewPolicy = Maybe ReviewPolicy
a} :: CreateHITWithHITType)
createHITWithHITType_hITLayoutId :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_hITLayoutId :: Lens' CreateHITWithHITType (Maybe Text)
createHITWithHITType_hITLayoutId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe Text
hITLayoutId :: Maybe Text
$sel:hITLayoutId:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
hITLayoutId} -> Maybe Text
hITLayoutId) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe Text
a -> CreateHITWithHITType
s {$sel:hITLayoutId:CreateHITWithHITType' :: Maybe Text
hITLayoutId = Maybe Text
a} :: CreateHITWithHITType)
createHITWithHITType_hITLayoutParameters :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe [HITLayoutParameter])
createHITWithHITType_hITLayoutParameters :: Lens' CreateHITWithHITType (Maybe [HITLayoutParameter])
createHITWithHITType_hITLayoutParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe [HITLayoutParameter]
hITLayoutParameters :: Maybe [HITLayoutParameter]
$sel:hITLayoutParameters:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe [HITLayoutParameter]
hITLayoutParameters} -> Maybe [HITLayoutParameter]
hITLayoutParameters) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe [HITLayoutParameter]
a -> CreateHITWithHITType
s {$sel:hITLayoutParameters:CreateHITWithHITType' :: Maybe [HITLayoutParameter]
hITLayoutParameters = Maybe [HITLayoutParameter]
a} :: CreateHITWithHITType) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createHITWithHITType_hITReviewPolicy :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe ReviewPolicy)
createHITWithHITType_hITReviewPolicy :: Lens' CreateHITWithHITType (Maybe ReviewPolicy)
createHITWithHITType_hITReviewPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe ReviewPolicy
hITReviewPolicy :: Maybe ReviewPolicy
$sel:hITReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
hITReviewPolicy} -> Maybe ReviewPolicy
hITReviewPolicy) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe ReviewPolicy
a -> CreateHITWithHITType
s {$sel:hITReviewPolicy:CreateHITWithHITType' :: Maybe ReviewPolicy
hITReviewPolicy = Maybe ReviewPolicy
a} :: CreateHITWithHITType)
createHITWithHITType_maxAssignments :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Int)
createHITWithHITType_maxAssignments :: Lens' CreateHITWithHITType (Maybe Int)
createHITWithHITType_maxAssignments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe Int
maxAssignments :: Maybe Int
$sel:maxAssignments:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Int
maxAssignments} -> Maybe Int
maxAssignments) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe Int
a -> CreateHITWithHITType
s {$sel:maxAssignments:CreateHITWithHITType' :: Maybe Int
maxAssignments = Maybe Int
a} :: CreateHITWithHITType)
createHITWithHITType_question :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_question :: Lens' CreateHITWithHITType (Maybe Text)
createHITWithHITType_question = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe Text
question :: Maybe Text
$sel:question:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
question} -> Maybe Text
question) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe Text
a -> CreateHITWithHITType
s {$sel:question:CreateHITWithHITType' :: Maybe Text
question = Maybe Text
a} :: CreateHITWithHITType)
createHITWithHITType_requesterAnnotation :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_requesterAnnotation :: Lens' CreateHITWithHITType (Maybe Text)
createHITWithHITType_requesterAnnotation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe Text
requesterAnnotation :: Maybe Text
$sel:requesterAnnotation:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
requesterAnnotation} -> Maybe Text
requesterAnnotation) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe Text
a -> CreateHITWithHITType
s {$sel:requesterAnnotation:CreateHITWithHITType' :: Maybe Text
requesterAnnotation = Maybe Text
a} :: CreateHITWithHITType)
createHITWithHITType_uniqueRequestToken :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_uniqueRequestToken :: Lens' CreateHITWithHITType (Maybe Text)
createHITWithHITType_uniqueRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Maybe Text
uniqueRequestToken :: Maybe Text
$sel:uniqueRequestToken:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
uniqueRequestToken} -> Maybe Text
uniqueRequestToken) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Maybe Text
a -> CreateHITWithHITType
s {$sel:uniqueRequestToken:CreateHITWithHITType' :: Maybe Text
uniqueRequestToken = Maybe Text
a} :: CreateHITWithHITType)
createHITWithHITType_hITTypeId :: Lens.Lens' CreateHITWithHITType Prelude.Text
createHITWithHITType_hITTypeId :: Lens' CreateHITWithHITType Text
createHITWithHITType_hITTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Text
hITTypeId :: Text
$sel:hITTypeId:CreateHITWithHITType' :: CreateHITWithHITType -> Text
hITTypeId} -> Text
hITTypeId) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Text
a -> CreateHITWithHITType
s {$sel:hITTypeId:CreateHITWithHITType' :: Text
hITTypeId = Text
a} :: CreateHITWithHITType)
createHITWithHITType_lifetimeInSeconds :: Lens.Lens' CreateHITWithHITType Prelude.Integer
createHITWithHITType_lifetimeInSeconds :: Lens' CreateHITWithHITType Integer
createHITWithHITType_lifetimeInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITType' {Integer
lifetimeInSeconds :: Integer
$sel:lifetimeInSeconds:CreateHITWithHITType' :: CreateHITWithHITType -> Integer
lifetimeInSeconds} -> Integer
lifetimeInSeconds) (\s :: CreateHITWithHITType
s@CreateHITWithHITType' {} Integer
a -> CreateHITWithHITType
s {$sel:lifetimeInSeconds:CreateHITWithHITType' :: Integer
lifetimeInSeconds = Integer
a} :: CreateHITWithHITType)
instance Core.AWSRequest CreateHITWithHITType where
type
AWSResponse CreateHITWithHITType =
CreateHITWithHITTypeResponse
request :: (Service -> Service)
-> CreateHITWithHITType -> Request CreateHITWithHITType
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateHITWithHITType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateHITWithHITType)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe HIT -> Int -> CreateHITWithHITTypeResponse
CreateHITWithHITTypeResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"HIT")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateHITWithHITType where
hashWithSalt :: Int -> CreateHITWithHITType -> Int
hashWithSalt Int
_salt CreateHITWithHITType' {Integer
Maybe Int
Maybe [HITLayoutParameter]
Maybe Text
Maybe ReviewPolicy
Text
lifetimeInSeconds :: Integer
hITTypeId :: Text
uniqueRequestToken :: Maybe Text
requesterAnnotation :: Maybe Text
question :: Maybe Text
maxAssignments :: Maybe Int
hITReviewPolicy :: Maybe ReviewPolicy
hITLayoutParameters :: Maybe [HITLayoutParameter]
hITLayoutId :: Maybe Text
assignmentReviewPolicy :: Maybe ReviewPolicy
$sel:lifetimeInSeconds:CreateHITWithHITType' :: CreateHITWithHITType -> Integer
$sel:hITTypeId:CreateHITWithHITType' :: CreateHITWithHITType -> Text
$sel:uniqueRequestToken:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:requesterAnnotation:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:question:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:maxAssignments:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Int
$sel:hITReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
$sel:hITLayoutParameters:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe [HITLayoutParameter]
$sel:hITLayoutId:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:assignmentReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReviewPolicy
assignmentReviewPolicy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hITLayoutId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [HITLayoutParameter]
hITLayoutParameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReviewPolicy
hITReviewPolicy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxAssignments
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
question
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
requesterAnnotation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uniqueRequestToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hITTypeId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
lifetimeInSeconds
instance Prelude.NFData CreateHITWithHITType where
rnf :: CreateHITWithHITType -> ()
rnf CreateHITWithHITType' {Integer
Maybe Int
Maybe [HITLayoutParameter]
Maybe Text
Maybe ReviewPolicy
Text
lifetimeInSeconds :: Integer
hITTypeId :: Text
uniqueRequestToken :: Maybe Text
requesterAnnotation :: Maybe Text
question :: Maybe Text
maxAssignments :: Maybe Int
hITReviewPolicy :: Maybe ReviewPolicy
hITLayoutParameters :: Maybe [HITLayoutParameter]
hITLayoutId :: Maybe Text
assignmentReviewPolicy :: Maybe ReviewPolicy
$sel:lifetimeInSeconds:CreateHITWithHITType' :: CreateHITWithHITType -> Integer
$sel:hITTypeId:CreateHITWithHITType' :: CreateHITWithHITType -> Text
$sel:uniqueRequestToken:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:requesterAnnotation:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:question:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:maxAssignments:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Int
$sel:hITReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
$sel:hITLayoutParameters:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe [HITLayoutParameter]
$sel:hITLayoutId:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:assignmentReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReviewPolicy
assignmentReviewPolicy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hITLayoutId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [HITLayoutParameter]
hITLayoutParameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReviewPolicy
hITReviewPolicy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxAssignments
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
question
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requesterAnnotation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uniqueRequestToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
hITTypeId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
lifetimeInSeconds
instance Data.ToHeaders CreateHITWithHITType where
toHeaders :: CreateHITWithHITType -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"MTurkRequesterServiceV20170117.CreateHITWithHITType" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateHITWithHITType where
toJSON :: CreateHITWithHITType -> Value
toJSON CreateHITWithHITType' {Integer
Maybe Int
Maybe [HITLayoutParameter]
Maybe Text
Maybe ReviewPolicy
Text
lifetimeInSeconds :: Integer
hITTypeId :: Text
uniqueRequestToken :: Maybe Text
requesterAnnotation :: Maybe Text
question :: Maybe Text
maxAssignments :: Maybe Int
hITReviewPolicy :: Maybe ReviewPolicy
hITLayoutParameters :: Maybe [HITLayoutParameter]
hITLayoutId :: Maybe Text
assignmentReviewPolicy :: Maybe ReviewPolicy
$sel:lifetimeInSeconds:CreateHITWithHITType' :: CreateHITWithHITType -> Integer
$sel:hITTypeId:CreateHITWithHITType' :: CreateHITWithHITType -> Text
$sel:uniqueRequestToken:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:requesterAnnotation:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:question:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:maxAssignments:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Int
$sel:hITReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
$sel:hITLayoutParameters:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe [HITLayoutParameter]
$sel:hITLayoutId:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:assignmentReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AssignmentReviewPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReviewPolicy
assignmentReviewPolicy,
(Key
"HITLayoutId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
hITLayoutId,
(Key
"HITLayoutParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [HITLayoutParameter]
hITLayoutParameters,
(Key
"HITReviewPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReviewPolicy
hITReviewPolicy,
(Key
"MaxAssignments" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxAssignments,
(Key
"Question" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
question,
(Key
"RequesterAnnotation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
requesterAnnotation,
(Key
"UniqueRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
uniqueRequestToken,
forall a. a -> Maybe a
Prelude.Just (Key
"HITTypeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
hITTypeId),
forall a. a -> Maybe a
Prelude.Just
(Key
"LifetimeInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Integer
lifetimeInSeconds)
]
)
instance Data.ToPath CreateHITWithHITType where
toPath :: CreateHITWithHITType -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateHITWithHITType where
toQuery :: CreateHITWithHITType -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateHITWithHITTypeResponse = CreateHITWithHITTypeResponse'
{
CreateHITWithHITTypeResponse -> Maybe HIT
hit :: Prelude.Maybe HIT,
CreateHITWithHITTypeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateHITWithHITTypeResponse
-> CreateHITWithHITTypeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHITWithHITTypeResponse
-> CreateHITWithHITTypeResponse -> Bool
$c/= :: CreateHITWithHITTypeResponse
-> CreateHITWithHITTypeResponse -> Bool
== :: CreateHITWithHITTypeResponse
-> CreateHITWithHITTypeResponse -> Bool
$c== :: CreateHITWithHITTypeResponse
-> CreateHITWithHITTypeResponse -> Bool
Prelude.Eq, ReadPrec [CreateHITWithHITTypeResponse]
ReadPrec CreateHITWithHITTypeResponse
Int -> ReadS CreateHITWithHITTypeResponse
ReadS [CreateHITWithHITTypeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHITWithHITTypeResponse]
$creadListPrec :: ReadPrec [CreateHITWithHITTypeResponse]
readPrec :: ReadPrec CreateHITWithHITTypeResponse
$creadPrec :: ReadPrec CreateHITWithHITTypeResponse
readList :: ReadS [CreateHITWithHITTypeResponse]
$creadList :: ReadS [CreateHITWithHITTypeResponse]
readsPrec :: Int -> ReadS CreateHITWithHITTypeResponse
$creadsPrec :: Int -> ReadS CreateHITWithHITTypeResponse
Prelude.Read, Int -> CreateHITWithHITTypeResponse -> ShowS
[CreateHITWithHITTypeResponse] -> ShowS
CreateHITWithHITTypeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHITWithHITTypeResponse] -> ShowS
$cshowList :: [CreateHITWithHITTypeResponse] -> ShowS
show :: CreateHITWithHITTypeResponse -> String
$cshow :: CreateHITWithHITTypeResponse -> String
showsPrec :: Int -> CreateHITWithHITTypeResponse -> ShowS
$cshowsPrec :: Int -> CreateHITWithHITTypeResponse -> ShowS
Prelude.Show, forall x.
Rep CreateHITWithHITTypeResponse x -> CreateHITWithHITTypeResponse
forall x.
CreateHITWithHITTypeResponse -> Rep CreateHITWithHITTypeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateHITWithHITTypeResponse x -> CreateHITWithHITTypeResponse
$cfrom :: forall x.
CreateHITWithHITTypeResponse -> Rep CreateHITWithHITTypeResponse x
Prelude.Generic)
newCreateHITWithHITTypeResponse ::
Prelude.Int ->
CreateHITWithHITTypeResponse
newCreateHITWithHITTypeResponse :: Int -> CreateHITWithHITTypeResponse
newCreateHITWithHITTypeResponse Int
pHttpStatus_ =
CreateHITWithHITTypeResponse'
{ $sel:hit:CreateHITWithHITTypeResponse' :: Maybe HIT
hit =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateHITWithHITTypeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createHITWithHITTypeResponse_hit :: Lens.Lens' CreateHITWithHITTypeResponse (Prelude.Maybe HIT)
createHITWithHITTypeResponse_hit :: Lens' CreateHITWithHITTypeResponse (Maybe HIT)
createHITWithHITTypeResponse_hit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITTypeResponse' {Maybe HIT
hit :: Maybe HIT
$sel:hit:CreateHITWithHITTypeResponse' :: CreateHITWithHITTypeResponse -> Maybe HIT
hit} -> Maybe HIT
hit) (\s :: CreateHITWithHITTypeResponse
s@CreateHITWithHITTypeResponse' {} Maybe HIT
a -> CreateHITWithHITTypeResponse
s {$sel:hit:CreateHITWithHITTypeResponse' :: Maybe HIT
hit = Maybe HIT
a} :: CreateHITWithHITTypeResponse)
createHITWithHITTypeResponse_httpStatus :: Lens.Lens' CreateHITWithHITTypeResponse Prelude.Int
createHITWithHITTypeResponse_httpStatus :: Lens' CreateHITWithHITTypeResponse Int
createHITWithHITTypeResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHITWithHITTypeResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateHITWithHITTypeResponse' :: CreateHITWithHITTypeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateHITWithHITTypeResponse
s@CreateHITWithHITTypeResponse' {} Int
a -> CreateHITWithHITTypeResponse
s {$sel:httpStatus:CreateHITWithHITTypeResponse' :: Int
httpStatus = Int
a} :: CreateHITWithHITTypeResponse)
instance Prelude.NFData CreateHITWithHITTypeResponse where
rnf :: CreateHITWithHITTypeResponse -> ()
rnf CreateHITWithHITTypeResponse' {Int
Maybe HIT
httpStatus :: Int
hit :: Maybe HIT
$sel:httpStatus:CreateHITWithHITTypeResponse' :: CreateHITWithHITTypeResponse -> Int
$sel:hit:CreateHITWithHITTypeResponse' :: CreateHITWithHITTypeResponse -> Maybe HIT
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe HIT
hit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus