{-# 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.Assignment
-- 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.Assignment 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.AssignmentStatus
import qualified Amazonka.Prelude as Prelude

-- | The Assignment data structure represents a single assignment of a HIT to
-- a Worker. The assignment tracks the Worker\'s efforts to complete the
-- HIT, and contains the results for later retrieval.
--
-- /See:/ 'newAssignment' smart constructor.
data Assignment = Assignment'
  { -- | The date and time the Worker accepted the assignment.
    Assignment -> Maybe POSIX
acceptTime :: Prelude.Maybe Data.POSIX,
    -- | The Worker\'s answers submitted for the HIT contained in a
    -- QuestionFormAnswers document, if the Worker provides an answer. If the
    -- Worker does not provide any answers, Answer may contain a
    -- QuestionFormAnswers document, or Answer may be empty.
    Assignment -> Maybe Text
answer :: Prelude.Maybe Prelude.Text,
    -- | If the Worker has submitted results and the Requester has approved the
    -- results, ApprovalTime is the date and time the Requester approved the
    -- results. This value is omitted from the assignment if the Requester has
    -- not yet approved the results.
    Assignment -> Maybe POSIX
approvalTime :: Prelude.Maybe Data.POSIX,
    -- | A unique identifier for the assignment.
    Assignment -> Maybe Text
assignmentId :: Prelude.Maybe Prelude.Text,
    -- | The status of the assignment.
    Assignment -> Maybe AssignmentStatus
assignmentStatus :: Prelude.Maybe AssignmentStatus,
    -- | If results have been submitted, AutoApprovalTime is the date and time
    -- the results of the assignment results are considered Approved
    -- automatically if they have not already been explicitly approved or
    -- rejected by the Requester. This value is derived from the auto-approval
    -- delay specified by the Requester in the HIT. This value is omitted from
    -- the assignment if the Worker has not yet submitted results.
    Assignment -> Maybe POSIX
autoApprovalTime :: Prelude.Maybe Data.POSIX,
    -- | The date and time of the deadline for the assignment. This value is
    -- derived from the deadline specification for the HIT and the date and
    -- time the Worker accepted the HIT.
    Assignment -> Maybe POSIX
deadline :: Prelude.Maybe Data.POSIX,
    -- | The ID of the HIT.
    Assignment -> Maybe Text
hITId :: Prelude.Maybe Prelude.Text,
    -- | If the Worker has submitted results and the Requester has rejected the
    -- results, RejectionTime is the date and time the Requester rejected the
    -- results.
    Assignment -> Maybe POSIX
rejectionTime :: Prelude.Maybe Data.POSIX,
    -- | The feedback string included with the call to the ApproveAssignment
    -- operation or the RejectAssignment operation, if the Requester approved
    -- or rejected the assignment and specified feedback.
    Assignment -> Maybe Text
requesterFeedback :: Prelude.Maybe Prelude.Text,
    -- | If the Worker has submitted results, SubmitTime is the date and time the
    -- assignment was submitted. This value is omitted from the assignment if
    -- the Worker has not yet submitted results.
    Assignment -> Maybe POSIX
submitTime :: Prelude.Maybe Data.POSIX,
    -- | The ID of the Worker who accepted the HIT.
    Assignment -> Maybe Text
workerId :: Prelude.Maybe Prelude.Text
  }
  deriving (Assignment -> Assignment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Assignment -> Assignment -> Bool
$c/= :: Assignment -> Assignment -> Bool
== :: Assignment -> Assignment -> Bool
$c== :: Assignment -> Assignment -> Bool
Prelude.Eq, ReadPrec [Assignment]
ReadPrec Assignment
Int -> ReadS Assignment
ReadS [Assignment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Assignment]
$creadListPrec :: ReadPrec [Assignment]
readPrec :: ReadPrec Assignment
$creadPrec :: ReadPrec Assignment
readList :: ReadS [Assignment]
$creadList :: ReadS [Assignment]
readsPrec :: Int -> ReadS Assignment
$creadsPrec :: Int -> ReadS Assignment
Prelude.Read, Int -> Assignment -> ShowS
[Assignment] -> ShowS
Assignment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Assignment] -> ShowS
$cshowList :: [Assignment] -> ShowS
show :: Assignment -> String
$cshow :: Assignment -> String
showsPrec :: Int -> Assignment -> ShowS
$cshowsPrec :: Int -> Assignment -> ShowS
Prelude.Show, forall x. Rep Assignment x -> Assignment
forall x. Assignment -> Rep Assignment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Assignment x -> Assignment
$cfrom :: forall x. Assignment -> Rep Assignment x
Prelude.Generic)

