@Override
  @SuppressWarnings("unchecked")
  public CalendarEventModel apply(Map<String, Object> event, TransformerContext context) {
    if (!"singleInstance"
        .equals(event.get("type"))) { // support single instances for now;recurring events later
      return null;
    }
    String calendarId = context.getProperty(CALENDAR_ID);

    String title = (String) event.getOrDefault("subject", "");
    String location = TransformerHelper.getOrDefault("location", "displayName", event, "");

    // Notes is itemBody resource type defined as: { "content": "string",  "contentType": "String"}
    String notes = TransformerHelper.getOrDefault("body", "content", event, "");

    List<Map<String, Object>> rawAttendees =
        (List<Map<String, Object>>) event.getOrDefault("attendees", emptyList());
    List<CalendarAttendeeModel> attendees = new ArrayList<>();
    for (Object rawAttendee : rawAttendees) {
      CalendarAttendeeModel attendee = context.transform(CalendarAttendeeModel.class, rawAttendee);
      if (attendee != null) {
        attendees.add(attendee);
      }
    }

    CalendarEventModel.CalendarEventTime startTime =
        context.transform(CalendarEventModel.CalendarEventTime.class, event.get("start"));
    if (startTime == null) {
      context.problem("Could not parse start time. Skipping event.");
      return null;
    }

    CalendarEventModel.CalendarEventTime endTime =
        context.transform(CalendarEventModel.CalendarEventTime.class, event.get("end"));
    if (endTime == null) {
      context.problem("Could not parse end time. Skipping event.");
      return null;
    }

    return new CalendarEventModel(
        calendarId, title, notes, attendees, location, startTime, endTime, null);
  }
Maps from a Graph API calendar event resource as defined by:
https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/event
extensions/data-transfer/portability-data-transfer-microsoft/src/main/java/org/datatransferproject/transfer/microsoft/transformer/calendar/ToCalendarEventModelTransformer.java