Add group context switching to Java and Python SDKs #68
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.
Summary
This PR adds group context switching functionality to Java and Python SDKs, bringing them to full feature parity with the Go SDK. It also includes a cleanup of deprecated methods in the Go Amount type.
Key Improvements:
withGroup()method for context switchingwith_group()method with centralized architectureIsEqual()method for API consistencyChanges by Language
🟦 Java SDK
Added
withGroup()Method (1cd6504)Enables convenient group context switching while preserving all other client configuration.
Implementation:
createOptionsWithGroup()protected helper toBaseGRPCClientInterfaceGeneratorto addwithGroup()method signature to all service interfacesClientGeneratorto generatewithGroup()implementation in all service clientsTesting:
WithGroupTestwith 3 test cases:Files Changed:
Example Usage:
🐍 Python SDK
Added
with_group()Method with Centralized Architecture (b8c7afb)Implements convenient group context switching matching Go SDK's
WithGroup()functionality, with significant architecture improvements.Implementation:
with_group()method toBaseGRPCClientwith comprehensive validationServiceOptionsclass inmeshtrade.common.service_options(eliminates duplication)BaseGRPCClientfor configuration accessServiceOptionsinstead of generating per-service copiesgroups/{id}formatArchitecture Improvements:
with_group()logic defined once in base class, inherited by all servicesServiceOptionsfiles across service packagesTesting:
test_with_group.py) with 8 test cases:ValueError)ValueError)Files Changed:
Example Usage:
🔵 Go SDK
Removed Deprecated
IsEqual()Method (5456aa8)Removes the deprecated
Amount.IsEqual()method in favor of the standardizedIsEqualTo()method for API consistency withToken.IsEqualTo().Changes:
Amount.IsEqual()method fromamount.goTestAmount_IsEqualtest functionIsEqualnil safety test case fromTestAmount_NilSafetyIntegrationRationale:
IsEqualTo()follows consistent naming withToken.IsEqualTo()Files Changed:
Migration:
Testing Summary
All Tests Passing ✅
Breaking Changes
Amount.IsEqual()methodIsEqual()will get compilation errorIsEqual()withIsEqualTo()IsEqualTo()has been available since v1.0.0Java & Python: ✅ No breaking changes - all additions are additive
Feature Parity Status
All three SDKs now have 100% feature parity for group context switching:
WithGroup()withGroup()with_group()Review Checklist
Amount.IsEqualonly)Related Issues
Implements group context switching functionality across all SDKs for multi-tenant operations.
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]