{-# 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.DevOpsGuru.Types.ServiceResourceCost where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types.CostEstimationServiceResourceState
import qualified Amazonka.Prelude as Prelude
data ServiceResourceCost = ServiceResourceCost'
{
ServiceResourceCost -> Maybe Double
cost :: Prelude.Maybe Prelude.Double,
ServiceResourceCost -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
ServiceResourceCost -> Maybe CostEstimationServiceResourceState
state :: Prelude.Maybe CostEstimationServiceResourceState,
ServiceResourceCost -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
ServiceResourceCost -> Maybe Double
unitCost :: Prelude.Maybe Prelude.Double
}
deriving (ServiceResourceCost -> ServiceResourceCost -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceResourceCost -> ServiceResourceCost -> Bool
$c/= :: ServiceResourceCost -> ServiceResourceCost -> Bool
== :: ServiceResourceCost -> ServiceResourceCost -> Bool
$c== :: ServiceResourceCost -> ServiceResourceCost -> Bool
Prelude.Eq, ReadPrec [ServiceResourceCost]
ReadPrec ServiceResourceCost
Int -> ReadS ServiceResourceCost
ReadS [ServiceResourceCost]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceResourceCost]
$creadListPrec :: ReadPrec [ServiceResourceCost]
readPrec :: ReadPrec ServiceResourceCost
$creadPrec :: ReadPrec ServiceResourceCost
readList :: ReadS [ServiceResourceCost]
$creadList :: ReadS [ServiceResourceCost]
readsPrec :: Int -> ReadS ServiceResourceCost
$creadsPrec :: Int -> ReadS ServiceResourceCost
Prelude.Read, Int -> ServiceResourceCost -> ShowS
[ServiceResourceCost] -> ShowS
ServiceResourceCost -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceResourceCost] -> ShowS
$cshowList :: [ServiceResourceCost] -> ShowS
show :: ServiceResourceCost -> String
$cshow :: ServiceResourceCost -> String
showsPrec :: Int -> ServiceResourceCost -> ShowS
$cshowsPrec :: Int -> ServiceResourceCost -> ShowS
Prelude.Show, forall x. Rep ServiceResourceCost x -> ServiceResourceCost
forall x. ServiceResourceCost -> Rep ServiceResourceCost x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceResourceCost x -> ServiceResourceCost
$cfrom :: forall x. ServiceResourceCost -> Rep ServiceResourceCost x
Prelude.Generic)
newServiceResourceCost ::
ServiceResourceCost
newServiceResourceCost :: ServiceResourceCost
newServiceResourceCost =
ServiceResourceCost'
{ $sel:cost:ServiceResourceCost' :: Maybe Double
cost = forall a. Maybe a
Prelude.Nothing,
$sel:count:ServiceResourceCost' :: Maybe Int
count = forall a. Maybe a
Prelude.Nothing,
$sel:state:ServiceResourceCost' :: Maybe CostEstimationServiceResourceState
state = forall a. Maybe a
Prelude.Nothing,
$sel:type':ServiceResourceCost' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing,
$sel:unitCost:ServiceResourceCost' :: Maybe Double
unitCost = forall a. Maybe a
Prelude.Nothing
}
serviceResourceCost_cost :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Double)
serviceResourceCost_cost :: Lens' ServiceResourceCost (Maybe Double)
serviceResourceCost_cost = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceResourceCost' {Maybe Double
cost :: Maybe Double
$sel:cost:ServiceResourceCost' :: ServiceResourceCost -> Maybe Double
cost} -> Maybe Double
cost) (\s :: ServiceResourceCost
s@ServiceResourceCost' {} Maybe Double
a -> ServiceResourceCost
s {$sel:cost:ServiceResourceCost' :: Maybe Double
cost = Maybe Double
a} :: ServiceResourceCost)
serviceResourceCost_count :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Int)
serviceResourceCost_count :: Lens' ServiceResourceCost (Maybe Int)
serviceResourceCost_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceResourceCost' {Maybe Int
count :: Maybe Int
$sel:count:ServiceResourceCost' :: ServiceResourceCost -> Maybe Int
count} -> Maybe Int
count) (\s :: ServiceResourceCost
s@ServiceResourceCost' {} Maybe Int
a -> ServiceResourceCost
s {$sel:count:ServiceResourceCost' :: Maybe Int
count = Maybe Int
a} :: ServiceResourceCost)
serviceResourceCost_state :: Lens.Lens' ServiceResourceCost (Prelude.Maybe CostEstimationServiceResourceState)
serviceResourceCost_state :: Lens'
ServiceResourceCost (Maybe CostEstimationServiceResourceState)
serviceResourceCost_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceResourceCost' {Maybe CostEstimationServiceResourceState
state :: Maybe CostEstimationServiceResourceState
$sel:state:ServiceResourceCost' :: ServiceResourceCost -> Maybe CostEstimationServiceResourceState
state} -> Maybe CostEstimationServiceResourceState
state) (\s :: ServiceResourceCost
s@ServiceResourceCost' {} Maybe CostEstimationServiceResourceState
a -> ServiceResourceCost
s {$sel:state:ServiceResourceCost' :: Maybe CostEstimationServiceResourceState
state = Maybe CostEstimationServiceResourceState
a} :: ServiceResourceCost)
serviceResourceCost_type :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Text)
serviceResourceCost_type :: Lens' ServiceResourceCost (Maybe Text)
serviceResourceCost_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceResourceCost' {Maybe Text
type' :: Maybe Text
$sel:type':ServiceResourceCost' :: ServiceResourceCost -> Maybe Text
type'} -> Maybe Text
type') (\s :: ServiceResourceCost
s@ServiceResourceCost' {} Maybe Text
a -> ServiceResourceCost
s {$sel:type':ServiceResourceCost' :: Maybe Text
type' = Maybe Text
a} :: ServiceResourceCost)
serviceResourceCost_unitCost :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Double)
serviceResourceCost_unitCost :: Lens' ServiceResourceCost (Maybe Double)
serviceResourceCost_unitCost = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceResourceCost' {Maybe Double
unitCost :: Maybe Double
$sel:unitCost:ServiceResourceCost' :: ServiceResourceCost -> Maybe Double
unitCost} -> Maybe Double
unitCost) (\s :: ServiceResourceCost
s@ServiceResourceCost' {} Maybe Double
a -> ServiceResourceCost
s {$sel:unitCost:ServiceResourceCost' :: Maybe Double
unitCost = Maybe Double
a} :: ServiceResourceCost)
instance Data.FromJSON ServiceResourceCost where
parseJSON :: Value -> Parser ServiceResourceCost
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServiceResourceCost"
( \Object
x ->
Maybe Double
-> Maybe Int
-> Maybe CostEstimationServiceResourceState
-> Maybe Text
-> Maybe Double
-> ServiceResourceCost
ServiceResourceCost'
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
"Cost")
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
"Count")
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
"State")
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
"Type")
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
"UnitCost")
)
instance Prelude.Hashable ServiceResourceCost where
hashWithSalt :: Int -> ServiceResourceCost -> Int
hashWithSalt Int
_salt ServiceResourceCost' {Maybe Double
Maybe Int
Maybe Text
Maybe CostEstimationServiceResourceState
unitCost :: Maybe Double
type' :: Maybe Text
state :: Maybe CostEstimationServiceResourceState
count :: Maybe Int
cost :: Maybe Double
$sel:unitCost:ServiceResourceCost' :: ServiceResourceCost -> Maybe Double
$sel:type':ServiceResourceCost' :: ServiceResourceCost -> Maybe Text
$sel:state:ServiceResourceCost' :: ServiceResourceCost -> Maybe CostEstimationServiceResourceState
$sel:count:ServiceResourceCost' :: ServiceResourceCost -> Maybe Int
$sel:cost:ServiceResourceCost' :: ServiceResourceCost -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
cost
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
count
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CostEstimationServiceResourceState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
unitCost
instance Prelude.NFData ServiceResourceCost where
rnf :: ServiceResourceCost -> ()
rnf ServiceResourceCost' {Maybe Double
Maybe Int
Maybe Text
Maybe CostEstimationServiceResourceState
unitCost :: Maybe Double
type' :: Maybe Text
state :: Maybe CostEstimationServiceResourceState
count :: Maybe Int
cost :: Maybe Double
$sel:unitCost:ServiceResourceCost' :: ServiceResourceCost -> Maybe Double
$sel:type':ServiceResourceCost' :: ServiceResourceCost -> Maybe Text
$sel:state:ServiceResourceCost' :: ServiceResourceCost -> Maybe CostEstimationServiceResourceState
$sel:count:ServiceResourceCost' :: ServiceResourceCost -> Maybe Int
$sel:cost:ServiceResourceCost' :: ServiceResourceCost -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
cost
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
count
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CostEstimationServiceResourceState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
unitCost