Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
nylas-python Changelog
======================

Unreleased
--------------
* Add support for Scheduler APIs

v6.4.0
----------------
* Add support for from field for sending messages
Expand Down
11 changes: 11 additions & 0 deletions nylas/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from nylas.resources.contacts import Contacts
from nylas.resources.drafts import Drafts
from nylas.resources.grants import Grants
from nylas.resources.scheduler import Scheduler


class Client:
Expand Down Expand Up @@ -169,3 +170,13 @@ def webhooks(self) -> Webhooks:
The Webhooks API.
"""
return Webhooks(self.http_client)

@property
def scheduler(self) -> Scheduler:
"""
Access the Scheduler API.

Returns:
The Scheduler API.
"""
return Scheduler(self.http_client)
18 changes: 18 additions & 0 deletions nylas/handler/api_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,24 @@ def update(
return Response.from_dict(response_json, response_type)


class UpdatablePatchApiResource(Resource):
def patch(
self,
path,
response_type,
headers=None,
query_params=None,
request_body=None,
method="PATCH",
overrides=None,
):
response_json = self._http_client._execute(
method, path, headers, query_params, request_body, overrides=overrides
)

return Response.from_dict(response_json, response_type)


class DestroyableApiResource(Resource):
def destroy(
self,
Expand Down
4 changes: 2 additions & 2 deletions nylas/models/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ class AvailabilityRules(TypedDict):
default_open_hours: A default set of open hours to apply to all participants.
You can overwrite these open hours for individual participants by specifying open_hours on
the participant object.
round_robin_event_id: The ID on events that Nylas considers when calculating the order of
round_robin_group_id: The ID on events that Nylas considers when calculating the order of
round-robin participants.
This is used for both max-fairness and max-availability methods.
"""

availability_method: NotRequired[AvailabilityMethod]
buffer: NotRequired[MeetingBuffer]
default_open_hours: NotRequired[List[OpenHours]]
round_robin_event_id: NotRequired[str]
round_robin_group_id: NotRequired[str]


class AvailabilityParticipant(TypedDict):
Expand Down
2 changes: 0 additions & 2 deletions nylas/models/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class Message:


class FindMessageQueryParams(TypedDict):

"""
Query parameters for finding a message.

Expand All @@ -144,7 +143,6 @@ class FindMessageQueryParams(TypedDict):


class UpdateMessageRequest(TypedDict):

"""
Request payload for updating a message.

Expand Down
Loading