{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-billing-and-cost-management/json-schema/amazon-billing-and-cost-management-update-cost-category-definition-request-schema.json",
  "title": "UpdateCostCategoryDefinitionRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-billing-and-cost-management-cost-category-definition-api-openapi.yml#/components/schemas/UpdateCostCategoryDefinitionRequest",
  "type": "object",
  "properties": {
    "CostCategoryArn": {
      "type": "string",
      "description": "The unique identifier for your cost category."
    },
    "EffectiveStart": {
      "type": "string",
      "description": "The cost category's effective start date. It can only be a billing start date (first day of the month). If the date isn't provided, it's the first day of the current month. Dates can't be before the previous twelve months, or in the future."
    },
    "RuleVersion": {
      "type": "string",
      "enum": [
        "CostCategoryExpression.v1"
      ]
    },
    "Rules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CostCategoryRule"
      },
      "description": "The Expression object used to categorize costs. For more information, see CostCategoryRule ."
    },
    "DefaultValue": {
      "type": "string"
    },
    "SplitChargeRules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CostCategorySplitChargeRule"
      },
      "description": "The split charge rules used to allocate your charges between your cost category values."
    }
  },
  "required": [
    "CostCategoryArn",
    "RuleVersion",
    "Rules"
  ],
  "$defs": {
    "CostCategoryInheritedValueDimension": {
      "type": "object",
      "properties": {
        "DimensionName": {
          "type": "string",
          "enum": [
            "LINKED_ACCOUNT_NAME",
            "TAG"
          ],
          "description": "The name of the dimension that's used to group costs. If you specify LINKED_ACCOUNT_NAME, the cost category value is based on account name. If you specify TAG, the cost category value is based on the value of the specified tag key."
        },
        "DimensionKey": {
          "type": "string",
          "description": "The key to extract cost category values."
        }
      }
    },
    "CostCategoryRule": {
      "type": "object",
      "properties": {
        "Value": {
          "type": "string"
        },
        "Rule": {
          "$ref": "#/$defs/Expression"
        },
        "InheritedValue": {
          "$ref": "#/$defs/CostCategoryInheritedValueDimension"
        },
        "Type": {
          "type": "string",
          "enum": [
            "REGULAR",
            "INHERITED_VALUE"
          ],
          "description": "You can define the CostCategoryRule rule type as either REGULAR or INHERITED_VALUE. The INHERITED_VALUE rule type adds the flexibility to define a rule that dynamically inherits the cost category value. This value is from the dimension value that's defined by CostCategoryInheritedValueDimension. For example, suppose that you want to costs to be dynamically grouped based on the value of a specific tag key. First, choose an inherited value rule type, and then choose the tag dimension and specify the tag key to use."
        }
      }
    },
    "CostCategorySplitChargeRule": {
      "type": "object",
      "properties": {
        "Source": {
          "type": "string",
          "description": "The cost category value that you want to split. That value can't be used as a source or a target in other split charge rules. To indicate uncategorized costs, you can use an empty string as the source."
        },
        "Targets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The cost category values that you want to split costs across. These values can't be used as a source in other split charge rules."
        },
        "Method": {
          "type": "string",
          "enum": [
            "FIXED",
            "PROPORTIONAL",
            "EVEN"
          ],
          "description": "The method that's used to define how to split your source costs across your targets. Proportional - Allocates charges across your targets based on the proportional weighted cost of each target. Fixed - Allocates charges across your targets based on your defined allocation percentage. >Even - Allocates costs evenly across all targets."
        },
        "Parameters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CostCategorySplitChargeRuleParameter"
          },
          "description": "The parameters for a split charge method. This is only required for the FIXED method."
        }
      },
      "required": [
        "Source",
        "Targets",
        "Method"
      ]
    },
    "CostCategorySplitChargeRuleParameter": {
      "type": "object",
      "properties": {
        "Type": {
          "type": "string",
          "enum": [
            "ALLOCATION_PERCENTAGES"
          ],
          "description": "The parameter type."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The parameter values."
        }
      },
      "required": [
        "Type",
        "Values"
      ]
    },
    "CostCategoryValues": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string"
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The specific value of the cost category."
        },
        "MatchOptions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "EQUALS",
              "ABSENT",
              "STARTS_WITH",
              "ENDS_WITH",
              "CONTAINS",
              "CASE_SENSITIVE",
              "CASE_INSENSITIVE",
              "GREATER_THAN_OR_EQUAL"
            ]
          },
          "description": "The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for MatchOptions is EQUALS and CASE_SENSITIVE."
        }
      }
    },
    "DimensionValues": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "enum": [
            "AZ",
            "INSTANCE_TYPE",
            "LINKED_ACCOUNT",
            "PAYER_ACCOUNT",
            "LINKED_ACCOUNT_NAME",
            "OPERATION",
            "PURCHASE_TYPE",
            "REGION",
            "SERVICE",
            "SERVICE_CODE",
            "USAGE_TYPE",
            "USAGE_TYPE_GROUP",
            "RECORD_TYPE",
            "OPERATING_SYSTEM",
            "TENANCY",
            "SCOPE",
            "PLATFORM",
            "SUBSCRIPTION_ID",
            "LEGAL_ENTITY_NAME",
            "DEPLOYMENT_OPTION",
            "DATABASE_ENGINE",
            "CACHE_ENGINE",
            "INSTANCE_TYPE_FAMILY",
            "BILLING_ENTITY",
            "RESERVATION_ID",
            "RESOURCE_ID",
            "RIGHTSIZING_TYPE",
            "SAVINGS_PLANS_TYPE",
            "SAVINGS_PLAN_ARN",
            "PAYMENT_OPTION",
            "AGREEMENT_END_DATE_TIME_AFTER",
            "AGREEMENT_END_DATE_TIME_BEFORE",
            "INVOICING_ENTITY",
            "ANOMALY_TOTAL_IMPACT_ABSOLUTE",
            "ANOMALY_TOTAL_IMPACT_PERCENTAGE",
            "PRODUCT_ATTRIBUTE"
          ],
          "description": "The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones. Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported. LINKED_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule. ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions. Use PRODUCT_ATTRIBUTE only as the Dimension in GetDimensionValues. To filter or group by product attributes, use the ProductAttributes field of Expression or t"
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values."
        },
        "MatchOptions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "EQUALS",
              "ABSENT",
              "STARTS_WITH",
              "ENDS_WITH",
              "CONTAINS",
              "CASE_SENSITIVE",
              "CASE_INSENSITIVE",
              "GREATER_THAN_OR_EQUAL"
            ]
          },
          "description": "The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for MatchOptions are EQUALS and CASE_SENSITIVE."
        }
      }
    },
    "Expression": {
      "type": "object",
      "properties": {
        "Or": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Expression"
          },
          "description": "Return results that match either Dimension object."
        },
        "And": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Expression"
          },
          "description": "Return results that match both Dimension objects."
        },
        "Not": {
          "$ref": "#/$defs/Expression"
        },
        "Dimensions": {
          "$ref": "#/$defs/DimensionValues"
        },
        "Tags": {
          "$ref": "#/$defs/TagValues"
        },
        "CostCategories": {
          "$ref": "#/$defs/CostCategoryValues"
        },
        "ProductAttributes": {
          "$ref": "#/$defs/ProductAttributeValues"
        }
      }
    },
    "ProductAttributeValues": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The name of the product attribute, such as model. The keys that are available depend on the service. For the keys of each supported service, see ProductAttributeValues . Keys are case-sensitive. A key that doesn't exist doesn't return an error: EQUALS matches no costs, and ABSENT matches all costs of supported services."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The specific values of the product attribute, such as Claude Sonnet 5 for the model key. Values are matched exactly, including case. To list the values of a key, use GetDimensionValues with Dimension set to PRODUCT_ATTRIBUTE and DimensionKey set to the key. To match costs that have no value for the key, set MatchOptions to ABSENT and omit Values. Otherwise, Values is required."
        },
        "MatchOptions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "EQUALS",
              "ABSENT",
              "STARTS_WITH",
              "ENDS_WITH",
              "CONTAINS",
              "CASE_SENSITIVE",
              "CASE_INSENSITIVE",
              "GREATER_THAN_OR_EQUAL"
            ]
          },
          "description": "The match options that you can use to filter your results. Valid values: EQUALS - Matches the values that you specify. ABSENT - Matches costs that have no value for the key. Omit Values. CASE_SENSITIVE - Use only with EQUALS. Values are always matched case-sensitively. Default values are EQUALS and CASE_SENSITIVE."
        }
      },
      "required": [
        "Key"
      ]
    },
    "TagValues": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key for the tag."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The specific value of the tag."
        },
        "MatchOptions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "EQUALS",
              "ABSENT",
              "STARTS_WITH",
              "ENDS_WITH",
              "CONTAINS",
              "CASE_SENSITIVE",
              "CASE_INSENSITIVE",
              "GREATER_THAN_OR_EQUAL"
            ]
          },
          "description": "The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for MatchOptions are EQUALS and CASE_SENSITIVE."
        }
      }
    }
  }
}