|
|
|
@ -159,7 +159,7 @@ class APIObject(object):
|
|
|
|
|
raise ValueError(
|
|
|
|
|
"%s ID %d already created" % (self.__class__.__name__, self.id)
|
|
|
|
|
)
|
|
|
|
|
self._data.update(**kwargs)
|
|
|
|
|
self.data.update(**kwargs)
|
|
|
|
|
if not self._data:
|
|
|
|
|
raise ValueError("No data associated with record.")
|
|
|
|
|
return self._create(parent=parent,data=self._data)
|
|
|
|
@ -274,7 +274,7 @@ class Customer(APIObject):
|
|
|
|
|
def create(self, parent=None, **kwargs):
|
|
|
|
|
if parent:
|
|
|
|
|
raise ValueError("Customer cannot have a parent")
|
|
|
|
|
self._data.update(**kwargs)
|
|
|
|
|
self.data.update(**kwargs)
|
|
|
|
|
for k in ("accountType", "company", "firstName", "lastName", "email", "address1", "city", "postcode", "telephone"):
|
|
|
|
|
if k not in self._data:
|
|
|
|
|
raise ValueError('missing mandatory field "%s"' % k)
|
|
|
|
@ -346,7 +346,7 @@ class LinkedUser(APIObject):
|
|
|
|
|
|
|
|
|
|
def create(self, parent, **kwargs):
|
|
|
|
|
kwargs['type'] = "linkeduser"
|
|
|
|
|
self._data.update(**kwargs)
|
|
|
|
|
self.data.update(**kwargs)
|
|
|
|
|
for k in ("activateUrl", "email", "recordingAccess", "owner", "enabled"):
|
|
|
|
|
if k not in self._data:
|
|
|
|
|
raise ValueError('missing mandatory field "%s"' % k)
|
|
|
|
|