diff --git a/nylas/models/folders.py b/nylas/models/folders.py index 06a68b64..2196034b 100644 --- a/nylas/models/folders.py +++ b/nylas/models/folders.py @@ -4,6 +4,8 @@ from dataclasses_json import dataclass_json from typing_extensions import TypedDict, NotRequired +from nylas.models.list_query_params import ListQueryParams + @dataclass_json @dataclass @@ -75,3 +77,15 @@ class UpdateFolderRequest(TypedDict): parent_id: NotRequired[str] background_color: NotRequired[str] text_color: NotRequired[str] + + +class ListFolderQueryParams(ListQueryParams): + """ + Interface representing the query parameters for listing folders. + + Attributes: + parent_id: (Microsoft and EWS only.) Use the ID of a folder to find all child folders it contains. + """ + + parent_id: NotRequired[str] + diff --git a/nylas/resources/folders.py b/nylas/resources/folders.py index 885056ff..61a3ae18 100644 --- a/nylas/resources/folders.py +++ b/nylas/resources/folders.py @@ -10,6 +10,7 @@ Folder, CreateFolderRequest, UpdateFolderRequest, + ListFolderQueryParams, ) from nylas.models.response import Response, ListResponse, DeleteResponse @@ -30,6 +31,7 @@ class Folders( def list( self, identifier: str, + query_params: ListFolderQueryParams, overrides: RequestOverrides = None, ) -> ListResponse[Folder]: """ @@ -37,6 +39,7 @@ def list( Args: identifier: The identifier of the Grant to act upon. + query_params: The query parameters to include in the request. overrides: The request overrides to use. Returns: @@ -46,6 +49,7 @@ def list( return super().list( path=f"/v3/grants/{identifier}/folders", response_type=Folder, + query_params=query_params, overrides=overrides, )