{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MechanicalTurk.Types.HIT
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MechanicalTurk.Types.HIT 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.HITReviewStatus
import Amazonka.MechanicalTurk.Types.HITStatus
import Amazonka.MechanicalTurk.Types.QualificationRequirement
import qualified Amazonka.Prelude as Prelude

-- | The HIT data structure represents a single HIT, including all the
-- information necessary for a Worker to accept and complete the HIT.
--
-- /See:/ 'newHIT' smart constructor.
data HIT = HIT'
  { -- | The length of time, in seconds, that a Worker has to complete the HIT
    -- after accepting it.
    HIT -> Maybe Integer
assignmentDurationInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The amount of time, in seconds, after the Worker submits an assignment
    -- for the HIT that the results are automatically approved by Amazon
    -- Mechanical Turk. This is the amount of time the Requester has to reject
    -- an assignment submitted by a Worker before the assignment is
    -- auto-approved and the Worker is paid.
    HIT -> Maybe Integer
autoApprovalDelayInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The date and time the HIT was created.
    HIT -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | A general description of the HIT.
    HIT -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date and time the HIT expires.
    HIT -> Maybe POSIX
expiration :: Prelude.Maybe Data.POSIX,
    -- | The ID of the HIT Group of this HIT.
    HIT -> Maybe Text
hITGroupId :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the HIT.
    HIT -> Maybe Text
hITId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the HIT Layout of this HIT.
    HIT -> Maybe Text
hITLayoutId :: Prelude.Maybe Prelude.Text,
    -- | Indicates the review status of the HIT. Valid Values are NotReviewed |
    -- MarkedForReview | ReviewedAppropriate | ReviewedInappropriate.
    HIT -> Maybe HITReviewStatus
hITReviewStatus :: Prelude.Maybe HITReviewStatus,
    -- | The status of the HIT and its assignments. Valid Values are Assignable |
    -- Unassignable | Reviewable | Reviewing | Disposed.
    HIT -> Maybe HITStatus
hITStatus :: Prelude.Maybe HITStatus,
    -- | The ID of the HIT type of this HIT
    HIT -> Maybe Text
hITTypeId :: Prelude.Maybe Prelude.Text,
    -- | One or more words or phrases that describe the HIT, separated by commas.
    -- Search terms similar to the keywords of a HIT are more likely to have
    -- the HIT in the search results.
    HIT -> Maybe Text
keywords :: Prelude.Maybe Prelude.Text,
    -- | The number of times the HIT can be accepted and completed before the HIT
    -- becomes unavailable.
    HIT -> Maybe Int
maxAssignments :: Prelude.Maybe Prelude.Int,
    -- | The number of assignments for this HIT that are available for Workers to
    -- accept.
    HIT -> Maybe Int
numberOfAssignmentsAvailable :: Prelude.Maybe Prelude.Int,
    -- | The number of assignments for this HIT that have been approved or
    -- rejected.
    HIT -> Maybe Int
numberOfAssignmentsCompleted :: Prelude.Maybe Prelude.Int,
    -- | The number of assignments for this HIT that are being previewed or have
    -- been accepted by Workers, but have not yet been submitted, returned, or
    -- abandoned.
    HIT -> Maybe Int
numberOfAssignmentsPending :: Prelude.Maybe Prelude.Int,
    -- | Conditions that a Worker\'s Qualifications must meet in order to accept
    -- the HIT. A HIT can have between zero and ten Qualification requirements.
    -- All requirements must be met in order for a Worker to accept the HIT.
    -- Additionally, other actions can be restricted using the @ActionsGuarded@
    -- field on each @QualificationRequirement@ structure.
    HIT -> Maybe [QualificationRequirement]
qualificationRequirements :: Prelude.Maybe [QualificationRequirement],
    -- | The data the Worker completing the HIT uses produce the results. This is
    -- either either a QuestionForm, HTMLQuestion or an ExternalQuestion data
    -- structure.
    HIT -> Maybe Text
question :: Prelude.Maybe Prelude.Text,
    -- | An arbitrary data field the Requester who created the HIT can use. This
    -- field is visible only to the creator of the HIT.
    HIT -> Maybe Text
requesterAnnotation :: Prelude.Maybe Prelude.Text,
    HIT -> Maybe Text
reward :: Prelude.Maybe Prelude.Text,
    -- | The title of the HIT.
    HIT -> Maybe Text
title :: Prelude.Maybe Prelude.Text
  }
  deriving (HIT -> HIT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HIT -> HIT -> Bool
$c/= :: HIT -> HIT -> Bool
== :: HIT -> HIT -> Bool
$c== :: HIT -> HIT -> Bool
Prelude.Eq, ReadPrec [HIT]
ReadPrec HIT
Int -> ReadS HIT
ReadS [HIT]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HIT]
$creadListPrec :: ReadPrec [HIT]
readPrec :: ReadPrec HIT
$creadPrec :: ReadPrec HIT
readList :: ReadS [HIT]
$creadList :: ReadS [HIT]
readsPrec :: Int -> ReadS HIT
$creadsPrec :: Int -> ReadS HIT
Prelude.Read, Int -> HIT -> ShowS
[HIT] -> ShowS
HIT -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HIT] -> ShowS
$cshowList :: [HIT] -> ShowS
show :: HIT -> String
$cshow :: HIT -> String
showsPrec :: Int -> HIT -> ShowS
$cshowsPrec :: Int -> HIT -> ShowS
Prelude.Show, forall x. Rep HIT x -> HIT
forall x. HIT -> Rep HIT x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HIT x -> HIT
$cfrom :: forall x. HIT -> Rep HIT x
Prelude.Generic)

