Method: projects.preview.write
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Aktualisiert die Projektvorschau des Nutzers basierend auf dem Modell.
HTTP-Anfrage
POST https://actions.googleapis.com/v2/{parent=projects/*}/preview:write
Die URL verwendet die Syntax der gRPC-Transcodierung.
Pfadparameter
Parameter |
parent |
string
Erforderlich. Der Name der übergeordneten Ressource im Format projects/{project} . {project} ist die mit dem Projekt verknüpfte Cloud-Projekt-ID.
|
Anfragetext
Der Anfragetext enthält Daten mit folgender Struktur:
Felder |
previewSettings |
object (PreviewSettings )
Erforderlich. Die Einstellungen zum Aktualisieren der Vorschau des Nutzers.
|
Union-Feld source . Die zum Erstellen der Vorschau verwendete Datenquelle. Für source ist nur einer der folgenden Werte zulässig: |
files |
object (Files )
Liste der Dateien, die jeweils an den Server gesendet werden. Dies ist eine Liste von Konfigurationsdateien oder Datendateien. 1. Die erste Anfrage muss eine ConfigFiles sein. 2. Die erste Anfrage muss eine ConfigFile mit „settings“ haben. 3. Die erste Anfrage muss eine ConfigFile mit „manifest“ haben. 4. Die Webhook-ConfigFile, die der Inline-Cloud Functions-Funktion entspricht, muss vor der DataFile gestreamt werden, die ihrem Quellcode entspricht.
|
draft |
object (ContentFromDraft )
Inhalte, die aus dem Projektentwurf stammen.
|
submittedVersion |
object (ContentFromSubmittedVersion )
Content, der aus der aktuellen Version stammt.
|
Antworttext
Bei Erfolg enthält der Antworttext Daten mit der folgenden Struktur:
Definition der Vorschauressource.
JSON-Darstellung |
{
"name": string,
"validationResults": {
object (ValidationResults )
},
"simulatorUrl": string
} |
Felder |
name |
string
Die eindeutige ID der Vorschau. Format: projects/{project}/preview
|
validationResults |
object (ValidationResults )
Validierungsergebnisse, die mit dem Vorschauinhalt des Nutzerprojekts verknüpft sind.
|
simulatorUrl |
string
Die Simulator-URL zum Testen der Nutzervorschau.
|
ContentFromDraft
Gibt an, dass der Vorschauinhalt aus dem Entwurf stammt.
ContentFromSubmittedVersion
Gibt an, dass der Vorschauinhalt aus einer Exit-Version stammt.
JSON-Darstellung |
{
"version": string
} |
Felder |
version |
string
Erforderlich. Eingereichte Version des Projekts, die zum Erstellen einer Vorschau verwendet werden soll. Format: projects/{project}/versions/{version}
|
PreviewSettings
Einstellungen zum Aktualisieren der Vorschau.
JSON-Darstellung |
{
"sandbox": boolean
} |
Felder |
sandbox |
boolean
Gibt an, ob bestimmte Vorgänge, z. B. Transaktionen, im Sandbox-Modus ausgeführt werden sollen. Bei Vorschauanfragen werden diese Vorgänge standardmäßig im Sandbox-Modus ausgeführt. Mit anderen Worten, der Standardwert für sandbox ist true .
|
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (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`. |"]]