voipms-python/voipms/api/dids/__init__.py

35 lines
860 B
Python
Raw Normal View History

from voipms.api.dids.search import Search
from voipms.api.dids.sms import SMS
2020-03-17 02:58:09 +00:00
2019-08-18 02:02:44 +00:00
class DIDs():
2019-08-18 02:34:44 +00:00
def __init__(self, base):
self._search = None
self._sms = None
self.base = base
@property
def search(self):
if self._search is None:
self._search = Search(self.base)
return self._search
@property
def sms(self):
if self._sms is None:
self._sms = SMS(self.base)
return self._sms
def cancel(self, params={}):
self.method = "cancelDID"
return self.base.request(self.method, params=params)
def order(self, params={}):
self.method = "orderDID"
return self.base.request(self.method, params=params)
def fetch(self, params={}):
self.method = "getDIDsInfo"
2020-03-17 02:58:09 +00:00
return self.base.request(self.method, params=params)