Skip to content

Commit c982f0b

Browse files
authored
Correct params for list_groups and list_users (#512)
1 parent f9f4299 commit c982f0b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/workos/directory_sync.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ def list_users(
184184
}
185185

186186
if group_id is not None:
187-
list_params["group"] = group_id
187+
list_params["group_id"] = group_id
188188
if directory_id is not None:
189-
list_params["directory"] = directory_id
189+
list_params["directory_id"] = directory_id
190190

191191
response = self._http_client.request(
192192
"directory_users",
@@ -218,9 +218,9 @@ def list_groups(
218218
}
219219

220220
if user_id is not None:
221-
list_params["user"] = user_id
221+
list_params["user_id"] = user_id
222222
if directory_id is not None:
223-
list_params["directory"] = directory_id
223+
list_params["directory_id"] = directory_id
224224

225225
response = self._http_client.request(
226226
"directory_groups",
@@ -322,9 +322,9 @@ async def list_users(
322322
}
323323

324324
if group_id is not None:
325-
list_params["group"] = group_id
325+
list_params["group_id"] = group_id
326326
if directory_id is not None:
327-
list_params["directory"] = directory_id
327+
list_params["directory_id"] = directory_id
328328

329329
response = await self._http_client.request(
330330
"directory_users",
@@ -355,9 +355,9 @@ async def list_groups(
355355
"order": order,
356356
}
357357
if user_id is not None:
358-
list_params["user"] = user_id
358+
list_params["user_id"] = user_id
359359
if directory_id is not None:
360-
list_params["directory"] = directory_id
360+
list_params["directory_id"] = directory_id
361361

362362
response = await self._http_client.request(
363363
"directory_groups",

src/workos/types/directory_sync/list_filters.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class DirectoryUserListFilters(
1212
ListArgs,
1313
total=False,
1414
):
15-
group: Optional[str]
16-
directory: Optional[str]
15+
group_id: Optional[str]
16+
directory_id: Optional[str]
1717

1818

1919
class DirectoryGroupListFilters(ListArgs, total=False):
20-
user: Optional[str]
21-
directory: Optional[str]
20+
user_id: Optional[str]
21+
directory_id: Optional[str]

tests/test_directory_sync.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_list_users_with_directory(
145145
assert request_kwargs["url"].endswith("/directory_users")
146146
assert request_kwargs["method"] == "get"
147147
assert request_kwargs["params"] == {
148-
"directory": "directory_id",
148+
"directory_id": "directory_id",
149149
"limit": 10,
150150
"order": "desc",
151151
}
@@ -163,7 +163,7 @@ def test_list_users_with_group(
163163
assert request_kwargs["url"].endswith("/directory_users")
164164
assert request_kwargs["method"] == "get"
165165
assert request_kwargs["params"] == {
166-
"group": "directory_grp_id",
166+
"group_id": "directory_grp_id",
167167
"limit": 10,
168168
"order": "desc",
169169
}
@@ -181,7 +181,7 @@ def test_list_groups_with_directory(
181181
assert request_kwargs["url"].endswith("/directory_groups")
182182
assert request_kwargs["method"] == "get"
183183
assert request_kwargs["params"] == {
184-
"directory": "directory_id",
184+
"directory_id": "directory_id",
185185
"limit": 10,
186186
"order": "desc",
187187
}
@@ -199,7 +199,7 @@ def test_list_groups_with_user(
199199
assert request_kwargs["url"].endswith("/directory_groups")
200200
assert request_kwargs["method"] == "get"
201201
assert request_kwargs["params"] == {
202-
"user": "directory_user_id",
202+
"user_id": "directory_user_id",
203203
"limit": 10,
204204
"order": "desc",
205205
}

0 commit comments

Comments
 (0)