class MeetingTimeSuggestionsResult
A data class representing the result of a meeting time suggestion query, containing either a collection of meeting time suggestions or a reason why no suggestions are available.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/calendar/meetingtimes/suggestions_result.py
6 - 23
simple
Purpose
This class encapsulates the response from Microsoft Outlook's meeting time suggestions API. It serves as a container for either successful meeting time suggestions (stored in meetingTimeSuggestions) or an explanation for why no suggestions could be generated (stored in emptySuggestionsReason). This is part of the Office 365 Outlook calendar integration, specifically for finding optimal meeting times based on attendee availability.
Source Code
class MeetingTimeSuggestionsResult(ClientValue):
"""
A collection of meeting suggestions if there is any, or the reason if there isn't.
"""
def __init__(self, meeting_time_suggestions=None, empty_suggestions_reason=None):
"""
:param list[MeetingTimeSuggestion] meeting_time_suggestions: An array of meeting suggestions.
:param str empty_suggestions_reason: A reason for not returning any meeting suggestions.
The possible values are: attendeesUnavailable, attendeesUnavailableOrUnknown, locationsUnavailable,
organizerUnavailable, or unknown. This property is an empty string if the meetingTimeSuggestions property
does include any meeting suggestions.
"""
super(MeetingTimeSuggestionsResult, self).__init__()
self.meetingTimeSuggestions = ClientValueCollection(
MeetingTimeSuggestion, meeting_time_suggestions
)
self.emptySuggestionsReason = empty_suggestions_reason
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
meeting_time_suggestions: A list of MeetingTimeSuggestion objects representing potential meeting times. Each suggestion contains details about when a meeting could be scheduled based on attendee availability. Can be None or an empty list if no suggestions are available.
empty_suggestions_reason: A string explaining why no meeting suggestions were returned. Valid values include: 'attendeesUnavailable' (all attendees are busy), 'attendeesUnavailableOrUnknown' (attendees' availability cannot be determined), 'locationsUnavailable' (requested locations are not available), 'organizerUnavailable' (the meeting organizer is not available), or 'unknown' (unspecified reason). Should be an empty string or None when meeting suggestions are present.
Return Value
Instantiation returns a MeetingTimeSuggestionsResult object that inherits from ClientValue. The object contains two main attributes: meetingTimeSuggestions (a ClientValueCollection of MeetingTimeSuggestion objects) and emptySuggestionsReason (a string). This object represents the complete response from a meeting time suggestion query.
Class Interface
Methods
__init__(self, meeting_time_suggestions=None, empty_suggestions_reason=None)
Purpose: Initializes a new MeetingTimeSuggestionsResult instance with meeting suggestions or a reason for no suggestions
Parameters:
meeting_time_suggestions: Optional list of MeetingTimeSuggestion objects representing potential meeting timesempty_suggestions_reason: Optional string explaining why no meeting suggestions are available
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
meetingTimeSuggestions |
ClientValueCollection[MeetingTimeSuggestion] | A collection wrapper containing MeetingTimeSuggestion objects. Each suggestion represents a potential meeting time slot based on attendee availability and other constraints. Empty when no suggestions are available. | instance |
emptySuggestionsReason |
str | A string indicating why no meeting suggestions were returned. Possible values: 'attendeesUnavailable', 'attendeesUnavailableOrUnknown', 'locationsUnavailable', 'organizerUnavailable', 'unknown', or empty string when suggestions are present. | instance |
Dependencies
office365
Required Imports
from office365.outlook.calendar.meetingtimes.suggestion import MeetingTimeSuggestion
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
Usage Example
from office365.outlook.calendar.meetingtimes.result import MeetingTimeSuggestionsResult
from office365.outlook.calendar.meetingtimes.suggestion import MeetingTimeSuggestion
# Example 1: Creating a result with meeting suggestions
suggestion1 = MeetingTimeSuggestion()
suggestion2 = MeetingTimeSuggestion()
result_with_suggestions = MeetingTimeSuggestionsResult(
meeting_time_suggestions=[suggestion1, suggestion2],
empty_suggestions_reason=''
)
# Access the suggestions
for suggestion in result_with_suggestions.meetingTimeSuggestions:
# Process each meeting time suggestion
pass
# Example 2: Creating a result with no suggestions
result_no_suggestions = MeetingTimeSuggestionsResult(
meeting_time_suggestions=None,
empty_suggestions_reason='attendeesUnavailable'
)
# Check why no suggestions were returned
if result_no_suggestions.emptySuggestionsReason:
print(f'No suggestions: {result_no_suggestions.emptySuggestionsReason}')
# Example 3: Typical usage from API response
# This would typically be returned from an Outlook API call
# result = outlook_client.find_meeting_times(...)
# if result.meetingTimeSuggestions:
# # Process suggestions
# else:
# # Handle empty_suggestions_reason
Best Practices
- Always check whether meetingTimeSuggestions contains items before iterating, as it may be empty when emptySuggestionsReason is set
- When emptySuggestionsReason is populated, meetingTimeSuggestions should be empty or None, and vice versa
- This class is typically instantiated by the Office 365 SDK when deserializing API responses, not manually by developers
- The class inherits from ClientValue, which provides serialization/deserialization capabilities for Office 365 API communication
- Use the ClientValueCollection wrapper for meetingTimeSuggestions to maintain consistency with Office 365 SDK patterns
- Handle all possible emptySuggestionsReason values in your application logic to provide appropriate user feedback
- This is an immutable data container - attributes are set during initialization and should not be modified afterward
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class MeetingTimeSuggestion 79.8% similar
-
class TimeConstraint 62.9% similar
-
class PersonalResultSuggestion 59.8% similar
-
class QuerySuggestionResults 57.5% similar
-
class AttendeeAvailability 56.5% similar