{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-purview/json-schema/microsoft-purview-retention-event-schema.json",
  "title": "RetentionEvent",
  "description": "A retention event that triggers event-based retention",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-purview-retention-events-api-openapi.yml#/components/schemas/RetentionEvent",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true
    },
    "displayName": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "eventTriggerDateTime": {
      "type": "string",
      "format": "date-time"
    },
    "eventQueries": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "queryType": {
            "type": "string"
          },
          "query": {
            "type": "string"
          }
        }
      }
    },
    "retentionEventType": {
      "$ref": "#/$defs/RetentionEventType"
    },
    "eventStatus": {
      "type": "object",
      "properties": {
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "error",
            "success",
            "unknownFutureValue"
          ]
        }
      }
    },
    "createdDateTime": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "lastModifiedDateTime": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "createdBy": {
      "$ref": "#/$defs/IdentitySet"
    },
    "lastModifiedBy": {
      "$ref": "#/$defs/IdentitySet"
    }
  },
  "$defs": {
    "IdentitySet": {
      "type": "object",
      "properties": {
        "user": {
          "type": "object",
          "properties": {
            "displayName": {
              "type": "string"
            },
            "id": {
              "type": "string"
            }
          }
        }
      }
    },
    "RetentionEventType": {
      "type": "object",
      "description": "A retention event type",
      "properties": {
        "id": {
          "type": "string",
          "readOnly": true
        },
        "displayName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "createdDateTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "lastModifiedDateTime": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "createdBy": {
          "$ref": "#/$defs/IdentitySet"
        },
        "lastModifiedBy": {
          "$ref": "#/$defs/IdentitySet"
        }
      }
    }
  }
}