{-# 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.QualificationType
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MechanicalTurk.Types.QualificationType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MechanicalTurk.Types.QualificationTypeStatus
import qualified Amazonka.Prelude as Prelude

-- | The QualificationType data structure represents a Qualification type, a
-- description of a property of a Worker that must match the requirements
-- of a HIT for the Worker to be able to accept the HIT. The type also
-- describes how a Worker can obtain a Qualification of that type, such as
-- through a Qualification test.
--
-- /See:/ 'newQualificationType' smart constructor.
data QualificationType = QualificationType'
  { -- | The date and time the Qualification type was created.
    QualificationType -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The amount of time, in seconds, given to a Worker to complete the
    -- Qualification test, beginning from the time the Worker requests the
    -- Qualification.
    QualificationType -> Maybe Integer
testDurationInSeconds :: Prelude.Maybe Prelude.Integer,
    -- | The status of the Qualification type. A Qualification type\'s status
    -- determines if users can apply to receive a Qualification of this type,
    -- and if HITs can be created with requirements based on this type. Valid
    -- values are Active | Inactive.
    QualificationType -> Maybe QualificationTypeStatus
qualificationTypeStatus :: Prelude.Maybe QualificationTypeStatus,
    -- | The answers to the Qualification test specified in the Test parameter.
    QualificationType -> Maybe Text
answerKey :: Prelude.Maybe Prelude.Text,
    -- | The questions for a Qualification test associated with this
    -- Qualification type that a user can take to obtain a Qualification of
    -- this type. This parameter must be specified if AnswerKey is present. A
    -- Qualification type cannot have both a specified Test parameter and an
    -- AutoGranted value of true.
    QualificationType -> Maybe Text
test :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the Qualification type. A Qualification type is
    -- given a Qualification type ID when you call the CreateQualificationType
    -- operation.
    QualificationType -> Maybe Text
qualificationTypeId :: Prelude.Maybe Prelude.Text,
    -- | The name of the Qualification type. The type name is used to identify
    -- the type, and to find the type using a Qualification type search.
    QualificationType -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | One or more words or phrases that describe theQualification type,
    -- separated by commas. The Keywords make the type easier to find using a
    -- search.
    QualificationType -> Maybe Text
keywords :: Prelude.Maybe Prelude.Text,
    -- | Specifies that requests for the Qualification type are granted
    -- immediately, without prompting the Worker with a Qualification test.
    -- Valid values are True | False.
    QualificationType -> Maybe Bool
autoGranted :: Prelude.Maybe Prelude.Bool,
    -- | The Qualification integer value to use for automatically granted
    -- Qualifications, if AutoGranted is true. This is 1 by default.
    QualificationType -> Maybe Int
autoGrantedValue :: Prelude.Maybe Prelude.Int,
    -- | A long description for the Qualification type.
    QualificationType -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the Qualification type is one that a user can request
    -- through the Amazon Mechanical Turk web site, such as by taking a
    -- Qualification test. This value is False for Qualifications assigned
    -- automatically by the system. Valid values are True | False.
    QualificationType -> Maybe Bool
isRequestable :: Prelude.Maybe Prelude.Bool,
    -- | The amount of time, in seconds, Workers must wait after taking the
    -- Qualification test before they can take it again. Workers can take a
    -- Qualification test multiple times if they were not granted the
    -- Qualification from a previous attempt, or if the test offers a gradient
    -- score and they want a better score. If not specified, retries are
    -- disabled and Workers can request a Qualification only once.
    QualificationType -> Maybe Integer
retryDelayInSeconds :: Prelude.Maybe Prelude.Integer
  }
  deriving (QualificationType -> QualificationType -> Bool
(QualificationType -> QualificationType -> Bool)
-> (QualificationType -> QualificationType -> Bool)
-> Eq QualificationType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QualificationType -> QualificationType -> Bool
$c/= :: QualificationType -> QualificationType -> Bool
== :: QualificationType -> QualificationType -> Bool
$c== :: QualificationType -> QualificationType -> Bool
Prelude.Eq, ReadPrec [QualificationType]
ReadPrec QualificationType
Int -> ReadS QualificationType
ReadS [QualificationType]
(Int -> ReadS QualificationType)
-> ReadS [QualificationType]
-> ReadPrec QualificationType
-> ReadPrec [QualificationType]
-> Read QualificationType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QualificationType]
$creadListPrec :: ReadPrec [QualificationType]
readPrec :: ReadPrec QualificationType
$creadPrec :: ReadPrec QualificationType
readList :: ReadS [QualificationType]
$creadList :: ReadS [QualificationType]
readsPrec :: Int -> ReadS QualificationType
$creadsPrec :: Int -> ReadS QualificationType
Prelude.Read, Int -> QualificationType -> ShowS
[QualificationType] -> ShowS
QualificationType -> String
(Int -> QualificationType -> ShowS)
-> (QualificationType -> String)
-> ([QualificationType] -> ShowS)
-> Show QualificationType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QualificationType] -> ShowS
$cshowList :: [QualificationType] -> ShowS
show :: QualificationType -> String
$cshow :: QualificationType -> String
showsPrec :: Int -> QualificationType -> ShowS
$cshowsPrec :: Int -> QualificationType -> ShowS
Prelude.Show, (forall x. QualificationType -> Rep QualificationType x)
-> (forall x. Rep QualificationType x -> QualificationType)
-> Generic QualificationType
forall x. Rep QualificationType x -> QualificationType
forall x. QualificationType -> Rep QualificationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QualificationType x -> QualificationType
$cfrom :: forall x. QualificationType -> Rep QualificationType x
Prelude.Generic)

