{-# 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.CostExplorer.Types.SavingsPlansUtilization where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SavingsPlansUtilization = SavingsPlansUtilization'
{
SavingsPlansUtilization -> Maybe Text
unusedCommitment :: Prelude.Maybe Prelude.Text,
SavingsPlansUtilization -> Maybe Text
utilizationPercentage :: Prelude.Maybe Prelude.Text,
SavingsPlansUtilization -> Maybe Text
totalCommitment :: Prelude.Maybe Prelude.Text,
SavingsPlansUtilization -> Maybe Text
usedCommitment :: Prelude.Maybe Prelude.Text
}
deriving (SavingsPlansUtilization -> SavingsPlansUtilization -> Bool
(SavingsPlansUtilization -> SavingsPlansUtilization -> Bool)
-> (SavingsPlansUtilization -> SavingsPlansUtilization -> Bool)
-> Eq SavingsPlansUtilization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlansUtilization -> SavingsPlansUtilization -> Bool
$c/= :: SavingsPlansUtilization -> SavingsPlansUtilization -> Bool
== :: SavingsPlansUtilization -> SavingsPlansUtilization -> Bool
$c== :: SavingsPlansUtilization -> SavingsPlansUtilization -> Bool
Prelude.Eq, ReadPrec [SavingsPlansUtilization]
ReadPrec SavingsPlansUtilization
Int -> ReadS SavingsPlansUtilization
ReadS [SavingsPlansUtilization]
(Int -> ReadS SavingsPlansUtilization)
-> ReadS [SavingsPlansUtilization]
-> ReadPrec SavingsPlansUtilization
-> ReadPrec [SavingsPlansUtilization]
-> Read SavingsPlansUtilization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlansUtilization]
$creadListPrec :: ReadPrec [SavingsPlansUtilization]
readPrec :: ReadPrec SavingsPlansUtilization
$creadPrec :: ReadPrec SavingsPlansUtilization
readList :: ReadS [SavingsPlansUtilization]
$creadList :: ReadS [SavingsPlansUtilization]
readsPrec :: Int -> ReadS SavingsPlansUtilization
$creadsPrec :: Int -> ReadS SavingsPlansUtilization
Prelude.Read, Int -> SavingsPlansUtilization -> ShowS
[SavingsPlansUtilization] -> ShowS
SavingsPlansUtilization -> String
(Int -> SavingsPlansUtilization -> ShowS)
-> (SavingsPlansUtilization -> String)
-> ([SavingsPlansUtilization] -> ShowS)
-> Show SavingsPlansUtilization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlansUtilization] -> ShowS
$cshowList :: [SavingsPlansUtilization] -> ShowS
show :: SavingsPlansUtilization -> String
$cshow :: SavingsPlansUtilization -> String
showsPrec :: Int -> SavingsPlansUtilization -> ShowS
$cshowsPrec :: Int -> SavingsPlansUtilization -> ShowS
Prelude.Show, (forall x.
SavingsPlansUtilization -> Rep SavingsPlansUtilization x)
-> (forall x.
Rep SavingsPlansUtilization x -> SavingsPlansUtilization)
-> Generic SavingsPlansUtilization
forall x. Rep SavingsPlansUtilization x -> SavingsPlansUtilization
forall x. SavingsPlansUtilization -> Rep SavingsPlansUtilization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SavingsPlansUtilization x -> SavingsPlansUtilization
$cfrom :: forall x. SavingsPlansUtilization -> Rep SavingsPlansUtilization x
Prelude.Generic)
newSavingsPlansUtilization ::
SavingsPlansUtilization
newSavingsPlansUtilization :: SavingsPlansUtilization
newSavingsPlansUtilization =
SavingsPlansUtilization' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SavingsPlansUtilization
SavingsPlansUtilization'
{ $sel:unusedCommitment:SavingsPlansUtilization' :: Maybe Text
unusedCommitment =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:utilizationPercentage:SavingsPlansUtilization' :: Maybe Text
utilizationPercentage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:totalCommitment:SavingsPlansUtilization' :: Maybe Text
totalCommitment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:usedCommitment:SavingsPlansUtilization' :: Maybe Text
usedCommitment = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
savingsPlansUtilization_unusedCommitment :: Lens.Lens' SavingsPlansUtilization (Prelude.Maybe Prelude.Text)
savingsPlansUtilization_unusedCommitment :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansUtilization -> f SavingsPlansUtilization
savingsPlansUtilization_unusedCommitment = (SavingsPlansUtilization -> Maybe Text)
-> (SavingsPlansUtilization
-> Maybe Text -> SavingsPlansUtilization)
-> Lens
SavingsPlansUtilization
SavingsPlansUtilization
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansUtilization' {Maybe Text
unusedCommitment :: Maybe Text
$sel:unusedCommitment:SavingsPlansUtilization' :: SavingsPlansUtilization -> Maybe Text
unusedCommitment} -> Maybe Text
unusedCommitment) (\s :: SavingsPlansUtilization
s@SavingsPlansUtilization' {} Maybe Text
a -> SavingsPlansUtilization
s {$sel:unusedCommitment:SavingsPlansUtilization' :: Maybe Text
unusedCommitment = Maybe Text
a} :: SavingsPlansUtilization)
savingsPlansUtilization_utilizationPercentage :: Lens.Lens' SavingsPlansUtilization (Prelude.Maybe Prelude.Text)
savingsPlansUtilization_utilizationPercentage :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansUtilization -> f SavingsPlansUtilization
savingsPlansUtilization_utilizationPercentage = (SavingsPlansUtilization -> Maybe Text)
-> (SavingsPlansUtilization
-> Maybe Text -> SavingsPlansUtilization)
-> Lens
SavingsPlansUtilization
SavingsPlansUtilization
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansUtilization' {Maybe Text
utilizationPercentage :: Maybe Text
$sel:utilizationPercentage:SavingsPlansUtilization' :: SavingsPlansUtilization -> Maybe Text
utilizationPercentage} -> Maybe Text
utilizationPercentage) (\s :: SavingsPlansUtilization
s@SavingsPlansUtilization' {} Maybe Text
a -> SavingsPlansUtilization
s {$sel:utilizationPercentage:SavingsPlansUtilization' :: Maybe Text
utilizationPercentage = Maybe Text
a} :: SavingsPlansUtilization)
savingsPlansUtilization_totalCommitment :: Lens.Lens' SavingsPlansUtilization (Prelude.Maybe Prelude.Text)
savingsPlansUtilization_totalCommitment :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansUtilization -> f SavingsPlansUtilization
savingsPlansUtilization_totalCommitment = (SavingsPlansUtilization -> Maybe Text)
-> (SavingsPlansUtilization
-> Maybe Text -> SavingsPlansUtilization)
-> Lens
SavingsPlansUtilization
SavingsPlansUtilization
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansUtilization' {Maybe Text
totalCommitment :: Maybe Text
$sel:totalCommitment:SavingsPlansUtilization' :: SavingsPlansUtilization -> Maybe Text
totalCommitment} -> Maybe Text
totalCommitment) (\s :: SavingsPlansUtilization
s@SavingsPlansUtilization' {} Maybe Text
a -> SavingsPlansUtilization
s {$sel:totalCommitment:SavingsPlansUtilization' :: Maybe Text
totalCommitment = Maybe Text
a} :: SavingsPlansUtilization)
savingsPlansUtilization_usedCommitment :: Lens.Lens' SavingsPlansUtilization (Prelude.Maybe Prelude.Text)
savingsPlansUtilization_usedCommitment :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansUtilization -> f SavingsPlansUtilization
savingsPlansUtilization_usedCommitment = (SavingsPlansUtilization -> Maybe Text)
-> (SavingsPlansUtilization
-> Maybe Text -> SavingsPlansUtilization)
-> Lens
SavingsPlansUtilization
SavingsPlansUtilization
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansUtilization' {Maybe Text
usedCommitment :: Maybe Text
$sel:usedCommitment:SavingsPlansUtilization' :: SavingsPlansUtilization -> Maybe Text
usedCommitment} -> Maybe Text
usedCommitment) (\s :: SavingsPlansUtilization
s@SavingsPlansUtilization' {} Maybe Text
a -> SavingsPlansUtilization
s {$sel:usedCommitment:SavingsPlansUtilization' :: Maybe Text
usedCommitment = Maybe Text
a} :: SavingsPlansUtilization)
instance Core.FromJSON SavingsPlansUtilization where
parseJSON :: Value -> Parser SavingsPlansUtilization
parseJSON =
String
-> (Object -> Parser SavingsPlansUtilization)
-> Value
-> Parser SavingsPlansUtilization
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SavingsPlansUtilization"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SavingsPlansUtilization
SavingsPlansUtilization'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SavingsPlansUtilization)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> SavingsPlansUtilization)
forall (f :: * -> *) a b. Functor 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
"UnusedCommitment")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> SavingsPlansUtilization)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SavingsPlansUtilization)
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
"UtilizationPercentage")
Parser (Maybe Text -> Maybe Text -> SavingsPlansUtilization)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SavingsPlansUtilization)
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
"TotalCommitment")
Parser (Maybe Text -> SavingsPlansUtilization)
-> Parser (Maybe Text) -> Parser SavingsPlansUtilization
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
"UsedCommitment")
)
instance Prelude.Hashable SavingsPlansUtilization
instance Prelude.NFData SavingsPlansUtilization