Patreon / patreon-java

Interact with the Patreon API via OAuth
Apache License 2.0
52 stars 26 forks source link

Wrapper rewrite and modernization #4

Closed adamint closed 6 years ago

adamint commented 6 years ago

This pull request, which is tested as much as I've been able to using my personal patreon, changes the endpoints to return easy-to-understand objects.

I invite other collaborators and the Patreon staff to look this over and see if I've missed anything.

adamint commented 6 years ago

Thanks for the quick response, I totally agree with you. The data classes are inflexible at the moment, and from a quick read, the first library you linked would definitely improve this. I'll go ahead and read through and play with the library in a few hours and then get back to work

adamint commented 6 years ago

David, I implemented jsonapi-converter as much as I could. However, I ended up making relationship and included models as it both preserved the flexibility of the code and was much more intuitive (see here) for example.

I also added an option to get the route https://www.patreon.com/api/user/user_id

However, rather importantly @21echoes, what concerns me is that I was unable to locate where Card objects are returned, though I do know the structure and thus wrote the model, and that the Patreon API Documentation is very inaccurate. I was unable to rely on it past the basics, as it both had incomplete fields and misrepresented structures.

Anyways, I'd love your opinion on whether this revision would meet acceptable standards.

21echoes commented 6 years ago

hey @adamint ! At first glance this looks awesome. The team is deep in some other big platform improvements due out in the next couple of weeks, so sadly we haven't had time to review this PR. We'll get to it soon, sorry!

Re: cards routes: right now the public API does not have a route for every resource, so you are correct that there is no way to get the actual cards.

Re: inaccurate documentation: we'll definitely want to fix that ASAP on our end. I'll make sure the team gets to it :)

Thanks again for this awesome work, and so sorry you caught us at an inopportune time. We'll be better soon!

talsraviv commented 6 years ago

@adamint by the way, I'm Tal and the product manager for the platform team. I'd love to find out more about your high level plans to use the API and what we can learn from your use case. I'm tal at patreon.com, if you're free to jump on a call next week.

adamint commented 6 years ago

David, thanks for your responses to my questions. Working through tests, I did end up with 7 more questions that I thought were pressing - they're listed in #5 . I totally understand and no worries about the delay. Regarding cards, I do remember seeing a list returned in one of the endpoints, though I can't seem to find it again.

@talsraviv Thanks for the offer, I'd love to! I do have a few quick questions. Firstly, I was talking to David (Kodehawa) from Mantaro - he'd also like to talk about some enhancements he believes would be advantageous, especially concerning Discord integration - would this be possible? Also, would email be your preferred method of communication for getting in touch?

talsraviv commented 6 years ago

@adamint that's fantastic and yep let's schedule over email

21echoes commented 6 years ago

Hey @adamint ! We finally had some time to go over this PR in detail, and it's super awesome. We've built on top of it over here: https://github.com/Patreon/patreon-java/pull/7 (it was easier to pull your changes into our own branch, rather than PR'ing against your fork) and we'd love your feedback on that PR if you'd like to offer it.

In short, that PR takes what you've done, and takes it over the finish line without making any major changes. The biggest changes are:

...and a few other small tweaks. By and large these changes provide answers to the questions you raised in your issue, along with making this a more standard usage of the jsonapi-converter library.

I just want to thank you again for pouring so much time into this library; we couldn't have done it without you! If you are ever are in the SF bay area, I'd love to grab a coffee and chat :) Feel free to reach out any time to platform@patreon.com as well (or just open another issue on this repo)