module Stratosphere.CE.CostCategory ( module Exports, CostCategory(..), mkCostCategory ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import {-# SOURCE #-} Stratosphere.CE.CostCategory.ResourceTagProperty as Exports import Stratosphere.ResourceProperties import Stratosphere.Value data CostCategory = -- | See: CostCategory {haddock_workaround_ :: (), -- | See: defaultValue :: (Prelude.Maybe (Value Prelude.Text)), -- | See: name :: (Value Prelude.Text), -- | See: ruleVersion :: (Value Prelude.Text), -- | See: rules :: (Value Prelude.Text), -- | See: splitChargeRules :: (Prelude.Maybe (Value Prelude.Text)), -- | See: tags :: (Prelude.Maybe [ResourceTagProperty])} deriving stock (Prelude.Eq, Prelude.Show) mkCostCategory :: Value Prelude.Text -> Value Prelude.Text -> Value Prelude.Text -> CostCategory mkCostCategory name ruleVersion rules = CostCategory {haddock_workaround_ = (), name = name, ruleVersion = ruleVersion, rules = rules, defaultValue = Prelude.Nothing, splitChargeRules = Prelude.Nothing, tags = Prelude.Nothing} instance ToResourceProperties CostCategory where toResourceProperties CostCategory {..} = ResourceProperties {awsType = "AWS::CE::CostCategory", supportsTags = Prelude.True, properties = Prelude.fromList ((Prelude.<>) ["Name" JSON..= name, "RuleVersion" JSON..= ruleVersion, "Rules" JSON..= rules] (Prelude.catMaybes [(JSON..=) "DefaultValue" Prelude.<$> defaultValue, (JSON..=) "SplitChargeRules" Prelude.<$> splitChargeRules, (JSON..=) "Tags" Prelude.<$> tags]))} instance JSON.ToJSON CostCategory where toJSON CostCategory {..} = JSON.object (Prelude.fromList ((Prelude.<>) ["Name" JSON..= name, "RuleVersion" JSON..= ruleVersion, "Rules" JSON..= rules] (Prelude.catMaybes [(JSON..=) "DefaultValue" Prelude.<$> defaultValue, (JSON..=) "SplitChargeRules" Prelude.<$> splitChargeRules, (JSON..=) "Tags" Prelude.<$> tags]))) instance Property "DefaultValue" CostCategory where type PropertyType "DefaultValue" CostCategory = Value Prelude.Text set newValue CostCategory {..} = CostCategory {defaultValue = Prelude.pure newValue, ..} instance Property "Name" CostCategory where type PropertyType "Name" CostCategory = Value Prelude.Text set newValue CostCategory {..} = CostCategory {name = newValue, ..} instance Property "RuleVersion" CostCategory where type PropertyType "RuleVersion" CostCategory = Value Prelude.Text set newValue CostCategory {..} = CostCategory {ruleVersion = newValue, ..} instance Property "Rules" CostCategory where type PropertyType "Rules" CostCategory = Value Prelude.Text set newValue CostCategory {..} = CostCategory {rules = newValue, ..} instance Property "SplitChargeRules" CostCategory where type PropertyType "SplitChargeRules" CostCategory = Value Prelude.Text set newValue CostCategory {..} = CostCategory {splitChargeRules = Prelude.pure newValue, ..} instance Property "Tags" CostCategory where type PropertyType "Tags" CostCategory = [ResourceTagProperty] set newValue CostCategory {..} = CostCategory {tags = Prelude.pure newValue, ..}