(20250123) Made a common API to disable all integrations.

This commit is contained in:
2025-01-23 12:29:03 +05:30
parent 816789fce5
commit fe48b79c09
20 changed files with 663 additions and 36 deletions
+10 -1
View File
@@ -107,6 +107,12 @@ from abc import ABC, abstractmethod
class SMSController(CoreMessageController, ABC):
# ┏┓┓ ┓┏
# ┃ ┃┏┓┏┏ ┃┃┏┓┏┓┏
# ┗┛┗┗┻┛┛ ┗┛┗┻┛ ┛
SERVICE_TYPE = "sms"
# ┏┓
# ┃ ┏┓┏┓┏╋┏┓┓┏┏╋┏┓┏┓
# ┗┛┗┛┛┗┛┗┛ ┗┻┗┗┗┛┛
@@ -138,7 +144,7 @@ class SMSController(CoreMessageController, ABC):
# Prepare the combined base filter:
sms_filter = {}
for k, v in (base_filter or {}).items(): sms_filter[k] = v
sms_filter["serviceType"] = "sms"
sms_filter["serviceType"] = self.SERVICE_TYPE
# Invoke the parent's constructor:
CoreMessageController.__init__(
@@ -152,6 +158,9 @@ class SMSController(CoreMessageController, ABC):
debug_only_errors = debug_only_errors
)
# Init a variable in a parent:
self._service_type = self.SERVICE_TYPE
# ┏┓┳┳┓┏┓ ┏┓ ┓•
# ┗┓┃┃┃┗┓ ┗┓┏┓┏┓┏┫┓┏┓┏┓
# ┗┛┛ ┗┗┛ ┗┛┗ ┛┗┗┻┗┛┗┗┫
+10 -1
View File
@@ -105,6 +105,12 @@ import asyncio
class NimbusSMSIndiaController(SMSController):
# ┏┓┓ ┓┏
# ┃ ┃┏┓┏┏ ┃┃┏┓┏┓┏
# ┗┛┗┗┻┛┛ ┗┛┗┻┛ ┛
CLIENT_NAME = "nimbusSmsIndia"
# ┏┓
# ┃ ┏┓┏┓┏╋┏┓┓┏┏╋┏┓┏┓
# ┗┛┗┛┛┗┛┗┛ ┗┻┗┗┗┛┛
@@ -135,12 +141,15 @@ class NimbusSMSIndiaController(SMSController):
cache = cache,
alert_url = alert_url,
http_client = http_client,
base_filter = {"client": "nimbusSmsIndia"},
base_filter = {"client": self.CLIENT_NAME},
debug = debug,
debug_prefix = debug_prefix,
debug_only_errors = debug_only_errors
)
# Init a variable in a parent:
self._client = self.CLIENT_NAME
# ┏┓┳┳┓┏┓ ┏┓ ┓•
# ┗┓┃┃┃┗┓ ┗┓┏┓┏┓┏┫┓┏┓┏┓
# ┗┛┛ ┗┗┛ ┗┛┗ ┛┗┗┻┗┛┗┗┫
@@ -105,6 +105,12 @@ import asyncio
class SavvyBulkSMSKenyaController(SMSController):
# ┏┓┓ ┓┏
# ┃ ┃┏┓┏┏ ┃┃┏┓┏┓┏
# ┗┛┗┗┻┛┛ ┗┛┗┻┛ ┛
CLIENT_NAME = "savvyBulkSmsKenya"
# ┏┓
# ┃ ┏┓┏┓┏╋┏┓┓┏┏╋┏┓┏┓
# ┗┛┗┛┛┗┛┗┛ ┗┻┗┗┗┛┛
@@ -135,12 +141,15 @@ class SavvyBulkSMSKenyaController(SMSController):
cache = cache,
alert_url = alert_url,
http_client = http_client,
base_filter = {"client": "savvyBulkSmsKenya"},
base_filter = {"client": self.CLIENT_NAME},
debug = debug,
debug_prefix = debug_prefix,
debug_only_errors = debug_only_errors
)
# Init a variable in a parent:
self._client = self.CLIENT_NAME
# ┏┓┳┳┓┏┓ ┏┓ ┓•
# ┗┓┃┃┃┗┓ ┗┓┏┓┏┓┏┫┓┏┓┏┓
# ┗┛┛ ┗┗┛ ┗┛┗ ┛┗┗┻┗┛┗┗┫