-- |
-- Create a value of 'HIT' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'assignmentDurationInSeconds', 'hit_assignmentDurationInSeconds' - The length of time, in seconds, that a Worker has to complete the HIT
-- after accepting it.
--
-- 'autoApprovalDelayInSeconds', 'hit_autoApprovalDelayInSeconds' - The amount of time, in seconds, after the Worker submits an assignment
-- for the HIT that the results are automatically approved by Amazon
-- Mechanical Turk. This is the amount of time the Requester has to reject
-- an assignment submitted by a Worker before the assignment is
-- auto-approved and the Worker is paid.
--
-- 'creationTime', 'hit_creationTime' - The date and time the HIT was created.
--
-- 'description', 'hit_description' - A general description of the HIT.
--
-- 'expiration', 'hit_expiration' - The date and time the HIT expires.
--
-- 'hITGroupId', 'hit_hITGroupId' - The ID of the HIT Group of this HIT.
--
-- 'hITId', 'hit_hITId' - A unique identifier for the HIT.
--
-- 'hITLayoutId', 'hit_hITLayoutId' - The ID of the HIT Layout of this HIT.
--
-- 'hITReviewStatus', 'hit_hITReviewStatus' - Indicates the review status of the HIT. Valid Values are NotReviewed |
-- MarkedForReview | ReviewedAppropriate | ReviewedInappropriate.
--
-- 'hITStatus', 'hit_hITStatus' - The status of the HIT and its assignments. Valid Values are Assignable |
-- Unassignable | Reviewable | Reviewing | Disposed.
--
-- 'hITTypeId', 'hit_hITTypeId' - The ID of the HIT type of this HIT
--
-- 'keywords', 'hit_keywords' - One or more words or phrases that describe the HIT, separated by commas.
-- Search terms similar to the keywords of a HIT are more likely to have
-- the HIT in the search results.
--
-- 'maxAssignments', 'hit_maxAssignments' - The number of times the HIT can be accepted and completed before the HIT
-- becomes unavailable.
--
-- 'numberOfAssignmentsAvailable', 'hit_numberOfAssignmentsAvailable' - The number of assignments for this HIT that are available for Workers to
-- accept.
--
-- 'numberOfAssignmentsCompleted', 'hit_numberOfAssignmentsCompleted' - The number of assignments for this HIT that have been approved or
-- rejected.
--
-- 'numberOfAssignmentsPending', 'hit_numberOfAssignmentsPending' - The number of assignments for this HIT that are being previewed or have
-- been accepted by Workers, but have not yet been submitted, returned, or
-- abandoned.
--
-- 'qualificationRequirements', 'hit_qualificationRequirements' - Conditions that a Worker\'s Qualifications must meet in order to accept
-- the HIT. A HIT can have between zero and ten Qualification requirements.
-- All requirements must be met in order for a Worker to accept the HIT.
-- Additionally, other actions can be restricted using the @ActionsGuarded@
-- field on each @QualificationRequirement@ structure.
--
-- 'question', 'hit_question' - The data the Worker completing the HIT uses produce the results. This is
-- either either a QuestionForm, HTMLQuestion or an ExternalQuestion data
-- structure.
--
-- 'requesterAnnotation', 'hit_requesterAnnotation' - An arbitrary data field the Requester who created the HIT can use. This
-- field is visible only to the creator of the HIT.
--
-- 'reward', 'hit_reward' - Undocumented member.
--
-- 'title', 'hit_title' - The title of the HIT.
newHIT ::
  HIT
