docs(code): add concise docstrings

This commit is contained in:
2026-07-14 11:05:07 +03:30
parent c54f6edc1e
commit 5f88e964f6
20 changed files with 299 additions and 26 deletions

View File

@@ -10,17 +10,22 @@ logger = logging.getLogger(__name__)
class KavenegarSmsClient(SmsClient):
"""Kavenegar verify/lookup implementation of the SMS provider strategy."""
def __init__(
self,
api_key: str,
timeout_seconds: float = 10.0,
transport: httpx.AsyncBaseTransport | None = None,
) -> None:
"""Configure credentials, timeout, and optional test transport."""
self._api_key = api_key
self._timeout_seconds = timeout_seconds
self._transport = transport
async def send_otp(self, mobile: str, code: str, template: str) -> None:
"""Send an OTP through Kavenegar and raise on transport or API failure."""
url = f"https://api.kavenegar.com/v1/{self._api_key}/verify/lookup.json"
payload = {"receptor": mobile, "template": template, "token": code, "type": "sms"}
try: