{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/genhttp-dev/json-schema/genhttp-dev-lambda-summary-response-schema.json",
  "title": "LambdaSummaryResponse",
  "description": "Everything worth knowing about a lambda at a glance.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/genhttp-dev-v1-openapi.json#/components/schemas/LambdaSummaryResponse",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "lambda": {
      "description": "The lambda",
      "$ref": "#/$defs/LambdaResponse"
    },
    "live": {
      "description": "The version that is online, if one is",
      "nullable": true,
      "$ref": "#/$defs/VersionResponse"
    },
    "latest": {
      "description": "The newest version, which may be ahead of the one online",
      "nullable": true,
      "$ref": "#/$defs/VersionResponse"
    },
    "versions": {
      "type": "integer",
      "description": "How many versions are kept",
      "format": "int32"
    },
    "activation": {
      "description": "Since when the version online has been online; absent while none is",
      "nullable": true,
      "$ref": "#/$defs/ActivationResponse"
    },
    "traffic": {
      "description": "How much it is used, and how well it answers",
      "$ref": "#/$defs/TrafficSummary"
    },
    "recentProblems": {
      "type": "array",
      "description": "The last few errors and warnings of its own log, newest first - not the requests that were merely refused",
      "items": {
        "$ref": "#/$defs/OwnerLogEntry"
      }
    },
    "storage": {
      "description": "What it keeps, and how much of its allowances that takes",
      "$ref": "#/$defs/StorageSummary"
    },
    "limits": {
      "description": "What its tier allows it",
      "$ref": "#/$defs/SummaryLimits"
    },
    "documentation": {
      "description": "What the documentation of the version the storage is about says, and which of its pages it has",
      "$ref": "#/$defs/DocumentationSummary"
    }
  },
  "$defs": {
    "ActivationResponse": {
      "type": "object",
      "description": "One stretch of time a version was online.",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "integer",
          "description": "The version that was online",
          "format": "int32"
        },
        "started": {
          "type": "string",
          "description": "When it went online",
          "format": "date-time"
        },
        "origin": {
          "type": [
            "string",
            "null"
          ],
          "description": "Who put it online: `api`, `agent`, `git`, `admin` (the operator) or `system`"
        },
        "ended": {
          "type": [
            "string",
            "null"
          ],
          "description": "When it went offline; absent while it is still online",
          "format": "date-time"
        },
        "endedBy": {
          "type": [
            "string",
            "null"
          ],
          "description": "Why it went offline: `replaced` by another deployment, `stopped` by its owner, `expired` because nobody used it, or taken down by the operator (`admin`)"
        },
        "seconds": {
          "type": "integer",
          "description": "How long it was online, or has been so far, in seconds",
          "format": "int64"
        }
      }
    },
    "DocumentationSummary": {
      "type": "object",
      "description": "What a version says about itself, in `docs/` and `tests/`.",
      "additionalProperties": false,
      "properties": {
        "about": {
          "type": [
            "string",
            "null"
          ],
          "description": "The first paragraph of `docs/product.md`, as plain text - what the app is, in a sentence or two"
        },
        "product": {
          "type": "boolean",
          "description": "Whether it has `docs/product.md`: what the app is, for whom, and why"
        },
        "decisions": {
          "type": "boolean",
          "description": "Whether it has `docs/decisions.md`: which technical decisions were made, and why"
        },
        "tests": {
          "type": "boolean",
          "description": "Whether it has `tests/README.md`: how it is tested"
        },
        "files": {
          "type": "integer",
          "description": "How many files its documentation and tests come to",
          "format": "int32"
        },
        "bytes": {
          "type": "integer",
          "description": "What those weigh, which counts towards what a version may come to like the rest of its code",
          "format": "int64"
        }
      }
    },
    "LambdaResponse": {
      "type": "object",
      "description": "A lambda, as whoever holds its editor key sees it.",
      "additionalProperties": false,
      "properties": {
        "publicKey": {
          "type": "string",
          "description": "Names its address below the hosting domain. Not a secret; its owner may change it."
        },
        "privateKey": {
          "type": "string",
          "description": "The editor key, which authorizes every call about the lambda. Treat it like a password."
        },
        "tier": {
          "type": "string",
          "description": "`Free`, `Premium` or `Demo`, assigned by the operator. Decides its limits, whether it is kept online while nobody uses it, and whether it may answer at a domain of its own."
        },
        "created": {
          "type": "string",
          "description": "When it was created",
          "format": "date-time"
        },
        "modified": {
          "type": "string",
          "description": "When something about it last changed: a save, a deployment, a setting",
          "format": "date-time"
        },
        "activeVersion": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The version that is online; absent while nothing is",
          "format": "int32"
        },
        "latestVersion": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The newest version saved, which may be ahead of the one online",
          "format": "int32"
        },
        "publicUrl": {
          "type": "string",
          "description": "Its address below the hosting domain, named after its public key: `https://quiz.genhttp.run/`. While it answers at a domain of its own, this address sends its visitors on to the domain."
        },
        "editorPath": {
          "type": "string",
          "description": "Where its editor is on this site: `/editor/{privateKey}`. Holds the editor key."
        },
        "deployedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "When the version online went online; absent while nothing is",
          "format": "date-time"
        },
        "deployedUntil": {
          "type": [
            "string",
            "null"
          ],
          "description": "When it is taken offline unless it is visited or edited before then - each visit and each edit moves this on. Absent while it is offline, and for a tier that keeps it online.",
          "format": "date-time"
        },
        "keptUntil": {
          "type": [
            "string",
            "null"
          ],
          "description": "When it is deleted unless it is visited or edited before then. Absent for a tier that keeps it.",
          "format": "date-time"
        },
        "domain": {
          "type": [
            "string",
            "null"
          ],
          "description": "The domain of its own it is configured to answer at, whether or not its tier lets it"
        },
        "domainServed": {
          "type": "boolean",
          "description": "Whether it answers at that domain: it has one, and its tier includes it"
        },
        "address": {
          "type": "string",
          "description": "Where to link to it: its domain while that is served, `publicUrl` otherwise"
        },
        "view": {
          "type": "string",
          "description": "How its editor opens for somebody who has not chosen a view of their own: `Full` or `Simple`"
        },
        "gitPath": {
          "type": "string",
          "description": "Where it is cloned with git and pushed to, on this site. The versions are the commits of `main`, the features the other branches. Holds the editor key, like the editor's path."
        }
      }
    },
    "OwnerLogEntry": {
      "type": "object",
      "description": "A line of a lambda's log, as its owner sees it - never with a visitor's address.",
      "additionalProperties": false,
      "properties": {
        "seq": {
          "type": "integer",
          "description": "Its sequence: counts up and never repeats, so a reader asks for what came after the last one it saw",
          "format": "int64"
        },
        "at": {
          "type": "string",
          "description": "When it was said",
          "format": "date-time"
        },
        "level": {
          "type": "string",
          "description": "`trace`, `debug`, `info`, `warn`, `error` or `critical`"
        },
        "source": {
          "type": "string",
          "description": "Who said it: `Requests` for a request line, `stdout` or `stderr` for what the code printed, or the part of the server that spoke"
        },
        "text": {
          "type": "string",
          "description": "What was said"
        },
        "detail": {
          "type": [
            "string",
            "null"
          ],
          "description": "The stack trace, where there is one"
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "The two letter code of the country the caller's address is registered in, where it is known"
        },
        "agent": {
          "type": [
            "string",
            "null"
          ],
          "description": "What the caller said it was - its user agent"
        },
        "repeats": {
          "type": "integer",
          "description": "How many identical lines in a row this one stands for; one is itself alone",
          "format": "int32"
        },
        "domain": {
          "type": [
            "string",
            "null"
          ],
          "description": "The host the request was addressed to: the lambda's subdomain of the hosting domain, or its own domain"
        }
      }
    },
    "StorageSummary": {
      "type": "object",
      "description": "What a lambda keeps, and how much of each allowance it takes.",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The version the figures about code are about: the one online, else the newest",
          "format": "int32"
        },
        "codeFiles": {
          "type": "integer",
          "description": "Files of its code: the C# it is compiled from and whatever else it is kept with, never served",
          "format": "int32"
        },
        "codeBytes": {
          "type": "integer",
          "description": "What those weigh, towards what a version may come to",
          "format": "int64"
        },
        "resourceFiles": {
          "type": "integer",
          "description": "Its resources, which it reads and serves while it runs",
          "format": "int32"
        },
        "resourceBytes": {
          "type": "integer",
          "description": "What those weigh, decoded, towards what a version may come to",
          "format": "int64"
        },
        "workspaceFiles": {
          "type": "integer",
          "description": "Files in the workspace, which it writes while it runs and every version shares",
          "format": "int32"
        },
        "workspaceBytes": {
          "type": "integer",
          "description": "The room those take, towards the data allowance",
          "format": "int64"
        },
        "servesResources": {
          "type": "boolean",
          "description": "Whether the code of that version serves its resources"
        },
        "servesWorkspace": {
          "type": "boolean",
          "description": "Whether it serves the workspace, which makes those files public"
        },
        "workspaceEnabled": {
          "type": "boolean",
          "description": "Whether the workspace is switched on"
        },
        "usesWorkspace": {
          "type": "boolean",
          "description": "Whether the code of that version uses the workspace at all, and so fails where it does once it is switched off"
        },
        "secretsEnabled": {
          "type": "boolean",
          "description": "Whether secrets are switched on"
        },
        "secrets": {
          "type": "integer",
          "description": "How many secrets it keeps",
          "format": "int32"
        },
        "missingSecrets": {
          "type": [
            "array",
            "null"
          ],
          "description": "The secrets its code reads that have no value yet - what its owner still has to enter, because until then the code that reads them fails",
          "items": {
            "type": "string"
          }
        },
        "databaseEnabled": {
          "type": "boolean",
          "description": "Whether the database is switched on"
        },
        "databaseTables": {
          "type": "integer",
          "description": "How many tables the database holds",
          "format": "int32"
        },
        "databaseBytes": {
          "type": "integer",
          "description": "The room the database takes, towards the data allowance",
          "format": "int64"
        },
        "usesDatabase": {
          "type": "boolean",
          "description": "Whether the code of that version connects to the database, and so fails where it does once it is switched off"
        }
      }
    },
    "SummaryLimits": {
      "type": "object",
      "description": "What a lambda of its tier may have on this installation, as the operator set it.",
      "additionalProperties": false,
      "properties": {
        "buildBytes": {
          "type": "integer",
          "description": "What a version may come to, its code and its resources together, in bytes",
          "format": "int64"
        },
        "dataBytes": {
          "type": "integer",
          "description": "The room its data may take, its database and its workspace together, in bytes",
          "format": "int64"
        },
        "versions": {
          "type": "integer",
          "description": "How many versions are kept; the oldest beyond that go with every save, but never the one online or one a feature is based on",
          "format": "int32"
        },
        "deploymentLifetimeHours": {
          "type": "integer",
          "description": "How long a free lambda may go without a visit or an edit before it is taken offline, in hours",
          "format": "int32"
        },
        "retentionDays": {
          "type": "integer",
          "description": "How long a free lambda may go without a visit or an edit before it is deleted, in days",
          "format": "int32"
        },
        "features": {
          "type": "integer",
          "description": "How many features it may have open at once",
          "format": "int32"
        }
      }
    },
    "TrafficSummary": {
      "type": "object",
      "description": "How much a lambda is used, and how well it answers.",
      "additionalProperties": false,
      "properties": {
        "hourRequests": {
          "type": "integer",
          "description": "Requests in the last hour",
          "format": "int64"
        },
        "hourFailed": {
          "type": "integer",
          "description": "Of those, answered with a server error",
          "format": "int64"
        },
        "dayRequests": {
          "type": "integer",
          "description": "Requests in the last day",
          "format": "int64"
        },
        "dayFailed": {
          "type": "integer",
          "description": "Of those, answered with a server error",
          "format": "int64"
        },
        "dayRejected": {
          "type": "integer",
          "description": "Of those, answered with a client error, not found included",
          "format": "int64"
        },
        "averageMillis": {
          "type": "number",
          "description": "The mean time to answer over the last day, in milliseconds",
          "format": "double"
        },
        "upgrades": {
          "type": "integer",
          "description": "Connections upgraded to a websocket in the last day",
          "format": "int64"
        },
        "hourly": {
          "type": "array",
          "description": "Requests per hour over the last day, oldest first",
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "lastSeen": {
          "type": [
            "string",
            "null"
          ],
          "description": "When the last request arrived",
          "format": "date-time"
        },
        "since": {
          "type": "string",
          "description": "When the counting started: when the server came up",
          "format": "date-time"
        }
      }
    },
    "VersionResponse": {
      "type": "object",
      "description": "A version, without its files.",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "integer",
          "description": "Its number, counting from 1",
          "format": "int32"
        },
        "created": {
          "type": "string",
          "description": "When it was saved",
          "format": "date-time"
        },
        "specification": {
          "type": [
            "string",
            "null"
          ],
          "description": "What the user wanted and why, where whoever saved it said"
        },
        "change": {
          "type": [
            "string",
            "null"
          ],
          "description": "What it changed, where whoever saved it said"
        },
        "origin": {
          "type": [
            "string",
            "null"
          ],
          "description": "How it was saved: `template` (what the lambda started as), `api`, `agent`, `git`, `admin` or `system`"
        }
      }
    }
  }
}