{-# 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.Budgets.Types.BudgetedAndActualAmounts where
import Amazonka.Budgets.Types.Spend
import Amazonka.Budgets.Types.TimePeriod
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BudgetedAndActualAmounts = BudgetedAndActualAmounts'
{
BudgetedAndActualAmounts -> Maybe TimePeriod
timePeriod :: Prelude.Maybe TimePeriod,
BudgetedAndActualAmounts -> Maybe Spend
actualAmount :: Prelude.Maybe Spend,
BudgetedAndActualAmounts -> Maybe Spend
budgetedAmount :: Prelude.Maybe Spend
}
deriving (BudgetedAndActualAmounts -> BudgetedAndActualAmounts -> Bool
(BudgetedAndActualAmounts -> BudgetedAndActualAmounts -> Bool)
-> (BudgetedAndActualAmounts -> BudgetedAndActualAmounts -> Bool)
-> Eq BudgetedAndActualAmounts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BudgetedAndActualAmounts -> BudgetedAndActualAmounts -> Bool
$c/= :: BudgetedAndActualAmounts -> BudgetedAndActualAmounts -> Bool
== :: BudgetedAndActualAmounts -> BudgetedAndActualAmounts -> Bool
$c== :: BudgetedAndActualAmounts -> BudgetedAndActualAmounts -> Bool
Prelude.Eq, ReadPrec [BudgetedAndActualAmounts]
ReadPrec BudgetedAndActualAmounts
Int -> ReadS BudgetedAndActualAmounts
ReadS [BudgetedAndActualAmounts]
(Int -> ReadS BudgetedAndActualAmounts)
-> ReadS [BudgetedAndActualAmounts]
-> ReadPrec BudgetedAndActualAmounts
-> ReadPrec [BudgetedAndActualAmounts]
-> Read BudgetedAndActualAmounts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BudgetedAndActualAmounts]
$creadListPrec :: ReadPrec [BudgetedAndActualAmounts]
readPrec :: ReadPrec BudgetedAndActualAmounts
$creadPrec :: ReadPrec BudgetedAndActualAmounts
readList :: ReadS [BudgetedAndActualAmounts]
$creadList :: ReadS [BudgetedAndActualAmounts]
readsPrec :: Int -> ReadS BudgetedAndActualAmounts
$creadsPrec :: Int -> ReadS BudgetedAndActualAmounts
Prelude.Read, Int -> BudgetedAndActualAmounts -> ShowS
[BudgetedAndActualAmounts] -> ShowS
BudgetedAndActualAmounts -> String
(Int -> BudgetedAndActualAmounts -> ShowS)
-> (BudgetedAndActualAmounts -> String)
-> ([BudgetedAndActualAmounts] -> ShowS)
-> Show BudgetedAndActualAmounts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BudgetedAndActualAmounts] -> ShowS
$cshowList :: [BudgetedAndActualAmounts] -> ShowS
show :: BudgetedAndActualAmounts -> String
$cshow :: BudgetedAndActualAmounts -> String
showsPrec :: Int -> BudgetedAndActualAmounts -> ShowS
$cshowsPrec :: Int -> BudgetedAndActualAmounts -> ShowS
Prelude.Show, (forall x.
BudgetedAndActualAmounts -> Rep BudgetedAndActualAmounts x)
-> (forall x.
Rep BudgetedAndActualAmounts x -> BudgetedAndActualAmounts)
-> Generic BudgetedAndActualAmounts
forall x.
Rep BudgetedAndActualAmounts x -> BudgetedAndActualAmounts
forall x.
BudgetedAndActualAmounts -> Rep BudgetedAndActualAmounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BudgetedAndActualAmounts x -> BudgetedAndActualAmounts
$cfrom :: forall x.
BudgetedAndActualAmounts -> Rep BudgetedAndActualAmounts x
Prelude.Generic)
newBudgetedAndActualAmounts ::
BudgetedAndActualAmounts
newBudgetedAndActualAmounts :: BudgetedAndActualAmounts
newBudgetedAndActualAmounts =
BudgetedAndActualAmounts' :: Maybe TimePeriod
-> Maybe Spend -> Maybe Spend -> BudgetedAndActualAmounts
BudgetedAndActualAmounts'
{ $sel:timePeriod:BudgetedAndActualAmounts' :: Maybe TimePeriod
timePeriod =
Maybe TimePeriod
forall a. Maybe a
Prelude.Nothing,
$sel:actualAmount:BudgetedAndActualAmounts' :: Maybe Spend
actualAmount = Maybe Spend
forall a. Maybe a
Prelude.Nothing,
$sel:budgetedAmount:BudgetedAndActualAmounts' :: Maybe Spend
budgetedAmount = Maybe Spend
forall a. Maybe a
Prelude.Nothing
}
budgetedAndActualAmounts_timePeriod :: Lens.Lens' BudgetedAndActualAmounts (Prelude.Maybe TimePeriod)
budgetedAndActualAmounts_timePeriod :: (Maybe TimePeriod -> f (Maybe TimePeriod))
-> BudgetedAndActualAmounts -> f BudgetedAndActualAmounts
budgetedAndActualAmounts_timePeriod = (BudgetedAndActualAmounts -> Maybe TimePeriod)
-> (BudgetedAndActualAmounts
-> Maybe TimePeriod -> BudgetedAndActualAmounts)
-> Lens
BudgetedAndActualAmounts
BudgetedAndActualAmounts
(Maybe TimePeriod)
(Maybe TimePeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BudgetedAndActualAmounts' {Maybe TimePeriod
timePeriod :: Maybe TimePeriod
$sel:timePeriod:BudgetedAndActualAmounts' :: BudgetedAndActualAmounts -> Maybe TimePeriod
timePeriod} -> Maybe TimePeriod
timePeriod) (\s :: BudgetedAndActualAmounts
s@BudgetedAndActualAmounts' {} Maybe TimePeriod
a -> BudgetedAndActualAmounts
s {$sel:timePeriod:BudgetedAndActualAmounts' :: Maybe TimePeriod
timePeriod = Maybe TimePeriod
a} :: BudgetedAndActualAmounts)
budgetedAndActualAmounts_actualAmount :: Lens.Lens' BudgetedAndActualAmounts (Prelude.Maybe Spend)
budgetedAndActualAmounts_actualAmount :: (Maybe Spend -> f (Maybe Spend))
-> BudgetedAndActualAmounts -> f BudgetedAndActualAmounts
budgetedAndActualAmounts_actualAmount = (BudgetedAndActualAmounts -> Maybe Spend)
-> (BudgetedAndActualAmounts
-> Maybe Spend -> BudgetedAndActualAmounts)
-> Lens
BudgetedAndActualAmounts
BudgetedAndActualAmounts
(Maybe Spend)
(Maybe Spend)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BudgetedAndActualAmounts' {Maybe Spend
actualAmount :: Maybe Spend
$sel:actualAmount:BudgetedAndActualAmounts' :: BudgetedAndActualAmounts -> Maybe Spend
actualAmount} -> Maybe Spend
actualAmount) (\s :: BudgetedAndActualAmounts
s@BudgetedAndActualAmounts' {} Maybe Spend
a -> BudgetedAndActualAmounts
s {$sel:actualAmount:BudgetedAndActualAmounts' :: Maybe Spend
actualAmount = Maybe Spend
a} :: BudgetedAndActualAmounts)
budgetedAndActualAmounts_budgetedAmount :: Lens.Lens' BudgetedAndActualAmounts (Prelude.Maybe Spend)
budgetedAndActualAmounts_budgetedAmount :: (Maybe Spend -> f (Maybe Spend))
-> BudgetedAndActualAmounts -> f BudgetedAndActualAmounts
budgetedAndActualAmounts_budgetedAmount = (BudgetedAndActualAmounts -> Maybe Spend)
-> (BudgetedAndActualAmounts
-> Maybe Spend -> BudgetedAndActualAmounts)
-> Lens
BudgetedAndActualAmounts
BudgetedAndActualAmounts
(Maybe Spend)
(Maybe Spend)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BudgetedAndActualAmounts' {Maybe Spend
budgetedAmount :: Maybe Spend
$sel:budgetedAmount:BudgetedAndActualAmounts' :: BudgetedAndActualAmounts -> Maybe Spend
budgetedAmount} -> Maybe Spend
budgetedAmount) (\s :: BudgetedAndActualAmounts
s@BudgetedAndActualAmounts' {} Maybe Spend
a -> BudgetedAndActualAmounts
s {$sel:budgetedAmount:BudgetedAndActualAmounts' :: Maybe Spend
budgetedAmount = Maybe Spend
a} :: BudgetedAndActualAmounts)
instance Core.FromJSON BudgetedAndActualAmounts where
parseJSON :: Value -> Parser BudgetedAndActualAmounts
parseJSON =
String
-> (Object -> Parser BudgetedAndActualAmounts)
-> Value
-> Parser BudgetedAndActualAmounts
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BudgetedAndActualAmounts"
( \Object
x ->
Maybe TimePeriod
-> Maybe Spend -> Maybe Spend -> BudgetedAndActualAmounts
BudgetedAndActualAmounts'
(Maybe TimePeriod
-> Maybe Spend -> Maybe Spend -> BudgetedAndActualAmounts)
-> Parser (Maybe TimePeriod)
-> Parser (Maybe Spend -> Maybe Spend -> BudgetedAndActualAmounts)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TimePeriod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimePeriod")
Parser (Maybe Spend -> Maybe Spend -> BudgetedAndActualAmounts)
-> Parser (Maybe Spend)
-> Parser (Maybe Spend -> BudgetedAndActualAmounts)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Spend)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ActualAmount")
Parser (Maybe Spend -> BudgetedAndActualAmounts)
-> Parser (Maybe Spend) -> Parser BudgetedAndActualAmounts
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Spend)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BudgetedAmount")
)
instance Prelude.Hashable BudgetedAndActualAmounts
instance Prelude.NFData BudgetedAndActualAmounts