{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cesnet/json-schema/cesnet-attribute-policy-collection-schema.json",
  "title": "AttributePolicyCollection",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cesnet-attributesmanager-api-openapi.yml#/components/schemas/AttributePolicyCollection",
  "type": "object",
  "required": [
    "id",
    "attributeId",
    "action",
    "policies"
  ],
  "properties": {
    "id": {
      "type": "integer"
    },
    "attributeId": {
      "type": "integer"
    },
    "action": {
      "$ref": "#/$defs/AttributeAction"
    },
    "policies": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AttributePolicy"
      }
    }
  },
  "$defs": {
    "AttributeAction": {
      "type": "string",
      "description": "Represents types of actions that users can perform upon attributes.",
      "enum": [
        "WRITE",
        "READ"
      ]
    },
    "AttributePolicy": {
      "type": "object",
      "required": [
        "id",
        "role",
        "object",
        "policyCollectionId"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "role": {
          "type": "string"
        },
        "object": {
          "$ref": "#/$defs/RoleObject"
        },
        "policyCollectionId": {
          "type": "integer"
        }
      }
    },
    "RoleObject": {
      "type": "string",
      "description": "Represents objects, upon which Perun roles can be set, e.g. role RESOURCEADMIN can be set upon Resource, Vo, Facility or no object (None).",
      "enum": [
        "None",
        "Group",
        "Vo",
        "Facility",
        "Resource",
        "User",
        "Member"
      ]
    }
  }
}