(20241214) SMS also ported to the 'tokenKey' system.

This commit is contained in:
2024-12-14 13:02:57 +05:30
parent dc181c4995
commit 364894c2af
4 changed files with 42 additions and 31 deletions
+2 -2
View File
@@ -177,7 +177,7 @@ class SMSSendRequestHeaders(BaseModel):
class SMSSendRequestData(BaseModel):
tokenId: ObjectId = Field(description = "the auth token to use to send this message")
tokenKey: ObjectId = Field(description = "the auth token to use to send this message")
message: List[NimbusSMSIndiaMessage] | List[SavvyBulkSMSKenyaMessage]
# ┏┓ ┏•
@@ -193,7 +193,7 @@ class SMSSendRequestData(BaseModel):
# ┃┃┏┓┃┓┏┫┏┓╋┓┏┓┏┓
# ┗┛┗┻┗┗┗┻┗┻┗┗┗┛┛┗
@field_validator("tokenId", mode = "before")
@field_validator("tokenKey", mode = "before")
def parse_oid(cls, value):
try: value = ObjectId(value)
except: pass