-- |
-- Create a value of 'Assignment' 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:
--
-- 'acceptTime', 'assignment_acceptTime' - The date and time the Worker accepted the assignment.
--
-- 'answer', 'assignment_answer' - The Worker\'s answers submitted for the HIT contained in a
-- QuestionFormAnswers document, if the Worker provides an answer. If the
-- Worker does not provide any answers, Answer may contain a
-- QuestionFormAnswers document, or Answer may be empty.
--
-- 'approvalTime', 'assignment_approvalTime' - If the Worker has submitted results and the Requester has approved the
-- results, ApprovalTime is the date and time the Requester approved the
-- results. This value is omitted from the assignment if the Requester has
-- not yet approved the results.
--
-- 'assignmentId', 'assignment_assignmentId' - A unique identifier for the assignment.
--
-- 'assignmentStatus', 'assignment_assignmentStatus' - The status of the assignment.
--
-- 'autoApprovalTime', 'assignment_autoApprovalTime' - If results have been submitted, AutoApprovalTime is the date and time
-- the results of the assignment results are considered Approved
-- automatically if they have not already been explicitly approved or
-- rejected by the Requester. This value is derived from the auto-approval
-- delay specified by the Requester in the HIT. This value is omitted from
-- the assignment if the Worker has not yet submitted results.
--
-- 'deadline', 'assignment_deadline' - The date and time of the deadline for the assignment. This value is
-- derived from the deadline specification for the HIT and the date and
-- time the Worker accepted the HIT.
--
-- 'hITId', 'assignment_hITId' - The ID of the HIT.
--
-- 'rejectionTime', 'assignment_rejectionTime' - If the Worker has submitted results and the Requester has rejected the
-- results, RejectionTime is the date and time the Requester rejected the
-- results.
--
-- 'requesterFeedback', 'assignment_requesterFeedback' - The feedback string included with the call to the ApproveAssignment
-- operation or the RejectAssignment operation, if the Requester approved
-- or rejected the assignment and specified feedback.
--
-- 'submitTime', 'assignment_submitTime' - If the Worker has submitted results, SubmitTime is the date and time the
-- assignment was submitted. This value is omitted from the assignment if
-- the Worker has not yet submitted results.
--
-- 'workerId', 'assignment_workerId' - The ID of the Worker who accepted the HIT.
newAssignment ::
  Assignment
newAssignment :: Assignment
newAssignment =
  Assignment'
    { $sel:acceptTime:Assignment' :: Maybe POSIX
acceptTime = forall a. Maybe a
Prelude.Nothing,
      $sel:answer:Assignment' :: Maybe Text
answer = forall a. Maybe a
Prelude.Nothing,
      $sel:approvalTime:Assignment' :: Maybe POSIX
approvalTime = forall a. Maybe a
Prelude.Nothing,
      $sel:assignmentId:Assignment' :: Maybe Text
assignmentId = forall a. Maybe a
Prelude.Nothing,
      $sel:assignmentStatus:Assignment' :: Maybe AssignmentStatus
assignmentStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:autoApprovalTime:Assignment' :: Maybe POSIX
autoApprovalTime = forall a. Maybe a
Prelude.Nothing,
      $sel:deadline:Assignment' :: Maybe POSIX
deadline = forall a. Maybe a
Prelude.Nothing,
      $sel:hITId:Assignment' :: Maybe Text
hITId = forall a. Maybe a
Prelude.Nothing,
      $sel:rejectionTime:Assignment' :: Maybe POSIX
rejectionTime = forall a. Maybe a
Prelude.Nothing,
      $sel:requesterFeedback:Assignment' :: Maybe Text
requesterFeedback = forall a. Maybe a
Prelude.Nothing,
      $sel:submitTime:Assignment' :: Maybe POSIX
submitTime = forall a. Maybe a
Prelude.Nothing,
      $sel:workerId:Assignment' :: Maybe Text
workerId = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time the Worker accepted the assignment.
assignment_acceptTime :: Lens.Lens' Assignment (Prelude.Maybe Prelude.UTCTime)
assignment_acceptTime :: Lens' Assignment (Maybe UTCTime)
assignment_acceptTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe POSIX
acceptTime :: Maybe POSIX
$sel:acceptTime:Assignment' :: Assignment -> Maybe POSIX
acceptTime} -> Maybe POSIX
acceptTime) (\s :: Assignment
s@Assignment' {} Maybe POSIX
a -> Assignment
s {$sel:acceptTime:Assignment' :: Maybe POSIX
acceptTime = Maybe POSIX
a} :: Assignment) 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 Worker\'s answers submitted for the HIT contained in a
-- QuestionFormAnswers document, if the Worker provides an answer. If the
-- Worker does not provide any answers, Answer may contain a
-- QuestionFormAnswers document, or Answer may be empty.
assignment_answer :: Lens.Lens' Assignment (Prelude.Maybe Prelude.Text)
assignment_answer :: Lens' Assignment (Maybe Text)
assignment_answer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe Text
answer :: Maybe Text
$sel:answer:Assignment' :: Assignment -> Maybe Text
answer} -> Maybe Text
answer) (\s :: Assignment
s@Assignment' {} Maybe Text
a -> Assignment
s {$sel:answer:Assignment' :: Maybe Text
answer = Maybe Text
a} :: Assignment)

