REST Resource: projects.versions
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:版本
表示脚本项目版本的资源。版本是一种“快照”与只读分支版本类似。创建部署时,必须指定要使用的版本。
JSON 表示法 |
{
"scriptId": string,
"versionNumber": integer,
"description": string,
"createTime": string
} |
字段 |
scriptId |
string
脚本项目的云端硬盘 ID。
|
versionNumber |
integer
创建版本时,Apps 脚本创建的增量 ID。这是系统分配的号码,一经创建便无法更改。
|
description |
string
此版本的说明。
|
createTime |
string (Timestamp format)
版本的创建时间。 时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
方法 |
|
使用当前代码创建一个新的不可变版本,具有唯一的版本号。 |
|
获取脚本项目的版本。 |
|
列出脚本项目的版本。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eA Version represents a read-only snapshot of a script project, similar to a branched release.\u003c/p\u003e\n"],["\u003cp\u003eIt's essential to specify the desired Version when creating Deployments.\u003c/p\u003e\n"],["\u003cp\u003eVersions have a unique ID, description, creation timestamp, and are linked to a specific script project.\u003c/p\u003e\n"],["\u003cp\u003eYou can create, retrieve, and list Versions through the provided methods.\u003c/p\u003e\n"]]],[],null,["# REST Resource: projects.versions\n\n- [Resource: Version](#Version)\n - [JSON representation](#Version.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Version\n-----------------\n\nA resource representing a script project version. A version is a \"snapshot\" of a script project and is similar to a read-only branched release. When creating deployments, the version to use must be specified.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------|\n| ``` { \"scriptId\": string, \"versionNumber\": integer, \"description\": string, \"createTime\": string } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `scriptId` | `string` The script project's Drive ID. |\n| `versionNumber` | `integer` The incremental ID that is created by Apps Script when a version is created. This is system assigned number and is immutable once created. |\n| `description` | `string` The description for this version. |\n| `createTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` When the version was created. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n\n| Methods ------- ||\n|---------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| ### [create](/apps-script/api/reference/rest/v1/projects.versions/create) | Creates a new immutable version using the current code, with a unique version number. |\n| ### [get](/apps-script/api/reference/rest/v1/projects.versions/get) | Gets a version of a script project. |\n| ### [list](/apps-script/api/reference/rest/v1/projects.versions/list) | List the versions of a script project. |"]]