Method: projects.draft.write
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://actions.googleapis.com/v2/{parent=projects/*}/draft:write
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。父级资源名称,格式为 projects/{project} 。{project} 是与项目关联的 Cloud 项目 ID。
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"files": {
object (Files )
}
} |
字段 |
files |
object (Files )
必需。每次发送到服务器的文件列表。这是配置文件或数据文件的列表。1. 第一个请求必须是 ConfigFiles。2. 第一个请求必须具有含“settings”的 ConfigFile。3. 第一个请求必须具有含“manifest”的 ConfigFile。4. 与内嵌 Cloud Functions 函数对应的 webhook ConfigFile 必须在与其源代码对应的 DataFile 之前进行流式传输。
|
响应正文
如果成功,响应正文将包含结构如下的数据:
字段 |
name |
string
草稿的唯一标识符,格式如下。projects/{project}/draft
|
validationResults |
object (ValidationResults )
与项目草稿内容关联的验证结果。请注意,尽管收到警告,但 draft.write 仍会更新草稿,因为警告并非草稿屏蔽。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eUpdates a project draft using a POST request to a specific endpoint with gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eRequires path and request body parameters, including project ID and files for the draft.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain configuration files (settings and manifest) before any data files.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes the draft's unique identifier and any validation results, including warnings that do not block draft updates.\u003c/p\u003e\n"]]],[],null,["# Method: projects.draft.write\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.Draft.SCHEMA_REPRESENTATION)\n\nUpdates the project draft based on the model.\n\n### HTTP request\n\n`POST https://actions.googleapis.com/v2/{parent=projects/*}/draft:write`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent resource name in the format `projects/{project}`. The `{project}` is the cloud project ID associated with the project. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation ||\n|----------------------------------------------------------------------------------|---|\n| ``` { \"files\": { object (/assistant/actions/api/reference/rest/v2/Files) } } ``` |\n\n| Fields ||\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `files` | `object (`[Files](/assistant/actions/api/reference/rest/v2/Files)`)` Required. List of files sent to the server at a time. This is a list of config files or data files. 1. The first request must be a ConfigFiles. 2. The first request must have a ConfigFile with 'settings'. 3. The first request must have a ConfigFile with 'manifest'. 4. The webhook ConfigFile corresponding to inline cloud function must be streamed before the DataFile corresponding to its source code. |\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nDefinition of draft resource.\n\n| JSON representation ||\n|--------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"name\": string, \"validationResults\": { object (/assistant/actions/api/reference/rest/v2/ValidationResults) } } ``` |\n\n| Fields ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The unique identifier of the draft in the following format. `projects/{project}/draft` |\n| `validationResults` | `object (`[ValidationResults](/assistant/actions/api/reference/rest/v2/ValidationResults)`)` Validation results associated with the project draft content. Note that draft.write updates the draft despite the warnings as warnings are not draft blocking. |"]]