From 7ddfd67f452d460abacddaa6dfa3c96c9c730b1c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Jul 2026 22:37:17 +0000 Subject: [PATCH] chore: sync Java client with Apify OpenAPI spec v2-2026-07-07T132551Z - Bump API_SPEC_VERSION to v2-2026-07-07T132551Z and project version to 0.1.1. - Correct LastRunOptions Javadoc: origin is now a spec-declared query parameter on the last-run endpoints. - Update README version/spec references to 0.1.1 / v2-2026-07-07T132551Z. - Align docs/examples.md storages example with the CI-tested Storages.java. --- CHANGELOG.md | 9 ++++ README.md | 8 ++-- docs/examples.md | 44 ++++++++++++------- pom.xml | 2 +- .../java/com/apify/client/LastRunOptions.java | 7 +-- src/main/java/com/apify/client/Version.java | 4 +- 6 files changed, 47 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f06e082..6fca00c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to the Apify Java client are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.1] - 2026-07-07 + +### Changed + +- Verified the client against OpenAPI specification version `v2-2026-07-07T132551Z` and bumped + `Version.API_SPEC_VERSION` accordingly. +- Corrected the `LastRunOptions` documentation: `origin` is now a spec-declared query parameter on + the `runs/last` endpoints (behaviour unchanged). + ## [0.1.0] - 2026-07-03 Initial release of the official (experimental, AI-generated and AI-maintained) Java client for the diff --git a/README.md b/README.md index 68bce1e..95fdd5d 100644 --- a/README.md +++ b/README.md @@ -21,14 +21,14 @@ Maven: com.apify apify-client - 0.1.0 + 0.1.1 ``` Gradle: ```groovy -implementation 'com.apify:apify-client:0.1.0' +implementation 'com.apify:apify-client:0.1.1' ``` ## Quick start @@ -122,9 +122,9 @@ try { ## Versioning -- `Version.CLIENT_VERSION` — the semantic version of this client (`0.1.0`). +- `Version.CLIENT_VERSION` — the semantic version of this client (`0.1.1`). - `Version.API_SPEC_VERSION` — the Apify OpenAPI specification version this client was verified - against (`v2-2026-07-02T131926Z`). + against (`v2-2026-07-07T132551Z`). Changes to the public interface other than additive ones are considered breaking changes and follow [Semantic Versioning](https://semver.org/). diff --git a/docs/examples.md b/docs/examples.md index 7593e6b..23ab709 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -17,28 +17,38 @@ System.out.println("Item count: " + items.getCount()); ## Each storage: create, push, read ```java -// Dataset +// Named storages persist on your account; each block deletes its storage in a finally so the +// example does not leak them. + +// Dataset: create, push items, read them back. Dataset dataset = client.datasets().getOrCreate("example-ds"); -client.dataset(dataset.getId()).pushItems(List.of(Map.of("hello", "world"))); -PaginationList dsItems = client.dataset(dataset.getId()).listItems(new DatasetListItemsOptions()); -System.out.println("Dataset items: " + dsItems.getCount()); +try { + client.dataset(dataset.getId()).pushItems(List.of(Map.of("hello", "world"))); + PaginationList items = client.dataset(dataset.getId()).listItems(new DatasetListItemsOptions()); + System.out.println("Dataset items: " + items.getItems()); +} finally { + client.dataset(dataset.getId()).delete(); +} -// Key-value store +// Key-value store: create, set a record, read it back. KeyValueStore store = client.keyValueStores().getOrCreate("example-kvs"); -client.keyValueStore(store.getId()).setRecordJson("OUTPUT", Map.of("answer", 42)); -Optional record = client.keyValueStore(store.getId()).getRecord("OUTPUT"); -record.ifPresent(r -> System.out.println("OUTPUT bytes: " + r.getValue().length)); +try { + client.keyValueStore(store.getId()).setRecordJson("OUTPUT", Map.of("answer", 42)); + Optional record = client.keyValueStore(store.getId()).getRecord("OUTPUT"); + record.ifPresent(r -> System.out.println("KVS record bytes: " + r.getValue().length)); +} finally { + client.keyValueStore(store.getId()).delete(); +} -// Request queue +// Request queue: create, add a request, read the head. RequestQueue queue = client.requestQueues().getOrCreate("example-rq"); -client.requestQueue(queue.getId()).addRequest(new RequestQueueRequest("https://example.com", "example"), false); -RequestQueueHead head = client.requestQueue(queue.getId()).listHead(10L); -System.out.println("Queue head items: " + head.getItems().size()); - -// Named storages persist on your account; delete them when done so the example does not leak them. -client.dataset(dataset.getId()).delete(); -client.keyValueStore(store.getId()).delete(); -client.requestQueue(queue.getId()).delete(); +try { + client.requestQueue(queue.getId()).addRequest(new RequestQueueRequest("https://example.com", "example"), false); + RequestQueueHead head = client.requestQueue(queue.getId()).listHead(10L); + System.out.println("Request queue head size: " + head.getItems().size()); +} finally { + client.requestQueue(queue.getId()).delete(); +} ``` ## Get own account details diff --git a/pom.xml b/pom.xml index 1d08b2b..a1d1372 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.apify apify-client - 0.1.0 + 0.1.1 jar Apify Java Client diff --git a/src/main/java/com/apify/client/LastRunOptions.java b/src/main/java/com/apify/client/LastRunOptions.java index 08f3008..0a582c1 100644 --- a/src/main/java/com/apify/client/LastRunOptions.java +++ b/src/main/java/com/apify/client/LastRunOptions.java @@ -4,9 +4,10 @@ * Filters which "last" run the {@link ActorClient#lastRun}/{@link TaskClient#lastRun} accessors * resolve to. Leave a field unset to leave that filter unset. * - *

{@code origin} is an Apify-platform convenience exposed by the reference client but not - * documented as a query parameter in the OpenAPI spec; it is included for parity, threaded to the - * same {@code runs/last} endpoint. + *

{@code origin} is now a spec-declared query parameter on the {@code runs/last} endpoints + * (alongside {@code status}), matching the reference client's {@code lastRun({status, origin})}. + * The spec also declares {@code waitForFinish} on those endpoints, but the reference client does + * not expose it on {@code lastRun}, so neither do we. */ public final class LastRunOptions { private String status; diff --git a/src/main/java/com/apify/client/Version.java b/src/main/java/com/apify/client/Version.java index 6b3cebf..c15e29d 100644 --- a/src/main/java/com/apify/client/Version.java +++ b/src/main/java/com/apify/client/Version.java @@ -13,13 +13,13 @@ public final class Version { * The semantic version of this client library (see SemVer). * Changes to the public interface other than additive ones are considered breaking changes. */ - public static final String CLIENT_VERSION = "0.1.0"; + public static final String CLIENT_VERSION = "0.1.1"; /** * The version of the Apify OpenAPI specification this client was generated and verified against. * Corresponds to the {@code info.version} field of the Apify OpenAPI document. */ - public static final String API_SPEC_VERSION = "v2-2026-07-02T131926Z"; + public static final String API_SPEC_VERSION = "v2-2026-07-07T132551Z"; private Version() {} }