(20241213) SMS Auth reworked.
This commit is contained in:
@@ -234,7 +234,7 @@ class AsyncNimbusSMS:
|
||||
summary.rawResponse = response_json
|
||||
summary.success = True if response_json.get("STATUS", "ERROR").lower() in ["ok"] else False
|
||||
if summary.success: summary.messageId = response_json.get("RESPONSE", {}).get("UID")
|
||||
else: summary.brief = response_json.get("RESPONSE", {}).get("INFO")
|
||||
else: summary.message = response_json.get("RESPONSE", {}).get("INFO")
|
||||
|
||||
# For any other code that indicates some form of failure:
|
||||
else: summary.rawResponse = response.content.decode()
|
||||
|
||||
@@ -188,7 +188,7 @@ class AsyncSavvyBulkSMS:
|
||||
first_desc = first_response.get("response-description", "N/A").lower().strip()
|
||||
summary.success = True if first_desc == "success" else False
|
||||
if summary.success: summary.messageId = first_response.get("messageid")
|
||||
else: summary.brief = first_response.get("response-description")
|
||||
else: summary.message = first_response.get("response-description")
|
||||
|
||||
# For any other code that indicates some form of failure:
|
||||
else: summary.rawResponse = api_response.content.decode()
|
||||
|
||||
@@ -115,7 +115,7 @@ class SentSMSMessageModel(BaseModel):
|
||||
default = False
|
||||
)
|
||||
|
||||
brief: str | None = Field(
|
||||
message: str | None = Field(
|
||||
description = "a brief message about what happened; useful when something goes wrong",
|
||||
default = None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user