newHIT :: HIT
newHIT =
  HIT'
    { $sel:assignmentDurationInSeconds:HIT' :: Maybe Integer
assignmentDurationInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:autoApprovalDelayInSeconds:HIT' :: Maybe Integer
autoApprovalDelayInSeconds = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:HIT' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:HIT' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:expiration:HIT' :: Maybe POSIX
expiration = forall a. Maybe a
Prelude.Nothing,
      $sel:hITGroupId:HIT' :: Maybe Text
hITGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:hITId:HIT' :: Maybe Text
hITId = forall a. Maybe a
Prelude.Nothing,
      $sel:hITLayoutId:HIT' :: Maybe Text
hITLayoutId = forall a. Maybe a
Prelude.Nothing,
      $sel:hITReviewStatus:HIT' :: Maybe HITReviewStatus
hITReviewStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:hITStatus:HIT' :: Maybe HITStatus
hITStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:hITTypeId:HIT' :: Maybe Text
hITTypeId = forall a. Maybe a
Prelude.Nothing,
      $sel:keywords:HIT' :: Maybe Text
keywords = forall a. Maybe a
Prelude.Nothing,
      $sel:maxAssignments:HIT' :: Maybe Int
maxAssignments = forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfAssignmentsAvailable:HIT' :: Maybe Int
numberOfAssignmentsAvailable = forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfAssignmentsCompleted:HIT' :: Maybe Int
numberOfAssignmentsCompleted = forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfAssignmentsPending:HIT' :: Maybe Int
numberOfAssignmentsPending = forall a. Maybe a
Prelude.Nothing,
      $sel:qualificationRequirements:HIT' :: Maybe [QualificationRequirement]
qualificationRequirements = forall a. Maybe a
Prelude.Nothing,
      $sel:question:HIT' :: Maybe Text
question = forall a. Maybe a
Prelude.Nothing,
      $sel:requesterAnnotation:HIT' :: Maybe Text
requesterAnnotation = forall a. Maybe a
Prelude.Nothing,
      $sel:reward:HIT' :: Maybe Text
reward = forall a. Maybe a
Prelude.Nothing,
      $sel:title:HIT' :: Maybe Text
title = forall a. Maybe a
Prelude.Nothing
    }

-- | The length of time, in seconds, that a Worker has to complete the HIT
-- after accepting it.
hit_assignmentDurationInSeconds :: Lens.Lens' HIT (Prelude.Maybe Prelude.Integer)
hit_assignmentDurationInSeconds :: Lens' HIT (Maybe Integer)
hit_assignmentDurationInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Integer
assignmentDurationInSeconds :: Maybe Integer
$sel:assignmentDurationInSeconds:HIT' :: HIT -> Maybe Integer
assignmentDurationInSeconds} -> Maybe Integer
assignmentDurationInSeconds) (\s :: HIT
s@HIT' {} Maybe Integer
a -> HIT
s {$sel:assignmentDurationInSeconds:HIT' :: Maybe Integer
assignmentDurationInSeconds = Maybe Integer
a} :: HIT)

