calendar (v3)
PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
CODEBLOCK0
Helper Commands
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:
CODEBLOCK1
Use gws schema output to build your --params and --json flags.
calendar (v3)
前置条件: 请先阅读 ../gws-shared/SKILL.md 了解认证、全局标志和安全规则。如果该文件缺失,请运行 gws generate-skills 创建。
bash
gws calendar <资源> <方法> [标志]
辅助命令
显示所有日历的即将发生的事件 |
API 资源
acl
- delete — 删除访问控制规则。
- get — 返回访问控制规则。
- insert — 创建访问控制规则。
- list — 返回日历的访问控制列表中的规则。
- patch — 更新访问控制规则。此方法支持补丁语义。
- update — 更新访问控制规则。
- watch — 监听 ACL 资源的变更。
calendarList
- delete — 从用户的日历列表中移除日历。
- get — 从用户的日历列表中返回日历。
- insert — 将现有日历插入到用户的日历列表中。
- list — 返回用户日历列表中的日历。
- patch — 更新用户日历列表中的现有日历。此方法支持补丁语义。
- update — 更新用户日历列表中的现有日历。
- watch — 监听 CalendarList 资源的变更。
calendars
- clear — 清空主日历。此操作会删除与账户主日历关联的所有事件。
- delete — 删除辅助日历。使用 calendars.clear 清空主日历上的所有事件。
- get — 返回日历的元数据。
- insert — 创建辅助日历。
请求的认证用户将成为新日历的数据所有者。
注意:建议使用预期的日历数据所有者身份进行认证。您可以使用域范围的授权委托,允许应用程序代表特定用户执行操作。不要使用服务账号进行认证。如果使用服务账号进行认证,服务账号将成为数据所有者,这可能导致意外行为。
- patch — 更新日历的元数据。此方法支持补丁语义。
- update — 更新日历的元数据。
channels
- stop — 停止通过此通道监听资源
colors
- get — 返回日历和事件的颜色定义。
events
- delete — 删除事件。
- get — 根据 Google 日历 ID 返回事件。要使用 iCalendar ID 检索事件,请使用 iCalUID 参数调用 events.list 方法。
- import — 导入事件。此操作用于将现有事件的私有副本添加到日历。只能导入 eventType 为 default 的事件。
已弃用的行为:如果导入非默认事件,其类型将更改为 default,并且可能拥有的任何事件类型特定属性将被丢弃。
- insert — 创建事件。
- instances — 返回指定重复事件的实例。
- list — 返回指定日历上的事件。
- move — 将事件移动到另一个日历,即更改事件的组织者。请注意,只有默认事件可以移动;生日、专注时间、来自Gmail、外出办公和工作地点事件无法移动。
- patch — 更新事件。此方法支持补丁语义。
- quickAdd — 基于简单的文本字符串创建事件。
- update — 更新事件。
- watch — 监听 Events 资源的变更。
freebusy
- query — 返回一组日历的空闲/忙碌信息。
settings
- get — 返回单个用户设置。
- list — 返回认证用户的所有用户设置。
- watch — 监听 Settings 资源的变更。
发现命令
在调用任何 API 方法之前,请先检查它:
bash
浏览资源和方法
gws calendar --help
检查方法的必需参数、类型和默认值
gws schema calendar.<资源>.<方法>
使用 gws schema 的输出来构建您的 --params 和 --json 标志。