{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/blockdaemon/main/json-schema/blockdaemon-rule-schema.json", "title": "Rule", "x-generated": "2026-10-14", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/blockdaemon-event-streaming-api-openapi.yml#/components/schemas/Rule", "type": "object", "required": [ "name", "protocol", "network", "type", "target", "condition_type", "condition" ], "properties": { "id": { "type": "string", "format": "uuid", "x-go-type": "myuuid.UUID", "x-go-type-import": { "name": "myuuid", "path": "github.com/google/uuid" } }, "name": { "type": "string" }, "description": { "type": "string" }, "protocol": { "type": "string" }, "network": { "type": "string" }, "type": { "type": "string" }, "isActive": { "type": "boolean" }, "safeDistance": { "type": "integer" }, "safeTimeout": { "type": "integer" }, "condition_type": { "type": "string", "default": "antlr", "enum": [ "antlr", "match_var" ] }, "condition": { "anyOf": [ { "$ref": "#/$defs/MatchVars" }, { "$ref": "#/$defs/Antlr" } ] }, "target": { "type": "string", "format": "uuid", "x-go-type": "myuuid.UUID", "x-go-type-import": { "name": "myuuid", "path": "github.com/google/uuid" } }, "template": { "$ref": "#/$defs/RuleTemplateRef" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } }, "$defs": { "Antlr": { "type": "string", "description": "A rule expression to define filtering or matching logic. For example, `height > 0` filters out items where the height is not greater than zero." }, "ID": { "description": "An ID representing a specific template.", "type": "string", "format": "uuid", "x-go-type": "myuuid.UUID", "x-go-type-import": { "name": "myuuid", "path": "github.com/google/uuid" } }, "MatchVar": { "type": "object", "description": "Represents a single variable used in a matching rule. It includes the variable's type and its ID.", "required": [ "variable_type", "variable_id" ], "properties": { "variable_type": { "type": "string" }, "variable_id": { "type": "string", "format": "uuid", "x-go-type": "myuuid.UUID", "x-go-type-import": { "name": "myuuid", "path": "github.com/google/uuid" } } } }, "MatchVars": { "type": "array", "description": "A list of variables used in a matching rule. Each item in the array must reference a valid MatchVar object.", "items": { "$ref": "#/$defs/MatchVar" } }, "PreDefinedTemplate": { "title": "Predefined Template", "description": "Available predefined templates that can be used for event formatting", "type": "string", "enum": [ "UNIFIED_V1", "UNIFIED_V1_RAW", "ALL_DATA", "INPUT_EMAIL", "OUTPUT_EMAIL", "TX_EMAIL" ] }, "RuleTemplateRef": { "anyOf": [ { "$ref": "#/$defs/ID" }, { "$ref": "#/$defs/PreDefinedTemplate" } ] } } }