{-# 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 Amazonka.DevOpsGuru.Types.CostEstimationServiceResourceState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServiceResourceCost = ServiceResourceCost'
{
ServiceResourceCost -> Maybe CostEstimationServiceResourceState
state :: Prelude.Maybe CostEstimationServiceResourceState,
ServiceResourceCost -> Maybe Double
unitCost :: Prelude.Maybe Prelude.Double,
ServiceResourceCost -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
ServiceResourceCost -> Maybe Double
cost :: Prelude.Maybe Prelude.Double,
ServiceResourceCost -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (ServiceResourceCost -> ServiceResourceCost -> Bool
(ServiceResourceCost -> ServiceResourceCost -> Bool)
-> (ServiceResourceCost -> ServiceResourceCost -> Bool)
-> Eq ServiceResourceCost
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]
(Int -> ReadS ServiceResourceCost)
-> ReadS [ServiceResourceCost]
-> ReadPrec ServiceResourceCost
-> ReadPrec [ServiceResourceCost]
-> Read 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
(Int -> ServiceResourceCost -> ShowS)
-> (ServiceResourceCost -> String)
-> ([ServiceResourceCost] -> ShowS)
-> Show ServiceResourceCost
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. ServiceResourceCost -> Rep ServiceResourceCost x)
-> (forall x. Rep ServiceResourceCost x -> ServiceResourceCost)
-> Generic ServiceResourceCost
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' :: Maybe CostEstimationServiceResourceState
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Text
-> ServiceResourceCost
ServiceResourceCost'
{ $sel:state:ServiceResourceCost' :: Maybe CostEstimationServiceResourceState
state = Maybe CostEstimationServiceResourceState
forall a. Maybe a
Prelude.Nothing,
$sel:unitCost:ServiceResourceCost' :: Maybe Double
unitCost = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:count:ServiceResourceCost' :: Maybe Int
count = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:cost:ServiceResourceCost' :: Maybe Double
cost = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:type':ServiceResourceCost' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
serviceResourceCost_state :: Lens.Lens' ServiceResourceCost (Prelude.Maybe CostEstimationServiceResourceState)
serviceResourceCost_state :: (Maybe CostEstimationServiceResourceState
-> f (Maybe CostEstimationServiceResourceState))
-> ServiceResourceCost -> f ServiceResourceCost
serviceResourceCost_state = (ServiceResourceCost -> Maybe CostEstimationServiceResourceState)
-> (ServiceResourceCost
-> Maybe CostEstimationServiceResourceState -> ServiceResourceCost)
-> Lens
ServiceResourceCost
ServiceResourceCost
(Maybe CostEstimationServiceResourceState)
(Maybe CostEstimationServiceResourceState)
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_unitCost :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Double)
serviceResourceCost_unitCost :: (Maybe Double -> f (Maybe Double))
-> ServiceResourceCost -> f ServiceResourceCost
serviceResourceCost_unitCost = (ServiceResourceCost -> Maybe Double)
-> (ServiceResourceCost -> Maybe Double -> ServiceResourceCost)
-> Lens
ServiceResourceCost
ServiceResourceCost
(Maybe Double)
(Maybe Double)
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)
serviceResourceCost_count :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Int)
serviceResourceCost_count :: (Maybe Int -> f (Maybe Int))
-> ServiceResourceCost -> f ServiceResourceCost
serviceResourceCost_count = (ServiceResourceCost -> Maybe Int)
-> (ServiceResourceCost -> Maybe Int -> ServiceResourceCost)
-> Lens
ServiceResourceCost ServiceResourceCost (Maybe Int) (Maybe Int)
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_cost :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Double)
serviceResourceCost_cost :: (Maybe Double -> f (Maybe Double))
-> ServiceResourceCost -> f ServiceResourceCost
serviceResourceCost_cost = (ServiceResourceCost -> Maybe Double)
-> (ServiceResourceCost -> Maybe Double -> ServiceResourceCost)
-> Lens
ServiceResourceCost
ServiceResourceCost
(Maybe Double)
(Maybe Double)
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_type :: Lens.Lens' ServiceResourceCost (Prelude.Maybe Prelude.Text)
serviceResourceCost_type :: (Maybe Text -> f (Maybe Text))
-> ServiceResourceCost -> f ServiceResourceCost
serviceResourceCost_type = (ServiceResourceCost -> Maybe Text)
-> (ServiceResourceCost -> Maybe Text -> ServiceResourceCost)
-> Lens
ServiceResourceCost ServiceResourceCost (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON ServiceResourceCost where
parseJSON :: Value -> Parser ServiceResourceCost
parseJSON =
String
-> (Object -> Parser ServiceResourceCost)
-> Value
-> Parser ServiceResourceCost
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServiceResourceCost"
( \Object
x ->
Maybe CostEstimationServiceResourceState
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Text
-> ServiceResourceCost
ServiceResourceCost'
(Maybe CostEstimationServiceResourceState
-> Maybe Double
-> Maybe Int
-> Maybe Double
-> Maybe Text
-> ServiceResourceCost)
-> Parser (Maybe CostEstimationServiceResourceState)
-> Parser
(Maybe Double
-> Maybe Int -> Maybe Double -> Maybe Text -> ServiceResourceCost)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CostEstimationServiceResourceState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe Double
-> Maybe Int -> Maybe Double -> Maybe Text -> ServiceResourceCost)
-> Parser (Maybe Double)
-> Parser
(Maybe Int -> Maybe Double -> Maybe Text -> ServiceResourceCost)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UnitCost")
Parser
(Maybe Int -> Maybe Double -> Maybe Text -> ServiceResourceCost)
-> Parser (Maybe Int)
-> Parser (Maybe Double -> Maybe Text -> ServiceResourceCost)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Count")
Parser (Maybe Double -> Maybe Text -> ServiceResourceCost)
-> Parser (Maybe Double)
-> Parser (Maybe Text -> ServiceResourceCost)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Cost")
Parser (Maybe Text -> ServiceResourceCost)
-> Parser (Maybe Text) -> Parser ServiceResourceCost
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
"Type")
)
instance Prelude.Hashable ServiceResourceCost
instance Prelude.NFData ServiceResourceCost