Class: AWSCDK::CE::CfnCostCategoryProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ce/cfn_cost_category_props.rb

Overview

Properties for defining a CfnCostCategory.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, rules:, rule_version:, default_value: nil, split_charge_rules: nil, tags: nil) ⇒ CfnCostCategoryProps

Returns a new instance of CfnCostCategoryProps.

Parameters:

  • name (String)

    The unique name of the Cost Category.

  • rules (String)

    The array of CostCategoryRule in JSON array format.

  • rule_version (String)

    The rule schema version in this particular Cost Category.

  • default_value (String, nil) (defaults to: nil)

    The default value for the cost category.

  • split_charge_rules (String, nil) (defaults to: nil)

    The split charge rules that are used to allocate your charges between your cost category values.

  • tags (Array<AWSCDK::CE::CfnCostCategory::ResourceTagProperty>, nil) (defaults to: nil)

    Tags to assign to the cost category.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'ce/cfn_cost_category_props.rb', line 15

def initialize(name:, rules:, rule_version:, default_value: nil, split_charge_rules: nil, tags: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @rules = rules
  Jsii::Type.check_type(@rules, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "rules")
  @rule_version = rule_version
  Jsii::Type.check_type(@rule_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleVersion")
  @default_value = default_value
  Jsii::Type.check_type(@default_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultValue") unless @default_value.nil?
  @split_charge_rules = split_charge_rules
  Jsii::Type.check_type(@split_charge_rules, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "splitChargeRules") unless @split_charge_rules.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CE::CfnCostCategory::ResourceTagProperty.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jZS5DZm5Db3N0Q2F0ZWdvcnkuUmVzb3VyY2VUYWdQcm9wZXJ0eSJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#default_valueString? (readonly)

The default value for the cost category.



51
52
53
# File 'ce/cfn_cost_category_props.rb', line 51

def default_value
  @default_value
end

#nameString (readonly)

The unique name of the Cost Category.



34
35
36
# File 'ce/cfn_cost_category_props.rb', line 34

def name
  @name
end

#rule_versionString (readonly)

The rule schema version in this particular Cost Category.



46
47
48
# File 'ce/cfn_cost_category_props.rb', line 46

def rule_version
  @rule_version
end

#rulesString (readonly)

The array of CostCategoryRule in JSON array format.

Rules are processed in order. If there are multiple rules that match the line item, then the first rule to match is used to determine that Cost Category value.



41
42
43
# File 'ce/cfn_cost_category_props.rb', line 41

def rules
  @rules
end

#split_charge_rulesString? (readonly)

The split charge rules that are used to allocate your charges between your cost category values.



56
57
58
# File 'ce/cfn_cost_category_props.rb', line 56

def split_charge_rules
  @split_charge_rules
end

#tagsArray<AWSCDK::CE::CfnCostCategory::ResourceTagProperty>? (readonly)

Tags to assign to the cost category.



61
62
63
# File 'ce/cfn_cost_category_props.rb', line 61

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



63
64
65
66
67
68
69
70
71
72
# File 'ce/cfn_cost_category_props.rb', line 63

def self.jsii_properties
  {
    :name => "name",
    :rules => "rules",
    :rule_version => "ruleVersion",
    :default_value => "defaultValue",
    :split_charge_rules => "splitChargeRules",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



74
75
76
77
78
79
80
81
82
83
84
85
# File 'ce/cfn_cost_category_props.rb', line 74

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "rules" => @rules,
    "ruleVersion" => @rule_version,
    "defaultValue" => @default_value,
    "splitChargeRules" => @split_charge_rules,
    "tags" => @tags,
  })
  result.compact
end