-
Notifications
You must be signed in to change notification settings - Fork 0
Support calls and bugfixes #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
Conversation
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.
Pull Request Overview
This PR adds support for call-related functionality and implements various bug fixes and improvements. The main purpose is to introduce a new Call API for handling incoming calls, along with swagger schema updates for better documentation generation.
- Added new Call API with methods for listing calls and opening call sessions for voice verifications
- Fixed parameter name inconsistencies in SMS API (snake_case to camelCase conversion)
- Updated swagger schema with improved documentation and examples
Reviewed Changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
textverified/textverified.py | Added CallAPI property to main TextVerified client |
textverified/sms_api.py | Fixed parameter naming from snake_case to camelCase for API consistency |
textverified/data/dtypes.py | Added new data types for calls (Call, CallSessionRequest, CallContext, TwilioCallingContextDto) and enhanced documentation |
textverified/call_api.py | New API module for handling call-related operations |
textverified/init.py | Added calls lazy API wrapper and updated examples |
tests/test_calls.py | Comprehensive test suite for the new Call API |
swagger.json | Updated API specification with call endpoints and improved documentation |
generate_enums.py | Enhanced code generation with migration reporting capabilities |
docs/api_reference.rst | Added Call API documentation section |
textverified/call_api.py
Outdated
VerificationExpanded, | ||
), | ||
): | ||
if hasattr(data, "number") and to_number: |
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 condition hasattr(data, "number")
is redundant since all the types in the isinstance check have a number
attribute. This should be simplified to just check if to_number:
since data is already validated to have the number attribute.
if hasattr(data, "number") and to_number: | |
if to_number: |
Copilot uses AI. Check for mistakes.
textverified/call_api.py
Outdated
else reservation | ||
) | ||
|
||
if not reservation_id or not isinstance(reservation_id, str): |
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 condition not reservation_id
will fail for empty strings, but the error message suggests that empty strings should be invalid. However, this check comes after the isinstance check, so if reservation_id is not a string, isinstance will return False. Consider using if not reservation_id or not isinstance(reservation_id, str) or not reservation_id.strip():
to also catch whitespace-only strings.
if not reservation_id or not isinstance(reservation_id, str): | |
if not isinstance(reservation_id, str) or not reservation_id.strip(): |
Copilot uses AI. Check for mistakes.
🚀 PR Quality Checks StartedWorkflow: View Details The following checks are running:
🔄 Rerun ChecksIf you need to rerun the checks, you can:
Results will be posted as separate comments when each check completes. |
🎨 Black Formatting Check✅ All files are properly formatted! |
🧪 Tests & Coverage Results🧪 Test Results✅ All tests passed! 📊 Coverage Report
|
Also add migration messages for swagger dtype generation