""" AUTHOR: Bhushan C Thakkar DATE: Monday, 20th Jan., 2025. OBJECTIVE: To give a structure to how Nimbus's API will respond. REFERENCES: N/A DOWNLOADS: N/A """ # ***************************************************************************************************************** # ***** **** # *** IMPORT *** # ***** **** # ***************************************************************************************************************** # To make sibling directories accessible for imports: import sys sys.path.append(".") sys.path.append("..") # For system-level activities: import os import io # For making data behaviour_models: from pydantic import BaseModel, Field, field_validator, PastDatetime, AwareDatetime from typing import Optional, Literal, Union, Any # My utils: from utils_v2.string import regex from utils_v2.date_time import date_time # To work with MongoDB: from bson.objectid import ObjectId # To work with date and time: import datetime # ***************************************************************************************************************** # ***** **** # *** MACROS / ONE-TIME INIT *** # ***** **** # ***************************************************************************************************************** # --- Nothing Yet # ***************************************************************************************************************** # ***** **** # *** VARIABLES *** # ***** **** # ***************************************************************************************************************** # --- Nothing Yet # ***************************************************************************************************************** # ***** **** # *** FUNCTIONS *** # ***** **** # ***************************************************************************************************************** class NimbusWhatsappSendMessageResponse(BaseModel): ts: AwareDatetime = Field( description = "The time (UTC) at which this message was sent by the sender.", frozen = True, default_factory = lambda: date_time.get_current_utc_date_time(as_string = False) ) success: bool = Field( description = "Whether, or not, the request was successful.", frozen = True, default = False ) statusCode: str | int = Field( description = "The response code as defined by Nimbus.", frozen = True, alias = "statuscode" ) statusMessage: str = Field( description = "A message about any error, or a general acknowledgement message.", frozen = True, alias = "msg" ) requestId: str | int | None = Field( description = "How Nimbus identifies your message.", frozen = True, default = None ) messageCount: int = Field( description = "The no. of messages sent.", frozen = True, default = 0 ) messageCost: float | int | None = Field( description = "The cost (in INR) of messages sent.", frozen = True, default = None ) balance: float | None = Field( description = "The balance remaining in the account.", frozen = True, default = None ) # ┏┓ ┏• # ┃ ┏┓┏┓╋┓┏┓ # ┗┛┗┛┛┗┛┗┗┫ # ┛ class Config: extra = "allow" # ***************************************************************************************************************** # ***** **** # *** MAIN PROGRAM *** # ***** **** # ***************************************************************************************************************** if __name__ == "__main__": pass