{-# 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.SageMaker.Types.PublicWorkforceTaskPrice
-- 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.SageMaker.Types.PublicWorkforceTaskPrice where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.USD

-- | Defines the amount of money paid to an Amazon Mechanical Turk worker for
-- each task performed.
--
-- Use one of the following prices for bounding box tasks. Prices are in US
-- dollars and should be based on the complexity of the task; the longer it
-- takes in your initial testing, the more you should offer.
--
-- -   0.036
--
-- -   0.048
--
-- -   0.060
--
-- -   0.072
--
-- -   0.120
--
-- -   0.240
--
-- -   0.360
--
-- -   0.480
--
-- -   0.600
--
-- -   0.720
--
-- -   0.840
--
-- -   0.960
--
-- -   1.080
--
-- -   1.200
--
-- Use one of the following prices for image classification, text
-- classification, and custom tasks. Prices are in US dollars.
--
-- -   0.012
--
-- -   0.024
--
-- -   0.036
--
-- -   0.048
--
-- -   0.060
--
-- -   0.072
--
-- -   0.120
--
-- -   0.240
--
-- -   0.360
--
-- -   0.480
--
-- -   0.600
--
-- -   0.720
--
-- -   0.840
--
-- -   0.960
--
-- -   1.080
--
-- -   1.200
--
-- Use one of the following prices for semantic segmentation tasks. Prices
-- are in US dollars.
--
-- -   0.840
--
-- -   0.960
--
-- -   1.080
--
-- -   1.200
--
-- Use one of the following prices for Textract AnalyzeDocument Important
-- Form Key Amazon Augmented AI review tasks. Prices are in US dollars.
--
-- -   2.400
--
-- -   2.280
--
-- -   2.160
--
-- -   2.040
--
-- -   1.920
--
-- -   1.800
--
-- -   1.680
--
-- -   1.560
--
-- -   1.440
--
-- -   1.320
--
-- -   1.200
--
-- -   1.080
--
-- -   0.960
--
-- -   0.840
--
-- -   0.720
--
-- -   0.600
--
-- -   0.480
--
-- -   0.360
--
-- -   0.240
--
-- -   0.120
--
-- -   0.072
--
-- -   0.060
--
-- -   0.048
--
-- -   0.036
--
-- -   0.024
--
-- -   0.012
--
-- Use one of the following prices for Rekognition DetectModerationLabels
-- Amazon Augmented AI review tasks. Prices are in US dollars.
--
-- -   1.200
--
-- -   1.080
--
-- -   0.960
--
-- -   0.840
--
-- -   0.720
--
-- -   0.600
--
-- -   0.480
--
-- -   0.360
--
-- -   0.240
--
-- -   0.120
--
-- -   0.072
--
-- -   0.060
--
-- -   0.048
--
-- -   0.036
--
-- -   0.024
--
-- -   0.012
--
-- Use one of the following prices for Amazon Augmented AI custom human
-- review tasks. Prices are in US dollars.
--
-- -   1.200
--
-- -   1.080
--
-- -   0.960
--
-- -   0.840
--
-- -   0.720
--
-- -   0.600
--
-- -   0.480
--
-- -   0.360
--
-- -   0.240
--
-- -   0.120
--
-- -   0.072
--
-- -   0.060
--
-- -   0.048
--
-- -   0.036
--
-- -   0.024
--
-- -   0.012
--
-- /See:/ 'newPublicWorkforceTaskPrice' smart constructor.
data PublicWorkforceTaskPrice = PublicWorkforceTaskPrice'
  { -- | Defines the amount of money paid to an Amazon Mechanical Turk worker in
    -- United States dollars.
    PublicWorkforceTaskPrice -> Maybe USD
amountInUsd :: Prelude.Maybe USD
  }
  deriving (PublicWorkforceTaskPrice -> PublicWorkforceTaskPrice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublicWorkforceTaskPrice -> PublicWorkforceTaskPrice -> Bool
$c/= :: PublicWorkforceTaskPrice -> PublicWorkforceTaskPrice -> Bool
== :: PublicWorkforceTaskPrice -> PublicWorkforceTaskPrice -> Bool
$c== :: PublicWorkforceTaskPrice -> PublicWorkforceTaskPrice -> Bool
Prelude.Eq, ReadPrec [PublicWorkforceTaskPrice]
ReadPrec PublicWorkforceTaskPrice
Int -> ReadS PublicWorkforceTaskPrice
ReadS [PublicWorkforceTaskPrice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublicWorkforceTaskPrice]
$creadListPrec :: ReadPrec [PublicWorkforceTaskPrice]
readPrec :: ReadPrec PublicWorkforceTaskPrice
$creadPrec :: ReadPrec PublicWorkforceTaskPrice
readList :: ReadS [PublicWorkforceTaskPrice]
$creadList :: ReadS [PublicWorkforceTaskPrice]
readsPrec :: Int -> ReadS PublicWorkforceTaskPrice
$creadsPrec :: Int -> ReadS PublicWorkforceTaskPrice
Prelude.Read, Int -> PublicWorkforceTaskPrice -> ShowS
[PublicWorkforceTaskPrice] -> ShowS
PublicWorkforceTaskPrice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublicWorkforceTaskPrice] -> ShowS
$cshowList :: [PublicWorkforceTaskPrice] -> ShowS
show :: PublicWorkforceTaskPrice -> String
$cshow :: PublicWorkforceTaskPrice -> String
showsPrec :: Int -> PublicWorkforceTaskPrice -> ShowS
$cshowsPrec :: Int -> PublicWorkforceTaskPrice -> ShowS
Prelude.Show, forall x.
Rep PublicWorkforceTaskPrice x -> PublicWorkforceTaskPrice
forall x.
PublicWorkforceTaskPrice -> Rep PublicWorkforceTaskPrice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PublicWorkforceTaskPrice x -> PublicWorkforceTaskPrice
$cfrom :: forall x.
PublicWorkforceTaskPrice -> Rep PublicWorkforceTaskPrice x
Prelude.Generic)

