{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cosuno/json-schema/cosuno-update-custom-catalog-input-schema.json",
  "title": "UpdateCustomCatalogInput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cosuno-company-api-openapi.yml#/components/schemas/UpdateCustomCatalogInput",
  "properties": {
    "name": {
      "type": "string",
      "description": "New display name for the catalog."
    },
    "status": {
      "$ref": "#/$defs/CUSTOM_COST_GROUP_CATALOG_STATUS",
      "description": "New status for the catalog. Use `deactivated` to retire the catalog so it can no longer be assigned to new projects."
    },
    "costGroups": {
      "items": {
        "$ref": "#/$defs/UpdateCustomCatalogCostGroupInput"
      },
      "type": "array",
      "description": "Replacement hierarchical cost groups for the catalog. Cost groups with an `id` are updated in place, entries without an `id` are created, and any existing cost groups not present in the payload are deleted."
    }
  },
  "type": "object",
  "additionalProperties": false,
  "$defs": {
    "CUSTOM_COST_GROUP_CATALOG_STATUS": {
      "type": "string",
      "enum": [
        "active",
        "deactivated"
      ]
    },
    "UpdateCustomCatalogCostGroupInput": {
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of an existing cost group to update. If omitted, a new cost group is created instead."
        },
        "localId": {
          "type": "string",
          "description": "Stable identifier for the cost group within the catalog (e.g. a cost group code like `300` or `310.1`). Must be unique within the catalog."
        },
        "name": {
          "type": "string",
          "description": "Display name of the cost group."
        },
        "childCostGroups": {
          "items": {
            "$ref": "#/$defs/UpdateCustomCatalogCostGroupInput"
          },
          "type": "array",
          "description": "Nested cost groups for a hierarchical catalog structure."
        }
      },
      "required": [
        "localId",
        "name"
      ],
      "type": "object",
      "additionalProperties": false
    }
  }
}