diff --git a/CHANGELOG.md b/CHANGELOG.md index e06883c..ae95e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Unreleased ---------- * Clarify that event `default` visibility is Google-only * Added `resources` field to Event, CreateEventRequest, and UpdateEventRequest models +* Added tentative_as_busy field to GetFreeBusyRequest v6.16.0 ---------- diff --git a/nylas/models/free_busy.py b/nylas/models/free_busy.py index 680ddd2..aa6396d 100644 --- a/nylas/models/free_busy.py +++ b/nylas/models/free_busy.py @@ -2,7 +2,7 @@ from typing import List, Union from dataclasses_json import dataclass_json -from typing_extensions import TypedDict +from typing_extensions import TypedDict, NotRequired @dataclass_json @@ -64,8 +64,11 @@ class GetFreeBusyRequest(TypedDict): start_time: Unix timestamp for the start time to check free/busy for. end_time: Unix timestamp for the end time to check free/busy for. emails: List of email addresses to check free/busy for. + tentative_as_busy: When set to false, treats tentative calendar events as busy:false. + Only applicable for Microsoft and EWS calendar providers. Defaults to true. """ start_time: int end_time: int emails: List[str] + tentative_as_busy: NotRequired[bool] diff --git a/tests/resources/test_calendars.py b/tests/resources/test_calendars.py index a07ccd4..b03f3cd 100644 --- a/tests/resources/test_calendars.py +++ b/tests/resources/test_calendars.py @@ -437,3 +437,27 @@ def test_get_free_busy(self, http_client_free_busy): overrides=None, ) + def test_get_free_busy_with_tentative_as_busy(self, http_client_free_busy): + calendars = Calendars(http_client_free_busy) + free_busy_request = { + "emails": ["test@gmail.com", "test2@gmail.com"], + "start_time": 1497916800, + "end_time": 1498003200, + "tentative_as_busy": False, + } + + # Http client is mocked in conftest.py, specific + # mock for free busy is configured there + calendars.get_free_busy( + identifier="abc123", request_body=free_busy_request, overrides=None + ) + + http_client_free_busy._execute.assert_called_once_with( + "POST", + "/v3/grants/abc123/calendars/free-busy", + None, + None, + free_busy_request, + overrides=None, + ) +