refactor!: make the Java client more idiomatic#4
Closed
Pijukatel wants to merge 5 commits into
Closed
Conversation
…overloads) Breaking changes to the public interface: - RunStatus/RunOrigin/PermissionLevel/WebhookEventType enums replace stringly-typed status, origin, permission level and webhook event type fields/params. - store().iterate() and requestQueue().paginateRequests() return Stream<T>. - RunClient.abort(Boolean) split into abort() / abort(boolean gracefully). Consistency target is the JS reference implementation only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
…ses, docs, tests) - README install snippets bumped to 0.2.0. - RunListOptions.apply filters null wire values so RunStatus.UNKNOWN cannot leak into the query. - PermissionLevel: drop unused @jsonvalue (write-only enum), document intent. - docs/webhooks.md: document typed-getter vs string-create asymmetry; derive create keys via getWireValue(). - CHANGELOG: add abort(null) -> abort() migration hint. - Add EnumTest (UNKNOWN fallback, hyphenated/dotted wire values, end-to-end deserialization); wire into CI unit-test step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
…h-gate EnumTest parity - Add EnumTest to the java-publish.yml unit-test step so the enum-correctness guard runs before release (parity with the PR gate). - Add offline unit tests: abort() omits the gracefully param, abort(true)/(false) map to gracefully=1/0, and RunListOptions filters RunStatus.UNKNOWN off the wire. - CHANGELOG: note nullable-Boolean auto-unboxing NPE risk in the abort migration. - Fix duplicated 'immediate' in RunClient.abort() javadoc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
RunOrigin is only emitted to the origin query param via LastRunOptions; no model field deserializes it, so its @JsonCreator/@JsonValue/UNKNOWN machinery was dead and the 'deserialization never fails' javadoc described a nonexistent path. Strip the annotations and UNKNOWN sentinel and document it as write-only, mirroring the refactor's own treatment of PermissionLevel. EnumTest updated accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JvkiV9GQnM5qo4iAnX43K7
Collaborator
Author
|
Contaminated by other implementations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the Java client to be more idiomatic Java, per the updated orchestration consistency requirement ("Consistency with the reference implementation that would go against idiomatic use of the language is not desired") with breaking public-interface changes explicitly permitted. This is not an OpenAPI spec sync — the client remains on
v2-2026-07-07T132551Z. Consistency is kept with the JS reference at the API-surface level, not with sibling clients. Version bumped0.1.1→0.2.0.Idiomatic changes (breaking)
RunStatus(withisTerminal(), replacing the internalStatuseshelper) onActorRun.getStatus()/Build.getStatus()and the status filters;RunOrigin,PermissionLevel,WebhookEventTypeflowing throughLastRunOptions,ActorClient/TaskClient.lastRun,RunListOptions.status,ActorStartOptions.forcePermissionLevel, andWebhook.getEventTypes().RunOrigin/PermissionLevelare write-only (no@JsonCreator).store().iterate(...)andrequestQueue().paginateRequests(...)now returnStream<T>instead of a rawIterator<T>.RunClient.abort(Boolean)→abort()+abort(boolean gracefully).Tests / CI
EnumTest(wire round-trips, hyphenatedTIMING-OUT/TIMED-OUT,UNKNOWNfallback) wired into both the PR and publish gates; new offlineabort()/RunListOptionsunit tests.Verification
EnumTest+ integration + examples + doc snippets) passes withAPIFY_TOKEN.Patterns already idiomatic (builders,
Optional, uncheckedApifyApiException, single well-named boolean params) were left unchanged. Java publishing requirements (Maven Central viamvn,Publishingenvironment secrets) are unchanged and compliant.Generated by Claude Code