Google Calendar API Event Free/Busy/Blocking Data

2020-04-11 09:21发布

I've been working with the Google Calendar API and am trying to figure out how to tell if an event a calendar should be considered an event that blocks time. For example, "Columbus Day" is an all day event (holiday) for many people in the US that has no effect on their workday, yet appears on a calendar. I've read in other places that the way to tell if an event is blocking on a calendar is by using its transparency field per This Post. However, when I play with my calendar events and toggle them back and forth, the event itself always remains "transparent" on the calendar.

My question is this: Is there a way to tell if an event blocks time on a calendar by looking at the event resource, or is this information something that should be derived from a free/busy query?

1条回答
▲ chillily
2楼-- · 2020-04-11 10:13

So as it turns out, when using the Ruby Google API Client, the transparency field is only included in the event resource when the event is marked "available" by the user. The default value is "opaque" according to the documentation. Presumably, when the transparency field is not present in the event resource, then the event should be considered "opaque" or "blocking" on the calendar. In the resulting request body in the API client, this should yield a nil value instead of a "transparent" value. Not the cleanest thing around, but I think it works.

查看更多
登录 后发表回答