-- | If the Worker has submitted results and the Requester has approved the
-- results, ApprovalTime is the date and time the Requester approved the
-- results. This value is omitted from the assignment if the Requester has
-- not yet approved the results.
assignment_approvalTime :: Lens.Lens' Assignment (Prelude.Maybe Prelude.UTCTime)
assignment_approvalTime :: Lens' Assignment (Maybe UTCTime)
assignment_approvalTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe POSIX
approvalTime :: Maybe POSIX
$sel:approvalTime:Assignment' :: Assignment -> Maybe POSIX
approvalTime} -> Maybe POSIX
approvalTime) (\s :: Assignment
s@Assignment' {} Maybe POSIX
a -> Assignment
s {$sel:approvalTime:Assignment' :: Maybe POSIX
approvalTime = Maybe POSIX
a} :: Assignment) 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 unique identifier for the assignment.
assignment_assignmentId :: Lens.Lens' Assignment (Prelude.Maybe Prelude.Text)
assignment_assignmentId :: Lens' Assignment (Maybe Text)
assignment_assignmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe Text
assignmentId :: Maybe Text
$sel:assignmentId:Assignment' :: Assignment -> Maybe Text
assignmentId} -> Maybe Text
assignmentId) (\s :: Assignment
s@Assignment' {} Maybe Text
a -> Assignment
s {$sel:assignmentId:Assignment' :: Maybe Text
assignmentId = Maybe Text
a} :: Assignment)

-- | The status of the assignment.
assignment_assignmentStatus :: Lens.Lens' Assignment (Prelude.Maybe AssignmentStatus)
assignment_assignmentStatus :: Lens' Assignment (Maybe AssignmentStatus)
assignment_assignmentStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe AssignmentStatus
assignmentStatus :: Maybe AssignmentStatus
$sel:assignmentStatus:Assignment' :: Assignment -> Maybe AssignmentStatus
assignmentStatus} -> Maybe AssignmentStatus
assignmentStatus) (\s :: Assignment
s@Assignment' {} Maybe AssignmentStatus
a -> Assignment
s {$sel:assignmentStatus:Assignment' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
a} :: Assignment)

