{-# 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.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
data PublicWorkforceTaskPrice = PublicWorkforceTaskPrice'
{
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)
newPublicWorkforceTaskPrice ::
PublicWorkforceTaskPrice
newPublicWorkforceTaskPrice :: PublicWorkforceTaskPrice
newPublicWorkforceTaskPrice =
PublicWorkforceTaskPrice' :: Maybe USD -> PublicWorkforceTaskPrice
PublicWorkforceTaskPrice'
{ $sel:amountInUsd:PublicWorkforceTaskPrice' :: Maybe USD
amountInUsd =
Maybe USD
forall a. Maybe a
Prelude.Nothing
}
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]
)