{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/onclarity-com/json-schema/onclarity-com-function-response-schema.json",
  "title": "FunctionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/onclarity-com-cloud-functions-admin-api-openapi.yml#/components/schemas/FunctionResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "handler": {
      "type": "string",
      "title": "Handler"
    },
    "timeout_s": {
      "type": "integer",
      "title": "Timeout S"
    },
    "memory_mb": {
      "type": "integer",
      "title": "Memory Mb"
    },
    "status": {
      "$ref": "#/$defs/FunctionStatus"
    },
    "deploy_error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Deploy Error"
    },
    "current_version": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Version"
    },
    "schedule_expression": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule Expression"
    },
    "schedule_timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schedule Timezone"
    },
    "schedule_input": {
      "additionalProperties": true,
      "type": "object",
      "title": "Schedule Input"
    },
    "schedule_status": {
      "$ref": "#/$defs/ScheduleStatus"
    },
    "state": {
      "additionalProperties": true,
      "type": "object",
      "title": "State"
    },
    "http_enabled": {
      "type": "boolean",
      "title": "Http Enabled"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "last_run": {
      "anyOf": [
        {
          "$ref": "#/$defs/RunSummary"
        },
        {
          "type": "null"
        }
      ],
      "description": "The newest run, in list responses only."
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "description",
    "handler",
    "timeout_s",
    "memory_mb",
    "status",
    "deploy_error",
    "current_version",
    "schedule_expression",
    "schedule_timezone",
    "schedule_input",
    "schedule_status",
    "state",
    "http_enabled",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "FunctionStatus": {
      "type": "string",
      "enum": [
        "deploying",
        "active",
        "failed"
      ],
      "title": "FunctionStatus"
    },
    "RunSummary": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "status": {
          "$ref": "#/$defs/src__cloud_functions__constants__RunStatus"
        },
        "trigger_type": {
          "$ref": "#/$defs/RunTrigger"
        },
        "started_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Started At"
        },
        "finished_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Finished At"
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms"
        }
      },
      "type": "object",
      "required": [
        "id",
        "status",
        "trigger_type",
        "started_at",
        "finished_at",
        "duration_ms"
      ],
      "title": "RunSummary",
      "description": "A run in one line, for a function list: what happened last and when."
    },
    "RunTrigger": {
      "type": "string",
      "enum": [
        "manual",
        "schedule",
        "http"
      ],
      "title": "RunTrigger"
    },
    "ScheduleStatus": {
      "type": "string",
      "enum": [
        "none",
        "enabled",
        "paused"
      ],
      "title": "ScheduleStatus"
    },
    "src__cloud_functions__constants__RunStatus": {
      "type": "string",
      "enum": [
        "running",
        "succeeded",
        "failed",
        "timed_out"
      ],
      "title": "RunStatus"
    }
  }
}