-- | If results have been submitted, AutoApprovalTime is the date and time
-- the results of the assignment results are considered Approved
-- automatically if they have not already been explicitly approved or
-- rejected by the Requester. This value is derived from the auto-approval
-- delay specified by the Requester in the HIT. This value is omitted from
-- the assignment if the Worker has not yet submitted results.
assignment_autoApprovalTime :: Lens.Lens' Assignment (Prelude.Maybe Prelude.UTCTime)
assignment_autoApprovalTime :: Lens' Assignment (Maybe UTCTime)
assignment_autoApprovalTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe POSIX
autoApprovalTime :: Maybe POSIX
$sel:autoApprovalTime:Assignment' :: Assignment -> Maybe POSIX
autoApprovalTime} -> Maybe POSIX
autoApprovalTime) (\s :: Assignment
s@Assignment' {} Maybe POSIX
a -> Assignment
s {$sel:autoApprovalTime:Assignment' :: Maybe POSIX
autoApprovalTime = Maybe POSIX
a} :: Assignment) 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 date and time of the deadline for the assignment. This value is
-- derived from the deadline specification for the HIT and the date and
-- time the Worker accepted the HIT.
assignment_deadline :: Lens.Lens' Assignment (Prelude.Maybe Prelude.UTCTime)
assignment_deadline :: Lens' Assignment (Maybe UTCTime)
assignment_deadline = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe POSIX
deadline :: Maybe POSIX
$sel:deadline:Assignment' :: Assignment -> Maybe POSIX
deadline} -> Maybe POSIX
deadline) (\s :: Assignment
s@Assignment' {} Maybe POSIX
a -> Assignment
s {$sel:deadline:Assignment' :: Maybe POSIX
deadline = Maybe POSIX
a} :: Assignment) 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.
assignment_hITId :: Lens.Lens' Assignment (Prelude.Maybe Prelude.Text)
assignment_hITId :: Lens' Assignment (Maybe Text)
assignment_hITId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe Text
hITId :: Maybe Text
$sel:hITId:Assignment' :: Assignment -> Maybe Text
hITId} -> Maybe Text
hITId) (\s :: Assignment
s@Assignment' {} Maybe Text
a -> Assignment
s {$sel:hITId:Assignment' :: Maybe Text
hITId = Maybe Text
a} :: Assignment)

-- | If the Worker has submitted results and the Requester has rejected the
-- results, RejectionTime is the date and time the Requester rejected the
-- results.
assignment_rejectionTime :: Lens.Lens' Assignment (Prelude.Maybe Prelude.UTCTime)
assignment_rejectionTime :: Lens' Assignment (Maybe UTCTime)
assignment_rejectionTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe POSIX
rejectionTime :: Maybe POSIX
$sel:rejectionTime:Assignment' :: Assignment -> Maybe POSIX
rejectionTime} -> Maybe POSIX
rejectionTime) (\s :: Assignment
s@Assignment' {} Maybe POSIX
a -> Assignment
s {$sel:rejectionTime:Assignment' :: Maybe POSIX
rejectionTime = Maybe POSIX
a} :: Assignment) 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 feedback string included with the call to the ApproveAssignment
-- operation or the RejectAssignment operation, if the Requester approved
-- or rejected the assignment and specified feedback.
assignment_requesterFeedback :: Lens.Lens' Assignment (Prelude.Maybe Prelude.Text)
assignment_requesterFeedback :: Lens' Assignment (Maybe Text)
assignment_requesterFeedback = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe Text
requesterFeedback :: Maybe Text
$sel:requesterFeedback:Assignment' :: Assignment -> Maybe Text
requesterFeedback} -> Maybe Text
requesterFeedback) (\s :: Assignment
s@Assignment' {} Maybe Text
a -> Assignment
s {$sel:requesterFeedback:Assignment' :: Maybe Text
requesterFeedback = Maybe Text
a} :: Assignment)

-- | If the Worker has submitted results, SubmitTime is the date and time the
-- assignment was submitted. This value is omitted from the assignment if
-- the Worker has not yet submitted results.
assignment_submitTime :: Lens.Lens' Assignment (Prelude.Maybe Prelude.UTCTime)
assignment_submitTime :: Lens' Assignment (Maybe UTCTime)
assignment_submitTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe POSIX
submitTime :: Maybe POSIX
$sel:submitTime:Assignment' :: Assignment -> Maybe POSIX
submitTime} -> Maybe POSIX
submitTime) (\s :: Assignment
s@Assignment' {} Maybe POSIX
a -> Assignment
s {$sel:submitTime:Assignment' :: Maybe POSIX
submitTime = Maybe POSIX
a} :: Assignment) 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 Worker who accepted the HIT.
assignment_workerId :: Lens.Lens' Assignment (Prelude.Maybe Prelude.Text)
assignment_workerId :: Lens' Assignment (Maybe Text)
assignment_workerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Assignment' {Maybe Text
workerId :: Maybe Text
$sel:workerId:Assignment' :: Assignment -> Maybe Text
workerId} -> Maybe Text
workerId) (\s :: Assignment
s@Assignment' {} Maybe Text
a -> Assignment
s {$sel:workerId:Assignment' :: Maybe Text
workerId = Maybe Text
a} :: Assignment)

