fix fetching sub-resources
This commit is contained in:
parent
2e1c368f53
commit
e0ab8168e9
@ -281,6 +281,15 @@ class Customer(APIObject):
|
|||||||
for c in self._api.getMany(LinkedUser.makeUrl(parent=self)):
|
for c in self._api.getMany(LinkedUser.makeUrl(parent=self)):
|
||||||
yield LinkedUser(self._api, data=c)
|
yield LinkedUser(self._api, data=c)
|
||||||
|
|
||||||
|
def limits(self):
|
||||||
|
return Limits(self._api, self._api.get(Limits.makeUrl(parent=self))
|
||||||
|
|
||||||
|
def callcharging(self):
|
||||||
|
return CallCharging(self._api, self._api.get(CallCharging.makeUrl(parent=self))
|
||||||
|
|
||||||
|
def permissions(self):
|
||||||
|
return Permissions(self._api, self._api.get(Permissions.makeUrl(parent=self))
|
||||||
|
|
||||||
def create(self, parent=None, **kwargs):
|
def create(self, parent=None, **kwargs):
|
||||||
if parent:
|
if parent:
|
||||||
raise ValueError("Customer cannot have a parent")
|
raise ValueError("Customer cannot have a parent")
|
||||||
@ -378,6 +387,31 @@ class OutgoingCallerId(APIObject):
|
|||||||
TYPE = "outgoingcallerid"
|
TYPE = "outgoingcallerid"
|
||||||
|
|
||||||
|
|
||||||
|
class CreditStatus(APIObject):
|
||||||
|
URLPART = "creditstatus"
|
||||||
|
TYPE = "creditstatus"
|
||||||
|
|
||||||
|
|
||||||
|
class Pricing(APIObject):
|
||||||
|
URLPART = "pricing"
|
||||||
|
TYPE = "customerpricing"
|
||||||
|
|
||||||
|
|
||||||
|
class Limits(APIObject):
|
||||||
|
URLPART = "limits"
|
||||||
|
TYPE = "customerlimits"
|
||||||
|
|
||||||
|
|
||||||
|
class CallCharging(APIObject):
|
||||||
|
URLPART = "callcharging"
|
||||||
|
TYPE = "customercallcharging"
|
||||||
|
|
||||||
|
|
||||||
|
class Permissions(APIObject):
|
||||||
|
URLPART = "permissions"
|
||||||
|
TYPE = "customerpermissions"
|
||||||
|
|
||||||
|
|
||||||
class CustomerAPIObject(APIObject):
|
class CustomerAPIObject(APIObject):
|
||||||
MANDATORY_FIELDS = ()
|
MANDATORY_FIELDS = ()
|
||||||
|
|
||||||
@ -392,31 +426,6 @@ class CustomerAPIObject(APIObject):
|
|||||||
return self._create(parent=parent, data=self._data)
|
return self._create(parent=parent, data=self._data)
|
||||||
|
|
||||||
|
|
||||||
class CreditStatus(CustomerAPIObject):
|
|
||||||
URLPART = "creditstatus"
|
|
||||||
TYPE = "creditstatus"
|
|
||||||
|
|
||||||
|
|
||||||
class CustomerPricing(CustomerAPIObject):
|
|
||||||
URLPART = "pricing"
|
|
||||||
TYPE = "customerpricing"
|
|
||||||
|
|
||||||
|
|
||||||
class Limits(CustomerAPIObject):
|
|
||||||
URLPART = "limits"
|
|
||||||
TYPE = "customerlimits"
|
|
||||||
|
|
||||||
|
|
||||||
class CallCharging(CustomerAPIObject):
|
|
||||||
URLPART = "callcharging"
|
|
||||||
TYPE = "customercallcharging"
|
|
||||||
|
|
||||||
|
|
||||||
class Permissions(CustomerAPIObject):
|
|
||||||
URLPART = "permissions"
|
|
||||||
TYPE = "customerpermissions"
|
|
||||||
|
|
||||||
|
|
||||||
class LinkedUser(CustomerAPIObject):
|
class LinkedUser(CustomerAPIObject):
|
||||||
URLPART = "linkedusers"
|
URLPART = "linkedusers"
|
||||||
TYPE = "linkeduser"
|
TYPE = "linkeduser"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user