turns out you need type on most of these
This commit is contained in:
parent
3969b7f0d1
commit
6fe93923d7
@ -165,6 +165,7 @@ class APIObject(object):
|
|||||||
return self._create(parent=parent,data=self._data)
|
return self._create(parent=parent,data=self._data)
|
||||||
|
|
||||||
def _create(self, parent, data):
|
def _create(self, parent, data):
|
||||||
|
data['type'] = self.__class__.TYPE
|
||||||
self._data = self._api.post(self.__class__.makeUrl(parent=parent), data=data)
|
self._data = self._api.post(self.__class__.makeUrl(parent=parent), data=data)
|
||||||
self.id = int(self._data.get("id"))
|
self.id = int(self._data.get("id"))
|
||||||
return self._data
|
return self._data
|
||||||
@ -212,6 +213,8 @@ class Partner(APIObject):
|
|||||||
|
|
||||||
|
|
||||||
class Customer(APIObject):
|
class Customer(APIObject):
|
||||||
|
TYPE = "customer"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def makeUrl(cls, id=None, parent=None):
|
def makeUrl(cls, id=None, parent=None):
|
||||||
if parent:
|
if parent:
|
||||||
@ -305,6 +308,26 @@ class Endpoint(APIObject):
|
|||||||
URLPART = "endpoints"
|
URLPART = "endpoints"
|
||||||
|
|
||||||
|
|
||||||
|
class PhoneEndpoint(Endpoint):
|
||||||
|
TYPE = "phone"
|
||||||
|
|
||||||
|
|
||||||
|
class VirtualEndpoint(Endpoint):
|
||||||
|
TYPE = "virtual"
|
||||||
|
|
||||||
|
|
||||||
|
class GroupEndpoint(Endpoint):
|
||||||
|
TYPE = "group"
|
||||||
|
|
||||||
|
|
||||||
|
class QueueEndpoint(Endpoint):
|
||||||
|
TYPE = "queue"
|
||||||
|
|
||||||
|
|
||||||
|
class MailboxEndpoint(Endpoint):
|
||||||
|
TYPE = "mailbox"
|
||||||
|
|
||||||
|
|
||||||
class PhoneNumber(APIObject):
|
class PhoneNumber(APIObject):
|
||||||
URLPART = "phonenumbers"
|
URLPART = "phonenumbers"
|
||||||
|
|
||||||
@ -343,9 +366,9 @@ class CreditStatus(APIObject):
|
|||||||
|
|
||||||
class LinkedUser(APIObject):
|
class LinkedUser(APIObject):
|
||||||
URLPART = "linkedusers"
|
URLPART = "linkedusers"
|
||||||
|
TYPE = "linkeduser"
|
||||||
|
|
||||||
def create(self, parent, **kwargs):
|
def create(self, parent, **kwargs):
|
||||||
kwargs['type'] = "linkeduser"
|
|
||||||
self.data.update(**kwargs)
|
self.data.update(**kwargs)
|
||||||
for k in ("activateUrl", "email", "recordingAccess", "owner", "enabled"):
|
for k in ("activateUrl", "email", "recordingAccess", "owner", "enabled"):
|
||||||
if k not in self._data:
|
if k not in self._data:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user