Skip to content

[Python SDK] Add resources field to Event, CreateEventRequest, and UpdateEventRequest models (CUST-5372)#480

Open
pengfeiye wants to merge 1 commit into
mainfrom
CUST-5372-python-sdk-add-resources-field-to-event-create-event-request-and-update-event-request-models
Open

[Python SDK] Add resources field to Event, CreateEventRequest, and UpdateEventRequest models (CUST-5372)#480
pengfeiye wants to merge 1 commit into
mainfrom
CUST-5372-python-sdk-add-resources-field-to-event-create-event-request-and-update-event-request-models

Conversation

@pengfeiye

@pengfeiye pengfeiye commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the resources field on events (used for room/resource booking) to the Python SDK, resolving CUST-5372 (child of CUST-5262). The Nylas API already supports this field; this change exposes it in the SDK models so resource data is deserialized from responses and can be sent on create/update requests.

Changes

  • nylas/models/events.py

    • Added a Resource response dataclass (@dataclass_json) with optional fields: email, name, capacity, building, floor_name, floor_section, floor_number.
    • Added resources: Optional[List[Resource]] to the Event response model so resource data is deserialized from API responses.
    • Added a WritableResource TypedDict (all keys NotRequired) for request bodies, following the existing Participant/CreateParticipant pattern; reused across both request models since the create/update shape is identical.
    • Added resources: NotRequired[List[WritableResource]] to CreateEventRequest and UpdateEventRequest.
    • Updated docstrings on all affected models.
  • tests/resources/test_events.py

    • Extended test_event_deserialization, test_create_event, and test_update_event to cover the resources field.
    • Added edge-case tests: missing resources, empty list, partially-populated resource, multiple resources, and create/update request passthrough for empty/partial resources.

Test plan

  • pytest tests/resources/test_events.py (28 passed)
  • No linter errors on edited files

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant