{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ownkube-io/json-schema/ownkube-io-deploy-function-body-schema.json",
  "title": "DeployFunctionBody",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ownkube-io-openapi.json#/components/schemas/DeployFunctionBody",
  "type": "object",
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "runtime": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "handler": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "architecture": {
          "type": "string",
          "enum": [
            "x86_64",
            "arm64"
          ],
          "default": "arm64"
        },
        "memoryMb": {
          "type": "integer",
          "minimum": 128,
          "maximum": 10240,
          "default": 256
        },
        "timeoutSeconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 900,
          "default": 30
        },
        "logRetentionDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3653,
          "default": 14
        },
        "env": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "secret": {
                "type": "boolean"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ]
          }
        },
        "triggers": {
          "type": "object",
          "properties": {
            "cron": {
              "type": "object",
              "properties": {
                "input": {
                  "type": "string"
                },
                "schedule": {
                  "type": "string",
                  "minLength": 1
                },
                "timezone": {
                  "type": "string"
                }
              },
              "required": [
                "schedule"
              ]
            },
            "http": {
              "type": "object",
              "properties": {
                "authType": {
                  "type": "string",
                  "enum": [
                    "none",
                    "iam"
                  ],
                  "default": "none"
                },
                "cors": {
                  "type": "object",
                  "properties": {
                    "allowHeaders": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "allowMethods": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "allowOrigins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "maxAge": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 86400
                    }
                  }
                }
              }
            }
          }
        },
        "substrate": {
          "type": "string",
          "enum": [
            "lambda",
            "ember"
          ]
        }
      },
      "required": [
        "runtime",
        "handler",
        "triggers"
      ],
      "description": "The function config to apply."
    },
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256000,
      "description": "New inline source. Omit to change settings only."
    },
    "filename": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "Source filename (defaults to the current entrypoint)."
    },
    "note": {
      "type": "string",
      "maxLength": 200,
      "description": "Optional revision note."
    }
  },
  "required": [
    "config"
  ]
}