openfga / python-sdk

OpenFGA SDK for Python 3 - https://pypi.org/project/openfga-sdk/
https://openfga.dev
Apache License 2.0
29 stars 10 forks source link

`list_users` should accept a `FgaObject` type for the `users` parameter #97

Closed ewanharris closed 1 week ago

ewanharris commented 2 weeks ago

Checklist

Description

Currently we accept a str for the users parameter in list_users this should be of type FgaObject

Expectation

The list_users call should accept FgaObject and look like below

        response = await fga_client.list_users(
            ClientListUsersRequest(
                object=FgaObject(type="document",id="roadmap"),
                relation="viewer",
                user_filters=[
                    UserTypeFilter(type="user")
                ],
                context=dict(ViewCount=100),
            )
        )

Reproduction

  1. Call the list_users endpoint
  2. The API call will fail

OpenFGA SDK version

v0.4.3

OpenFGA version

v1.5.4

SDK Configuration

Using the example

Logs

No response

References

No response