-- | The amount of time, in seconds, after the Worker submits an assignment
-- for the HIT that the results are automatically approved by Amazon
-- Mechanical Turk. This is the amount of time the Requester has to reject
-- an assignment submitted by a Worker before the assignment is
-- auto-approved and the Worker is paid.
hit_autoApprovalDelayInSeconds :: Lens.Lens' HIT (Prelude.Maybe Prelude.Integer)
hit_autoApprovalDelayInSeconds :: Lens' HIT (Maybe Integer)
hit_autoApprovalDelayInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Integer
autoApprovalDelayInSeconds :: Maybe Integer
$sel:autoApprovalDelayInSeconds:HIT' :: HIT -> Maybe Integer
autoApprovalDelayInSeconds} -> Maybe Integer
autoApprovalDelayInSeconds) (\s :: HIT
s@HIT' {} Maybe Integer
a -> HIT
s {$sel:autoApprovalDelayInSeconds:HIT' :: Maybe Integer
autoApprovalDelayInSeconds = Maybe Integer
a} :: HIT)

-- | The date and time the HIT was created.
hit_creationTime :: Lens.Lens' HIT (Prelude.Maybe Prelude.UTCTime)
hit_creationTime :: Lens' HIT (Maybe UTCTime)
hit_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:HIT' :: HIT -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: HIT
s@HIT' {} Maybe POSIX
a -> HIT
s {$sel:creationTime:HIT' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: HIT) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A general description of the HIT.
hit_description :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_description :: Lens' HIT (Maybe Text)
hit_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
description :: Maybe Text
$sel:description:HIT' :: HIT -> Maybe Text
description} -> Maybe Text
description) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:description:HIT' :: Maybe Text
description = Maybe Text
a} :: HIT)

-- | The date and time the HIT expires.
hit_expiration :: Lens.Lens' HIT (Prelude.Maybe Prelude.UTCTime)
hit_expiration :: Lens' HIT (Maybe UTCTime)
hit_expiration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe POSIX
expiration :: Maybe POSIX
$sel:expiration:HIT' :: HIT -> Maybe POSIX
expiration} -> Maybe POSIX
expiration) (\s :: HIT
s@HIT' {} Maybe POSIX
a -> HIT
s {$sel:expiration:HIT' :: Maybe POSIX
expiration = Maybe POSIX
a} :: HIT) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ID of the HIT Group of this HIT.
hit_hITGroupId :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_hITGroupId :: Lens' HIT (Maybe Text)
hit_hITGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
hITGroupId :: Maybe Text
$sel:hITGroupId:HIT' :: HIT -> Maybe Text
hITGroupId} -> Maybe Text
hITGroupId) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:hITGroupId:HIT' :: Maybe Text
hITGroupId = Maybe Text
a} :: HIT)

-- | A unique identifier for the HIT.
hit_hITId :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_hITId :: Lens' HIT (Maybe Text)
hit_hITId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
hITId :: Maybe Text
$sel:hITId:HIT' :: HIT -> Maybe Text
hITId} -> Maybe Text
hITId) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:hITId:HIT' :: Maybe Text
hITId = Maybe Text
a} :: HIT)

-- | The ID of the HIT Layout of this HIT.
hit_hITLayoutId :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_hITLayoutId :: Lens' HIT (Maybe Text)
hit_hITLayoutId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
hITLayoutId :: Maybe Text
$sel:hITLayoutId:HIT' :: HIT -> Maybe Text
hITLayoutId} -> Maybe Text
hITLayoutId) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:hITLayoutId:HIT' :: Maybe Text
hITLayoutId = Maybe Text
a} :: HIT)

-- | Indicates the review status of the HIT. Valid Values are NotReviewed |
-- MarkedForReview | ReviewedAppropriate | ReviewedInappropriate.
hit_hITReviewStatus :: Lens.Lens' HIT (Prelude.Maybe HITReviewStatus)
hit_hITReviewStatus :: Lens' HIT (Maybe HITReviewStatus)
hit_hITReviewStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe HITReviewStatus
hITReviewStatus :: Maybe HITReviewStatus
$sel:hITReviewStatus:HIT' :: HIT -> Maybe HITReviewStatus
hITReviewStatus} -> Maybe HITReviewStatus
hITReviewStatus) (\s :: HIT
s@HIT' {} Maybe HITReviewStatus
a -> HIT
s {$sel:hITReviewStatus:HIT' :: Maybe HITReviewStatus
hITReviewStatus = Maybe HITReviewStatus
a} :: HIT)

-- | The status of the HIT and its assignments. Valid Values are Assignable |
-- Unassignable | Reviewable | Reviewing | Disposed.
hit_hITStatus :: Lens.Lens' HIT (Prelude.Maybe HITStatus)
hit_hITStatus :: Lens' HIT (Maybe HITStatus)
hit_hITStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe HITStatus
hITStatus :: Maybe HITStatus
$sel:hITStatus:HIT' :: HIT -> Maybe HITStatus
hITStatus} -> Maybe HITStatus
hITStatus) (\s :: HIT
s@HIT' {} Maybe HITStatus
a -> HIT
s {$sel:hITStatus:HIT' :: Maybe HITStatus
hITStatus = Maybe HITStatus
a} :: HIT)

-- | The ID of the HIT type of this HIT
hit_hITTypeId :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_hITTypeId :: Lens' HIT (Maybe Text)
hit_hITTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
hITTypeId :: Maybe Text
$sel:hITTypeId:HIT' :: HIT -> Maybe Text
hITTypeId} -> Maybe Text
hITTypeId) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:hITTypeId:HIT' :: Maybe Text
hITTypeId = Maybe Text
a} :: HIT)

-- | One or more words or phrases that describe the HIT, separated by commas.
-- Search terms similar to the keywords of a HIT are more likely to have
-- the HIT in the search results.
hit_keywords :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_keywords :: Lens' HIT (Maybe Text)
hit_keywords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
keywords :: Maybe Text
$sel:keywords:HIT' :: HIT -> Maybe Text
keywords} -> Maybe Text
keywords) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:keywords:HIT' :: Maybe Text
keywords = Maybe Text
a} :: HIT)

-- | The number of times the HIT can be accepted and completed before the HIT
-- becomes unavailable.
hit_maxAssignments :: Lens.Lens' HIT (Prelude.Maybe Prelude.Int)
hit_maxAssignments :: Lens' HIT (Maybe Int)
hit_maxAssignments = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Int
maxAssignments :: Maybe Int
$sel:maxAssignments:HIT' :: HIT -> Maybe Int
maxAssignments} -> Maybe Int
maxAssignments) (\s :: HIT
s@HIT' {} Maybe Int
a -> HIT
s {$sel:maxAssignments:HIT' :: Maybe Int
maxAssignments = Maybe Int
a} :: HIT)

-- | The number of assignments for this HIT that are available for Workers to
-- accept.
hit_numberOfAssignmentsAvailable :: Lens.Lens' HIT (Prelude.Maybe Prelude.Int)
hit_numberOfAssignmentsAvailable :: Lens' HIT (Maybe Int)
hit_numberOfAssignmentsAvailable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Int
numberOfAssignmentsAvailable :: Maybe Int
$sel:numberOfAssignmentsAvailable:HIT' :: HIT -> Maybe Int
numberOfAssignmentsAvailable} -> Maybe Int
numberOfAssignmentsAvailable) (\s :: HIT
s@HIT' {} Maybe Int
a -> HIT
s {$sel:numberOfAssignmentsAvailable:HIT' :: Maybe Int
numberOfAssignmentsAvailable = Maybe Int
a} :: HIT)

-- | The number of assignments for this HIT that have been approved or
-- rejected.
hit_numberOfAssignmentsCompleted :: Lens.Lens' HIT (Prelude.Maybe Prelude.Int)
hit_numberOfAssignmentsCompleted :: Lens' HIT (Maybe Int)
hit_numberOfAssignmentsCompleted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Int
numberOfAssignmentsCompleted :: Maybe Int
$sel:numberOfAssignmentsCompleted:HIT' :: HIT -> Maybe Int
numberOfAssignmentsCompleted} -> Maybe Int
numberOfAssignmentsCompleted) (\s :: HIT
s@HIT' {} Maybe Int
a -> HIT
s {$sel:numberOfAssignmentsCompleted:HIT' :: Maybe Int
numberOfAssignmentsCompleted = Maybe Int
a} :: HIT)

-- | The number of assignments for this HIT that are being previewed or have
-- been accepted by Workers, but have not yet been submitted, returned, or
-- abandoned.
hit_numberOfAssignmentsPending :: Lens.Lens' HIT (Prelude.Maybe Prelude.Int)
hit_numberOfAssignmentsPending :: Lens' HIT (Maybe Int)
hit_numberOfAssignmentsPending = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Int
numberOfAssignmentsPending :: Maybe Int
$sel:numberOfAssignmentsPending:HIT' :: HIT -> Maybe Int
numberOfAssignmentsPending} -> Maybe Int
numberOfAssignmentsPending) (\s :: HIT
s@HIT' {} Maybe Int
a -> HIT
s {$sel:numberOfAssignmentsPending:HIT' :: Maybe Int
numberOfAssignmentsPending = Maybe Int
a} :: HIT)

-- | Conditions that a Worker\'s Qualifications must meet in order to accept
-- the HIT. A HIT can have between zero and ten Qualification requirements.
-- All requirements must be met in order for a Worker to accept the HIT.
-- Additionally, other actions can be restricted using the @ActionsGuarded@
-- field on each @QualificationRequirement@ structure.
hit_qualificationRequirements :: Lens.Lens' HIT (Prelude.Maybe [QualificationRequirement])
hit_qualificationRequirements :: Lens' HIT (Maybe [QualificationRequirement])
hit_qualificationRequirements = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe [QualificationRequirement]
qualificationRequirements :: Maybe [QualificationRequirement]
$sel:qualificationRequirements:HIT' :: HIT -> Maybe [QualificationRequirement]
qualificationRequirements} -> Maybe [QualificationRequirement]
qualificationRequirements) (\s :: HIT
s@HIT' {} Maybe [QualificationRequirement]
a -> HIT
s {$sel:qualificationRequirements:HIT' :: Maybe [QualificationRequirement]
qualificationRequirements = Maybe [QualificationRequirement]
a} :: HIT) 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

-- | The data the Worker completing the HIT uses produce the results. This is
-- either either a QuestionForm, HTMLQuestion or an ExternalQuestion data
-- structure.
hit_question :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_question :: Lens' HIT (Maybe Text)
hit_question = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
question :: Maybe Text
$sel:question:HIT' :: HIT -> Maybe Text
question} -> Maybe Text
question) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:question:HIT' :: Maybe Text
question = Maybe Text
a} :: HIT)

-- | An arbitrary data field the Requester who created the HIT can use. This
-- field is visible only to the creator of the HIT.
hit_requesterAnnotation :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_requesterAnnotation :: Lens' HIT (Maybe Text)
hit_requesterAnnotation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
requesterAnnotation :: Maybe Text
$sel:requesterAnnotation:HIT' :: HIT -> Maybe Text
requesterAnnotation} -> Maybe Text
requesterAnnotation) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:requesterAnnotation:HIT' :: Maybe Text
requesterAnnotation = Maybe Text
a} :: HIT)

