{-# 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_hITReviewPolicy,
createHITWithHITType_uniqueRequestToken,
createHITWithHITType_requesterAnnotation,
createHITWithHITType_maxAssignments,
createHITWithHITType_hITLayoutId,
createHITWithHITType_hITLayoutParameters,
createHITWithHITType_question,
createHITWithHITType_assignmentReviewPolicy,
createHITWithHITType_hITTypeId,
createHITWithHITType_lifetimeInSeconds,
CreateHITWithHITTypeResponse (..),
newCreateHITWithHITTypeResponse,
createHITWithHITTypeResponse_hit,
createHITWithHITTypeResponse_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 CreateHITWithHITType = CreateHITWithHITType'
{
CreateHITWithHITType -> Maybe ReviewPolicy
hITReviewPolicy :: Prelude.Maybe ReviewPolicy,
CreateHITWithHITType -> Maybe Text
uniqueRequestToken :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Maybe Text
requesterAnnotation :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Maybe Int
maxAssignments :: Prelude.Maybe Prelude.Int,
CreateHITWithHITType -> Maybe Text
hITLayoutId :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Maybe [HITLayoutParameter]
hITLayoutParameters :: Prelude.Maybe [HITLayoutParameter],
CreateHITWithHITType -> Maybe Text
question :: Prelude.Maybe Prelude.Text,
CreateHITWithHITType -> Maybe ReviewPolicy
assignmentReviewPolicy :: Prelude.Maybe ReviewPolicy,
CreateHITWithHITType -> Text
hITTypeId :: Prelude.Text,
CreateHITWithHITType -> Integer
lifetimeInSeconds :: Prelude.Integer
}
deriving (CreateHITWithHITType -> CreateHITWithHITType -> Bool
(CreateHITWithHITType -> CreateHITWithHITType -> Bool)
-> (CreateHITWithHITType -> CreateHITWithHITType -> Bool)
-> Eq CreateHITWithHITType
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]
(Int -> ReadS CreateHITWithHITType)
-> ReadS [CreateHITWithHITType]
-> ReadPrec CreateHITWithHITType
-> ReadPrec [CreateHITWithHITType]
-> Read 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
(Int -> CreateHITWithHITType -> ShowS)
-> (CreateHITWithHITType -> String)
-> ([CreateHITWithHITType] -> ShowS)
-> Show CreateHITWithHITType
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. CreateHITWithHITType -> Rep CreateHITWithHITType x)
-> (forall x. Rep CreateHITWithHITType x -> CreateHITWithHITType)
-> Generic CreateHITWithHITType
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' :: Maybe ReviewPolicy
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [HITLayoutParameter]
-> Maybe Text
-> Maybe ReviewPolicy
-> Text
-> Integer
-> CreateHITWithHITType
CreateHITWithHITType'
{ $sel:hITReviewPolicy:CreateHITWithHITType' :: Maybe ReviewPolicy
hITReviewPolicy =
Maybe ReviewPolicy
forall a. Maybe a
Prelude.Nothing,
$sel:uniqueRequestToken:CreateHITWithHITType' :: Maybe Text
uniqueRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:requesterAnnotation:CreateHITWithHITType' :: Maybe Text
requesterAnnotation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxAssignments:CreateHITWithHITType' :: Maybe Int
maxAssignments = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:hITLayoutId:CreateHITWithHITType' :: Maybe Text
hITLayoutId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hITLayoutParameters:CreateHITWithHITType' :: Maybe [HITLayoutParameter]
hITLayoutParameters = Maybe [HITLayoutParameter]
forall a. Maybe a
Prelude.Nothing,
$sel:question:CreateHITWithHITType' :: Maybe Text
question = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assignmentReviewPolicy:CreateHITWithHITType' :: Maybe ReviewPolicy
assignmentReviewPolicy = Maybe ReviewPolicy
forall a. Maybe a
Prelude.Nothing,
$sel:hITTypeId:CreateHITWithHITType' :: Text
hITTypeId = Text
pHITTypeId_,
$sel:lifetimeInSeconds:CreateHITWithHITType' :: Integer
lifetimeInSeconds = Integer
pLifetimeInSeconds_
}
createHITWithHITType_hITReviewPolicy :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe ReviewPolicy)
createHITWithHITType_hITReviewPolicy :: (Maybe ReviewPolicy -> f (Maybe ReviewPolicy))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_hITReviewPolicy = (CreateHITWithHITType -> Maybe ReviewPolicy)
-> (CreateHITWithHITType
-> Maybe ReviewPolicy -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType
CreateHITWithHITType
(Maybe ReviewPolicy)
(Maybe ReviewPolicy)
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_uniqueRequestToken :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_uniqueRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_uniqueRequestToken = (CreateHITWithHITType -> Maybe Text)
-> (CreateHITWithHITType -> Maybe Text -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType CreateHITWithHITType (Maybe Text) (Maybe Text)
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_requesterAnnotation :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_requesterAnnotation :: (Maybe Text -> f (Maybe Text))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_requesterAnnotation = (CreateHITWithHITType -> Maybe Text)
-> (CreateHITWithHITType -> Maybe Text -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType CreateHITWithHITType (Maybe Text) (Maybe Text)
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_maxAssignments :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Int)
createHITWithHITType_maxAssignments :: (Maybe Int -> f (Maybe Int))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_maxAssignments = (CreateHITWithHITType -> Maybe Int)
-> (CreateHITWithHITType -> Maybe Int -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType CreateHITWithHITType (Maybe Int) (Maybe Int)
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_hITLayoutId :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_hITLayoutId :: (Maybe Text -> f (Maybe Text))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_hITLayoutId = (CreateHITWithHITType -> Maybe Text)
-> (CreateHITWithHITType -> Maybe Text -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType CreateHITWithHITType (Maybe Text) (Maybe Text)
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 :: (Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_hITLayoutParameters = (CreateHITWithHITType -> Maybe [HITLayoutParameter])
-> (CreateHITWithHITType
-> Maybe [HITLayoutParameter] -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType
CreateHITWithHITType
(Maybe [HITLayoutParameter])
(Maybe [HITLayoutParameter])
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) ((Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> CreateHITWithHITType -> f CreateHITWithHITType)
-> ((Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> (Maybe [HITLayoutParameter] -> f (Maybe [HITLayoutParameter]))
-> CreateHITWithHITType
-> f CreateHITWithHITType
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
createHITWithHITType_question :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe Prelude.Text)
createHITWithHITType_question :: (Maybe Text -> f (Maybe Text))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_question = (CreateHITWithHITType -> Maybe Text)
-> (CreateHITWithHITType -> Maybe Text -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType CreateHITWithHITType (Maybe Text) (Maybe Text)
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_assignmentReviewPolicy :: Lens.Lens' CreateHITWithHITType (Prelude.Maybe ReviewPolicy)
createHITWithHITType_assignmentReviewPolicy :: (Maybe ReviewPolicy -> f (Maybe ReviewPolicy))
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_assignmentReviewPolicy = (CreateHITWithHITType -> Maybe ReviewPolicy)
-> (CreateHITWithHITType
-> Maybe ReviewPolicy -> CreateHITWithHITType)
-> Lens
CreateHITWithHITType
CreateHITWithHITType
(Maybe ReviewPolicy)
(Maybe ReviewPolicy)
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_hITTypeId :: Lens.Lens' CreateHITWithHITType Prelude.Text
createHITWithHITType_hITTypeId :: (Text -> f Text) -> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_hITTypeId = (CreateHITWithHITType -> Text)
-> (CreateHITWithHITType -> Text -> CreateHITWithHITType)
-> Lens CreateHITWithHITType CreateHITWithHITType Text Text
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 :: (Integer -> f Integer)
-> CreateHITWithHITType -> f CreateHITWithHITType
createHITWithHITType_lifetimeInSeconds = (CreateHITWithHITType -> Integer)
-> (CreateHITWithHITType -> Integer -> CreateHITWithHITType)
-> Lens CreateHITWithHITType CreateHITWithHITType Integer Integer
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 :: CreateHITWithHITType -> Request CreateHITWithHITType
request = Service -> CreateHITWithHITType -> Request CreateHITWithHITType
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateHITWithHITType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateHITWithHITType)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateHITWithHITType))
-> Logger
-> Service
-> Proxy CreateHITWithHITType
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateHITWithHITType)))
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 -> CreateHITWithHITTypeResponse
CreateHITWithHITTypeResponse'
(Maybe HIT -> Int -> CreateHITWithHITTypeResponse)
-> Either String (Maybe HIT)
-> Either String (Int -> CreateHITWithHITTypeResponse)
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 -> CreateHITWithHITTypeResponse)
-> Either String Int -> Either String CreateHITWithHITTypeResponse
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 CreateHITWithHITType
instance Prelude.NFData CreateHITWithHITType
instance Core.ToHeaders CreateHITWithHITType where
toHeaders :: CreateHITWithHITType -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateHITWithHITType -> 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.CreateHITWithHITType" ::
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 CreateHITWithHITType where
toJSON :: CreateHITWithHITType -> Value
toJSON CreateHITWithHITType' {Integer
Maybe Int
Maybe [HITLayoutParameter]
Maybe Text
Maybe ReviewPolicy
Text
lifetimeInSeconds :: Integer
hITTypeId :: Text
assignmentReviewPolicy :: Maybe ReviewPolicy
question :: Maybe Text
hITLayoutParameters :: Maybe [HITLayoutParameter]
hITLayoutId :: Maybe Text
maxAssignments :: Maybe Int
requesterAnnotation :: Maybe Text
uniqueRequestToken :: Maybe Text
hITReviewPolicy :: Maybe ReviewPolicy
$sel:lifetimeInSeconds:CreateHITWithHITType' :: CreateHITWithHITType -> Integer
$sel:hITTypeId:CreateHITWithHITType' :: CreateHITWithHITType -> Text
$sel:assignmentReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe ReviewPolicy
$sel:question:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:hITLayoutParameters:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe [HITLayoutParameter]
$sel:hITLayoutId:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:maxAssignments:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Int
$sel:requesterAnnotation:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:uniqueRequestToken:CreateHITWithHITType' :: CreateHITWithHITType -> Maybe Text
$sel:hITReviewPolicy:CreateHITWithHITType' :: CreateHITWithHITType -> 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
"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
"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
"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
"HITTypeId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
hITTypeId),
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)
]
)
instance Core.ToPath CreateHITWithHITType where
toPath :: CreateHITWithHITType -> ByteString
toPath = ByteString -> CreateHITWithHITType -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateHITWithHITType where
toQuery :: CreateHITWithHITType -> QueryString
toQuery = QueryString -> CreateHITWithHITType -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateHITWithHITTypeResponse
-> CreateHITWithHITTypeResponse -> Bool)
-> (CreateHITWithHITTypeResponse
-> CreateHITWithHITTypeResponse -> Bool)
-> Eq CreateHITWithHITTypeResponse
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]
(Int -> ReadS CreateHITWithHITTypeResponse)
-> ReadS [CreateHITWithHITTypeResponse]
-> ReadPrec CreateHITWithHITTypeResponse
-> ReadPrec [CreateHITWithHITTypeResponse]
-> Read 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
(Int -> CreateHITWithHITTypeResponse -> ShowS)
-> (CreateHITWithHITTypeResponse -> String)
-> ([CreateHITWithHITTypeResponse] -> ShowS)
-> Show CreateHITWithHITTypeResponse
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.
CreateHITWithHITTypeResponse -> Rep CreateHITWithHITTypeResponse x)
-> (forall x.
Rep CreateHITWithHITTypeResponse x -> CreateHITWithHITTypeResponse)
-> Generic CreateHITWithHITTypeResponse
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' :: Maybe HIT -> Int -> CreateHITWithHITTypeResponse
CreateHITWithHITTypeResponse'
{ $sel:hit:CreateHITWithHITTypeResponse' :: Maybe HIT
hit =
Maybe HIT
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateHITWithHITTypeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createHITWithHITTypeResponse_hit :: Lens.Lens' CreateHITWithHITTypeResponse (Prelude.Maybe HIT)
createHITWithHITTypeResponse_hit :: (Maybe HIT -> f (Maybe HIT))
-> CreateHITWithHITTypeResponse -> f CreateHITWithHITTypeResponse
createHITWithHITTypeResponse_hit = (CreateHITWithHITTypeResponse -> Maybe HIT)
-> (CreateHITWithHITTypeResponse
-> Maybe HIT -> CreateHITWithHITTypeResponse)
-> Lens
CreateHITWithHITTypeResponse
CreateHITWithHITTypeResponse
(Maybe HIT)
(Maybe 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 :: (Int -> f Int)
-> CreateHITWithHITTypeResponse -> f CreateHITWithHITTypeResponse
createHITWithHITTypeResponse_httpStatus = (CreateHITWithHITTypeResponse -> Int)
-> (CreateHITWithHITTypeResponse
-> Int -> CreateHITWithHITTypeResponse)
-> Lens
CreateHITWithHITTypeResponse CreateHITWithHITTypeResponse Int Int
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