|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import json |
4 | | -from datetime import datetime |
| 4 | +from datetime import datetime, timedelta |
5 | 5 | from typing import Optional |
6 | 6 |
|
7 | 7 | from typing_extensions import Self |
|
54 | 54 | from office365.outlook.calendar.attendees.base import AttendeeBase |
55 | 55 | from office365.outlook.calendar.calendar import Calendar |
56 | 56 | from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone |
| 57 | +from office365.outlook.calendar.email_address import EmailAddress |
57 | 58 | from office365.outlook.calendar.events.event import Event |
58 | 59 | from office365.outlook.calendar.events.reminder import Reminder |
59 | 60 | from office365.outlook.calendar.group import CalendarGroup |
|
85 | 86 | from office365.runtime.queries.function import FunctionQuery |
86 | 87 | from office365.runtime.queries.service_operation import ServiceOperationQuery |
87 | 88 | from office365.runtime.types.collections import StringCollection |
| 89 | +from office365.runtime.types.duration import Duration |
88 | 90 | from office365.runtime.types.odata_property import odata |
89 | 91 | from office365.teams.chats.collection import ChatCollection |
90 | 92 | from office365.teams.collection import TeamCollection |
@@ -396,10 +398,10 @@ def export_device_and_app_management_data(self) -> ClientResult[ClientValueColle |
396 | 398 |
|
397 | 399 | def find_meeting_times( |
398 | 400 | self, |
399 | | - attendees: list[AttendeeBase] | None = None, |
| 401 | + attendees: list[str] | None = None, |
400 | 402 | location_constraint: LocationConstraint | None = None, |
401 | 403 | time_constraint: TimeConstraint | None = None, |
402 | | - meeting_duration: str | None = None, |
| 404 | + meeting_duration: Duration | str | timedelta | None = None, |
403 | 405 | max_candidates: int | None = None, |
404 | 406 | is_organizer_optional: bool | None = None, |
405 | 407 | return_suggestion_reasons: bool | None = None, |
@@ -439,11 +441,15 @@ def find_meeting_times( |
439 | 441 | minimum_attendee_percentage (float): The minimum required confidence for a time slot to be returned |
440 | 442 | in the response. It is a % value ranging from 0 to 100. Optional. |
441 | 443 | """ |
| 444 | + if isinstance(meeting_duration, timedelta): |
| 445 | + meeting_duration = Duration.parse(meeting_duration) |
442 | 446 | payload = { |
443 | | - "attendees": ClientValueCollection(AttendeeBase, attendees), |
| 447 | + "attendees": ClientValueCollection( |
| 448 | + AttendeeBase, [AttendeeBase(emailAddress=EmailAddress(a)) for a in attendees or []] |
| 449 | + ), |
444 | 450 | "locationConstraint": location_constraint, |
445 | 451 | "timeConstraint": time_constraint, |
446 | | - "meeting_duration": meeting_duration, |
| 452 | + "meetingDuration": meeting_duration, |
447 | 453 | "maxCandidates": max_candidates, |
448 | 454 | "isOrganizerOptional": is_organizer_optional, |
449 | 455 | "returnSuggestionReasons": return_suggestion_reasons, |
|
0 commit comments