-- | Undocumented member.
hit_reward :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_reward :: Lens' HIT (Maybe Text)
hit_reward = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
reward :: Maybe Text
$sel:reward:HIT' :: HIT -> Maybe Text
reward} -> Maybe Text
reward) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:reward:HIT' :: Maybe Text
reward = Maybe Text
a} :: HIT)

-- | The title of the HIT.
hit_title :: Lens.Lens' HIT (Prelude.Maybe Prelude.Text)
hit_title :: Lens' HIT (Maybe Text)
hit_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HIT' {Maybe Text
title :: Maybe Text
$sel:title:HIT' :: HIT -> Maybe Text
title} -> Maybe Text
title) (\s :: HIT
s@HIT' {} Maybe Text
a -> HIT
s {$sel:title:HIT' :: Maybe Text
title = Maybe Text
a} :: HIT)

instance Data.FromJSON HIT where
  parseJSON :: Value -> Parser HIT
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HIT"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe HITReviewStatus
-> Maybe HITStatus
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe [QualificationRequirement]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> HIT
HIT'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AssignmentDurationInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AutoApprovalDelayInSeconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Expiration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HITGroupId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HITId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HITLayoutId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HITReviewStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HITStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HITTypeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Keywords")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaxAssignments")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NumberOfAssignmentsAvailable")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NumberOfAssignmentsCompleted")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NumberOfAssignmentsPending")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"QualificationRequirements"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Question")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RequesterAnnotation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Reward")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Title")
      )

instance Prelude.Hashable HIT where
  hashWithSalt :: Int -> HIT -> Int
hashWithSalt Int
_salt HIT' {Maybe Int
Maybe Integer
Maybe [QualificationRequirement]
Maybe Text
Maybe POSIX
Maybe HITReviewStatus
Maybe HITStatus
title :: Maybe Text
reward :: Maybe Text
requesterAnnotation :: Maybe Text
question :: Maybe Text
qualificationRequirements :: Maybe [QualificationRequirement]
numberOfAssignmentsPending :: Maybe Int
numberOfAssignmentsCompleted :: Maybe Int
numberOfAssignmentsAvailable :: Maybe Int
maxAssignments :: Maybe Int
keywords :: Maybe Text
hITTypeId :: Maybe Text
hITStatus :: Maybe HITStatus
hITReviewStatus :: Maybe HITReviewStatus
hITLayoutId :: Maybe Text
hITId :: Maybe Text
hITGroupId :: Maybe Text
expiration :: Maybe POSIX
description :: Maybe Text
creationTime :: Maybe POSIX
autoApprovalDelayInSeconds :: Maybe Integer
assignmentDurationInSeconds :: Maybe Integer
$sel:title:HIT' :: HIT -> Maybe Text
$sel:reward:HIT' :: HIT -> Maybe Text
$sel:requesterAnnotation:HIT' :: HIT -> Maybe Text
$sel:question:HIT' :: HIT -> Maybe Text
$sel:qualificationRequirements:HIT' :: HIT -> Maybe [QualificationRequirement]
$sel:numberOfAssignmentsPending:HIT' :: HIT -> Maybe Int
$sel:numberOfAssignmentsCompleted:HIT' :: HIT -> Maybe Int
$sel:numberOfAssignmentsAvailable:HIT' :: HIT -> Maybe Int
$sel:maxAssignments:HIT' :: HIT -> Maybe Int
$sel:keywords:HIT' :: HIT -> Maybe Text
$sel:hITTypeId:HIT' :: HIT -> Maybe Text
$sel:hITStatus:HIT' :: HIT -> Maybe HITStatus
$sel:hITReviewStatus:HIT' :: HIT -> Maybe HITReviewStatus
$sel:hITLayoutId:HIT' :: HIT -> Maybe Text
$sel:hITId:HIT' :: HIT -> Maybe Text
$sel:hITGroupId:HIT' :: HIT -> Maybe Text
$sel:expiration:HIT' :: HIT -> Maybe POSIX
$sel:description:HIT' :: HIT -> Maybe Text
$sel:creationTime:HIT' :: HIT -> Maybe POSIX
$sel:autoApprovalDelayInSeconds:HIT' :: HIT -> Maybe Integer
$sel:assignmentDurationInSeconds:HIT' :: HIT -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
assignmentDurationInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
autoApprovalDelayInSeconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
expiration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hITGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hITId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hITLayoutId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HITReviewStatus
hITReviewStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HITStatus
hITStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hITTypeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
keywords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxAssignments
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfAssignmentsAvailable
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfAssignmentsCompleted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfAssignmentsPending
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [QualificationRequirement]
qualificationRequirements
      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
