Allow strings for group methods as an alternative to enums #691
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A variety of enums are published by the SDK for use with the Groups service. These cover GroupRole, etc and must be imported to use various methods in a type-safe way. Make all methods taking these enums more permissive by taking a Literal[...] as well. The literals are defined alongside the enums for easier consistency between the two.
A new type checking test validates these changes against relevant usages.
Tests which interact with these Groups API methods now are parametrized to pass enum members OR literal strings, variously. These must always serialize as strings before being sent.
Additionally, I started moving some of the fixture data into
globus_sdk._testing
to make it more available (and this makes tests marginally faster than the older method, which repeatedly reads data from disk).📚 Documentation preview 📚: https://globus-sdk-python--691.org.readthedocs.build/en/691/