2019-09-03 20:21:52 +00:00
|
|
|
from voipms.api.dids.search import Search
|
|
|
|
from voipms.api.dids.sms import SMS
|
2019-08-19 02:30:31 +00:00
|
|
|
|
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):
|
2019-09-03 20:21:52 +00:00
|
|
|
self._search = None
|
|
|
|
self._sms = None
|
2019-08-19 02:30:31 +00:00
|
|
|
|
2019-09-03 20:21:52 +00:00
|
|
|
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)
|