Describe the bug
PaddleStrEnum is implemented as an Iterator. So when to_dict is called on any instance of Entity (any class inheriting from Entity), all possible values of the enum field get serialized instead of serializing the current value of the enum in the instance.
The goal behavior should be serializing the current value of the field (which is exposed as to_json()) on the Enum.
The current workaround is that we have to loop through all the fields on any entity and manually call the to_json for Enum fields which defeats a large purpose of using the SDK.
Steps to reproduce
- Call to_dict on a Subscription or SubscriptionCreated instance.
- You will see all currency codes getting listed instead of the currency code of the instance.
Expected behavior
The goal behavior should be serializing the current value of the enum fields (which is exposed as to_json() on the Enum)
Code snippets
Python version
Python 3.11
SDK version
paddle-python-sdk 1.6.0
API version
Paddle Version 1
Additional context
