{
  "$defs": {
    "LicenceLimits": {
      "additionalProperties": false,
      "description": "Vendor or client licence limits checked before export (spec \u00a720).",
      "properties": {
        "ids": {
          "items": {
            "type": "string"
          },
          "title": "Ids",
          "type": "array"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Text"
        }
      },
      "title": "LicenceLimits",
      "type": "object"
    }
  },
  "$id": "https://schemas.ump.dev/v1/access-policy.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Access rules on a data connection, copied onto each connected dataset (POC DATA-CATALOGUE \u00a72).",
  "properties": {
    "allowed_uses": {
      "items": {
        "enum": [
          "fit",
          "score",
          "side_modelling",
          "benchmark",
          "transform"
        ],
        "type": "string"
      },
      "title": "Allowed Uses",
      "type": "array"
    },
    "copy_policy": {
      "default": "transient_only",
      "enum": [
        "allowed",
        "transient_only",
        "aggregates_only"
      ],
      "title": "Copy Policy",
      "type": "string"
    },
    "licence_limits": {
      "anyOf": [
        {
          "$ref": "#/$defs/LicenceLimits"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "min_segment_size": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "For aggregates_only; defaults to the contract's G-PRIV-01 floor.",
      "title": "Min Segment Size"
    },
    "retention_days": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "For cached copies; defaults to the client contract's retention_days (rules.effective_access).",
      "title": "Retention Days"
    }
  },
  "title": "AccessPolicy",
  "type": "object"
}
