docs(code): add concise docstrings
This commit is contained in:
@@ -10,6 +10,8 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SmsIrSmsClient(SmsClient):
|
||||
"""SMS.ir verify API implementation of the SMS provider strategy."""
|
||||
|
||||
_endpoint = "https://api.sms.ir/v1/send/verify"
|
||||
|
||||
def __init__(
|
||||
@@ -18,11 +20,14 @@ class SmsIrSmsClient(SmsClient):
|
||||
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 SMS.ir using the configured verify template id."""
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
@@ -53,4 +58,3 @@ class SmsIrSmsClient(SmsClient):
|
||||
raise ExternalServiceError("SMS.ir API error")
|
||||
|
||||
logger.info("OTP SMS sent successfully to mobile=%s via SMS.ir", mobile)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user