{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
reservedHours :: Prelude.Maybe Prelude.Text,
CoverageHours -> Maybe Text
totalRunningHours :: Prelude.Maybe Prelude.Text
}
deriving (CoverageHours -> CoverageHours -> Bool
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]
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
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. 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'
{ $sel:coverageHoursPercentage:CoverageHours' :: Maybe Text
coverageHoursPercentage =
forall a. Maybe a
Prelude.Nothing,
$sel:onDemandHours:CoverageHours' :: Maybe Text
onDemandHours = forall a. Maybe a
Prelude.Nothing,
$sel:reservedHours:CoverageHours' :: Maybe Text
reservedHours = forall a. Maybe a
Prelude.Nothing,
$sel:totalRunningHours:CoverageHours' :: Maybe Text
totalRunningHours = forall a. Maybe a
Prelude.Nothing
}
coverageHours_coverageHoursPercentage :: Lens.Lens' CoverageHours (Prelude.Maybe Prelude.Text)
coverageHours_coverageHoursPercentage :: Lens' CoverageHours (Maybe Text)
coverageHours_coverageHoursPercentage = 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 :: Lens' CoverageHours (Maybe Text)
coverageHours_onDemandHours = 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_reservedHours :: Lens.Lens' CoverageHours (Prelude.Maybe Prelude.Text)
coverageHours_reservedHours :: Lens' CoverageHours (Maybe Text)
coverageHours_reservedHours = 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)
coverageHours_totalRunningHours :: Lens.Lens' CoverageHours (Prelude.Maybe Prelude.Text)
coverageHours_totalRunningHours :: Lens' CoverageHours (Maybe Text)
coverageHours_totalRunningHours = 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)
instance Data.FromJSON CoverageHours where
parseJSON :: Value -> Parser CoverageHours
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CoverageHours"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> CoverageHours
CoverageHours'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CoverageHoursPercentage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OnDemandHours")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ReservedHours")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TotalRunningHours")
)
instance Prelude.Hashable CoverageHours where
hashWithSalt :: Int -> CoverageHours -> Int
hashWithSalt Int
_salt CoverageHours' {Maybe Text
totalRunningHours :: Maybe Text
reservedHours :: Maybe Text
onDemandHours :: Maybe Text
coverageHoursPercentage :: Maybe Text
$sel:totalRunningHours:CoverageHours' :: CoverageHours -> Maybe Text
$sel:reservedHours:CoverageHours' :: CoverageHours -> Maybe Text
$sel:onDemandHours:CoverageHours' :: CoverageHours -> Maybe Text
$sel:coverageHoursPercentage:CoverageHours' :: CoverageHours -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
coverageHoursPercentage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
onDemandHours
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reservedHours
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
totalRunningHours
instance Prelude.NFData CoverageHours where
rnf :: CoverageHours -> ()
rnf CoverageHours' {Maybe Text
totalRunningHours :: Maybe Text
reservedHours :: Maybe Text
onDemandHours :: Maybe Text
coverageHoursPercentage :: Maybe Text
$sel:totalRunningHours:CoverageHours' :: CoverageHours -> Maybe Text
$sel:reservedHours:CoverageHours' :: CoverageHours -> Maybe Text
$sel:onDemandHours:CoverageHours' :: CoverageHours -> Maybe Text
$sel:coverageHoursPercentage:CoverageHours' :: CoverageHours -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
coverageHoursPercentage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
onDemandHours
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reservedHours
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
totalRunningHours