-- |
-- Create a value of 'QualificationType' 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:
--
-- 'creationTime', 'qualificationType_creationTime' - The date and time the Qualification type was created.
--
-- 'testDurationInSeconds', 'qualificationType_testDurationInSeconds' - The amount of time, in seconds, given to a Worker to complete the
-- Qualification test, beginning from the time the Worker requests the
-- Qualification.
--
-- 'qualificationTypeStatus', 'qualificationType_qualificationTypeStatus' - The status of the Qualification type. A Qualification type\'s status
-- determines if users can apply to receive a Qualification of this type,
-- and if HITs can be created with requirements based on this type. Valid
-- values are Active | Inactive.
--
-- 'answerKey', 'qualificationType_answerKey' - The answers to the Qualification test specified in the Test parameter.
--
-- 'test', 'qualificationType_test' - The questions for a Qualification test associated with this
-- Qualification type that a user can take to obtain a Qualification of
-- this type. This parameter must be specified if AnswerKey is present. A
-- Qualification type cannot have both a specified Test parameter and an
-- AutoGranted value of true.
--
-- 'qualificationTypeId', 'qualificationType_qualificationTypeId' - A unique identifier for the Qualification type. A Qualification type is
-- given a Qualification type ID when you call the CreateQualificationType
-- operation.
--
-- 'name', 'qualificationType_name' - The name of the Qualification type. The type name is used to identify
-- the type, and to find the type using a Qualification type search.
--
-- 'keywords', 'qualificationType_keywords' - One or more words or phrases that describe theQualification type,
-- separated by commas. The Keywords make the type easier to find using a
-- search.
--
-- 'autoGranted', 'qualificationType_autoGranted' - Specifies that requests for the Qualification type are granted
-- immediately, without prompting the Worker with a Qualification test.
-- Valid values are True | False.
--
-- 'autoGrantedValue', 'qualificationType_autoGrantedValue' - The Qualification integer value to use for automatically granted
-- Qualifications, if AutoGranted is true. This is 1 by default.
--
-- 'description', 'qualificationType_description' - A long description for the Qualification type.
--
-- 'isRequestable', 'qualificationType_isRequestable' - Specifies whether the Qualification type is one that a user can request
-- through the Amazon Mechanical Turk web site, such as by taking a
-- Qualification test. This value is False for Qualifications assigned
-- automatically by the system. Valid values are True | False.
--
-- 'retryDelayInSeconds', 'qualificationType_retryDelayInSeconds' - The amount of time, in seconds, Workers must wait after taking the
-- Qualification test before they can take it again. Workers can take a
-- Qualification test multiple times if they were not granted the
-- Qualification from a previous attempt, or if the test offers a gradient
-- score and they want a better score. If not specified, retries are
-- disabled and Workers can request a Qualification only once.
newQualificationType ::
  QualificationType
newQualificationType :: QualificationType
newQualificationType =
  QualificationType' :: Maybe POSIX
