Method: projects.preview.write
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Kullanıcının proje önizlemesini modele göre günceller.
HTTP isteği
POST https://actions.googleapis.com/v2/{parent=projects/*}/preview:write
URL, gRPC Kod Dönüştürme söz dizimini kullanır.
Yol parametreleri
Parametreler |
parent |
string
Zorunlu. projects/{project} biçimindeki üst kaynak adı. {project} , projeyle ilişkili bulut projesinin kimliğidir.
|
İstek içeriği
İstek gövdesi, aşağıdaki yapıya sahip verileri içerir:
Alanlar |
previewSettings |
object (PreviewSettings )
Zorunlu. Kullanıcının önizlemesini güncelleme ayarları.
|
Birleştirme alanı source . Önizlemeyi oluşturmak için kullanılan veri kaynağı. source şunlardan yalnızca biri olabilir: |
files |
object (Files )
Tek seferde sunucuya gönderilen dosyaların listesi. Bu liste, yapılandırma dosyaları veya veri dosyalarından oluşur. 1. İlk istek bir ConfigFiles olmalıdır. 2. İlk isteğin "settings" içeren bir ConfigFile'ı olmalıdır. 3. İlk isteğin "manifest" içeren bir ConfigFile'ı olmalıdır. 4. Satır içi bulut işlevine karşılık gelen webhook ConfigFile'ının, kaynak koduna karşılık gelen DataFile'dan önce yayınlanması gerekir.
|
draft |
object (ContentFromDraft )
İçerik, proje taslağından alınmıştır.
|
submittedVersion |
object (ContentFromSubmittedVersion )
Mevcut sürümden alınan içerik.
|
Yanıt gövdesi
Başarılı olursa yanıt metni aşağıdaki yapıyla birlikte verileri içerir:
Önizleme kaynağının tanımı.
JSON gösterimi |
{
"name": string,
"validationResults": {
object (ValidationResults )
},
"simulatorUrl": string
} |
Alanlar |
name |
string
Önizlemenin benzersiz tanımlayıcısıdır. Biçim: projects/{project}/preview
|
validationResults |
object (ValidationResults )
Kullanıcı projesi önizleme içeriğiyle ilişkili doğrulama sonuçları.
|
simulatorUrl |
string
Kullanıcı önizlemesini test etmek için kullanılacak simülasyon aracı URL'si.
|
ContentFromDraft
Önizleme içeriğinin Taslak'tan alınacağını belirtir.
ContentFromSubmittedVersion
Önizleme içeriğinin mevcut bir sürümden geleceğini belirtir.
JSON gösterimi |
{
"version": string
} |
Alanlar |
version |
string
Zorunlu. Önizleme oluşturmak için kullanılacak projenin gönderilen sürümü. Biçim: projects/{project}/versions/{version}
|
PreviewSettings
Önizlemeyi güncelleme ayarları.
JSON gösterimi |
{
"sandbox": boolean
} |
Alanlar |
sandbox |
boolean
İşlemler gibi belirli işlemlerin korumalı alan modunda çalıştırılıp çalıştırılmayacağını belirtir. Varsayılan olarak, önizleme istekleri bu işlemleri korumalı alan modunda çalıştırır. Başka bir deyişle, sandbox için varsayılan değer true şeklindedir.
|
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 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`. |"]]