Skip to content

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

Merged
merged 5 commits into from
Aug 6, 2025
Merged

Support calls and bugfixes #2

merged 5 commits into from
Aug 6, 2025

Conversation

Pop101
Copy link
Collaborator

@Pop101 Pop101 commented Aug 6, 2025

Also add migration messages for swagger dtype generation

@Pop101 Pop101 requested a review from Copilot August 6, 2025 02:03
Copy link

@Copilot Copilot AI left a 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

VerificationExpanded,
),
):
if hasattr(data, "number") and to_number:
Copy link
Preview

Copilot AI Aug 6, 2025

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.

Suggested change
if hasattr(data, "number") and to_number:
if to_number:

Copilot uses AI. Check for mistakes.

else reservation
)

if not reservation_id or not isinstance(reservation_id, str):
Copy link
Preview

Copilot AI Aug 6, 2025

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.

Suggested change
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.

Copy link

github-actions bot commented Aug 6, 2025

🚀 PR Quality Checks Started

Workflow: View Details

The following checks are running:

  • 🧪 Tests & Coverage - Running test suite and analyzing coverage
  • 🎨 Black Formatting - Checking code formatting compliance
🔄 Rerun Checks

If you need to rerun the checks, you can:

  1. Rerun this workflow (requires write access)
  2. Push a new commit to trigger checks again
  3. Close and reopen this PR

Results will be posted as separate comments when each check completes.

Copy link

github-actions bot commented Aug 6, 2025

🎨 Black Formatting Check

✅ All files are properly formatted!

Copy link

github-actions bot commented Aug 6, 2025

🧪 Tests & Coverage Results

🧪 Test Results

✅ All tests passed!

📊 Coverage Report


Name                                Stmts   Miss  Cover
-------------------------------------------------------
textverified/__init__.py               49     14    71%
textverified/account_api.py            18      0   100%
textverified/action.py                 19      2    89%
textverified/billing_cycle_api.py      46      5    89%
textverified/call_api.py               34      0   100%
textverified/data/__init__.py           4      0   100%
textverified/data/dtypes.py          1059    127    88%
textverified/exceptions.py              8      1    88%
textverified/paginated_list.py         59     13    78%
textverified/reservations_api.py      121     18    85%
textverified/sales_api.py              18      1    94%
textverified/services_api.py           14      0   100%
textverified/sms_api.py                54      9    83%
textverified/textverified.py          107      4    96%
textverified/verifications_api.py      66      9    86%
textverified/wake_api.py               48      3    94%
-------------------------------------------------------
TOTAL                                1724    206    88%
Coverage XML written to file coverage.xml
============================= 112 passed in 1.85s ==============================

@Pop101 Pop101 merged commit cf19d81 into main Aug 6, 2025
3 checks passed
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.

1 participant