Skip to content

Commit 28d16cf

Browse files
authored
Merge branch 'main' into fix-attachment-download
2 parents 12ee8be + b68c893 commit 28d16cf

File tree

16 files changed

+1436
-7
lines changed

16 files changed

+1436
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
nylas-python Changelog
22
======================
33

4+
Unreleased
5+
--------------
6+
* Add support for Scheduler APIs
7+
48
v6.4.0
59
----------------
610
* Add support for from field for sending messages

nylas/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from nylas.resources.contacts import Contacts
1414
from nylas.resources.drafts import Drafts
1515
from nylas.resources.grants import Grants
16+
from nylas.resources.scheduler import Scheduler
1617

1718

1819
class Client:
@@ -169,3 +170,13 @@ def webhooks(self) -> Webhooks:
169170
The Webhooks API.
170171
"""
171172
return Webhooks(self.http_client)
173+
174+
@property
175+
def scheduler(self) -> Scheduler:
176+
"""
177+
Access the Scheduler API.
178+
179+
Returns:
180+
The Scheduler API.
181+
"""
182+
return Scheduler(self.http_client)

nylas/handler/api_resources.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ def update(
7575
return Response.from_dict(response_json, response_type)
7676

7777

78+
class UpdatablePatchApiResource(Resource):
79+
def patch(
80+
self,
81+
path,
82+
response_type,
83+
headers=None,
84+
query_params=None,
85+
request_body=None,
86+
method="PATCH",
87+
overrides=None,
88+
):
89+
response_json = self._http_client._execute(
90+
method, path, headers, query_params, request_body, overrides=overrides
91+
)
92+
93+
return Response.from_dict(response_json, response_type)
94+
95+
7896
class DestroyableApiResource(Resource):
7997
def destroy(
8098
self,

nylas/models/availability.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ class AvailabilityRules(TypedDict):
8787
default_open_hours: A default set of open hours to apply to all participants.
8888
You can overwrite these open hours for individual participants by specifying open_hours on
8989
the participant object.
90-
round_robin_event_id: The ID on events that Nylas considers when calculating the order of
90+
round_robin_group_id: The ID on events that Nylas considers when calculating the order of
9191
round-robin participants.
9292
This is used for both max-fairness and max-availability methods.
9393
"""
9494

9595
availability_method: NotRequired[AvailabilityMethod]
9696
buffer: NotRequired[MeetingBuffer]
9797
default_open_hours: NotRequired[List[OpenHours]]
98-
round_robin_event_id: NotRequired[str]
98+
round_robin_group_id: NotRequired[str]
9999

100100

101101
class AvailabilityParticipant(TypedDict):

nylas/models/messages.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ class Message:
132132

133133

134134
class FindMessageQueryParams(TypedDict):
135-
136135
"""
137136
Query parameters for finding a message.
138137
@@ -144,7 +143,6 @@ class FindMessageQueryParams(TypedDict):
144143

145144

146145
class UpdateMessageRequest(TypedDict):
147-
148146
"""
149147
Request payload for updating a message.
150148

nylas/models/response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def from_dict(cls, resp: dict, generic_type):
9494

9595
converted_data = []
9696
for item in resp["data"]:
97-
converted_data.append(generic_type.from_dict(item))
97+
converted_data.append(generic_type.from_dict(item, infer_missing=True))
9898

9999
return cls(
100100
data=converted_data,

0 commit comments

Comments
 (0)