Class Event
- All Implemented Interfaces:
ICreatable,IUpdatable
The Event resource represents a calendar event that can be scheduled, attended, and managed through Microsoft 365 calendars. Events can include meetings with attendees, all-day events, recurring events, and online meetings.
Key features of events include:
- Single instance and recurring events
- Multiple attendees with response status tracking
- Online meeting integration (Teams, Skype)
- Location information including physical and virtual locations
- Reminders and time zone support
- Attachments and extended properties
- Free/busy status (free, tentative, busy, out of office)
Example usage:
GraphClient client = new GraphClient();
// ... configure authentication ...
// Create a new event
Event event = new Event();
event.setSubject("Team Meeting");
DateTimeTimeZone start = new DateTimeTimeZone(
new Date(),
"America/New_York"
);
event.setStart(start);
DateTimeTimeZone end = new DateTimeTimeZone(
new Date(start.getTime().getTime() + 3600000),
"America/New_York"
);
event.setEnd(end);
// Add attendees
Attendee attendee = new Attendee();
EmailAddress email = new EmailAddress("user@example.com", "John Doe");
attendee.setEmailAddress(email);
event.getAttendees().add(attendee);
// Create the event
Event createdEvent = client.createEvent(event);
- Since:
- 1.0
- See Also:
- event resource type, Create event, Update event
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidallowNewTimeProposals(boolean allowNewTimeProposals)getBody()getEnd()getId()intgetStart()getType()getUid()booleanbooleanbooleanisAllDay()booleanbooleanbooleanisDraft()booleanbooleanbooleanbooleanvoidsetAsAllDay(boolean isAllDay)voidsetAsCancelled(boolean isCancelled)voidsetAsDraft(boolean isDraft)voidsetAsOnlineMeeting(boolean isOnlineMeeting)voidsetAsOrganizer(boolean isOrganizer)voidvoidsetEnd(DateTimeTimeZone end)voidsetHasAttachments(boolean hasAttachments)voidsetHideAttendees(boolean hideAttendees)voidvoidsetImportance(Importance importance)voidsetLocation(Location location)voidsetRecurrence(Recurrence recurrence)voidsetReminderMinutesBeforeStart(int reminderMinutesBeforeStart)voidsetReminderOn(boolean isReminderOn)voidsetResponseRequested(boolean responseRequested)voidsetSensitivity(Sensitivity sensitivity)voidvoidsetStart(DateTimeTimeZone start)voidsetSubject(String subject)Converts this object to its JSON representation for creation.toString()Converts this object to its JSON representation for update.toUpdateJson(List<String> propertyNames)Converts this object to JSON for update with specific properties.
-
Constructor Details
-
Event
public Event() -
Event
-
-
Method Details
-
toCreateJson
Description copied from interface:ICreatableConverts this object to its JSON representation for creation.This method generates a JSON string containing all properties needed to create a new instance of this resource in Microsoft Graph. Only properties appropriate for creation should be included (e.g., excluding read-only properties like ID, createdTime, etc.).
- Specified by:
toCreateJsonin interfaceICreatable- Returns:
- JSON string representation for creating this resource
-
toUpdateJson
Description copied from interface:IUpdatableConverts this object to its JSON representation for update.This method generates a JSON string containing all modified properties that should be updated in Microsoft Graph. Only writeable properties with non-null values are typically included.
- Specified by:
toUpdateJsonin interfaceIUpdatable- Returns:
- JSON string representation for updating this resource
-
toUpdateJson
Description copied from interface:IUpdatableConverts this object to JSON for update with specific properties.This method generates a JSON string containing only the specified properties. This enables partial updates where only certain fields need to be modified, reducing payload size and avoiding unintended changes to other properties.
- Specified by:
toUpdateJsonin interfaceIUpdatable- Parameters:
propertyNames- List of property names to include in the JSON. If null or empty, all modified properties are included.- Returns:
- JSON string representation for updating specific properties
-
toString
-
getId
-
setId
-
getChangeKey
-
isAllowNewTimeProposals
public boolean isAllowNewTimeProposals() -
allowNewTimeProposals
public void allowNewTimeProposals(boolean allowNewTimeProposals) -
getAttendees
-
getBody
-
setBody
-
getBodyPreview
-
getCategories
-
getCreatedTime
-
getEnd
-
setEnd
-
hasAttachments
public boolean hasAttachments() -
setHasAttachments
public void setHasAttachments(boolean hasAttachments) -
hideAttendees
public boolean hideAttendees() -
setHideAttendees
public void setHideAttendees(boolean hideAttendees) -
getImportance
-
setImportance
-
isAllDay
public boolean isAllDay() -
setAsAllDay
public void setAsAllDay(boolean isAllDay) -
isCancelled
public boolean isCancelled() -
setAsCancelled
public void setAsCancelled(boolean isCancelled) -
isDraft
public boolean isDraft() -
setAsDraft
public void setAsDraft(boolean isDraft) -
isOnlineMeeting
public boolean isOnlineMeeting() -
setAsOnlineMeeting
public void setAsOnlineMeeting(boolean isOnlineMeeting) -
isOrganizer
public boolean isOrganizer() -
setAsOrganizer
public void setAsOrganizer(boolean isOrganizer) -
isReminderOn
public boolean isReminderOn() -
setReminderOn
public void setReminderOn(boolean isReminderOn) -
getLastModifiedTime
-
getLocation
-
setLocation
-
getOcurrenceId
-
getLocations
-
getOnlineMeetingUrl
-
getOrganizer
-
getOriginalEndTimeZone
-
getOriginalStartTime
-
getOriginalStartTimeZone
-
getRecurrence
-
setRecurrence
-
getReminderMinutesBeforeStart
public int getReminderMinutesBeforeStart() -
setReminderMinutesBeforeStart
public void setReminderMinutesBeforeStart(int reminderMinutesBeforeStart) -
isResponseRequested
public boolean isResponseRequested() -
setResponseRequested
public void setResponseRequested(boolean responseRequested) -
getResponseStatus
-
getSensitivity
-
setSensitivity
-
getSeriesMasterId
-
getShowAs
-
setShowAs
-
getStart
-
setStart
-
getSubject
-
setSubject
-
getType
-
getUid
-
getWebLink
-
getExtendedProperties
-