Skip to content

draft: chore/prepare release v2#138

Open
matsk-sinch wants to merge 114 commits intomainfrom
chore/prepare-release-v2
Open

draft: chore/prepare release v2#138
matsk-sinch wants to merge 114 commits intomainfrom
chore/prepare-release-v2

Conversation

@matsk-sinch
Copy link
Contributor

No description provided.

matsk-sinch and others added 30 commits January 30, 2025 16:12
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>
- 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>
DEVEXP-710: Implement Models and Apis for "Available Numbers"
- Implemented the automatic and manual pagination of elements. This iterator
allows users to navigate through multiple pages while abstracting away the
underlying HTTP requests.

Signed-off-by: Jessica Matsuoka <jessica.akemi.matsuoka@sinch.com>
For the moment, the E2E tests steps have been implemented
using the Sync SinchClient. As the Async SinchClient uses
another HTTP library and the pagination uses a different
 implementation, it's necessary to run the E2E
tests suite in both ways.

Signed-off-by: Jessica Matsuoka <jessica.akemi.matsuoka@sinch.com>
DEVEXP 757: [Python E2E] Run tests with Sync and Async clients
 - Update unit tests to validate all credentials
 - Update README to explain which credentials must be set for each API

Signed-off-by: Jessica Matsuoka <jessica.akemi.matsuoka@sinch.com>
Signed-off-by: Jessica Matsuoka <jessica.akemi.matsuoka@sinch.com>
@matsk-sinch matsk-sinch marked this pull request as draft March 25, 2026 16:38
@matsk-sinch matsk-sinch marked this pull request as ready for review March 25, 2026 16:43
@matsk-sinch
Copy link
Contributor Author

Code review

2 issues found:


Issue 1: Missing space in error messages

File: sinch/core/clients/sinch_client_configuration.py
Functions: get_sms_origin_for_auth() and get_conversation_origin()

Python implicit string concatenation produces malformed error messages. The two adjacent string literals have no space between them:

# Current (broken):
"Example: SinchClient(..., sms_region='eu')"
"or set it via sinch_client.configuration.sms_region. "
# Produces: "...sms_region='eu')or set it via..."

Fix: Add a leading space to the second string:

"Example: SinchClient(..., sms_region='eu')"
" or set it via sinch_client.configuration.sms_region. "

Same fix needed in get_conversation_origin().


Issue 2: get_sinch_client() ignores its config parameter

File: examples/sinch_events/sinch_client_helper.py

The function signature accepts config: dict and the docstring says it returns a "configured Sinch client instance", but the body returns a bare SinchClient() with no arguments — the config dict is never used:

def get_sinch_client(config: dict) -> SinchClient:
    """Create and return a configured SinchClient instance."""
    return SinchClient()  # config is completely ignored

This means any user extending this example to make outbound API calls will get a client with no credentials.

Fix: Pass the config values to SinchClient(), e.g.:

return SinchClient(
    project_id=config.get("project_id"),
    key_id=config.get("key_id"),
    key_secret=config.get("key_secret"),
)

🤖 Generated with Claude Code

@matsk-sinch matsk-sinch marked this pull request as draft March 25, 2026 17:20
@matsk-sinch matsk-sinch marked this pull request as ready for review March 25, 2026 20:18
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.

2 participants