class CalendarSharingMessage
CalendarSharingMessage is a specialized message class that represents calendar sharing messages in Microsoft Outlook, inheriting from the base Message class.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/calendar/sharing_message.py
4 - 5
simple
Purpose
This class represents a specific type of Outlook message used for sharing calendar information. It extends the base Message class to handle calendar sharing functionality within the Office 365 Outlook API. The class serves as a data model for calendar sharing messages, allowing users to work with calendar invitations and sharing requests programmatically.
Source Code
class CalendarSharingMessage(Message):
""""""
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
Message | - |
Parameter Details
bases: Inherits from Message class, which provides the base functionality for all Outlook messages including properties like subject, body, sender, recipients, and standard message operations
Return Value
Instantiation returns a CalendarSharingMessage object that represents an Outlook calendar sharing message with all inherited properties and methods from the Message base class.
Class Interface
Dependencies
office365
Required Imports
from office365.outlook.mail.messages.calendar_sharing_message import CalendarSharingMessage
Usage Example
from office365.outlook.mail.messages.calendar_sharing_message import CalendarSharingMessage
from office365.runtime.auth.client_credential import ClientCredential
from office365.graph_client import GraphClient
# Authenticate
credentials = ClientCredential('client_id', 'client_secret')
client = GraphClient(credentials)
# Get calendar sharing messages
messages = client.me.messages.filter("@odata.type eq 'microsoft.graph.calendarSharingMessage'").get().execute_query()
# Work with a calendar sharing message
for msg in messages:
if isinstance(msg, CalendarSharingMessage):
print(f'Subject: {msg.subject}')
print(f'From: {msg.from_property.email_address.address}')
# Access inherited Message properties and methods
Best Practices
- This class is typically instantiated by the Office 365 SDK when retrieving messages from the API, rather than being manually constructed
- Use type checking (isinstance) to identify CalendarSharingMessage objects when working with mixed message collections
- Ensure proper authentication and API permissions are configured before attempting to access calendar sharing messages
- Leverage inherited Message class methods for common operations like send, reply, forward, and delete
- The class serves primarily as a type marker to distinguish calendar sharing messages from other message types in the Outlook API
- Access calendar-specific properties through the inherited Message interface
- Always handle API exceptions when working with Office 365 services
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class EventMessage 67.6% similar
-
class CalendarPermission 65.4% similar
-
class Message 62.6% similar
-
class CalendarPermissionCollection 61.4% similar
-
class MessageCollection 59.8% similar