instance Data.FromJSON Assignment where
  parseJSON :: Value -> Parser Assignment
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Assignment"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Assignment
Assignment'
            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
"AcceptTime")
            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
"Answer")
            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
"ApprovalTime")
            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
"AssignmentId")
            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
"AssignmentStatus")
            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
"AutoApprovalTime")
            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
"Deadline")
            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
"RejectionTime")
            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
"RequesterFeedback")
            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
"SubmitTime")
            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
"WorkerId")
      )

instance Prelude.Hashable Assignment where
  hashWithSalt :: Int -> Assignment -> Int
hashWithSalt Int
_salt Assignment' {Maybe Text
Maybe POSIX
Maybe AssignmentStatus
workerId :: Maybe Text
submitTime :: Maybe POSIX
requesterFeedback :: Maybe Text
rejectionTime :: Maybe POSIX
hITId :: Maybe Text
deadline :: Maybe POSIX
autoApprovalTime :: Maybe POSIX
assignmentStatus :: Maybe AssignmentStatus
assignmentId :: Maybe Text
approvalTime :: Maybe POSIX
answer :: Maybe Text
acceptTime :: Maybe POSIX
$sel:workerId:Assignment' :: Assignment -> Maybe Text
$sel:submitTime:Assignment' :: Assignment -> Maybe POSIX
$sel:requesterFeedback:Assignment' :: Assignment -> Maybe Text
$sel:rejectionTime:Assignment' :: Assignment -> Maybe POSIX
$sel:hITId:Assignment' :: Assignment -> Maybe Text
$sel:deadline:Assignment' :: Assignment -> Maybe POSIX
$sel:autoApprovalTime:Assignment' :: Assignment -> Maybe POSIX
$sel:assignmentStatus:Assignment' :: Assignment -> Maybe AssignmentStatus
$sel:assignmentId:Assignment' :: Assignment -> Maybe Text
$sel:approvalTime:Assignment' :: Assignment -> Maybe POSIX
$sel:answer:Assignment' :: Assignment -> Maybe Text
$sel:acceptTime:Assignment' :: Assignment -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
acceptTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
answer
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
approvalTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
assignmentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssignmentStatus
assignmentStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
autoApprovalTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
deadline
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hITId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
rejectionTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
requesterFeedback
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
submitTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
workerId

instance Prelude.NFData Assignment where
  rnf :: Assignment -> ()
rnf Assignment' {Maybe Text
Maybe POSIX
Maybe AssignmentStatus
workerId :: Maybe Text
submitTime :: Maybe POSIX
requesterFeedback :: Maybe Text
rejectionTime :: Maybe POSIX
hITId :: Maybe Text
deadline :: Maybe POSIX
autoApprovalTime :: Maybe POSIX
assignmentStatus :: Maybe AssignmentStatus
assignmentId :: Maybe Text
approvalTime :: Maybe POSIX
answer :: Maybe Text
acceptTime :: Maybe POSIX
$sel:workerId:Assignment' :: Assignment -> Maybe Text
$sel:submitTime:Assignment' :: Assignment -> Maybe POSIX
$sel:requesterFeedback:Assignment' :: Assignment -> Maybe Text
$sel:rejectionTime:Assignment' :: Assignment -> Maybe POSIX
$sel:hITId:Assignment' :: Assignment -> Maybe Text
$sel:deadline:Assignment' :: Assignment -> Maybe POSIX
$sel:autoApprovalTime:Assignment' :: Assignment -> Maybe POSIX
$sel:assignmentStatus:Assignment' :: Assignment -> Maybe AssignmentStatus
$sel:assignmentId:Assignment' :: Assignment -> Maybe Text
$sel:approvalTime:Assignment' :: Assignment -> Maybe POSIX
$sel:answer:Assignment' :: Assignment -> Maybe Text
$sel:acceptTime:Assignment' :: Assignment -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
acceptTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
answer
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
approvalTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
assignmentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AssignmentStatus
assignmentStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
autoApprovalTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
deadline
      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 POSIX
rejectionTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requesterFeedback
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
submitTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
workerId