class ScheduleItem
A data class representing a calendar schedule item that describes the availability of a user or resource (room/equipment) corresponding to an actual event on their default calendar.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/calendar/schedule/item.py
5 - 35
simple
Purpose
This class encapsulates information about a calendar event's availability status, including timing, location, privacy settings, and subject. It is used to represent schedule information in Microsoft Graph API interactions, particularly for querying user or resource availability. The class inherits from ClientValue, indicating it's part of a client-side data model for Office 365 integration.
Source Code
class ScheduleItem(ClientValue):
"""
An item that describes the availability of a user corresponding to an actual event on the user's default calendar.
This item applies to a resource (room or equipment) as well.
"""
def __init__(
self,
start=DateTimeTimeZone(),
end=DateTimeTimeZone(),
location=None,
is_private=None,
subject=None,
status=None,
):
"""
:param DateTimeTimeZone start: The date, time, and time zone that the corresponding event starts.
:param DateTimeTimeZone end: The date, time, and time zone that the corresponding event ends.
:param str location: The location where the corresponding event is held or attended from. Optional.
:param bool is_private: The sensitivity of the corresponding event. True if the event is marked private,
false otherwise. Optional.
:param str subject: The corresponding event's subject line. Optional.
:param str status: The availability status of the user or resource during the corresponding event.
The possible values are: free, tentative, busy, oof, workingElsewhere, unknown.
"""
self.start = start
self.end = end
self.location = location
self.isPrivate = is_private
self.subject = subject
self.status = status
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
start: A DateTimeTimeZone object representing when the corresponding event starts, including date, time, and timezone information. Defaults to an empty DateTimeTimeZone() instance.
end: A DateTimeTimeZone object representing when the corresponding event ends, including date, time, and timezone information. Defaults to an empty DateTimeTimeZone() instance.
location: Optional string specifying where the event is held or attended from. Can be None if location is not specified.
is_private: Optional boolean indicating the sensitivity of the event. True if the event is marked as private, False otherwise. Can be None if privacy status is not specified.
subject: Optional string containing the event's subject line or title. Can be None if subject is not provided.
status: Optional string representing the availability status during the event. Possible values are: 'free', 'tentative', 'busy', 'oof' (out of office), 'workingElsewhere', or 'unknown'. Can be None if status is not specified.
Return Value
Instantiation returns a ScheduleItem object with all specified attributes set. The object serves as a data container with no methods that return values, only storing schedule information as instance attributes.
Class Interface
Methods
__init__(start=DateTimeTimeZone(), end=DateTimeTimeZone(), location=None, is_private=None, subject=None, status=None)
Purpose: Initializes a new ScheduleItem instance with event availability information
Parameters:
start: DateTimeTimeZone object for event start timeend: DateTimeTimeZone object for event end timelocation: Optional string for event locationis_private: Optional boolean for event privacy statussubject: Optional string for event subject/titlestatus: Optional string for availability status
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
start |
DateTimeTimeZone | The date, time, and timezone when the event starts | instance |
end |
DateTimeTimeZone | The date, time, and timezone when the event ends | instance |
location |
str or None | The location where the event is held or attended from | instance |
isPrivate |
bool or None | Indicates if the event is marked as private (True) or not (False) | instance |
subject |
str or None | The subject line or title of the event | instance |
status |
str or None | The availability status during the event (free, tentative, busy, oof, workingElsewhere, unknown) | instance |
Dependencies
office365
Required Imports
from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone
from office365.runtime.client_value import ClientValue
Usage Example
from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone
from office365.outlook.calendar.scheduleItem import ScheduleItem
# Create DateTimeTimeZone objects for start and end times
start_time = DateTimeTimeZone()
start_time.dateTime = '2024-01-15T09:00:00'
start_time.timeZone = 'Pacific Standard Time'
end_time = DateTimeTimeZone()
end_time.dateTime = '2024-01-15T10:00:00'
end_time.timeZone = 'Pacific Standard Time'
# Create a schedule item for a busy meeting
schedule_item = ScheduleItem(
start=start_time,
end=end_time,
location='Conference Room A',
is_private=False,
subject='Team Standup Meeting',
status='busy'
)
# Access attributes
print(f'Meeting: {schedule_item.subject}')
print(f'Status: {schedule_item.status}')
print(f'Private: {schedule_item.isPrivate}')
Best Practices
- Always provide valid DateTimeTimeZone objects for start and end parameters to ensure proper time representation
- Use the correct status values from the allowed set: 'free', 'tentative', 'busy', 'oof', 'workingElsewhere', 'unknown'
- Note that the is_private parameter is stored as 'isPrivate' attribute (camelCase) to match Microsoft Graph API conventions
- This is a data container class with no business logic methods - it's meant to be instantiated, populated, and passed to other components
- The class inherits from ClientValue, which likely provides serialization/deserialization capabilities for API communication
- All optional parameters (location, is_private, subject, status) can be None, so handle None values when accessing these attributes
- This class represents a read-only snapshot of schedule information at a point in time; it does not maintain live connections to calendar data
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ScheduleInformation 78.0% similar
-
class StaffAvailabilityItem 73.0% similar
-
class AttendeeAvailability 69.8% similar
-
class Calendar 68.4% similar
-
class ShiftAvailability 67.7% similar