{-# 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 #-}
module Amazonka.MechanicalTurk.Types.QualificationRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data QualificationRequest = QualificationRequest'
{
QualificationRequest -> Maybe Text
qualificationRequestId :: Prelude.Maybe Prelude.Text,
QualificationRequest -> Maybe Text
test :: Prelude.Maybe Prelude.Text,
QualificationRequest -> Maybe Text
qualificationTypeId :: Prelude.Maybe Prelude.Text,
QualificationRequest -> Maybe Text
answer :: Prelude.Maybe Prelude.Text,
QualificationRequest -> Maybe Text
workerId :: Prelude.Maybe Prelude.Text,
QualificationRequest -> Maybe POSIX
submitTime :: Prelude.Maybe Core.POSIX
}
deriving (QualificationRequest -> QualificationRequest -> Bool
(QualificationRequest -> QualificationRequest -> Bool)
-> (QualificationRequest -> QualificationRequest -> Bool)
-> Eq QualificationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QualificationRequest -> QualificationRequest -> Bool
$c/= :: QualificationRequest -> QualificationRequest -> Bool
== :: QualificationRequest -> QualificationRequest -> Bool
$c== :: QualificationRequest -> QualificationRequest -> Bool
Prelude.Eq, ReadPrec [QualificationRequest]
ReadPrec QualificationRequest
Int -> ReadS QualificationRequest
ReadS [QualificationRequest]
(Int -> ReadS QualificationRequest)
-> ReadS [QualificationRequest]
-> ReadPrec QualificationRequest
-> ReadPrec [QualificationRequest]
-> Read QualificationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QualificationRequest]
$creadListPrec :: ReadPrec [QualificationRequest]
readPrec :: ReadPrec QualificationRequest
$creadPrec :: ReadPrec QualificationRequest
readList :: ReadS [QualificationRequest]
$creadList :: ReadS [QualificationRequest]
readsPrec :: Int -> ReadS QualificationRequest
$creadsPrec :: Int -> ReadS QualificationRequest
Prelude.Read, Int -> QualificationRequest -> ShowS
[QualificationRequest] -> ShowS
QualificationRequest -> String
(Int -> QualificationRequest -> ShowS)
-> (QualificationRequest -> String)
-> ([QualificationRequest] -> ShowS)
-> Show QualificationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QualificationRequest] -> ShowS
$cshowList :: [QualificationRequest] -> ShowS
show :: QualificationRequest -> String
$cshow :: QualificationRequest -> String
showsPrec :: Int -> QualificationRequest -> ShowS
$cshowsPrec :: Int -> QualificationRequest -> ShowS
Prelude.Show, (forall x. QualificationRequest -> Rep QualificationRequest x)
-> (forall x. Rep QualificationRequest x -> QualificationRequest)
-> Generic QualificationRequest
forall x. Rep QualificationRequest x -> QualificationRequest
forall x. QualificationRequest -> Rep QualificationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QualificationRequest x -> QualificationRequest
$cfrom :: forall x. QualificationRequest -> Rep QualificationRequest x
Prelude.Generic)
newQualificationRequest ::
QualificationRequest
newQualificationRequest :: QualificationRequest
newQualificationRequest =
QualificationRequest' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> QualificationRequest
QualificationRequest'
{ $sel:qualificationRequestId:QualificationRequest' :: Maybe Text
qualificationRequestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:test:QualificationRequest' :: Maybe Text
test = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:qualificationTypeId:QualificationRequest' :: Maybe Text
qualificationTypeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:answer:QualificationRequest' :: Maybe Text
answer = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workerId:QualificationRequest' :: Maybe Text
workerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:submitTime:QualificationRequest' :: Maybe POSIX
submitTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
qualificationRequest_qualificationRequestId :: Lens.Lens' QualificationRequest (Prelude.Maybe Prelude.Text)
qualificationRequest_qualificationRequestId :: (Maybe Text -> f (Maybe Text))
-> QualificationRequest -> f QualificationRequest
qualificationRequest_qualificationRequestId = (QualificationRequest -> Maybe Text)
-> (QualificationRequest -> Maybe Text -> QualificationRequest)
-> Lens
QualificationRequest QualificationRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationRequest' {Maybe Text
qualificationRequestId :: Maybe Text
$sel:qualificationRequestId:QualificationRequest' :: QualificationRequest -> Maybe Text
qualificationRequestId} -> Maybe Text
qualificationRequestId) (\s :: QualificationRequest
s@QualificationRequest' {} Maybe Text
a -> QualificationRequest
s {$sel:qualificationRequestId:QualificationRequest' :: Maybe Text
qualificationRequestId = Maybe Text
a} :: QualificationRequest)
qualificationRequest_test :: Lens.Lens' QualificationRequest (Prelude.Maybe Prelude.Text)
qualificationRequest_test :: (Maybe Text -> f (Maybe Text))
-> QualificationRequest -> f QualificationRequest
qualificationRequest_test = (QualificationRequest -> Maybe Text)
-> (QualificationRequest -> Maybe Text -> QualificationRequest)
-> Lens
QualificationRequest QualificationRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationRequest' {Maybe Text
test :: Maybe Text
$sel:test:QualificationRequest' :: QualificationRequest -> Maybe Text
test} -> Maybe Text
test) (\s :: QualificationRequest
s@QualificationRequest' {} Maybe Text
a -> QualificationRequest
s {$sel:test:QualificationRequest' :: Maybe Text
test = Maybe Text
a} :: QualificationRequest)
qualificationRequest_qualificationTypeId :: Lens.Lens' QualificationRequest (Prelude.Maybe Prelude.Text)
qualificationRequest_qualificationTypeId :: (Maybe Text -> f (Maybe Text))
-> QualificationRequest -> f QualificationRequest
qualificationRequest_qualificationTypeId = (QualificationRequest -> Maybe Text)
-> (QualificationRequest -> Maybe Text -> QualificationRequest)
-> Lens
QualificationRequest QualificationRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationRequest' {Maybe Text
qualificationTypeId :: Maybe Text
$sel:qualificationTypeId:QualificationRequest' :: QualificationRequest -> Maybe Text
qualificationTypeId} -> Maybe Text
qualificationTypeId) (\s :: QualificationRequest
s@QualificationRequest' {} Maybe Text
a -> QualificationRequest
s {$sel:qualificationTypeId:QualificationRequest' :: Maybe Text
qualificationTypeId = Maybe Text
a} :: QualificationRequest)
qualificationRequest_answer :: Lens.Lens' QualificationRequest (Prelude.Maybe Prelude.Text)
qualificationRequest_answer :: (Maybe Text -> f (Maybe Text))
-> QualificationRequest -> f QualificationRequest
qualificationRequest_answer = (QualificationRequest -> Maybe Text)
-> (QualificationRequest -> Maybe Text -> QualificationRequest)
-> Lens
QualificationRequest QualificationRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationRequest' {Maybe Text
answer :: Maybe Text
$sel:answer:QualificationRequest' :: QualificationRequest -> Maybe Text
answer} -> Maybe Text
answer) (\s :: QualificationRequest
s@QualificationRequest' {} Maybe Text
a -> QualificationRequest
s {$sel:answer:QualificationRequest' :: Maybe Text
answer = Maybe Text
a} :: QualificationRequest)
qualificationRequest_workerId :: Lens.Lens' QualificationRequest (Prelude.Maybe Prelude.Text)
qualificationRequest_workerId :: (Maybe Text -> f (Maybe Text))
-> QualificationRequest -> f QualificationRequest
qualificationRequest_workerId = (QualificationRequest -> Maybe Text)
-> (QualificationRequest -> Maybe Text -> QualificationRequest)
-> Lens
QualificationRequest QualificationRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationRequest' {Maybe Text
workerId :: Maybe Text
$sel:workerId:QualificationRequest' :: QualificationRequest -> Maybe Text
workerId} -> Maybe Text
workerId) (\s :: QualificationRequest
s@QualificationRequest' {} Maybe Text
a -> QualificationRequest
s {$sel:workerId:QualificationRequest' :: Maybe Text
workerId = Maybe Text
a} :: QualificationRequest)
qualificationRequest_submitTime :: Lens.Lens' QualificationRequest (Prelude.Maybe Prelude.UTCTime)
qualificationRequest_submitTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> QualificationRequest -> f QualificationRequest
qualificationRequest_submitTime = (QualificationRequest -> Maybe POSIX)
-> (QualificationRequest -> Maybe POSIX -> QualificationRequest)
-> Lens
QualificationRequest
QualificationRequest
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationRequest' {Maybe POSIX
submitTime :: Maybe POSIX
$sel:submitTime:QualificationRequest' :: QualificationRequest -> Maybe POSIX
submitTime} -> Maybe POSIX
submitTime) (\s :: QualificationRequest
s@QualificationRequest' {} Maybe POSIX
a -> QualificationRequest
s {$sel:submitTime:QualificationRequest' :: Maybe POSIX
submitTime = Maybe POSIX
a} :: QualificationRequest) ((Maybe POSIX -> f (Maybe POSIX))
-> QualificationRequest -> f QualificationRequest)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> QualificationRequest
-> f QualificationRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON QualificationRequest where
parseJSON :: Value -> Parser QualificationRequest
parseJSON =
String
-> (Object -> Parser QualificationRequest)
-> Value
-> Parser QualificationRequest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"QualificationRequest"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> QualificationRequest
QualificationRequest'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> QualificationRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> QualificationRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QualificationRequestId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> QualificationRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> QualificationRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Test")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> QualificationRequest)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> QualificationRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QualificationTypeId")
Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> QualificationRequest)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> QualificationRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Answer")
Parser (Maybe Text -> Maybe POSIX -> QualificationRequest)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> QualificationRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkerId")
Parser (Maybe POSIX -> QualificationRequest)
-> Parser (Maybe POSIX) -> Parser QualificationRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubmitTime")
)
instance Prelude.Hashable QualificationRequest
instance Prelude.NFData QualificationRequest