Paging with directory sync is broken...
it seems that the python library to list groups by directory id is broken:
```
TypeError: DirectorySync.list_groups() got an unexpected keyword argument 'directory'. Did you mean 'directory_id'?
```
while the call to it looks like:
```
for group in workos_client.directory_sync.list_groups(
directory_id=directory_id, after=after
):
```
I suspect the issue is in:
```
def list_groups(
self,
*,
directory_id: Optional[str] = None,
user_id: Optional[str] = None,
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
before: Optional[str] = None,
after: Optional[str] = None,
order: PaginationOrder = "desc",
) -> DirectoryGroupsListResource:
list_params: DirectoryGroupListFilters = {
"limit": limit,
"before": before,
"after": after,
"order": order,
}
if user_id is not None:
list_params["user"] = user_id
if directory_id is not None:
list_params["directory"] = directory_id
response = self._http_client.request(
"directory_groups",
method=REQUEST_METHOD_GET,
params=list_params,
)
```
the line
```
list_params["directory"] = directory_id
```
should be
```
list_params["directory_id"] = directory_id
```
This issue seems to repeat in many places in the `directory_sync.py` file.
0 条评论