gws-drive

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

drive (v3)

drive(v3版本)

PREREQUISITE: Read
../gws-shared/SKILL.md
for auth, global flags, and security rules. If missing, run
gws generate-skills
to create it.
bash
gws drive <resource> <method> [flags]
前置要求: 请阅读
../gws-shared/SKILL.md
了解认证、全局标志和安全规则。如果该文件缺失,请运行
gws generate-skills
命令生成。
bash
gws drive <resource> <method> [flags]

Helper Commands

辅助命令

CommandDescription
+upload
Upload a file with automatic metadata
命令描述
+upload
自动添加元数据上传文件

API Resources

API 资源

about

about

  • get
    — Gets information about the user, the user's Drive, and system capabilities. For more information, see Return user info. Required: The
    fields
    parameter must be set. To return the exact fields you need, see Return specific fields.
  • get
    — 获取用户、用户的Drive以及系统功能的相关信息。更多信息请查看返回用户信息。必填项:必须设置
    fields
    参数。如需返回所需的特定字段,请查看返回特定字段

accessproposals

accessproposals

approvals

approvals

  • get
    — Gets an Approval by ID.
    • list
      — Lists the Approvals on a file.
  • get
    — 通过ID获取审批记录。
    • list
      — 列出文件的审批记录。

apps

apps

changes

changes

  • getStartPageToken
    — 获取用于列出未来变更的起始pageToken。更多信息请查看检索变更记录
    • list
      — 列出用户或共享云端硬盘的变更记录。更多信息请查看检索变更记录
    • watch
      — 订阅用户的变更通知。更多信息请查看资源变更通知

channels

channels

comments

comments

drives

drives

  • create
    — Creates a shared drive. For more information, see Manage shared drives.
    • delete
      — Permanently deletes a shared drive for which the user is an
      organizer
      . The shared drive cannot contain any untrashed items. For more information, see Manage shared drives.
    • get
      — Gets a shared drive's metadata by ID. For more information, see Manage shared drives.
    • hide
      — Hides a shared drive from the default view. For more information, see Manage shared drives.
    • list
      — Lists the user's shared drives. This method accepts the
      q
      parameter, which is a search query combining one or more search terms. For more information, see the Search for shared drives guide.
    • unhide
      — Restores a shared drive to the default view. For more information, see Manage shared drives.
    • update
      — Updates the metadata for a shared drive. For more information, see Manage shared drives.
  • create
    — 创建共享云端硬盘。更多信息请查看管理共享云端硬盘
    • delete
      — 永久删除用户作为
      organizer
      (组织者)的共享云端硬盘。该共享云端硬盘不能包含任何未放入回收站的项目。更多信息请查看管理共享云端硬盘
    • get
      — 通过ID获取共享云端硬盘的元数据。更多信息请查看管理共享云端硬盘
    • hide
      — 在默认视图中隐藏共享云端硬盘。更多信息请查看管理共享云端硬盘
    • list
      — 列出用户的共享云端硬盘。该方法支持
      q
      参数,该参数是一个组合了多个搜索条件的查询语句。更多信息请查看搜索共享云端硬盘指南。
    • unhide
      — 将共享云端硬盘恢复到默认视图。更多信息请查看管理共享云端硬盘
    • update
      — 更新共享云端硬盘的元数据。更多信息请查看管理共享云端硬盘

files

