-
Notifications
You must be signed in to change notification settings - Fork 75
Adding the possibility to list Events for a given user #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks so much for this @andreiruse 😄 I'll review and test the code in the next week. For tests you can always take a look at the current test set and create a similar one but if you're not able to, not to worry as we can add them in too 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Managed to take a look at this and a couple of comments below
- Best to refactor to a
listcall to be consistent with current code - Add example code to Readme
- Add tests if possible (maybe similar to loading conversations: could load a json file and verify number of entries as well as actual data read?)
Let me know if you're good to make those changes or if you had any other comments on this @andreiruse
| return Job.listJobErrorFeed(jobID, Event.class); | ||
| } | ||
|
|
||
| public static EventCollection listBy(String type, String parameterName, String parameterValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think to keep things consistent with the rest of the library and our Idioms https://github.com/intercom/intercom-java/#pagination, this should be refactored to be a list call which takes an input of Map<String, String> params. Seems like we could utilise a similar pattern as the Notes and NotesCollection here 😄
Some examples of using list in the current code
public static NoteCollection list(Map<String, String> params) throws InvalidException, AuthorizationException { public static CompanyCollection list(Map<String, String> params) throws InvalidException, AuthorizationException {
It would be good to also add some sample code to the README.md file to indicate how to utilise this new endpoint
|
Hi @andreiruse just wanted to check in to see if you were keen and able to make the changes. If not, no worries 😄 I'll be happy to work on what you have and build from there to get this merged! 👍 |
|
@thewheat Hey, |
|
Fantastic! If you do run into any roadblocks, let me know and we can even tag team on things if needed 😁 |
|
Hey @andreiruse , just wanted to find out how things are going? I'm looking to finalise this PR in the new year so do let me know if you're still good finishing up on this otherwise I'll just work with what you have so that we can get the functionality in the library 👍 |
|
I'm closing this PR as I have addresses the changes in #173 😄 |
The use case for adding this is being able to iterate over the recent events triggered by a given user, for reporting purposes. The REST API is already able to do so using a single GET request, given the user ID/e-mail/intercom ID.
I was not able to figure a quick way to write a unit test, without triggering an external HTTP connection (ideally, this would happen with a mock web server).
This addition is corresponding to this section of the API docs: https://developers.intercom.com/v2.0/reference#list-user-events