Method: projects.preview.write
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cập nhật bản xem trước dự án của người dùng dựa trên mô hình.
Yêu cầu HTTP
POST https://actions.googleapis.com/v2/{parent=projects/*}/preview:write
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Tham số |
parent |
string
Bắt buộc. Tên tài nguyên mẹ ở định dạng projects/{project} . {project} là mã dự án trên đám mây liên kết với dự án đó.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"previewSettings": {
object (PreviewSettings )
},
// Union field source can be only one of the following:
"files": {
object (Files )
},
"draft": {
object (ContentFromDraft )
},
"submittedVersion": {
object (ContentFromSubmittedVersion )
}
// End of list of possible types for union field source .
} |
Trường |
previewSettings |
object (PreviewSettings )
Bắt buộc. Chế độ cài đặt để cập nhật bản xem trước của người dùng.
|
Trường kết hợp source . Nguồn dữ liệu dùng để tạo bản xem trước. source chỉ có thể là một trong những trạng thái sau đây: |
files |
object (Files )
Danh sách các tệp được gửi đến máy chủ cùng một lúc. Đây là danh sách các tệp cấu hình hoặc tệp dữ liệu. 1. Yêu cầu đầu tiên phải là một ConfigFiles. 2. Yêu cầu đầu tiên phải có một ConfigFile có "settings". 3. Yêu cầu đầu tiên phải có một ConfigFile có "tệp kê khai". 4. Bạn phải truyền trực tuyến ConfigFile của webhook tương ứng với chức năng đám mây cùng dòng trước khi DataFile tương ứng với mã nguồn tương ứng.
|
draft |
object (ContentFromDraft )
Nội dung được lấy từ bản nháp dự án.
|
submittedVersion |
object (ContentFromSubmittedVersion )
Nội dung được lấy từ một phiên bản đã thoát.
|
Nội dung phản hồi
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Định nghĩa về tài nguyên xem trước.
Biểu diễn dưới dạng JSON |
{
"name": string,
"validationResults": {
object (ValidationResults )
},
"simulatorUrl": string
} |
Trường |
name |
string
Giá trị nhận dạng duy nhất của bản xem trước. Định dạng projects/{project}/preview
|
validationResults |
object (ValidationResults )
Kết quả xác thực được liên kết với nội dung xem trước dự án của người dùng.
|
simulatorUrl |
string
URL trình mô phỏng để kiểm tra bản xem trước của người dùng.
|
ContentFromDraft
Cho biết nội dung xem trước sẽ được lấy từ Bản nháp.
ContentFromSubmittedVersion
Cho biết nội dung xem trước sẽ đến từ một phiên bản thoát.
Biểu diễn dưới dạng JSON |
{
"version": string
} |
Trường |
version |
string
Bắt buộc. Phiên bản đã gửi của dự án được dùng để tạo bản xem trước. Định dạng projects/{project}/versions/{version}
|
PreviewSettings
Chế độ cài đặt để cập nhật bản xem trước.
Biểu diễn dưới dạng JSON |
{
"sandbox": boolean
} |
Trường |
sandbox |
boolean
Cho biết liệu có chạy các hoạt động nhất định hay không, chẳng hạn như giao dịch, trong chế độ hộp cát. Theo mặc định, yêu cầu xem trước chạy các thao tác này ở chế độ hộp cát. Nói cách khác, giá trị mặc định của sandbox là true .
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-22 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-08-22 UTC."],[[["\u003cp\u003eUpdates a user's project preview using either draft content, an existing version, or uploaded files.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the project ID and the preview settings, which include an optional sandbox mode.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must indicate the source of the preview content (draft, version, or files).\u003c/p\u003e\n"],["\u003cp\u003eA successful response provides the preview's name, validation results, and a simulator URL for testing.\u003c/p\u003e\n"],["\u003cp\u003eThe API uses gRPC Transcoding and expects the content to follow specific JSON structures for requests and responses.\u003c/p\u003e\n"]]],[],null,["# Method: projects.preview.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.Preview.SCHEMA_REPRESENTATION)\n- [ContentFromDraft](#ContentFromDraft)\n- [ContentFromSubmittedVersion](#ContentFromSubmittedVersion)\n - [JSON representation](#ContentFromSubmittedVersion.SCHEMA_REPRESENTATION)\n- [PreviewSettings](#PreviewSettings)\n - [JSON representation](#PreviewSettings.SCHEMA_REPRESENTATION)\n\nUpdates the user's project preview based on the model.\n\n### HTTP request\n\n`POST https://actions.googleapis.com/v2/{parent=projects/*}/preview: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| ``` { \"previewSettings\": { object (/assistant/actions/api/reference/rest/v2/projects.preview/write#PreviewSettings) }, // Union field `source` can be only one of the following: \"files\": { object (/assistant/actions/api/reference/rest/v2/Files) }, \"draft\": { object (/assistant/actions/api/reference/rest/v2/projects.preview/write#ContentFromDraft) }, \"submittedVersion\": { object (/assistant/actions/api/reference/rest/v2/projects.preview/write#ContentFromSubmittedVersion) } // End of list of possible types for union field `source`. } ``` |\n\n| Fields ||\n|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `previewSettings` | `object (`[PreviewSettings](/assistant/actions/api/reference/rest/v2/projects.preview/write#PreviewSettings)`)` Required. The settings for updating the user's preview. |\n| Union field `source`. Data source used to created the preview. `source` can be only one of the following: |||\n| `files` | `object (`[Files](/assistant/actions/api/reference/rest/v2/Files)`)` 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| `draft` | `object (`[ContentFromDraft](/assistant/actions/api/reference/rest/v2/projects.preview/write#ContentFromDraft)`)` Content sourced from the project draft. |\n| `submittedVersion` | `object (`[ContentFromSubmittedVersion](/assistant/actions/api/reference/rest/v2/projects.preview/write#ContentFromSubmittedVersion)`)` Content sourced from the an exiting version. |\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\nDefinition of preview resource.\n\n| JSON representation ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"name\": string, \"validationResults\": { object (/assistant/actions/api/reference/rest/v2/ValidationResults) }, \"simulatorUrl\": string } ``` |\n\n| Fields ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The unique identifier of the preview. Format: `projects/{project}/preview` |\n| `validationResults` | `object (`[ValidationResults](/assistant/actions/api/reference/rest/v2/ValidationResults)`)` Validation results associated with the user project preview content. |\n| `simulatorUrl` | `string` The simulator URL to test the user preview. |\n\nContentFromDraft\n----------------\n\nIndicates the preview content will be coming from the Draft.\n\nContentFromSubmittedVersion\n---------------------------\n\nIndicates the preview content will be coming from an exiting version.\n\n| JSON representation ||\n|-------------------------------|---|\n| ``` { \"version\": string } ``` |\n\n| Fields ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `version` | `string` Required. Submitted version of the project to be used to create a preview. Format: `projects/{project}/versions/{version}` |\n\nPreviewSettings\n---------------\n\nSettings for updating the preview.\n\n| JSON representation ||\n|--------------------------------|---|\n| ``` { \"sandbox\": boolean } ``` |\n\n| Fields ||\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sandbox` | `boolean` Indicates whether or not to run certain operations, such as transactions, in sandbox mode. By default, preview requests run these operations in sandbox mode. In other words, the default value for `sandbox` is `true`. |"]]