diff --git a/setup.py b/setup.py index 4b12c00..fe2c72e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="smsir-python", - version="1.0.4", + version="1.0.5", author="Mojtaba Akbari", author_email="mojtaba.akbari.221b@gmail.com", packages=["sms_ir"], diff --git a/sms_ir/services.py b/sms_ir/services.py index 9a46c35..4ba11b9 100644 --- a/sms_ir/services.py +++ b/sms_ir/services.py @@ -1,7 +1,10 @@ from typing import List from requests.models import Response +from typing import TypeVar from .mixins import RequestsMixin, LoggerMixin +T = TypeVar('T', int, None) + class SmsIr(RequestsMixin, LoggerMixin): ENDPOINT = 'https://api.sms.ir' @@ -9,7 +12,7 @@ class SmsIr(RequestsMixin, LoggerMixin): def __init__( self, api_key: str, - linenumber: int|None = None, + linenumber: T = None, ) -> None: self.config_logger() @@ -25,7 +28,7 @@ def send_sms( self, number: str, message: str, - linenumber: int|None = None, + linenumber: T = None, ) -> Response: """ Send message to specific mobile number @@ -41,7 +44,7 @@ def send_bulk_sms( self, numbers: List[str], message: str, - linenumber: int|None = None, + linenumber: T = None, ) -> Response: """ Send message to multiple mobile numbers @@ -64,7 +67,7 @@ def send_like_to_like( self, numbers: List[str], messages: List[str], - linenumber: int|None =None, + linenumber: T =None, send_date_time: str|None =None, ) -> Response: """ @@ -173,8 +176,8 @@ def report_today( def report_archived( self, - from_date: int|None =None, - to_date: int|None =None, + from_date: T =None, + to_date: T =None, page_size: int =10, page_number: int =1, ) -> Response: @@ -238,8 +241,8 @@ def report_today_received( def report_archived_received( self, - from_date: int|None =None, - to_date: int|None =None, + from_date: T =None, + to_date: T =None, page_size: int =10, page_number: int =1, ) -> Response: