{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Policy",
  "title": "Policy",
  "type": "object",
  "description": "Represents an organization-level policy that defines rules and controls for security, authentication, and governance.",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier of the policy.",
      "example": "abc123"
    },
    "type": {
      "type": "string",
      "description": "The type of policy.",
      "enum": [
        "ip-allowlist",
        "data-residency",
        "authentication",
        "external-user",
        "user-security"
      ],
      "example": "ip-allowlist"
    },
    "name": {
      "type": "string",
      "description": "The display name of the policy.",
      "example": "Example Title"
    },
    "status": {
      "type": "string",
      "description": "The current status of the policy.",
      "enum": [
        "enabled",
        "disabled"
      ],
      "example": "enabled"
    },
    "attributes": {
      "type": "object",
      "description": "Policy-specific configuration attributes.",
      "additionalProperties": true,
      "example": "example_value"
    },
    "resources": {
      "type": "array",
      "description": "Resources this policy applies to.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The resource identifier."
          },
          "type": {
            "type": "string",
            "description": "The resource type."
          }
        }
      },
      "example": []
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "description": "When the policy was created.",
      "example": "2026-01-15T10:30:00Z"
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "description": "When the policy was last updated.",
      "example": "2026-01-15T10:30:00Z"
    }
  }
}