-- |
-- Create a value of 'PublicWorkforceTaskPrice' 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:
--
-- 'amountInUsd', 'publicWorkforceTaskPrice_amountInUsd' - Defines the amount of money paid to an Amazon Mechanical Turk worker in
-- United States dollars.
newPublicWorkforceTaskPrice ::
  PublicWorkforceTaskPrice
newPublicWorkforceTaskPrice :: PublicWorkforceTaskPrice
newPublicWorkforceTaskPrice =
  PublicWorkforceTaskPrice'
    { $sel:amountInUsd:PublicWorkforceTaskPrice' :: Maybe USD
amountInUsd =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Defines the amount of money paid to an Amazon Mechanical Turk worker in
-- United States dollars.
publicWorkforceTaskPrice_amountInUsd :: Lens.Lens' PublicWorkforceTaskPrice (Prelude.Maybe USD)
publicWorkforceTaskPrice_amountInUsd :: Lens' PublicWorkforceTaskPrice (Maybe USD)
publicWorkforceTaskPrice_amountInUsd = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicWorkforceTaskPrice' {Maybe USD
amountInUsd :: Maybe USD
$sel:amountInUsd:PublicWorkforceTaskPrice' :: PublicWorkforceTaskPrice -> Maybe USD
amountInUsd} -> Maybe USD
amountInUsd) (\s :: PublicWorkforceTaskPrice
s@PublicWorkforceTaskPrice' {} Maybe USD
a -> PublicWorkforceTaskPrice
s {$sel:amountInUsd:PublicWorkforceTaskPrice' :: Maybe USD
amountInUsd = Maybe USD
a} :: PublicWorkforceTaskPrice)

instance Data.FromJSON PublicWorkforceTaskPrice where
  parseJSON :: Value -> Parser PublicWorkforceTaskPrice
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PublicWorkforceTaskPrice"
      ( \Object
x ->
          Maybe USD -> PublicWorkforceTaskPrice
PublicWorkforceTaskPrice'
            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
"AmountInUsd")
      )

instance Prelude.Hashable PublicWorkforceTaskPrice where
  hashWithSalt :: Int -> PublicWorkforceTaskPrice -> Int
hashWithSalt Int
_salt PublicWorkforceTaskPrice' {Maybe USD
amountInUsd :: Maybe USD
$sel:amountInUsd:PublicWorkforceTaskPrice' :: PublicWorkforceTaskPrice -> Maybe USD
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe USD
amountInUsd

instance Prelude.NFData PublicWorkforceTaskPrice where
  rnf :: PublicWorkforceTaskPrice -> ()
rnf PublicWorkforceTaskPrice' {Maybe USD
amountInUsd :: Maybe USD
$sel:amountInUsd:PublicWorkforceTaskPrice' :: PublicWorkforceTaskPrice -> Maybe USD
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe USD
amountInUsd

instance Data.ToJSON PublicWorkforceTaskPrice where
  toJSON :: PublicWorkforceTaskPrice -> Value
toJSON PublicWorkforceTaskPrice' {Maybe USD
amountInUsd :: Maybe USD
$sel:amountInUsd:PublicWorkforceTaskPrice' :: PublicWorkforceTaskPrice -> Maybe USD
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"AmountInUsd" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe USD
amountInUsd]
      )