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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(PublicWorkforceTaskPrice -> PublicWorkforceTaskPrice -> Bool)
-> (PublicWorkforceTaskPrice -> PublicWorkforceTaskPrice -> Bool)
-> Eq PublicWorkforceTaskPrice
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]
(Int -> ReadS PublicWorkforceTaskPrice)
-> ReadS [PublicWorkforceTaskPrice]
-> ReadPrec PublicWorkforceTaskPrice
-> ReadPrec [PublicWorkforceTaskPrice]
-> Read 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
(Int -> PublicWorkforceTaskPrice -> ShowS)
-> (PublicWorkforceTaskPrice -> String)
-> ([PublicWorkforceTaskPrice] -> ShowS)
-> Show PublicWorkforceTaskPrice
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.
 PublicWorkforceTaskPrice -> Rep PublicWorkforceTaskPrice x)
-> (forall x.
    Rep PublicWorkforceTaskPrice x -> PublicWorkforceTaskPrice)
-> Generic PublicWorkforceTaskPrice
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' :: Maybe USD -> PublicWorkforceTaskPrice
PublicWorkforceTaskPrice'
    { $sel:amountInUsd:PublicWorkforceTaskPrice' :: Maybe USD
amountInUsd =
        Maybe USD
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 :: (Maybe USD -> f (Maybe USD))
-> PublicWorkforceTaskPrice -> f PublicWorkforceTaskPrice
publicWorkforceTaskPrice_amountInUsd = (PublicWorkforceTaskPrice -> Maybe USD)
-> (PublicWorkforceTaskPrice
    -> Maybe USD -> PublicWorkforceTaskPrice)
-> Lens
     PublicWorkforceTaskPrice
     PublicWorkforceTaskPrice
     (Maybe USD)
     (Maybe USD)
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 Core.FromJSON PublicWorkforceTaskPrice where
  parseJSON :: Value -> Parser PublicWorkforceTaskPrice
parseJSON =
    String
-> (Object -> Parser PublicWorkforceTaskPrice)
-> Value
-> Parser PublicWorkforceTaskPrice
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PublicWorkforceTaskPrice"
      ( \Object
x ->
          Maybe USD -> PublicWorkforceTaskPrice
PublicWorkforceTaskPrice'
            (Maybe USD -> PublicWorkforceTaskPrice)
-> Parser (Maybe USD) -> Parser PublicWorkforceTaskPrice
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe USD)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AmountInUsd")
      )

instance Prelude.Hashable PublicWorkforceTaskPrice

instance Prelude.NFData PublicWorkforceTaskPrice

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