DEVEXP-710: Implement Models and Apis for "Available Numbers"#44
Merged
matsk-sinch merged 8 commits intov2.0from Feb 6, 2025
Merged
DEVEXP-710: Implement Models and Apis for "Available Numbers"#44matsk-sinch merged 8 commits intov2.0from
matsk-sinch merged 8 commits intov2.0from
Conversation
Development: - Implemented Pydantic models for API responses. - Added Pydantic models for query parameters. Enhancements to Input and Output Handling: - Added functionality to convert unknown fields from snake_case to camelCase and vice versa when handling extra fields in requests and responses. - Improved handling for related request and response models, including: - Optional parameters support. - Management of unexpected parameters in server responses. - Processing of nested data structures with Pydantic to ensure proper validation - Handling of datetime fields. - Used TypedDict for dictionary-like parameter handling to improve DX Testing: - Developed unit tests for all models. - Created unit tests for API endpoints. Signed-off-by: Jessica Matsuoka <jessica.akemi.matsuoka@sinch.com>
asein-sinch
reviewed
Jan 31, 2025
sinch/domains/numbers/models/available/activate_number_request.py
Outdated
Show resolved
Hide resolved
JPPortier
reviewed
Jan 31, 2025
sinch/domains/numbers/models/available/activate_number_response.py
Outdated
Show resolved
Hide resolved
sinch/domains/numbers/models/available/check_number_availability_response.py
Outdated
Show resolved
Hide resolved
- Refactor models to remove redundancy - Mapping approach for VoiceConfiguration to dynamically select the correct model Signed-off-by: Jessica Matsuoka <jessica.akemi.matsuoka@sinch.com>
JPPortier
reviewed
Feb 3, 2025
JPPortier
reviewed
Feb 4, 2025
tests/unit/domains/numbers/models/available/requests/test_rent_any_number_request_model.py
Show resolved
Hide resolved
tests/unit/domains/numbers/models/available/requests/test_search_for_number_request_model.py
Show resolved
Hide resolved
tests/unit/domains/numbers/models/available/response/test_activate_number_response_model.py
Show resolved
Hide resolved
tests/unit/domains/numbers/models/available/response/test_activate_number_response_model.py
Outdated
Show resolved
Hide resolved
93a71a7 to
8281d46
Compare
asein-sinch
approved these changes
Feb 5, 2025
Contributor
asein-sinch
left a comment
There was a problem hiding this comment.
The code in this PR looks solid. There are points regarding the DX and the type hints that I would like to revisit, but the current version and its test coverage are already very good. Keep up the good work! 🌟
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Development:
Enhancements to Input and Output Handling:
Testing: