{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/devarmor/json-schema/devarmor-build-schema.json",
  "title": "Build",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/devarmor-builds-api-openapi.yml#/components/schemas/Build",
  "properties": {
    "family": {
      "$ref": "#/$defs/BuildFamily"
    },
    "type": {
      "$ref": "#/$defs/BuildType"
    },
    "parameters": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parameters"
    },
    "state": {
      "$ref": "#/$defs/JobState"
    },
    "eta": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Eta"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At"
    },
    "success": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Success"
    },
    "result": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Result"
    },
    "log": {
      "type": "string",
      "title": "Log",
      "default": ""
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "project": {
      "$ref": "#/$defs/Project"
    },
    "parent_id": {
      "type": "integer",
      "title": "Parent Id"
    }
  },
  "type": "object",
  "required": [
    "family",
    "type",
    "state",
    "id",
    "project",
    "parent_id"
  ],
  "$defs": {
    "BuildFamily": {
      "type": "string",
      "enum": [
        "test",
        "threat_model",
        "design_review",
        "diagram",
        "code_review",
        "report",
        "rule",
        "data_flow_diagram"
      ],
      "title": "BuildFamily"
    },
    "BuildType": {
      "type": "string",
      "enum": [
        "main",
        "architecture",
        "architecture_from_code",
        "architecture_from_diagrams",
        "architecture_from_docs",
        "assumptions",
        "requirements",
        "findings",
        "action_items",
        "rules",
        "pull_request_review",
        "threat_model_impact",
        "diagram_from_image",
        "pdf",
        "version_diff",
        "interpretation"
      ],
      "title": "BuildType"
    },
    "JobState": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed"
      ],
      "title": "JobState"
    },
    "Project": {
      "properties": {
        "symbolic_name": {
          "type": "string",
          "pattern": "^[0-9a-z-]+$",
          "title": "Symbolic Name"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "default": {
          "type": "boolean",
          "title": "Default",
          "default": false
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "use_memory": {
          "type": "boolean",
          "title": "Use Memory",
          "default": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "owner_user": {
          "$ref": "#/$defs/User"
        },
        "memory_effective": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective"
        },
        "memory_effective_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Memory Effective Reason"
        }
      },
      "type": "object",
      "required": [
        "symbolic_name",
        "title",
        "id",
        "owner_user"
      ],
      "title": "Project"
    },
    "User": {
      "properties": {
        "email": {
          "type": "string",
          "title": "Email"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "state": {
          "$ref": "#/$defs/UserState",
          "default": "active"
        },
        "roles": {
          "items": {
            "$ref": "#/$defs/UserRole"
          },
          "type": "array",
          "title": "Roles",
          "default": []
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        }
      },
      "type": "object",
      "required": [
        "email",
        "name",
        "id"
      ],
      "title": "User"
    },
    "UserRole": {
      "type": "string",
      "enum": [
        "admin",
        "customer_support"
      ],
      "title": "UserRole"
    },
    "UserState": {
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "pending_org_approval"
      ],
      "title": "UserState"
    }
  }
}