globus-sdk-python
globus-sdk-python copied to clipboard
Implement attrs-based payload encoding helpers
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 an extra
parameter for what we have historically named addtional_fields
.
Payload
also gives us a type for usage in type hints for the transport layer and base client, and provides an asdict
method which handles any specialized pre-transport encoding steps. For the base this is the handling of extra
, but subclasses can extend it if necessary.
📚 Documentation preview 📚: https://globus-sdk-python--935.org.readthedocs.build/en/935/