python-intercom and self fields
Intercom’s docs state the following:
All objects in the API have an id field indicating their logical identifier. Some objects may optionally also have a self field that indicates a URL or canonical address for the object.
selfA URL that addresses the object within the API. The self field will not be larger than 255 characters (in SQL it corresponds to a varchar(255)).
The current version of python-intercom allows fields called id e.g.
user.id. I could add similar support for self e.g.
user.self but it feels wrong.
I can only think of two semi-sensible alternatives:
- rename to
_self– this doesn’t sit well either as they are not intended to be private
__setattr__support and just use
__getitem__i.e. instead of
user['self']. This is clean but will break whatever code is out there using
Right here, right now
I am going to add support for
.self for initial release. Keeping to a familiar programming model is the most important thing right now.
I’ve opened an issue on GitHub to track any feedback.