intercom-php icon indicating copy to clipboard operation
intercom-php copied to clipboard

Resource Objects

Open JakeBooher opened this issue 4 years ago • 1 comments

Would be incredibly useful if there were Resource object classes that were returned rather than just a generic PHP object, if done correctly this would be fully backwards compatible as well. Could allow type hinting and such for IDE auto completion.

I'd be happy to contribute towards this via a PR if this is something that would be accepted

JakeBooher avatar Apr 16 '20 15:04 JakeBooher

Hi @JakeBooher, sorry for the delay I totally missed your message. I have been thinking about what you mentioned for a long time. I think it would be great to have something like what you mention.

We originally went for stdClasses so that all the new fields we add get immediately added to the objects. The main idea was to avoid creating friction if we need to release a new SDK version every time we add a new property to a resource.

If you have time for that, I'd love to see what you have in mind. If you want to contribute, I'd recommend opening an initial PR with just one single model, so we can get an agreement on how we want them to look like, and then we can work towards creating resource objects for the rest of the models.

GabrielAnca avatar Jul 21 '20 11:07 GabrielAnca