{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nexus/json-schema/nexus-cleanup-policy-resource-xo-schema.json",
  "title": "CleanupPolicyResourceXO",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nexus-cleanup-policies-api-openapi.yml#/components/schemas/CleanupPolicyResourceXO",
  "required": [
    "format",
    "name"
  ],
  "type": "object",
  "properties": {
    "notes": {
      "type": "string",
      "description": "description"
    },
    "criteriaLastBlobUpdated": {
      "type": "integer",
      "description": "component age (Components published over “x” days ago (e.g 1-999))",
      "format": "int64"
    },
    "criteriaLastDownloaded": {
      "type": "integer",
      "description": "component usage (Components downloaded in “x” amount of days (e.g 1-999))",
      "format": "int64"
    },
    "criteriaReleaseType": {
      "type": "string",
      "description": "release type (Remove components that are of the following release type:)",
      "enum": [
        "RELEASES",
        "PRERELEASES",
        "RELEASES_AND_PRERELEASES"
      ]
    },
    "criteriaAssetRegex": {
      "type": "string",
      "description": "asset name matcher (Remove components that have at least one asset name matching the following regular expression pattern:)"
    },
    "retain": {
      "minimum": 1,
      "type": "integer",
      "description": "keep the latest \"x\" number of versions",
      "format": "int32"
    },
    "repositories": {
      "type": "array",
      "description": "Repositories to attach this policy to. When provided on update, replaces the existing attachment set.",
      "items": {
        "type": "string",
        "description": "Repositories to attach this policy to. When provided on update, replaces the existing attachment set."
      }
    },
    "name": {
      "maxLength": 255,
      "minLength": 0,
      "pattern": "^[a-zA-Z0-9\\-]{1}[a-zA-Z0-9_\\-\\.]*$",
      "type": "string",
      "description": "policy name"
    },
    "format": {
      "minLength": 1,
      "type": "string",
      "description": "repository format"
    }
  }
}