前提条件: 阅读 ../gws-shared/SKILL.md 了解认证、全局标志和安全规则。如果缺失,运行 gws generate-skills 创建。
gws calendar <资源> <方法> [标志]
辅助命令
API 资源
acl
- delete — 删除访问控制规则。
- get — 返回访问控制规则。
- insert — 创建访问控制规则。
- list — 返回日历的访问控制列表中的规则。
- patch — 更新访问控制规则。此方法支持 patch 语义。
- update — 更新访问控制规则。
- watch — 监视 ACL 资源的变更。
calendarList
- delete — 从用户的日历列表中移除日历。
- get — 从用户的日历列表中返回日历。
- insert — 将现有日历插入用户的日历列表。
- list — 返回用户日历列表中的日历。
- patch — 更新用户日历列表中的现有日历。此方法支持 patch 语义。
- update — 更新用户日历列表中的现有日历。
- watch — 监视 CalendarList 资源的变更。
calendars
- clear — 清除主日历。此操作删除与账号主日历关联的所有事件。
- delete — 删除辅助日历。清除主日历上的所有事件请使用 calendars.clear。
- get — 返回日历的元数据。
- insert — 创建辅助日历。请求的认证用户将成为新日历的数据所有者。
注意:建议以日历的预期数据所有者身份进行认证。可以使用全域委派权限允许应用代表特定用户操作。不要使用服务账号进行认证。如果使用服务账号认证,服务账号将成为数据所有者,可能导致意外行为。
- patch — 更新日历的元数据。此方法支持 patch 语义。
- update — 更新日历的元数据。
channels
- stop — 停止通过此通道监视资源
colors
- get — 返回日历和事件的颜色定义。
events
- delete — 删除事件。
- get — 根据 Google 日历 ID 返回事件。要使用 iCalendar ID 检索事件,请使用 iCalUID 参数调用 events.list 方法。
- import — 导入事件。此操作用于将现有事件的私有副本添加到日历。仅可导入 eventType 为 default 的事件。
已弃用行为:如果导入非 default 事件,其类型将更改为 default,任何事件类型特定属性将被丢弃。
- insert — 创建事件。
- instances — 返回指定周期性事件的实例。
- list — 返回指定日历上的事件。
- move — 将事件移动到另一个日历,即更改事件的组织者。注意,仅默认事件可移动;生日、专注时间、来自 Gmail、外出和办公地点事件无法移动。
- patch — 更新事件。此方法支持 patch 语义。
- quickAdd — 基于简单文本字符串创建事件。
- update — 更新事件。
- watch — 监视 Events 资源的变更。
freebusy
- query — 返回一组日历的空闲/忙碌信息。
settings
- get — 返回单个用户设置。
- list — 返回认证用户的所有用户设置。
- watch — 监视 Settings 资源的变更。
发现命令
调用任何 API 方法前,先检查它:
# 浏览资源和方法
gws calendar --help# 检查方法的必需参数、类型和默认值
gws schema calendar.<资源>.<方法>
使用 gws schema 输出来构建你的 --params 和 --json 标志。
PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
gws calendar [flags]
Helper Commands
| Command | Description |
|---|
+insert | create a new event |
+agenda | Show upcoming events across all calendars |
API Resources
acl
- delete — Deletes an access control rule.
- get — Returns an access control rule.
- insert — Creates an access control rule.
- list — Returns the rules in the access control list for the calendar.
- patch — Updates an access control rule. This method supports patch semantics.
- update — Updates an access control rule.
- watch — Watch for changes to ACL resources.
calendarList
- delete — Removes a calendar from the user's calendar list.
- get — Returns a calendar from the user's calendar list.
- insert — Inserts an existing calendar into the user's calendar list.
- list — Returns the calendars on the user's calendar list.
- patch — Updates an existing calendar on the user's calendar list. This method supports patch semantics.
- update — Updates an existing calendar on the user's calendar list.
- watch — Watch for changes to CalendarList resources.
calendars
- clear — Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.
- delete — Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.
- get — Returns metadata for a calendar.
- insert — Creates a secondary calendar.
The authenticated user for the request is made the data owner of the new calendar.
Note: We recommend to authenticate as the intended data owner of the calendar. You can use domain-wide delegation of authority to allow applications to act on behalf of a specific user. Don't use a service account for authentication. If you use a service account for authentication, the service account is the data owner, which can lead to unexpected behavior.
- patch — Updates metadata for a calendar. This method supports patch semantics.
- update — Updates metadata for a calendar.
channels
- stop — Stop watching resources through this channel
colors
- get — Returns the color definitions for calendars and events.
events
- delete — Deletes an event.
- get — Returns an event based on its Google Calendar ID. To retrieve an event using its iCalendar ID, call the events.list method using the iCalUID parameter.
- import — Imports an event. This operation is used to add a private copy of an existing event to a calendar. Only events with an eventType of default may be imported.
Deprecated behavior: If a non-default event is imported, its type will be changed to default and any event-type-specific properties it may have will be dropped.
- insert — Creates an event.
- instances — Returns instances of the specified recurring event.
- list — Returns events on the specified calendar.
- move — Moves an event to another calendar, i.e. changes an event's organizer. Note that only default events can be moved; birthday, focusTime, fromGmail, outOfOffice and workingLocation events cannot be moved.
- patch — Updates an event. This method supports patch semantics.
- quickAdd — Creates an event based on a simple text string.
- update — Updates an event.
- watch — Watch for changes to Events resources.
freebusy
- query — Returns free/busy information for a set of calendars.
settings
- get — Returns a single user setting.
- list — Returns all user settings for the authenticated user.
- watch — Watch for changes to Settings resources.
Discovering Commands
Before calling any API method, inspect it:
# Browse resources and methods
gws calendar --help# Inspect a method's required params, types, and defaults
gws schema calendar..
Use gws schema output to build your --params and --json flags.