java - 如何在java中的google calendar api中添加google meet?请帮我。我还没有理解谷歌文档。 https://developers.google.com/calendar/create-events。源代码在这里给出。在这里,我想使用用户 gmail 帐户创建事件。我没有任何 G-suite 帐户
Event event = new Event()
.setSummary(title)
.setLocation(location)
.setDescription(description);
DateTime startDateTime = new DateTime( date +"T"+startTime+"+06:00" );//"2020-05-05T11:00:00+06:00");
EventDateTime start = new EventDateTime()
.setDateTime(startDateTime)
.setTimeZone("Asia/Dhaka");
event.setStart(start);
DateTime endDateTime = new DateTime(date +"T"+endTime+"+06:00");//"2020-05-05T12:00:00+06:00");
EventDateTime end = new EventDateTime()
.setDateTime(endDateTime)
.setTimeZone("Asia/Dhaka");
event.setEnd(end);
String[] recurrence = new String[] {"RRULE:FREQ=DAILY;COUNT=1"};
event.setRecurrence(Arrays.asList(recurrence));
EventAttendee attendees[];
attendees = new EventAttendee[allAttendees.size()];
for(int i=0; i<allAttendees.size(); i++){
// System.out.println(allAttendees.get(i));
attendees[i] = new EventAttendee().setEmail(allAttendees.get(i));
}
event.setAttendees(Arrays.asList(attendees));
EventReminder[] reminderOverrides = new EventReminder[] {
new EventReminder().setMethod("email").setMinutes(24 * 60),
new EventReminder().setMethod("popup").setMinutes(10),
};
Event.Reminders reminders = new Event.Reminders()
.setUseDefault(false)
.setOverrides(Arrays.asList(reminderOverrides));
event.setReminders(reminders);
String calendarId = "primary";
try {
abc = service.events().insert(calendarId, event);
} catch (IOException e) {
e.printStackTrace();
}
try {
event = service.events().insert(calendarId, event).execute();
} catch (IOException e) {
e.printStackTrace();
}
String meetingId = event.getHangoutLink();
System.out.println("What is meeting ID? = "+meetingId);