{-# 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.CoverageCost where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CoverageCost = CoverageCost'
{
CoverageCost -> Maybe Text
onDemandCost :: Prelude.Maybe Prelude.Text
}
deriving (CoverageCost -> CoverageCost -> Bool
(CoverageCost -> CoverageCost -> Bool)
-> (CoverageCost -> CoverageCost -> Bool) -> Eq CoverageCost
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CoverageCost -> CoverageCost -> Bool
$c/= :: CoverageCost -> CoverageCost -> Bool
== :: CoverageCost -> CoverageCost -> Bool
$c== :: CoverageCost -> CoverageCost -> Bool
Prelude.Eq, ReadPrec [CoverageCost]
ReadPrec CoverageCost
Int -> ReadS CoverageCost
ReadS [CoverageCost]
(Int -> ReadS CoverageCost)
-> ReadS [CoverageCost]
-> ReadPrec CoverageCost
-> ReadPrec [CoverageCost]
-> Read CoverageCost
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CoverageCost]
$creadListPrec :: ReadPrec [CoverageCost]
readPrec :: ReadPrec CoverageCost
$creadPrec :: ReadPrec CoverageCost
readList :: ReadS [CoverageCost]
$creadList :: ReadS [CoverageCost]
readsPrec :: Int -> ReadS CoverageCost
$creadsPrec :: Int -> ReadS CoverageCost
Prelude.Read, Int -> CoverageCost -> ShowS
[CoverageCost] -> ShowS
CoverageCost -> String
(Int -> CoverageCost -> ShowS)
-> (CoverageCost -> String)
-> ([CoverageCost] -> ShowS)
-> Show CoverageCost
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CoverageCost] -> ShowS
$cshowList :: [CoverageCost] -> ShowS
show :: CoverageCost -> String
$cshow :: CoverageCost -> String
showsPrec :: Int -> CoverageCost -> ShowS
$cshowsPrec :: Int -> CoverageCost -> ShowS
Prelude.Show, (forall x. CoverageCost -> Rep CoverageCost x)
-> (forall x. Rep CoverageCost x -> CoverageCost)
-> Generic CoverageCost
forall x. Rep CoverageCost x -> CoverageCost
forall x. CoverageCost -> Rep CoverageCost x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CoverageCost x -> CoverageCost
$cfrom :: forall x. CoverageCost -> Rep CoverageCost x
Prelude.Generic)
newCoverageCost ::
CoverageCost
newCoverageCost :: CoverageCost
newCoverageCost =
CoverageCost' :: Maybe Text -> CoverageCost
CoverageCost' {$sel:onDemandCost:CoverageCost' :: Maybe Text
onDemandCost = Maybe Text
forall a. Maybe a
Prelude.Nothing}
coverageCost_onDemandCost :: Lens.Lens' CoverageCost (Prelude.Maybe Prelude.Text)
coverageCost_onDemandCost :: (Maybe Text -> f (Maybe Text)) -> CoverageCost -> f CoverageCost
coverageCost_onDemandCost = (CoverageCost -> Maybe Text)
-> (CoverageCost -> Maybe Text -> CoverageCost)
-> Lens CoverageCost CoverageCost (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CoverageCost' {Maybe Text
onDemandCost :: Maybe Text
$sel:onDemandCost:CoverageCost' :: CoverageCost -> Maybe Text
onDemandCost} -> Maybe Text
onDemandCost) (\s :: CoverageCost
s@CoverageCost' {} Maybe Text
a -> CoverageCost
s {$sel:onDemandCost:CoverageCost' :: Maybe Text
onDemandCost = Maybe Text
a} :: CoverageCost)
instance Core.FromJSON CoverageCost where
parseJSON :: Value -> Parser CoverageCost
parseJSON =
String
-> (Object -> Parser CoverageCost) -> Value -> Parser CoverageCost
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CoverageCost"
( \Object
x ->
Maybe Text -> CoverageCost
CoverageCost'
(Maybe Text -> CoverageCost)
-> Parser (Maybe Text) -> Parser CoverageCost
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
"OnDemandCost")
)
instance Prelude.Hashable CoverageCost
instance Prelude.NFData CoverageCost