Conversation
4f42ff3 to
7ad1be0
Compare
cs3client/space.py
Outdated
| Create a filter for listing storage spaces. | ||
|
|
||
| :param filter_value: Value of the filter. | ||
| :param filter_type: Type of the filter. Supported values are "ID", "OWNER", "SPACE_TYPE", "PATH" and "USER". |
There was a problem hiding this comment.
Why don't we use a literal (with the possible values) instead of a string?
There was a problem hiding this comment.
Like an enum you mean? I think this is simpler because then we don't need to import this enum when calling the method.
I have thought about using the filters directly as inputs but then we would have to import the cs3apis when calling the functions which I don't like, I prefer to decouple this.
There was a problem hiding this comment.
Also having exactly these values allows me to do this:
filter_type_value = cs3spp.ListStorageSpacesRequest.Filter.Type.Value(filter_type)
There was a problem hiding this comment.
No, I mean Literal["TYPE_ID", "TYPE_OWNER", etc]
7ad1be0 to
bd54158
Compare
|
I noticed the comments were wrong, and also changed it so we get an error instead of |
This PR implements the ListStorageSpaces call and the create filter class method that is needed.