files

  • copy
    — Creates a copy of a file and applies any requested updates with patch semantics. For more information, see Create and manage files.
    • create
      — Creates a file. For more information, see Create and manage files. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:
      */*
      (Specify a valid MIME type, rather than the literal
      */*
      value. The literal
      */*
      is only used to indicate that any valid MIME type can be uploaded.
    • delete
      — Permanently deletes a file owned by the user without moving it to the trash. For more information, see Trash or delete files and folders. If the file belongs to a shared drive, the user must be an
      organizer
      on the parent folder. If the target is a folder, all descendants owned by the user are also deleted.
    • download
      — Downloads the content of a file. For more information, see Download and export files. Operations are valid for 24 hours from the time of creation.
    • emptyTrash
      — Permanently deletes all of the user's trashed files. For more information, see Trash or delete files and folders.
    • export
      — Exports a Google Workspace document to the requested MIME type and returns exported byte content. For more information, see Download and export files. Note that the exported content is limited to 10 MB.
    • generateIds
      — Generates a set of file IDs which can be provided in create or copy requests. For more information, see Create and manage files.
    • get
      — Gets a file's metadata or content by ID. For more information, see Search for files and folders. If you provide the URL parameter
      alt=media
      , then the response includes the file contents in the response body. Downloading content with
      alt=media
      only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use
      files.export
      instead.
    • list
      — Lists the user's files. For more information, see Search for files and folders. This method accepts the
      q
      parameter, which is a search query combining one or more search terms. This method returns all files by default, including trashed files. If you don't want trashed files to appear in the list, use the
      trashed=false
      query parameter to remove trashed files from the results.
    • listLabels
      — Lists the labels on a file. For more information, see List labels on a file.
    • modifyLabels
      — Modifies the set of labels applied to a file. For more information, see Set a label field on a file. Returns a list of the labels that were added or modified.
    • update
      — Updates a file's metadata, content, or both. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as
      modifiedDate
      . This method supports patch semantics. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:
      */*
      (Specify a valid MIME type, rather than the literal
      */*
      value.
    • watch
      — Subscribes to changes to a file. For more information, see Notifications for resource changes.
  • copy
    — 创建文件副本,并使用补丁语义应用所有请求的更新。更多信息请查看创建与管理文件
    • create
      — 创建文件。更多信息请查看创建与管理文件。该方法支持*/upload* URI,接受符合以下特征的上传媒体:- 最大文件大小: 5120 GB - 支持的媒体MIME类型:
      */*
      (请指定有效的MIME类型,而非字面意义上的
      */*
      。字面意义的
      */*
      仅用于表示可以上传任何有效的MIME类型。
    • delete
      — 永久删除用户拥有的文件,不会将其移至回收站。更多信息请查看将文件和文件夹放入回收站或删除。如果文件属于共享云端硬盘,用户必须是父文件夹的
      organizer
      (组织者)。如果目标是文件夹,用户拥有的所有子项也会被删除。
    • download
      — 下载文件内容。更多信息请查看下载与导出文件。创建后的操作有效期为24小时。
    • emptyTrash
      — 永久删除用户回收站中的所有文件。更多信息请查看将文件和文件夹放入回收站或删除
    • export
      — 将Google Workspace文档导出为指定的MIME类型,并返回导出的字节内容。更多信息请查看下载与导出文件。注意:导出内容的大小限制为10 MB。
    • generateIds
      — 生成一组可用于创建或复制请求的文件ID。更多信息请查看创建与管理文件
    • get
      — 通过ID获取文件的元数据或内容。更多信息请查看搜索文件和文件夹。如果提供URL参数
      alt=media
      ,则响应正文将包含文件内容。只有当文件存储在Drive中时,使用
      alt=media
      下载内容才有效。如需下载Google Docs、Sheets和Slides,请使用
      files.export
      接口。
    • list
      — 列出用户的所有文件。更多信息请查看搜索文件和文件夹。该方法支持
      q
      参数,该参数是一个组合了多个搜索条件的查询语句。默认情况下,该方法返回所有文件,包括已放入回收站的文件。如果不希望回收站中的文件出现在列表中,请使用
      trashed=false
      查询参数过滤结果。
    • listLabels
      — 列出文件的标签。更多信息请查看列出文件的标签
    • modifyLabels
      — 修改应用于文件的标签集合。更多信息请查看在文件上设置标签字段。返回已添加或修改的标签列表。
    • update
      — 更新文件的元数据、内容或两者。调用该方法时,只需在请求中填充需要修改的字段。更新字段时,某些字段会自动更改,例如
      modifiedDate
      。该方法支持补丁语义。该方法支持*/upload* URI,接受符合以下特征的上传媒体:- 最大文件大小: 5120 GB - 支持的媒体MIME类型:
      */*
      (请指定有效的MIME类型,而非字面意义上的
      */*
    • watch
      — 订阅文件的变更通知。更多信息请查看资源变更通知

operations

operations

  • get
    — Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
  • get
    — 获取长时间运行操作的最新状态。客户端可以按照API服务推荐的时间间隔,使用该方法轮询操作结果。

permissions

permissions

  • create
    — Creates a permission for a file or shared drive. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren't supported; only the last update is applied.

replies

replies

revisions

revisions

  • delete
    — Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted. For more information, see Manage file revisions.
    • get
      — Gets a revision's metadata or content by ID. For more information, see Manage file revisions.
    • list
      — Lists a file's revisions. For more information, see Manage file revisions. Important: The list of revisions returned by this method might be incomplete for files with a large revision history, including frequently edited Google Docs, Sheets, and Slides. Older revisions might be omitted from the response, meaning the first revision returned may not be the oldest existing revision.
    • update
      — Updates a revision with patch semantics. For more information, see Manage file revisions.
  • delete
    — 永久删除文件版本。仅能删除Google Drive中包含二进制内容的文件版本,例如图片或视频。无法删除其他文件(如Google Docs或Sheets)的版本,以及文件的最后一个剩余版本。更多信息请查看管理文件版本
    • get
      — 通过ID获取版本的元数据或内容。更多信息请查看管理文件版本
    • list
      — 列出文件的所有版本。更多信息请查看管理文件版本重要提示: 对于版本历史较多的文件,包括频繁编辑的Google Docs、Sheets和Slides,该方法返回的版本列表可能不完整。较旧的版本可能会被省略,这意味着返回的第一个版本可能不是最早的现有版本。
    • update
      — 使用补丁语义更新版本。更多信息请查看管理文件版本

teamdrives

teamdrives

  • create
    — Deprecated: Use
    drives.create
    instead.
    • delete
      — Deprecated: Use
      drives.delete
      instead.
    • get
      — Deprecated: Use
      drives.get
      instead.
    • list
      — Deprecated: Use
      drives.list
      instead.
    • update
      — Deprecated: Use
      drives.update
      instead.
  • create
    — 已弃用:请使用
    drives.create
    替代。
    • delete
      — 已弃用:请使用
      drives.delete
      替代。
    • get
      — 已弃用:请使用
      drives.get
      替代。
    • list
      — 已弃用:请使用
      drives.list
      替代。
    • update
      — 已弃用:请使用
      drives.update
      替代。

Discovering Commands

命令查询

Before calling any API method, inspect it:
bash
undefined
调用任何API方法之前,请先查看其详情:
bash
undefined

Browse resources and methods

浏览资源与方法

gws drive --help
gws drive --help

Inspect a method's required params, types, and defaults

查看方法的必填参数、类型和默认值

gws schema drive.<resource>.<method>

Use `gws schema` output to build your `--params` and `--json` flags.
gws schema drive.<resource>.<method>

使用`gws schema`的输出来构建`--params`和`--json`标志。