-> Maybe Integer
-> Maybe QualificationTypeStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Integer
-> QualificationType
QualificationType'
    { $sel:creationTime:QualificationType' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:testDurationInSeconds:QualificationType' :: Maybe Integer
testDurationInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:qualificationTypeStatus:QualificationType' :: Maybe QualificationTypeStatus
qualificationTypeStatus = Maybe QualificationTypeStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:answerKey:QualificationType' :: Maybe Text
answerKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:test:QualificationType' :: Maybe Text
test = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:qualificationTypeId:QualificationType' :: Maybe Text
qualificationTypeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:QualificationType' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keywords:QualificationType' :: Maybe Text
keywords = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoGranted:QualificationType' :: Maybe Bool
autoGranted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:autoGrantedValue:QualificationType' :: Maybe Int
autoGrantedValue = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:description:QualificationType' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isRequestable:QualificationType' :: Maybe Bool
isRequestable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:retryDelayInSeconds:QualificationType' :: Maybe Integer
retryDelayInSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time the Qualification type was created.
qualificationType_creationTime :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.UTCTime)
qualificationType_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> QualificationType -> f QualificationType
qualificationType_creationTime = (QualificationType -> Maybe POSIX)
-> (QualificationType -> Maybe POSIX -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:QualificationType' :: QualificationType -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: QualificationType
s@QualificationType' {} Maybe POSIX
a -> QualificationType
s {$sel:creationTime:QualificationType' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: QualificationType) ((Maybe POSIX -> f (Maybe POSIX))
 -> QualificationType -> f QualificationType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> QualificationType
-> f QualificationType
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

-- | The amount of time, in seconds, given to a Worker to complete the
-- Qualification test, beginning from the time the Worker requests the
-- Qualification.
qualificationType_testDurationInSeconds :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Integer)
qualificationType_testDurationInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> QualificationType -> f QualificationType
qualificationType_testDurationInSeconds = (QualificationType -> Maybe Integer)
-> (QualificationType -> Maybe Integer -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Integer
testDurationInSeconds :: Maybe Integer
$sel:testDurationInSeconds:QualificationType' :: QualificationType -> Maybe Integer
testDurationInSeconds} -> Maybe Integer
testDurationInSeconds) (\s :: QualificationType
s@QualificationType' {} Maybe Integer
a -> QualificationType
s {$sel:testDurationInSeconds:QualificationType' :: Maybe Integer
testDurationInSeconds = Maybe Integer
a} :: QualificationType)

-- | The status of the Qualification type. A Qualification type\'s status
-- determines if users can apply to receive a Qualification of this type,
-- and if HITs can be created with requirements based on this type. Valid
-- values are Active | Inactive.
qualificationType_qualificationTypeStatus :: Lens.Lens' QualificationType (Prelude.Maybe QualificationTypeStatus)
qualificationType_qualificationTypeStatus :: (Maybe QualificationTypeStatus
 -> f (Maybe QualificationTypeStatus))
-> QualificationType -> f QualificationType
qualificationType_qualificationTypeStatus = (QualificationType -> Maybe QualificationTypeStatus)
-> (QualificationType
    -> Maybe QualificationTypeStatus -> QualificationType)
-> Lens
     QualificationType
     QualificationType
     (Maybe QualificationTypeStatus)
     (Maybe QualificationTypeStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe QualificationTypeStatus
qualificationTypeStatus :: Maybe QualificationTypeStatus
$sel:qualificationTypeStatus:QualificationType' :: QualificationType -> Maybe QualificationTypeStatus
qualificationTypeStatus} -> Maybe QualificationTypeStatus
qualificationTypeStatus) (\s :: QualificationType
s@QualificationType' {} Maybe QualificationTypeStatus
a -> QualificationType
s {$sel:qualificationTypeStatus:QualificationType' :: Maybe QualificationTypeStatus
qualificationTypeStatus = Maybe QualificationTypeStatus
a} :: QualificationType)

-- | The answers to the Qualification test specified in the Test parameter.
qualificationType_answerKey :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Text)
qualificationType_answerKey :: (Maybe Text -> f (Maybe Text))
-> QualificationType -> f QualificationType
qualificationType_answerKey = (QualificationType -> Maybe Text)
-> (QualificationType -> Maybe Text -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Text
answerKey :: Maybe Text
$sel:answerKey:QualificationType' :: QualificationType -> Maybe Text
answerKey} -> Maybe Text
answerKey) (\s :: QualificationType
s@QualificationType' {} Maybe Text
a -> QualificationType
s {$sel:answerKey:QualificationType' :: Maybe Text
answerKey = Maybe Text
a} :: QualificationType)

-- | The questions for a Qualification test associated with this
-- Qualification type that a user can take to obtain a Qualification of
-- this type. This parameter must be specified if AnswerKey is present. A
-- Qualification type cannot have both a specified Test parameter and an
-- AutoGranted value of true.
qualificationType_test :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Text)
qualificationType_test :: (Maybe Text -> f (Maybe Text))
-> QualificationType -> f QualificationType
qualificationType_test = (QualificationType -> Maybe Text)
-> (QualificationType -> Maybe Text -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Text
test :: Maybe Text
$sel:test:QualificationType' :: QualificationType -> Maybe Text
test} -> Maybe Text
test) (\s :: QualificationType
s@QualificationType' {} Maybe Text
a -> QualificationType
s {$sel:test:QualificationType' :: Maybe Text
test = Maybe Text
a} :: QualificationType)

