{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-container-registry/json-schema/azure-container-registry-cache-rule-schema.json",
  "title": "CacheRule",
  "description": "An object that represents a cache rule for a container registry.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/azure-container-registry-cacherules-api-openapi.yml#/components/schemas/CacheRule",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/CacheRuleProperties",
      "description": "The properties of the cache rule.",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "../../../../../../common-types/resource-management/v6/types.json#/definitions/ProxyResource"
    }
  ],
  "$defs": {
    "CacheRuleProperties": {
      "type": "object",
      "description": "The properties of a cache rule.",
      "properties": {
        "credentialSetResourceId": {
          "type": "string",
          "description": "The ARM resource ID of the credential store which is associated with the cache rule."
        },
        "sourceRepository": {
          "type": "string",
          "description": "Source repository pulled from upstream."
        },
        "targetRepository": {
          "type": "string",
          "description": "Target repository specified in docker pull command.\nEg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}"
        },
        "creationDate": {
          "type": "string",
          "format": "date-time",
          "description": "The creation date of the cache rule.",
          "readOnly": true
        },
        "provisioningState": {
          "$ref": "#/$defs/ProvisioningState",
          "description": "Provisioning state of the resource.",
          "readOnly": true
        }
      }
    },
    "ProvisioningState": {
      "type": "string",
      "description": "The provisioning state of the archive at the time the operation was called.",
      "enum": [
        "Creating",
        "Updating",
        "Deleting",
        "Succeeded",
        "Failed",
        "Canceled"
      ],
      "x-ms-enum": {
        "name": "ProvisioningState",
        "modelAsString": true,
        "values": [
          {
            "name": "Creating",
            "value": "Creating"
          },
          {
            "name": "Updating",
            "value": "Updating"
          },
          {
            "name": "Deleting",
            "value": "Deleting"
          },
          {
            "name": "Succeeded",
            "value": "Succeeded"
          },
          {
            "name": "Failed",
            "value": "Failed"
          },
          {
            "name": "Canceled",
            "value": "Canceled"
          }
        ]
      }
    }
  }
}