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