-- | A unique identifier for the Qualification type. A Qualification type is
-- given a Qualification type ID when you call the CreateQualificationType
-- operation.
qualificationType_qualificationTypeId :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Text)
qualificationType_qualificationTypeId :: (Maybe Text -> f (Maybe Text))
-> QualificationType -> f QualificationType
qualificationType_qualificationTypeId = (QualificationType -> Maybe Text)
-> (QualificationType -> Maybe Text -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Text
qualificationTypeId :: Maybe Text
$sel:qualificationTypeId:QualificationType' :: QualificationType -> Maybe Text
qualificationTypeId} -> Maybe Text
qualificationTypeId) (\s :: QualificationType
s@QualificationType' {} Maybe Text
a -> QualificationType
s {$sel:qualificationTypeId:QualificationType' :: Maybe Text
qualificationTypeId = Maybe Text
a} :: QualificationType)

-- | The name of the Qualification type. The type name is used to identify
-- the type, and to find the type using a Qualification type search.
qualificationType_name :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Text)
qualificationType_name :: (Maybe Text -> f (Maybe Text))
-> QualificationType -> f QualificationType
qualificationType_name = (QualificationType -> Maybe Text)
-> (QualificationType -> Maybe Text -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Text
name :: Maybe Text
$sel:name:QualificationType' :: QualificationType -> Maybe Text
name} -> Maybe Text
name) (\s :: QualificationType
s@QualificationType' {} Maybe Text
a -> QualificationType
s {$sel:name:QualificationType' :: Maybe Text
name = Maybe Text
a} :: QualificationType)

-- | One or more words or phrases that describe theQualification type,
-- separated by commas. The Keywords make the type easier to find using a
-- search.
qualificationType_keywords :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Text)
qualificationType_keywords :: (Maybe Text -> f (Maybe Text))
-> QualificationType -> f QualificationType
qualificationType_keywords = (QualificationType -> Maybe Text)
-> (QualificationType -> Maybe Text -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Text
keywords :: Maybe Text
$sel:keywords:QualificationType' :: QualificationType -> Maybe Text
keywords} -> Maybe Text
keywords) (\s :: QualificationType
s@QualificationType' {} Maybe Text
a -> QualificationType
s {$sel:keywords:QualificationType' :: Maybe Text
keywords = Maybe Text
a} :: QualificationType)

-- | Specifies that requests for the Qualification type are granted
-- immediately, without prompting the Worker with a Qualification test.
-- Valid values are True | False.
qualificationType_autoGranted :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Bool)
qualificationType_autoGranted :: (Maybe Bool -> f (Maybe Bool))
-> QualificationType -> f QualificationType
qualificationType_autoGranted = (QualificationType -> Maybe Bool)
-> (QualificationType -> Maybe Bool -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Bool
autoGranted :: Maybe Bool
$sel:autoGranted:QualificationType' :: QualificationType -> Maybe Bool
autoGranted} -> Maybe Bool
autoGranted) (\s :: QualificationType
s@QualificationType' {} Maybe Bool
a -> QualificationType
s {$sel:autoGranted:QualificationType' :: Maybe Bool
autoGranted = Maybe Bool
a} :: QualificationType)

-- | The Qualification integer value to use for automatically granted
-- Qualifications, if AutoGranted is true. This is 1 by default.
qualificationType_autoGrantedValue :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Int)
qualificationType_autoGrantedValue :: (Maybe Int -> f (Maybe Int))
-> QualificationType -> f QualificationType
qualificationType_autoGrantedValue = (QualificationType -> Maybe Int)
-> (QualificationType -> Maybe Int -> QualificationType)
-> Lens QualificationType QualificationType (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Int
autoGrantedValue :: Maybe Int
$sel:autoGrantedValue:QualificationType' :: QualificationType -> Maybe Int
autoGrantedValue} -> Maybe Int
autoGrantedValue) (\s :: QualificationType
s@QualificationType' {} Maybe Int
a -> QualificationType
s {$sel:autoGrantedValue:QualificationType' :: Maybe Int
autoGrantedValue = Maybe Int
a} :: QualificationType)

