use of com.google.api.services.calendar.Calendar in project muikku by otavanopisto.
the class GoogleCalendarClient method createCalendar.
public fi.otavanopisto.muikku.calendar.Calendar createCalendar(String summary, String description) throws CalendarServiceException {
com.google.api.services.calendar.model.Calendar calendar = new com.google.api.services.calendar.model.Calendar();
calendar.setSummary(summary);
calendar.setDescription(description);
try {
calendar = getClient().calendars().insert(calendar).execute();
} catch (IOException | GeneralSecurityException ex) {
throw new CalendarServiceException(ex);
}
return new GoogleCalendar(summary, description, calendar.getId(), true);
}
Aggregations