{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/stackit/main/json-schema/stackit-create-function-revision-payload-schema.json",
  "title": "createFunctionRevisionPayload",
  "description": "The function revision",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stackit-functions-openapi.yml#/components/schemas/createFunctionRevisionPayload",
  "properties": {
    "created_at": {
      "description": "Time the function was created.",
      "format": "date-time",
      "type": "string"
    },
    "digest": {
      "description": "A hashed fingerprint of the revision artifact.",
      "type": "string"
    },
    "function_id": {
      "description": "The ID of the function associated with this revision.",
      "type": "string"
    },
    "id": {
      "description": "The revision identifier.",
      "type": "string"
    },
    "labels": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object"
    },
    "limits": {
      "$ref": "#/$defs/ResourceLimits"
    },
    "message": {
      "description": "Revision message",
      "type": "string"
    },
    "name": {
      "description": "The name of the the revision. Must be unique within the function.",
      "maxLength": 32,
      "minLength": 1,
      "type": "string"
    },
    "oci_pull_credential_id": {
      "description": "OCI Registry pull credential to use for pulling the revision's image.",
      "type": "string"
    },
    "oci_reference": {
      "description": "OCI reference for the revision.",
      "pattern": "(:[vV]?\\d+\\.\\d+\\.\\d+(@sha256:[a-fA-F0-9]{64})?)$|((:latest)?@sha256:[a-fA-F0-9]{64})$",
      "type": "string"
    },
    "state": {
      "description": "Status of this revision.",
      "enum": [
        "CANCELLED",
        "CREATING",
        "ACTIVE",
        "FAILED"
      ],
      "type": "string"
    },
    "state_error": {
      "description": "Error message related to this revision.",
      "type": "string"
    },
    "updated_at": {
      "description": "Time the function was last updated.",
      "format": "date-time",
      "type": "string"
    },
    "variables": {
      "description": "Variable values for this revision. Each variable must reference a variable definition on the function.",
      "items": {
        "$ref": "#/$defs/RevisionVariable"
      },
      "maxItems": 100,
      "type": "array"
    },
    "version": {
      "description": "The version number of the revision.",
      "format": "int64",
      "type": "integer"
    }
  },
  "required": [
    "oci_reference",
    "limits"
  ],
  "type": "object",
  "$defs": {
    "ResourceLimits": {
      "description": "Resource utilization limitations",
      "properties": {
        "concurrency": {
          "format": "int32",
          "type": "integer"
        },
        "plan": {
          "maxLength": 4,
          "minLength": 2,
          "type": "string"
        }
      },
      "required": [
        "plan",
        "concurrency"
      ],
      "type": "object"
    },
    "RevisionVariable": {
      "description": "Represents a variable value for a specific revision.",
      "properties": {
        "name": {
          "description": "Name of the variable (must match a variable definition on the function).",
          "maxLength": 255,
          "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
          "type": "string"
        },
        "value": {
          "description": "The value of the variable. Only present for normal variables. Secrets will have a vault reference instead.",
          "type": [
            "string",
            "null"
          ]
        },
        "vault_reference": {
          "description": "Reference to the vault secret. Only present for secret variables.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    }
  }
}