com.google.api.services.calendar.model.Event.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中com.google.api.services.calendar.model.Event.<init>()方法的一些代码示例,展示了Event.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.<init>()方法的具体详情如下:
包路径:com.google.api.services.calendar.model.Event
类名称:Event
方法名:<init>

Event.<init>介绍

暂无

代码示例

代码示例来源:origin: google/data-transfer-project

static Event convertToGoogleCalendarEvent(CalendarEventModel eventModel) {
 Event event = new Event()
   .setLocation(eventModel.getLocation())
   .setDescription(eventModel.getTitle())
   .setSummary(eventModel.getNotes())
   .setStart(getEventDateTime(eventModel.getStartTime()))
   .setEnd(getEventDateTime(eventModel.getEndTime()));
 if (eventModel.getAttendees() != null) {
  event.setAttendees(eventModel.getAttendees().stream()
    .map(GoogleCalendarImporter::transformToEventAttendee)
    .collect(Collectors.toList()));
 }
 return event;
}

代码示例来源:origin: google/data-transfer-project

new CalendarEventModel(modelCalendarId, null, null, null, null, null, null, null);
Event eventToInsert = GoogleCalendarImporter.convertToGoogleCalendarEvent(eventModel);
Event responseEvent = new Event();

代码示例来源:origin: google/google-api-java-client-samples

private static Event newEvent() {
 Event event = new Event();
 event.setSummary("New Event");
 Date startDate = new Date();
 Date endDate = new Date(startDate.getTime() + 3600000);
 DateTime start = new DateTime(startDate, TimeZone.getTimeZone("UTC"));
 event.setStart(new EventDateTime().setDateTime(start));
 DateTime end = new DateTime(endDate, TimeZone.getTimeZone("UTC"));
 event.setEnd(new EventDateTime().setDateTime(end));
 return event;
}

代码示例来源:origin: gdenning/exchange-sync

@Override
public void addAppointment(final AppointmentDto appointment) throws IOException {
  final Event event = new Event();
  final Map<String, String> privateProperties = new HashMap<String, String>();
  privateProperties.put(EXT_PROPERTY_EXCHANGE_ID, appointment.getExchangeId());
  final ExtendedProperties extProperties = new ExtendedProperties();
  extProperties.setPrivate(privateProperties);
  event.setExtendedProperties(extProperties);
  populateEventFromAppointmentDto(appointment, event);
  client.events().insert(calendarId, event).execute();
  LOG.info("Added Google appointment " + appointment.getSummary());
}

代码示例来源:origin: synyx/urlaubsverwaltung

@Override
public Optional<String> add(Absence absence, CalendarSettings calendarSettings) {
  googleCalendarClient = getOrCreateGoogleCalendarClient();
  if (googleCalendarClient != null) {
    GoogleCalendarSettings googleCalendarSettings =
        settingsService.getSettings().getCalendarSettings().getGoogleCalendarSettings();
    String calendarId = googleCalendarSettings.getCalendarId();
    try {
      Event eventToCommit = new Event();
      fillEvent(absence, eventToCommit);
      Event eventInCalendar = googleCalendarClient.events().insert(calendarId, eventToCommit).execute();
      LOG.info(String.format("Event %s for '%s' added to calendar '%s'.", eventInCalendar.getId(),
          absence.getPerson().getNiceName(), eventInCalendar.getSummary()));
      return Optional.of(eventInCalendar.getId());
    } catch (IOException ex) {
      LOG.warn(String.format("An error occurred while trying to add appointment to calendar %s", calendarId), ex);
      mailService.sendCalendarSyncErrorNotification(calendarId, absence, ex.toString());
    }
  }
  return Optional.empty();
}

代码示例来源:origin: org.jbpm.contrib/google-calendar-workitem

@Before
public void setUp() {
  try {
    CalendarList calendarListModel = new com.google.api.services.calendar.model.CalendarList();
    when(client.calendars()).thenReturn(calendars);
    when(calendars.insert(anyObject())).thenReturn(calendarsInsert);
    when(calendarsInsert.execute()).thenReturn(new com.google.api.services.calendar.model.Calendar());
    when(client.calendarList()).thenReturn(calendarsList);
    when(calendarsList.list()).thenReturn(calendarsListList);
    when(calendarsListList.execute()).thenReturn(calendarListModel);
    when(auth.getAuthorizedCalendar(anyString(),
                    anyString())).thenReturn(client);
    when(client.events()).thenReturn(clientEvents);
    when(clientEvents.insert(anyString(),
                 anyObject())).thenReturn(calendarEventsInsert);
    when(calendarEventsInsert.execute()).thenReturn(new com.google.api.services.calendar.model.Event());
    when(clientEvents.list(anyString())).thenReturn(calendarEventsList);
    when(calendarEventsList.execute()).thenReturn(new com.google.api.services.calendar.model.Events());
  } catch (Exception e) {
    fail(e.getMessage());
  }
}

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

com.google.api.services.calendar.model.Calendar cal = service.calendars().get(calendarData.getCalendarId()).execute();
Event event = new Event();
event.setId(eventId);
event.setVisibility("public");

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

com.google.api.services.calendar.model.Calendar cal = service.calendars().get(calendarData.getCalendarId()).execute();
Event event = new Event();
event.setId(KeyGenerator.generateEventId());
event.setVisibility("public");

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

com.google.api.services.calendar.model.Calendar cal = service.calendars().get(calendarData.getCalendarId()).execute();
Event event = new Event();
event.setId(KeyGenerator.generateEventId());
event.setVisibility("public");

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

com.google.api.services.calendar.model.Calendar cal = service.calendars().get(calendarData.getCalendarId()).execute();
Event event = new Event();
event.setId(KeyGenerator.generateEventId());
event.setVisibility("public");

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

com.google.api.services.calendar.model.Calendar cal = service.calendars().get(calendarData.getCalendarId()).execute();
Event event = new Event();
event.setId(eventId);
event.setVisibility("public");

代码示例来源:origin: NovaFox161/DisCal-Discord-Bot

com.google.api.services.calendar.model.Calendar cal = service.calendars().get(calendarData.getCalendarId()).execute();
Event event = new Event();
event.setId(eventId);
event.setVisibility("public");

代码示例来源:origin: io.syndesis.connector/connector-google-calendar

private Event createGoogleEvent(String summary, String description, String attendees, String startDate, String startTime, String endDate, String endTime, String location) throws AddressException, ParseException {
  DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
  Event event = new Event();
  event.setSummary(summary);
  event.setDescription(description);

代码示例来源:origin: io.syndesis.connector/connector-google-calendar

private Event createGoogleEvent(String summary, String description, String attendees, String startDate, String startTime, String endDate, String endTime, String location) throws AddressException, ParseException {
  DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
  Event event = new Event();
  event.setSummary(summary);
  event.setDescription(description);

相关文章