文档API 参考

Rust · 0.1.0

User

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

此结构在哪里使用

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

被以下组件结构引用:

结构与字段

object

字段类型 / 是否必需描述
namestringThe resource name of the user. Format: users/{user}
rolestring (enum)
ROLE_UNSPECIFIED · ADMIN · USER
必需
The role of the user.
usernamestring
必需
Required. The unique username for login.
emailstringOptional. The email address of the user. Stored trimmed and lowercased; empty means no address. An address belongs to at most one user on the instance, so writes that would reuse one fail with ALREADY_EXISTS.
displayNamestringOptional. The display name of the user.
avatarUrlstringOptional. The avatar URL of the user.
descriptionstringOptional. The description of the user.
passwordstringInput only. The password for the user.
statestring (enum)
STATE_UNSPECIFIED · NORMAL · ARCHIVED
必需
The state of the user.
createTimestring (date-time)Output only. The creation timestamp.
updateTimestring (date-time)Output only. The last update timestamp.

完整结构

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

{
  "required": [
    "role",
    "username",
    "state"
  ],
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The resource name of the user.\n Format: users/{user}"
    },
    "role": {
      "enum": [
        "ROLE_UNSPECIFIED",
        "ADMIN",
        "USER"
      ],
      "type": "string",
      "description": "The role of the user.",
      "format": "enum"
    },
    "username": {
      "type": "string",
      "description": "Required. The unique username for login."
    },
    "email": {
      "type": "string",
      "description": "Optional. The email address of the user. Stored trimmed and lowercased;\n empty means no address. An address belongs to at most one user on the\n instance, so writes that would reuse one fail with ALREADY_EXISTS."
    },
    "displayName": {
      "type": "string",
      "description": "Optional. The display name of the user."
    },
    "avatarUrl": {
      "type": "string",
      "description": "Optional. The avatar URL of the user."
    },
    "description": {
      "type": "string",
      "description": "Optional. The description of the user."
    },
    "password": {
      "writeOnly": true,
      "type": "string",
      "description": "Input only. The password for the user."
    },
    "state": {
      "enum": [
        "STATE_UNSPECIFIED",
        "NORMAL",
        "ARCHIVED"
      ],
      "type": "string",
      "description": "The state of the user.",
      "format": "enum"
    },
    "createTime": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The creation timestamp.",
      "format": "date-time"
    },
    "updateTime": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. The last update timestamp.",
      "format": "date-time"
    }
  }
}