11import calendar
22import datetime as dt
33import logging
4- from zoneinfo import ZoneInfo
54
65# noinspection PyPep8Naming
76from bs4 import BeautifulSoup as bs
87from dateutil .parser import parse
8+ from zoneinfo import ZoneInfo
99
10- from .utils import CaseEnum
11- from .utils import HandleRecipientsMixin
12- from .utils import AttachableMixin , ImportanceLevel , TrackerSet
13- from .utils import BaseAttachments , BaseAttachment
14- from .utils import Pagination , NEXT_LINK_KEYWORD , ApiComponent
15- from .utils .windows_tz import get_windows_tz
1610from .category import Category
11+ from .utils import (
12+ NEXT_LINK_KEYWORD ,
13+ ApiComponent ,
14+ AttachableMixin ,
15+ BaseAttachment ,
16+ BaseAttachments ,
17+ CaseEnum ,
18+ HandleRecipientsMixin ,
19+ ImportanceLevel ,
20+ Pagination ,
21+ TrackerSet ,
22+ )
23+ from .utils .windows_tz import get_windows_tz
1724
1825log = logging .getLogger (__name__ )
1926
@@ -541,9 +548,11 @@ def __init__(self, parent, response_status):
541548 """
542549 super ().__init__ (protocol = parent .protocol ,
543550 main_resource = parent .main_resource )
551+ #: The status of the response |br| **Type:** str
544552 self .status = response_status .get (self ._cc ('response' ), 'none' )
545553 self .status = None if self .status == 'none' else EventResponse .from_value (self .status )
546554 if self .status :
555+ #: The time the response was received |br| **Type:** datetime
547556 self .response_time = response_status .get (self ._cc ('time' ), None )
548557 if self .response_time == '0001-01-01T00:00:00Z' :
549558 # consider there's no response time
@@ -853,15 +862,18 @@ def __init__(self, *, parent=None, con=None, **kwargs):
853862 cc = self ._cc # alias
854863 # internal to know which properties need to be updated on the server
855864 self ._track_changes = TrackerSet (casing = cc )
865+ #: The calendar's unique identifier. |br| **Type:** str
856866 self .calendar_id = kwargs .get ('calendar_id' , None )
857867 download_attachments = kwargs .get ('download_attachments' )
858868 cloud_data = kwargs .get (self ._cloud_data_key , {})
859869
870+ #: Unique identifier for the event. |br| **Type:** str
860871 self .object_id = cloud_data .get (cc ('id' ), None )
861872 self .__subject = cloud_data .get (cc ('subject' ),
862873 kwargs .get ('subject' , '' ) or '' )
863874 body = cloud_data .get (cc ('body' ), {})
864875 self .__body = body .get (cc ('content' ), '' )
876+ #: The type of the content. Possible values are text and html. |br| **Type:** bodyType
865877 self .body_type = body .get (cc ('contentType' ),
866878 'HTML' ) # default to HTML for new messages
867879
@@ -886,23 +898,32 @@ def __init__(self, *, parent=None, con=None, **kwargs):
886898 end_obj = cloud_data .get (cc ('end' ), {})
887899 self .__end = self ._parse_date_time_time_zone (end_obj , self .__is_all_day )
888900
901+ #: Set to true if the event has attachments. |br| **Type:** bool
889902 self .has_attachments = cloud_data .get (cc ('hasAttachments' ), False )
890903 self .__attachments = EventAttachments (parent = self , attachments = [])
891904 if self .has_attachments and download_attachments :
892905 self .attachments .download_attachments ()
893906 self .__categories = cloud_data .get (cc ('categories' ), [])
907+ #: A unique identifier for an event across calendars. This ID is different for each occurrence in a recurring series. |br| **Type:** str
894908 self .ical_uid = cloud_data .get (cc ('iCalUId' ), None )
895909 self .__importance = ImportanceLevel .from_value (
896910 cloud_data .get (cc ('importance' ), 'normal' ) or 'normal' )
911+ #: Set to true if the event has been cancelled. |br| **Type:** bool
897912 self .is_cancelled = cloud_data .get (cc ('isCancelled' ), False )
913+ #: Set to true if the calendar owner (specified by the owner property of the calendar) is the organizer of the event
914+ #: (specified by the organizer property of the event). It also applies if a delegate organized the event on behalf of the owner.
915+ #: |br| **Type:** bool
898916 self .is_organizer = cloud_data .get (cc ('isOrganizer' ), True )
899917 self .__location = cloud_data .get (cc ('location' ), {})
918+ #: The locations where the event is held or attended from. |br| **Type:** list
900919 self .locations = cloud_data .get (cc ('locations' ), []) # TODO
901920
921+ #: A URL for an online meeting. |br| **Type:** str
902922 self .online_meeting_url = cloud_data .get (cc ('onlineMeetingUrl' ), None )
903923 self .__is_online_meeting = cloud_data .get (cc ('isOnlineMeeting' ), False )
904924 self .__online_meeting_provider = OnlineMeetingProviderType .from_value (
905925 cloud_data .get (cc ('onlineMeetingProvider' ), 'teamsForBusiness' ))
926+ #: Details for an attendee to join the meeting online. The default is null. |br| **Type:** OnlineMeetingInfo
906927 self .online_meeting = cloud_data .get (cc ('onlineMeeting' ), None )
907928 if not self .online_meeting_url and self .is_online_meeting :
908929 self .online_meeting_url = self .online_meeting .get (cc ('joinUrl' ), None ) \
@@ -923,10 +944,12 @@ def __init__(self, *, parent=None, con=None, **kwargs):
923944 cc ('responseStatus' ), {}))
924945 self .__sensitivity = EventSensitivity .from_value (
925946 cloud_data .get (cc ('sensitivity' ), 'normal' ))
947+ #: The ID for the recurring series master item, if this event is part of a recurring series. |br| **Type:** str
926948 self .series_master_id = cloud_data .get (cc ('seriesMasterId' ), None )
927949 self .__show_as = EventShowAs .from_value (cloud_data .get (cc ('showAs' ), 'busy' ))
928950 self .__event_type = EventType .from_value (cloud_data .get (cc ('type' ), 'singleInstance' ))
929951 self .__no_forwarding = False
952+ #: The URL to open the event in Outlook on the web. |br| **Type:** str
930953 self .web_link = cloud_data .get (cc ('webLink' ), None )
931954
932955 def __str__ (self ):
@@ -1359,6 +1382,7 @@ def no_forwarding(self, value):
13591382 def get_occurrences (self , start , end , * , limit = None , query = None , order_by = None , batch = None ):
13601383 """
13611384 Returns all the occurrences of a seriesMaster event for a specified time range.
1385+
13621386 :type start: datetime
13631387 :param start: the start of the time range
13641388 :type end: datetime
@@ -1608,7 +1632,7 @@ class Calendar(ApiComponent, HandleRecipientsMixin):
16081632 'default_events_view' : '/calendar/calendarView' ,
16091633 'get_event' : '/calendars/{id}/events/{ide}' ,
16101634 }
1611- event_constructor = Event
1635+ event_constructor = Event #: :meta private:
16121636
16131637 def __init__ (self , * , parent = None , con = None , ** kwargs ):
16141638 """ Create a Calendar Representation
@@ -1635,22 +1659,31 @@ def __init__(self, *, parent=None, con=None, **kwargs):
16351659
16361660 cloud_data = kwargs .get (self ._cloud_data_key , {})
16371661
1662+ #: The calendar name. |br| **Type:** str
16381663 self .name = cloud_data .get (self ._cc ('name' ), '' )
1664+ #: The calendar's unique identifier. |br| **Type:** str
16391665 self .calendar_id = cloud_data .get (self ._cc ('id' ), None )
16401666 self .__owner = self ._recipient_from_cloud (
16411667 cloud_data .get (self ._cc ('owner' ), {}), field = 'owner' )
16421668 color = cloud_data .get (self ._cc ('color' ), 'auto' )
16431669 try :
1670+ #: Specifies the color theme to distinguish the calendar from other calendars in a UI. |br| **Type:** calendarColor
16441671 self .color = CalendarColor .from_value (color )
16451672 except :
16461673 self .color = CalendarColor .from_value ('auto' )
1674+ #: true if the user can write to the calendar, false otherwise. |br| **Type:** bool
16471675 self .can_edit = cloud_data .get (self ._cc ('canEdit' ), False )
1676+ #: true if the user has permission to share the calendar, false otherwise. |br| **Type:** bool
16481677 self .can_share = cloud_data .get (self ._cc ('canShare' ), False )
1678+ #: If true, the user can read calendar items that have been marked private, false otherwise. |br| **Type:** bool
16491679 self .can_view_private_items = cloud_data .get (
16501680 self ._cc ('canViewPrivateItems' ), False )
16511681
16521682 # Hex color only returns a value when a custom calandar is set
16531683 # Hex color is read-only, cannot be used to set calendar's color
1684+ #: The calendar color, expressed in a hex color code of three hexadecimal values,
1685+ #: each ranging from 00 to FF and representing the red, green, or blue components
1686+ #: of the color in the RGB color space. |br| **Type:** str
16541687 self .hex_color = cloud_data .get (self ._cc ('hexColor' ), None )
16551688
16561689 def __str__ (self ):
@@ -1871,8 +1904,8 @@ class Schedule(ApiComponent):
18711904 'get_availability' : '/calendar/getSchedule' ,
18721905 }
18731906
1874- calendar_constructor = Calendar
1875- event_constructor = Event
1907+ calendar_constructor = Calendar #: :meta private:
1908+ event_constructor = Event #: :meta private:
18761909
18771910 def __init__ (self , * , parent = None , con = None , ** kwargs ):
18781911 """ Create a wrapper around calendars and events
0 commit comments