REST Resource: projects.chatAppConfig

资源:ChatAppConfig

表示作为 Google Workspace 插件构建的 Google Chat 应用的配置。

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "interactiveFeatureConfig": {
    object (InteractiveFeatureConfig)
  },
  "avatarUri": string,
  "state": enum (AppState),
  "errorLoggingEnabled": boolean,
  "markupSyntax": enum (MarkupSyntax)
}
字段
name

string

必需。标识符。Chat 应用配置的资源名称。

格式:projects/{project}/chatAppConfig,其中 {project} 是 Google Cloud 项目编号。

displayName

string

必需。Chat 应用的显示名称。长度应介于 3 到 25 个字符之间。

description

string

必需。Chat 应用的简短说明。长度应介于 1 到 40 个字符之间。

interactiveFeatureConfig

object (InteractiveFeatureConfig)

可选。应用的互动功能设置。如果未提供此设置,应用将不具备互动功能,这意味着应用可以使用 Chat API,但用户无法与应用互动。

avatarUri

string

可选。应用头像图片的网址。必须是托管一张方形(宽高比为 1:1)PNG 图片的 HTTPS 网址。建议的最小尺寸:256 x 256 像素。如果未指定,系统将使用默认应用头像。

state

enum (AppState)

可选。应用的状态。如果未指定,则默认为 ACTIVE。

errorLoggingEnabled

boolean

可选。是否将错误记录到 Cloud Logging。如果未指定,则默认为 false。

markupSyntax

enum (MarkupSyntax)

可选。此 Chat 应用发送或读取的消息的默认标记语法。如果未指定,则默认值为 MARKUP_SYNTAX_MARKDOWN。

AppState

Chat 应用的当前状态。

枚举
APP_STATE_UNSPECIFIED 默认值。未指定。
ACTIVE 映射到 Chat API 配置页面中的“LIVE”。应用处于活跃状态,可供有权查看的用户找到和使用。
DISABLED 该应用已被停用,任何人都无法再找到该应用,也无法再与该应用对话。

InteractiveFeatureConfig

应用的互动功能设置。

JSON 表示法
{
  "connectionConfig": {
    object (ConnectionConfig)
  },
  "appCommands": [
    {
      object (AppCommand)
    }
  ],
  "urlPatterns": [
    {
      object (UrlPattern)
    }
  ],
  "allowlistedTestingPrincipals": [
    string
  ],
  "supportsMultiuserSpaces": boolean
}
字段
connectionConfig

object (ConnectionConfig)

必需。应用如何接收来自 Google Chat 的事件。

appCommands[]

object (AppCommand)

可选。应用命令的配置。

urlPatterns[]

object (UrlPattern)

可选。链接预览的配置。

allowlistedTestingPrincipals[]

string

可选。您 Google Workspace 网域中可以查找和使用该应用的用户和群组的电子邮件地址。

supportsMultiuserSpaces

boolean

可选。应用是否可以添加到 1 对 1 人工私信、群聊和聊天室中。如果未指定,则默认为 false。

ConnectionConfig

应用如何接收事件。

JSON 表示法
{

  "httpEndpointConfig": {
    object (HttpEndpointConfig)
  },
  "appsScriptEndpointConfig": {
    object (AppsScriptEndpointConfig)
  },
  "cloudPubSubEndpointConfig": {
    object (CloudPubSubEndpointConfig)
  },
  "dialogflowEndpointConfig": {
    object (DialogflowEndpointConfig)
  }
}
字段
连接类型。以下是互斥字段的列表。在响应中,最多只能设置其中一个字段:
httpEndpointConfig

object (HttpEndpointConfig)

HTTP 端点配置。

appsScriptEndpointConfig

object (AppsScriptEndpointConfig)

Apps 脚本部署配置。

cloudPubSubEndpointConfig

object (CloudPubSubEndpointConfig)

Pub/Sub 主题配置。

dialogflowEndpointConfig

object (DialogflowEndpointConfig)

Dialogflow 配置。

互斥字段结束。

HttpEndpointConfig

HTTP 端点配置。

JSON 表示法
{

  "commonUrl": string,
  "perEventEndpointConfig": {
    object (HttpPerEventEndpointConfig)
  }
}
字段
HTTP 端点网址配置。以下是互斥字段的列表。在响应中,最多只能设置以下字段中的一个:
commonUrl

string

可选。Google Chat 向其发送所有互动事件的 HTTPS 网址。

perEventEndpointConfig

object (HttpPerEventEndpointConfig)

可选。Google Chat 向其发送每种类型的互动事件的单独 HTTPS 网址。

互斥字段结束。

HttpPerEventEndpointConfig

特定事件类型的 HTTP 端点配置。

JSON 表示法
{
  "appCommandEndpoint": string,
  "addedToSpaceEndpoint": string,
  "messageEndpoint": string,
  "removedFromSpaceEndpoint": string
}
字段
appCommandEndpoint

string

必需。应用命令事件的 HTTPS 网址端点。

addedToSpaceEndpoint

string

必需。“已添加到聊天室”事件的 HTTPS 网址端点。

messageEndpoint

string

必需。消息事件的 HTTPS 网址端点。

removedFromSpaceEndpoint

string

必需。用于接收“从聊天室中移除”事件的 HTTPS 网址端点。

AppsScriptEndpointConfig

Apps 脚本端点配置。

JSON 表示法
{
  "deploymentId": string,
  "perEventEndpointConfig": {
    object (AppsScriptPerEventEndpointConfig)
  }
}
字段
deploymentId

string

必需。Apps 脚本部署 ID。

perEventEndpointConfig

object (AppsScriptPerEventEndpointConfig)