-- | A long description for the Qualification type.
qualificationType_description :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Text)
qualificationType_description :: (Maybe Text -> f (Maybe Text))
-> QualificationType -> f QualificationType
qualificationType_description = (QualificationType -> Maybe Text)
-> (QualificationType -> Maybe Text -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Text
description :: Maybe Text
$sel:description:QualificationType' :: QualificationType -> Maybe Text
description} -> Maybe Text
description) (\s :: QualificationType
s@QualificationType' {} Maybe Text
a -> QualificationType
s {$sel:description:QualificationType' :: Maybe Text
description = Maybe Text
a} :: QualificationType)

-- | Specifies whether the Qualification type is one that a user can request
-- through the Amazon Mechanical Turk web site, such as by taking a
-- Qualification test. This value is False for Qualifications assigned
-- automatically by the system. Valid values are True | False.
qualificationType_isRequestable :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Bool)
qualificationType_isRequestable :: (Maybe Bool -> f (Maybe Bool))
-> QualificationType -> f QualificationType
qualificationType_isRequestable = (QualificationType -> Maybe Bool)
-> (QualificationType -> Maybe Bool -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Bool
isRequestable :: Maybe Bool
$sel:isRequestable:QualificationType' :: QualificationType -> Maybe Bool
isRequestable} -> Maybe Bool
isRequestable) (\s :: QualificationType
s@QualificationType' {} Maybe Bool
a -> QualificationType
s {$sel:isRequestable:QualificationType' :: Maybe Bool
isRequestable = Maybe Bool
a} :: QualificationType)

-- | The amount of time, in seconds, Workers must wait after taking the
-- Qualification test before they can take it again. Workers can take a
-- Qualification test multiple times if they were not granted the
-- Qualification from a previous attempt, or if the test offers a gradient
-- score and they want a better score. If not specified, retries are
-- disabled and Workers can request a Qualification only once.
qualificationType_retryDelayInSeconds :: Lens.Lens' QualificationType (Prelude.Maybe Prelude.Integer)
qualificationType_retryDelayInSeconds :: (Maybe Integer -> f (Maybe Integer))
-> QualificationType -> f QualificationType
qualificationType_retryDelayInSeconds = (QualificationType -> Maybe Integer)
-> (QualificationType -> Maybe Integer -> QualificationType)
-> Lens
     QualificationType QualificationType (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QualificationType' {Maybe Integer
retryDelayInSeconds :: Maybe Integer
$sel:retryDelayInSeconds:QualificationType' :: QualificationType -> Maybe Integer
retryDelayInSeconds} -> Maybe Integer
retryDelayInSeconds) (\s :: QualificationType
s@QualificationType' {} Maybe Integer
a -> QualificationType
s {$sel:retryDelayInSeconds:QualificationType' :: Maybe Integer
retryDelayInSeconds = Maybe Integer
a} :: QualificationType)

instance Core.FromJSON QualificationType where
  parseJSON :: Value -> Parser QualificationType
parseJSON =
    String
-> (Object -> Parser QualificationType)
-> Value
-> Parser QualificationType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"QualificationType"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Integer
-> Maybe QualificationTypeStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Integer
-> QualificationType
QualificationType'
            (Maybe POSIX
 -> Maybe Integer
 -> Maybe QualificationTypeStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Int
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Integer
 -> QualificationType)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Integer
      -> Maybe QualificationTypeStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
forall (f :: * -> *) a b. Functor 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
"CreationTime")
            Parser
  (Maybe Integer
   -> Maybe QualificationTypeStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe Integer)
-> Parser
     (Maybe QualificationTypeStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TestDurationInSeconds")
            Parser
  (Maybe QualificationTypeStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe QualificationTypeStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QualificationTypeStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QualificationTypeStatus")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
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
"AnswerKey")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
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 Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
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 Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
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
"Name")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> QualificationType)
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
"Keywords")
            Parser
  (Maybe Bool
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> QualificationType)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Int
      -> Maybe Text -> Maybe Bool -> Maybe Integer -> QualificationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AutoGranted")
            Parser
  (Maybe Int
   -> Maybe Text -> Maybe Bool -> Maybe Integer -> QualificationType)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text -> Maybe Bool -> Maybe Integer -> QualificationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AutoGrantedValue")
            Parser
  (Maybe Text -> Maybe Bool -> Maybe Integer -> QualificationType)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Integer -> QualificationType)
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
"Description")
            Parser (Maybe Bool -> Maybe Integer -> QualificationType)
-> Parser (Maybe Bool)
-> Parser (Maybe Integer -> QualificationType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsRequestable")
            Parser (Maybe Integer -> QualificationType)
-> Parser (Maybe Integer) -> Parser QualificationType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RetryDelayInSeconds")
      )

instance Prelude.Hashable QualificationType

instance Prelude.NFData QualificationType