@@ -263,7 +263,6 @@ class Folder(ApiComponent):
263263 "copy_folder" : "/mailFolders/{id}/copy" ,
264264 "move_folder" : "/mailFolders/{id}/move" ,
265265 "message" : "/messages/{id}" ,
266- "subscriptions" : "/subscriptions" ,
267266 }
268267 message_constructor = Message #: :meta private:
269268
@@ -1070,63 +1069,4 @@ def get_settings(self):
10701069
10711070 return self .mailbox_settings_constructor (
10721071 parent = self , ** {self ._cloud_data_key : data }
1073- )
1074-
1075- '''
1076- def set_email_subscription(self, notificationurl, minutes):
1077- """Set a webhook subscription to send post request every
1078- time an email is received
1079-
1080- :return: response from the connection
1081- :rtype: connection
1082- """
1083-
1084- # Get the current UTC time
1085- now_utc = dr.datetime.utcnow()
1086-
1087- # Calculate the future time by adding 4200 minutes
1088- future_utc = now_utc + dt.timedelta(minutes=minutes)
1089-
1090- # Format with 7 decimal places and append 'Z' to indicate UTC
1091- # '%f' gives 6 digits for microseconds; we add an extra '0' for 7 decimal places.
1092- expiration_str = future_utc.strftime("%Y-%m-%dT%H:%M:%S.%f0Z")
1093-
1094- url = "https://graph.microsoft.com/v1.0/subscriptions"
1095-
1096- params = {
1097- "changeType": "created,updated",
1098- "notificationUrl": notificationurl,
1099- "resource": "/me/mailfolders('inbox')/messages",
1100- "expirationDateTime": expiration_str,
1101- }
1102-
1103- response = self.con.get(url, params=my_params)
1104-
1105-
1106- def renew_email_subscription(self, id, minutes):
1107- """Renew a webhook subscription to send post request every
1108- time an email is received
1109-
1110- :return: response from the connection
1111- :rtype: connection
1112- """
1113-
1114- # Get the current UTC time
1115- now_utc = dr.datetime.utcnow()
1116-
1117- # Calculate the future time by adding 4200 minutes
1118- future_utc = now_utc + dt.timedelta(minutes=minutes)
1119-
1120- # Format with 7 decimal places and append 'Z' to indicate UTC
1121- # '%f' gives 6 digits for microseconds; we add an extra '0' for 7 decimal places.
1122- expiration_str = future_utc.strftime("%Y-%m-%dT%H:%M:%S.%f0Z")
1123-
1124- url = f'https://graph.microsoft.com/v1.0/subscriptions/{id}'
1125-
1126- params = {
1127- "expirationDateTime": expiration_str,
1128- }
1129-
1130- response = self.con.get(url, params=my_params)
1131-
1132- '''
1072+ )
0 commit comments