可选。Google Chat 针对每种类型的互动事件调用的 Apps 脚本函数的名称。如果未指定,Chat 会为每种事件类型调用默认函数。

AppsScriptPerEventEndpointConfig

特定事件类型的 Apps 脚本端点配置。

JSON 表示法
{
  "appCommandEndpoint": string,
  "addedToSpaceEndpoint": string,
  "messageEndpoint": string,
  "removedFromSpaceEndpoint": string
}
字段
appCommandEndpoint

string

可选。应用命令事件的函数名称。如果未指定,系统将使用默认的 onAppCommand 函数名称。

addedToSpaceEndpoint

string

可选。“已添加到聊天室”事件的函数名称。如果未指定,系统将使用默认的 onAddedToSpace 函数名称。

messageEndpoint

string

可选。消息事件的函数名称。如果未指定,系统将使用默认的 onMessage 函数名称。

removedFromSpaceEndpoint

string

可选。从聊天室中移除事件的函数名称。如果未指定,系统将使用默认的 onRemovedFromSpace 函数名称。

CloudPubSubEndpointConfig

Pub/Sub 端点配置。

JSON 表示法
{
  "topic": string
}
字段
topic

string

必需。Google Chat 将所有互动事件发布到的 Pub/Sub 主题。主题必须与应用位于同一 Google Cloud 云项目 中,并且 Chat 必须有权向该主题发布消息。如需了解详情,请参阅使用 Pub/Sub 构建 Google Chat 应用。

格式:projects/{project}/topics/{topic}

DialogflowEndpointConfig

Dialogflow 端点配置。

JSON 表示法
{
  "dialogflowEdition": enum (DialogflowEdition),
  "agent": string
}
字段
dialogflowEdition

enum (DialogflowEdition)

必需。Dialogflow 版本。

agent

string

可选。Dialogflow CX 智能体或环境名称。Dialogflow CX 必需。请勿为 Dialogflow ES 设置。

格式:projects/{project}/locations/{location}/agents/{agent} 或 projects/{project}/locations/{location}/agents/{agent}/environments/{environment}。

DialogflowEdition

Dialogflow 版本类型。

枚举
DIALOGFLOW_EDITION_UNSPECIFIED 默认值。未指定。
ES Dialogflow ES 版本。如需使用此版本,Dialogflow ES 代理必须与应用位于同一 Google Cloud 项目中。Google Chat 会将所有互动事件发送到该代理。
CX Dialogflow CX 版本。如需使用此版本,Dialogflow CX 智能体必须与应用位于同一 Google Cloud 云项目中,并在 agent 字段中指定。Google Chat 会将所有互动事件发送到该代理。

AppCommand

应用命令的配置。

JSON 表示法
{
  "commandType": enum (CommandType),
  "commandId": integer,
  "command": string,
  "displayName": string,
  "description": string,
  "dialogEnabled": boolean,
  "loadingNotificationMessage": string
}
字段
commandType

enum (CommandType)

必需。此命令的类型。

commandId

integer

必需。命令的 ID (1-1000)。在应用中必须是唯一的。

command

string

可选。命令的名称。对于 SLASH_COMMAND,此字段为必填字段;对于其他命令类型,请勿设置此字段。必须以“/”开头,例如“/command”。

displayName

string

可选。命令的人性化显示名称。对于 MESSAGE_ACTION 和 QUICK_COMMAND,此字段是必需的;对于 SLASH_COMMAND,请勿设置此字段。

description

string

必需。命令的简短说明。

dialogEnabled

boolean

可选。此命令是否应触发对话框。如果未指定,则默认为 false。

loadingNotificationMessage

string

可选。当用户触发消息操作时,系统会向其发送通知。仅 MESSAGE_ACTION 命令支持此字段。

CommandType

应用命令的类型。

枚举
COMMAND_TYPE_UNSPECIFIED 默认值。未指定。
SLASH_COMMAND 通过输入“/”后跟命令名称调用的命令。它可能会在消息文本中接受其他参数。
QUICK_COMMAND 从邮件撰写上下文菜单中调用的快捷命令。快捷命令不接受其他参数。
MESSAGE_ACTION 从消息上下文菜单调用的命令。

UrlPattern

链接预览的配置。

JSON 表示法
{
  "hostPattern": string,
  "pathPrefix": string
}
字段
hostPattern

string

必需。要匹配的网域。匹配特定子网域(例如“subdomain.example.com”),或通过添加星号 (*) 作为前导通配符来匹配整个网域。例如,“*.example.com”与“https://subdomain.example.com”和“https://any.number.of.subdomains.example.com”匹配。

pathPrefix

string

可选。附加到主机模式的路径前缀。如果留空,系统会匹配主机模式中的所有网址。例如,与主机模式“subdomain.example.com”搭配使用时,请指定“path/”以匹配以“https://subdomain.example.com/path/”开头的页面网址。

MarkupSyntax

用于设置此 Chat 应用的消息文本格式的标记语法。

枚举
MARKUP_SYNTAX_UNSPECIFIED 默认值。未指定。在 markup_syntax 推出之前创建的现有 Chat 应用具有此值,并会一直使用 MARKUP_SYNTAX_CHAT,直到明确更新。
MARKUP_SYNTAX_CHAT 使用 Google Chat 的标记语法。如需了解详情,请参阅 https://developers.google.com/workspace/chat/format-messages#format-texts。
MARKUP_SYNTAX_MARKDOWN 使用 Markdown 语法。此语法基于 CommonMark 规范,并包含其他扩展。如需了解详情,请参阅 https://developers.google.com/workspace/chat/format-messages#format-texts。

方法

get

获取项目的 Chat 应用配置。

patch

更新项目的 Chat 应用配置。