Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/sms_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def main():
recipient=recipient,
message=message,
sender=sender,
hirvalidation=True, # Enable high-quality routing validation
hlrvalidation=True, # Enable high-quality routing validation
)

print("SMS sent successfully!")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ docs = [

[project.urls]
Homepage = "https://github.com/devotel/devhub-python"
Documentation = "https://devhub-python.readthedocs.io"
Documentation = "https://devotel.github.io/devhub-python/"
Repository = "https://github.com/devotel/devhub-python"
Issues = "https://github.com/devotel/devhub-python/issues"

Expand Down
4 changes: 2 additions & 2 deletions src/devhub_python/models/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SMSQuickSendRequest(BaseModel):
sender: str = Field(..., description="Sender phone number or ID")
recipient: str = Field(..., description="Recipient phone number in E.164 format")
message: str = Field(..., description="SMS message content")
hirvalidation: bool = Field(True, description="Enable HIR validation")
hlrvalidation: bool = Field(True, description="Enable HIR validation")


class NumberPurchaseRequest(BaseModel):
Expand Down Expand Up @@ -62,7 +62,7 @@ class SMSQuickSendResponse(BaseModel):
api_route: Optional[str] = Field(None, description="API route used")
apimode: Optional[str] = Field(None, description="API mode")
quicksendidentifier: Optional[str] = Field(None, description="Quick send identifier")
hirvalidation: Optional[bool] = Field(None, description="HIR validation enabled")
hlrvalidation: Optional[bool] = Field(None, description="HIR validation enabled")

# Error response fields
statusCode: Optional[int] = Field(None, description="HTTP status code for errors")
Expand Down
8 changes: 4 additions & 4 deletions src/devhub_python/resources/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def send_sms(
recipient: str,
message: str,
sender: str,
hirvalidation: bool = True,
hlrvalidation: bool = True,
sandbox: bool = False,
) -> "SMSQuickSendResponse":
"""
Expand All @@ -67,7 +67,7 @@ def send_sms(
recipient: The recipient's phone number in E.164 format
message: The SMS message content
sender: The sender phone number or sender ID
hirvalidation: Enable HIR validation (default: True)
hlrvalidation: Enable HIR validation (default: True)
sandbox: Use sandbox environment for testing (default: False)

Returns:
Expand Down Expand Up @@ -100,7 +100,7 @@ def send_sms(
sender=sender,
recipient=recipient,
message=message,
hirvalidation=hirvalidation,
hlrvalidation=hlrvalidation,
)

# Send request to the exact API endpoint
Expand Down Expand Up @@ -327,5 +327,5 @@ def send(
recipient=to,
message=body,
sender=from_,
hirvalidation=kwargs.get("hirvalidation", True),
hlrvalidation=kwargs.get("hlrvalidation", True),
)
10 changes: 5 additions & 5 deletions tests/test_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_send_sms_success(self, sms_resource, test_phone_number):
"api_route": "user-api/sms/quick-send",
"apimode": "quick-send",
"quicksendidentifier": "quick_123",
"hirvalidation": True,
"hlrvalidation": True,
}
sms_resource.client.post.return_value = mock_response

Expand All @@ -47,15 +47,15 @@ def test_send_sms_success(self, sms_resource, test_phone_number):
recipient=test_phone_number,
message="Hello, World!",
sender="+1987654321",
hirvalidation=True,
hlrvalidation=True,
)

# Verify the response
assert result.id == "msg_123456789"
assert result.recipient == test_phone_number
assert result.message == "Hello, World!"
assert result.status == "queued"
assert result.hirvalidation is True
assert result.hlrvalidation is True

# Verify the API call
sms_resource.client.post.assert_called_once_with(
Expand All @@ -64,7 +64,7 @@ def test_send_sms_success(self, sms_resource, test_phone_number):
"sender": "+1987654321",
"recipient": test_phone_number,
"message": "Hello, World!",
"hirvalidation": True,
"hlrvalidation": True,
},
sandbox=False,
)
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_legacy_send_method(self, sms_resource, test_phone_number):
"api_route": "user-api/sms/quick-send",
"apimode": "quick-send",
"quicksendidentifier": "quick_123",
"hirvalidation": True,
"hlrvalidation": True,
}
sms_resource.client.post.return_value = mock_response

Expand Down