Skip to content
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

Support the 'Content Tags' resource in the Zendesk API - resolves #559 #560

Conversation

andy-may-at
Copy link
Contributor

Content Tags can be added to posts and articles to loosely group them together.
The resource is a small object {id, name, createdDate, updatedDate}
The API supports CRUD & some searching

Additional context
API documentation: https://developer.zendesk.com/api-reference/help_center/help-center-api/content_tags/
Article about how they are used: https://support.zendesk.com/hc/en-us/articles/4848925672730

@PierreBtz
Copy link
Collaborator

@andy-may-at I'll let you refresh and finish up on this branch, then I'll merge and cut a new release.

@andy-may-at andy-may-at force-pushed the issue/559/implement_content_tags_resource branch from 1d64cb7 to a60e12f Compare March 16, 2023 10:10
@andy-may-at andy-may-at force-pushed the issue/559/implement_content_tags_resource branch from a60e12f to bb691c6 Compare March 22, 2023 17:49
ContentTag pagination sadly doesn't conform to Zendesk's standards.
It uses cursor pagination, but doesn't include a `links.next` node in the response (which would normally hold the URL of the next page of results).
Because of this, we have to build the 'next page URL' ourselves by extracting the `meta.after_cursor` node value & using it to add a `&page[after]=<cursorValue>` parameter to the original query URL
@andy-may-at andy-may-at force-pushed the issue/559/implement_content_tags_resource branch from bb691c6 to 8f76412 Compare March 22, 2023 17:51
@andy-may-at andy-may-at marked this pull request as ready for review March 22, 2023 17:52
@andy-may-at
Copy link
Contributor Author

@PierreBtz This PR is now complete & ready for review :)

This is (I hope) the last piece of the work to support Content Tags on Help Center articles

PierreBtz
PierreBtz previously approved these changes Apr 3, 2023
Copy link
Collaborator

@PierreBtz PierreBtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgmt, nice work.
I'm taking the library to commit the fix on the javadoc to be able to merge and release

@PierreBtz PierreBtz self-requested a review April 3, 2023 10:09
@PierreBtz PierreBtz merged commit c0283d3 into cloudbees-oss:master Apr 3, 2023
@andy-may-at
Copy link
Contributor Author

@PierreBtz - while doing this PR, I noticed that there's a fair bit of inconsistent whitespace in Zendesk.java, which made my IntelliJ keep try to be helpful & fix it (which I didn't want to do as part of this PR).

Might be worth doing an auto-format of the whole file if you've got an IDE with appropriate code-style settings for the project :)

@andy-may-at andy-may-at deleted the issue/559/implement_content_tags_resource branch April 3, 2023 10:41
@PierreBtz
Copy link
Collaborator

@andy-may-at indeed I noticed that too (project has a lot of history with a lot of different contributors and maintainers).
I was recently contributing to a project that was using https://github.com/diffplug/spotless/tree/main/plugin-maven to keep things clean (it fails the build if the formatting is messed up). I had something like that in mind.

@andy-may-at
Copy link
Contributor Author

In Kotlin-land I've been using Kotlinter, which enforces the code style that you have in your .editorconfig file
That behaviour's been good for having a single source of truth for code style.

Not used it myself, but this maven plugin seems to do that:
https://ec4j.github.io/editorconfig-maven-plugin/

@PierreBtz
Copy link
Collaborator

Interesting, I wasn't aware editorconfig was providing a Maven plugin. I'll have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants