Skip to content

Commit b529883

Browse files
committed
Renamed max_results to limit
1 parent 7013f3c commit b529883

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

examples/import_events_demo/import_events_example.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def demonstrate_basic_import(client: Client, grant_id: str) -> None:
5353
print("\nFetching events from primary calendar:")
5454
events = client.events.list_import_events(
5555
identifier=grant_id,
56-
query_params={"calendar_id": "primary", "max_results": 2}
56+
query_params={"calendar_id": "primary", "limit": 2}
5757
)
5858
print_data(events.data, "Basic import events")
5959

@@ -83,19 +83,19 @@ def demonstrate_time_filtered_import(client: Client, grant_id: str) -> None:
8383
print_data(events.data, f"Events from {from_date} to {to_date}")
8484

8585

86-
def demonstrate_max_results(client: Client, grant_id: str) -> None:
87-
"""Demonstrate import events with max_results parameter."""
86+
def demonstrate_limit(client: Client, grant_id: str) -> None:
87+
"""Demonstrate import events with limit parameter."""
8888
print("\n=== Import Events with Max Results ===")
8989

90-
print("\nFetching events with max_results=5:")
90+
print("\nFetching events with limit=5:")
9191
events = client.events.list_import_events(
9292
identifier=grant_id,
9393
query_params={
9494
"calendar_id": "primary",
95-
"max_results": 5
95+
"limit": 5
9696
}
9797
)
98-
print_data(events.data, "Events with max_results=5")
98+
print_data(events.data, "Events with limit=5")
9999

100100

101101
def demonstrate_field_selection(client: Client, grant_id: str) -> None:
@@ -107,7 +107,7 @@ def demonstrate_field_selection(client: Client, grant_id: str) -> None:
107107
identifier=grant_id,
108108
query_params={
109109
"calendar_id": "primary",
110-
"max_results": 2,
110+
"limit": 2,
111111
"select": "id,title,when"
112112
}
113113
)
@@ -119,12 +119,12 @@ def demonstrate_pagination(client: Client, grant_id: str) -> None:
119119
print("\n=== Import Events with Pagination ===")
120120

121121
# First page
122-
print("\nFetching first page of events (max_results=3):")
122+
print("\nFetching first page of events (limit=3):")
123123
first_page = client.events.list_import_events(
124124
identifier=grant_id,
125125
query_params={
126126
"calendar_id": "primary",
127-
"max_results": 3
127+
"limit": 3
128128
}
129129
)
130130
print_data(first_page.data, "First page of events")
@@ -136,7 +136,7 @@ def demonstrate_pagination(client: Client, grant_id: str) -> None:
136136
identifier=grant_id,
137137
query_params={
138138
"calendar_id": "primary",
139-
"max_results": 3,
139+
"limit": 3,
140140
"page_token": first_page.next_cursor
141141
}
142142
)
@@ -159,7 +159,7 @@ def demonstrate_full_example(client: Client, grant_id: str) -> None:
159159
identifier=grant_id,
160160
query_params={
161161
"calendar_id": "primary",
162-
"max_results": 10,
162+
"limit": 10,
163163
"start": int(start_of_year),
164164
"end": int(end_of_year),
165165
"select": "id,title,description,when,participants,location"
@@ -185,7 +185,7 @@ def main():
185185
# Demonstrate different ways to use list_import_events
186186
demonstrate_basic_import(client, grant_id)
187187
demonstrate_time_filtered_import(client, grant_id)
188-
demonstrate_max_results(client, grant_id)
188+
demonstrate_limit(client, grant_id)
189189
demonstrate_field_selection(client, grant_id)
190190
demonstrate_pagination(client, grant_id)
191191
demonstrate_full_example(client, grant_id)

nylas/models/events.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,14 +806,13 @@ class SendRsvpRequest(TypedDict):
806806
status: SendRsvpStatus
807807

808808

809-
class ListImportEventsQueryParams(TypedDict):
809+
class ListImportEventsQueryParams(ListQueryParams):
810810
"""
811811
Interface representing the query parameters for listing imported events.
812812
813813
Attributes:
814814
calendar_id: Specify calendar ID to import events to. "primary" is a supported value
815815
indicating the user's primary calendar.
816-
max_results: Specifies the maximum number of events Nylas returns in a single page of results.
817816
start: Filter for events that start at or after the specified time, in Unix timestamp format.
818817
end: Filter for events that end at or before the specified time, in Unix timestamp format.
819818
select: Comma-separated list of fields to return in the response.
@@ -823,7 +822,6 @@ class ListImportEventsQueryParams(TypedDict):
823822
"""
824823

825824
calendar_id: str
826-
max_results: NotRequired[int]
827825
start: NotRequired[int]
828826
end: NotRequired[int]
829827
select: NotRequired[str]

tests/resources/test_events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,18 @@ def test_list_import_events_with_select_param(self, http_client_list_response):
207207
overrides=None,
208208
)
209209

210-
def test_list_import_events_with_max_results(self, http_client_list_response):
210+
def test_list_import_events_with_limit(self, http_client_list_response):
211211
events = Events(http_client=http_client_list_response)
212212
events.list_import_events(
213213
identifier="grant-123",
214-
query_params={"calendar_id": "primary", "max_results": 100},
214+
query_params={"calendar_id": "primary", "limit": 100},
215215
)
216216

217217
http_client_list_response._execute.assert_called_once_with(
218218
"GET",
219219
"/v3/grants/grant-123/events/import",
220220
None,
221-
{"calendar_id": "primary", "max_results": 100},
221+
{"calendar_id": "primary", "limit": 100},
222222
None,
223223
overrides=None,
224224
)
@@ -261,7 +261,7 @@ def test_list_import_events_with_all_params(self, http_client_list_response):
261261
identifier="grant-123",
262262
query_params={
263263
"calendar_id": "primary",
264-
"max_results": 50,
264+
"limit": 50,
265265
"start": start_time,
266266
"end": end_time,
267267
"select": "id,title,participants,when",
@@ -275,7 +275,7 @@ def test_list_import_events_with_all_params(self, http_client_list_response):
275275
None,
276276
{
277277
"calendar_id": "primary",
278-
"max_results": 50,
278+
"limit": 50,
279279
"start": start_time,
280280
"end": end_time,
281281
"select": "id,title,participants,when",

0 commit comments

Comments
 (0)