Implement attrs-based payload encoding helpers #935
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.
This PR is a proposal for a new impelmentation of payload definitions for primary use in SDK v4 and for any new payload classes under v3.
This first implementation introduces a new subpackage,
globus_sdk.payload
which is integrated into the transport layer's request encoding logic.globus_sdk.payload.Payload
defines a base class for@attrs.define
d classes, providing support for anextra
parameter for what we have historically namedaddtional_fields
.Payload
also gives us a type for usage in type hints for the transport layer and base client, and provides anasdict
method which handles any specialized pre-transport encoding steps. For the base this is the handling ofextra
, but subclasses can extend it if necessary.📚 Documentation preview 📚: https://globus-sdk-python--935.org.readthedocs.build/en/935/