Skip to content
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

Open
wants to merge 4 commits into
base: v2.0
Choose a base branch
from

Conversation

matsk-sinch
Copy link
Contributor

No description provided.

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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 ?

Copy link
Contributor Author

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.

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, ...)

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants