Search in sources :

Example 31 with Calendar

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);
}
Also used : GoogleCalendar(fi.otavanopisto.muikku.plugins.googlecalendar.model.GoogleCalendar) Calendar(com.google.api.services.calendar.Calendar) GoogleCalendar(fi.otavanopisto.muikku.plugins.googlecalendar.model.GoogleCalendar) GeneralSecurityException(java.security.GeneralSecurityException) IOException(java.io.IOException) CalendarServiceException(fi.otavanopisto.muikku.calendar.CalendarServiceException)

Aggregations

Calendar (com.google.api.services.calendar.Calendar)31 Event (com.google.api.services.calendar.model.Event)13 IOException (java.io.IOException)12 CalendarData (com.cloudcraftgaming.discal.api.object.calendar.CalendarData)11 DateTime (com.google.api.client.util.DateTime)8 CalendarListEntry (com.google.api.services.calendar.model.CalendarListEntry)8 Events (com.google.api.services.calendar.model.Events)8 EventData (com.cloudcraftgaming.discal.api.object.event.EventData)7 Credential (com.google.api.client.auth.oauth2.Credential)7 GuildSettings (com.cloudcraftgaming.discal.api.object.GuildSettings)6 ArrayList (java.util.ArrayList)5 EmbedBuilder (sx.blah.discord.util.EmbedBuilder)5 EventColor (com.cloudcraftgaming.discal.api.enums.event.EventColor)4 WebGuild (com.cloudcraftgaming.discal.api.object.web.WebGuild)4 EventDateTime (com.google.api.services.calendar.model.EventDateTime)4 Recurrence (com.cloudcraftgaming.discal.api.object.event.Recurrence)3 CalendarList (com.google.api.services.calendar.model.CalendarList)3 List (java.util.List)3 Map (java.util.Map)3 Consumer (java.util.function.Consumer)3