We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60b1413 commit 2f3acb0Copy full SHA for 2f3acb0
intercom/api_operations/delete.py
@@ -7,9 +7,11 @@
7
class Delete(object):
8
"""A mixin that provides `delete` functionality."""
9
10
- def delete(self, obj):
+ def delete(self, obj=None, **kwargs):
11
"""Delete the specified instance of this resource."""
12
collection = utils.resource_class_to_collection_name(
13
self.collection_class)
14
- self.client.delete("/%s/%s" % (collection, obj.id), {})
+ assert obj is not None or kwargs.keys()[0] == "%s_id" % collection
15
+ obj_id = kwargs.values()[0] if obj is None else obj.id
16
+ self.client.delete("/%s/%s" % (collection, obj_id), {})
17
return obj
0 commit comments