reward
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
title

instance Prelude.NFData HIT where
  rnf :: HIT -> ()
rnf HIT' {Maybe Int
Maybe Integer
Maybe [QualificationRequirement]
Maybe Text
Maybe POSIX
Maybe HITReviewStatus
Maybe HITStatus
title :: Maybe Text
reward :: Maybe Text
requesterAnnotation :: Maybe Text
question :: Maybe Text
qualificationRequirements :: Maybe [QualificationRequirement]
numberOfAssignmentsPending :: Maybe Int
numberOfAssignmentsCompleted :: Maybe Int
numberOfAssignmentsAvailable :: Maybe Int
maxAssignments :: Maybe Int
keywords :: Maybe Text
hITTypeId :: Maybe Text
hITStatus :: Maybe HITStatus
hITReviewStatus :: Maybe HITReviewStatus
hITLayoutId :: Maybe Text
hITId :: Maybe Text
hITGroupId :: Maybe Text
expiration :: Maybe POSIX
description :: Maybe Text
creationTime :: Maybe POSIX
autoApprovalDelayInSeconds :: Maybe Integer
assignmentDurationInSeconds :: Maybe Integer
$sel:title:HIT' :: HIT -> Maybe Text
$sel:reward:HIT' :: HIT -> Maybe Text
$sel:requesterAnnotation:HIT' :: HIT -> Maybe Text
$sel:question:HIT' :: HIT -> Maybe Text
$sel:qualificationRequirements:HIT' :: HIT -> Maybe [QualificationRequirement]
$sel:numberOfAssignmentsPending:HIT' :: HIT -> Maybe Int
$sel:numberOfAssignmentsCompleted:HIT' :: HIT -> Maybe Int
$sel:numberOfAssignmentsAvailable:HIT' :: HIT -> Maybe Int
$sel:maxAssignments:HIT' :: HIT -> Maybe Int
$sel:keywords:HIT' :: HIT -> Maybe Text
$sel:hITTypeId:HIT' :: HIT -> Maybe Text
$sel:hITStatus:HIT' :: HIT -> Maybe HITStatus
$sel:hITReviewStatus:HIT' :: HIT -> Maybe HITReviewStatus
$sel:hITLayoutId:HIT' :: HIT -> Maybe Text
$sel:hITId:HIT' :: HIT -> Maybe Text
$sel:hITGroupId:HIT' :: HIT -> Maybe Text
$sel:expiration:HIT' :: HIT -> Maybe POSIX
$sel:description:HIT' :: HIT -> Maybe Text
$sel:creationTime:HIT' :: HIT -> Maybe POSIX
$sel:autoApprovalDelayInSeconds:HIT' :: HIT -> Maybe Integer
$sel:assignmentDurationInSeconds:HIT' :: HIT -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
assignmentDurationInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
autoApprovalDelayInSeconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
expiration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hITGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hITId
      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 HITReviewStatus
hITReviewStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HITStatus
hITStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hITTypeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
keywords
      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 Int
numberOfAssignmentsAvailable
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numberOfAssignmentsCompleted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numberOfAssignmentsPending
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe [QualificationRequirement]
qualificationRequirements
      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
reward
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
title