文档API 参考

Rust · 0.1.0

InstanceProfile

应用协议结构。字段名称及继承的描述保留原始语言。

此结构在哪里使用

以下链接根据协议快照中的直接引用生成。认证、可写字段和运行行为应以调用操作为准;可复用资源结构本身并不是完整的写入请求。

结构与字段

object

Instance profile message containing basic instance information.

字段类型 / 是否必需描述
versionstringVersion is the current version of instance.
demobooleanDemo indicates if the instance is in demo mode.
instanceUrlstringInstance URL is the URL of the instance.
adminallOf
User
The first administrator who set up this instance, for display purposes. May be null on an instance that has lost all admins; use needs_setup to determine whether initial setup is actually required.
commitstringCommit is the current build commit of instance.
needsSetupbooleanNeedsSetup is true when the instance has no users yet and requires initial setup (creating the first admin account). Unlike a null admin, this stays false once any user exists, so an instance that has lost its admins is not mistaken for a fresh install.
accessModestring (enum)
INSTANCE_ACCESS_MODE_UNSPECIFIED · INSTANCE_ACCESS_MODE_PRIVATE · INSTANCE_ACCESS_MODE_PUBLIC
Access mode controls whether unauthenticated users may access instance content.
challengeInstanceProfile_Challenge

完整结构

约束与嵌套结构请以这份完整 JSON 定义为准。字段出现在这里,并不意味着每位调用者都能修改它。

{
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "description": "Version is the current version of instance."
    },
    "demo": {
      "type": "boolean",
      "description": "Demo indicates if the instance is in demo mode."
    },
    "instanceUrl": {
      "type": "string",
      "description": "Instance URL is the URL of the instance."
    },
    "admin": {
      "allOf": [
        {
          "$ref": "#/components/schemas/User"
        }
      ],
      "description": "The first administrator who set up this instance, for display purposes.\n May be null on an instance that has lost all admins; use needs_setup to\n determine whether initial setup is actually required."
    },
    "commit": {
      "type": "string",
      "description": "Commit is the current build commit of instance."
    },
    "needsSetup": {
      "type": "boolean",
      "description": "NeedsSetup is true when the instance has no users yet and requires initial\n setup (creating the first admin account). Unlike a null admin, this stays\n false once any user exists, so an instance that has lost its admins is not\n mistaken for a fresh install."
    },
    "accessMode": {
      "enum": [
        "INSTANCE_ACCESS_MODE_UNSPECIFIED",
        "INSTANCE_ACCESS_MODE_PRIVATE",
        "INSTANCE_ACCESS_MODE_PUBLIC"
      ],
      "type": "string",
      "description": "Access mode controls whether unauthenticated users may access instance content.",
      "format": "enum"
    },
    "challenge": {
      "$ref": "#/components/schemas/InstanceProfile_Challenge"
    }
  },
  "description": "Instance profile message containing basic instance information."
}