-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEVEXP-766: Refactor Numbers domain as expected generated structure #51
base: v2.0
Are you sure you want to change the base?
Conversation
Signed-off-by: Jessica Matsuoka <jessica.akemi.matsuoka@sinch.com>
from sinch.domains.numbers.models.numbers import ( | ||
CapabilityTypeValuesList, NumberTypeValues, NumberSearchPatternTypeValues, OrderByValues, ActiveNumber | ||
) | ||
from sinch.domains.numbers.models.v1.active_number import ActiveNumber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be worth to import all the public models from a single place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. As discussed, the public shared models were moved to shared_params
.
Note that I had to import some nested models using their full path to avoid circular import issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, the pydantic models for the list
responses aren't exposed and can be moved the the "internal" package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the "_endpoint" could be stored within the "internal" location ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming convention for private files / attributes in Python uses a leading score (e.g., _utils.py). However, unlike Java, Python does not enforce privacy.
In this case here, we chose to use the internal/ directory as a way to organize what gets generated rather than marking it as private.
I didn't mark *_endpoints.py
as public since *_apis.py
already serves with public interface. Importing a private class should not (It's a convention, Python won't stop you) be used outside its defining module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About the "internal" location (/endpoints
directory), is another keyword could be used ? (e.g. /internal
, private
, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Moved the files to \internal
folder
No description provided.