Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ 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.11.0] - 2026-10-26

### Added

- `Build.getActorDefinition()` and the `ActorDefinition`, `ActorDefinitionMeta` and
`ActorDefinitionStorages` models for the build's `actorDefinition`, including the new `title`,
`description`, `output`, `meta`, `storages.datasets`, `storages.keyValueStore`,
`webServerSchema` and `webServerMcpPath` fields.

### Fixed

- An explicit JSON `null` for a raw-JSON (`JsonNode`) model field, such as `Task.getInput()`, is now
returned as Java `null` instead of a `NullNode`.

### Changed

- Updated to Apify OpenAPI specification `v2-2026-10-26T112451Z`.
- Documented that only runs with status `SUCCEEDED`, `FAILED`, `ABORTED` or `TIMED-OUT` can be
resurrected with `RunClient.resurrect`.

## [0.10.0] - 2026-10-21

### Added
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Maven (Maven Central is a default repository, so no extra configuration is neede
<dependency>
<groupId>com.apify</groupId>
<artifactId>apify-client</artifactId>
<version>0.10.0</version>
<version>0.11.0</version>
</dependency>
```

Expand All @@ -35,7 +35,7 @@ repositories {
}

dependencies {
implementation 'com.apify:apify-client:0.10.0'
implementation 'com.apify:apify-client:0.11.0'
}
```

Expand Down Expand Up @@ -317,10 +317,10 @@ try {
The public `com.apify.client.Version` class (`import com.apify.client.Version;`) exposes two
constants:

- `Version.CLIENT_VERSION` — the semantic version of this client (`0.10.0`).
- `Version.CLIENT_VERSION` — the semantic version of this client (`0.11.0`).
- `Version.API_SPEC_VERSION` — the version of the [Apify OpenAPI specification](https://docs.apify.com/api/openapi.json)
(its `info.version` field) that this client's endpoints, parameters and models were last generated
and checked against (`v2-2026-10-20T121847Z`). It is a snapshot, not a live compatibility
and checked against (`v2-2026-10-26T112451Z`). It is a snapshot, not a live compatibility
guarantee: the client keeps working against newer, backward-compatible spec revisions, but a
feature added to the API after this snapshot has no corresponding method here yet.

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ option types, so import each resource you use from its own package:
| `com.apify.client` (root) | `ApifyClient`, `ApifyClientBuilder`, `Version`, `PaginationList<T>`, `ListOptions`, `StorageListOptions`, `ApifyResource` |
| `com.apify.client.http` | `ApifyClientException`, `ApifyApiException`, `ApifyTransportException`, `HttpTransport`, `DefaultHttpTransport`, `HttpTimeoutException` |
| `com.apify.client.actor` | `Actor`, `ActorClient`, `ActorCollectionClient`, `ActorListOptions`, `ActorStartOptions`, `ActorCallOptions`, `ActorBuildOptions`, `ActorStandby`, `ActorVersion`, `SourceCodeFile`, `ActorVersionClient`, `ActorVersionCollectionClient`, `ActorEnvVar`, `ActorEnvVarClient`, `ActorEnvVarCollectionClient`, `ValidateInputOptions`, `ActorStats`, `ActorDefaultRunOptions` |
| `com.apify.client.build` | `Build`, `BuildClient`, `BuildCollectionClient`, `BuildActVersion`, `BuildMeta`, `BuildStats`, `BuildOptions`, `BuildUsage` |
| `com.apify.client.build` | `Build`, `BuildClient`, `BuildCollectionClient`, `BuildActVersion`, `ActorDefinition`, `ActorDefinitionMeta`, `ActorDefinitionStorages`, `BuildMeta`, `BuildStats`, `BuildOptions`, `BuildUsage` |
| `com.apify.client.run` | `ActorRun`, `ActorRunStats`, `ActorRunOptions`, `ActorRunMeta`, `ActorRunUsage`, `RunClient`, `RunCollectionClient`, `RunListOptions`, `LastRunOptions`, `MetamorphOptions`, `RunChargeOptions`, `RunResurrectOptions`, `SetStatusMessageOptions` |
| `com.apify.client.dataset` | `Dataset`, `DatasetClient`, `DatasetCollectionClient`, `DatasetListItemsOptions`, `DatasetDownloadOptions`, `DownloadItemsFormat` |
| `com.apify.client.keyvalue` | `KeyValueStore`, `KeyValueStoreClient`, `KeyValueStoreCollectionClient`, `KeyValueStoreRecord`, `KeyValueStoreKeysPage`, `KeyValueStoreKey`, `GetRecordOptions`, `SetRecordOptions`, `ListKeysOptions` |
Expand Down
11 changes: 9 additions & 2 deletions docs/builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ builds) and a single build with `client.build(id)`.
`Build` fields: `getId()`, `getActId()`, `getUserId()`, `getStatus()`, `getStartedAt()`,
`getFinishedAt()`, `getBuildNumber()`, `getActVersion()` (`BuildActVersion` — `getSourceType()`, `getBuildTag()`
(nullable), `getVersionNumber()`, `getGitRepoUrl()`, `getSourceFiles()` (`List<SourceCodeFile>` — `getName()`,
`getFormat()`, `getContent()`)), `getImageDigest()` (`String`, nullable — the built Docker
`getFormat()`, `getContent()`)), `getActorDefinition()` (`ActorDefinition`, nullable — the Actor's `.actor/actor.json` at build time:
`getActorSpecification()`, `getName()`, `getTitle()`, `getDescription()`, `getVersion()`, `getBuildTag()`,
`getMeta()` (`ActorDefinitionMeta` — `getTemplateId()`, `getGeneratedBy()`), `getEnvironmentVariables()`,
`getDockerfile()`, `getDockerContextDir()`, `getReadme()`, `getInput()`/`getOutput()` (`JsonNode` schemas),
`getChangelog()`, `getStorages()` (`ActorDefinitionStorages` — `getDataset()`, `getDatasets()`,
`getKeyValueStore()`), `getDefaultMemoryMbytes()` (`JsonNode`, an integer or a dynamic memory
expression), `getMinMemoryMbytes()`, `getMaxMemoryMbytes()`, `getUsesStandbyMode()`, `getWebServerSchema()`,
`getWebServerMcpPath()`), `getImageDigest()` (`String`, nullable — the built Docker
image manifest's digest, without the `sha256:` prefix; compare two builds' digests to tell whether
their image contents differ), `getMeta()` (`BuildMeta` — `getOrigin()`, `getClientIp()`,
`getUserAgent()`), `getStats()` (`BuildStats` — `getDurationMillis()`/`getRunTimeSecs()` as `Long`,
Expand All @@ -34,7 +41,7 @@ their image contents differ), `getMeta()` (`BuildMeta` — `getOrigin()`, `getCl
`getUsage()` / `getUsageUsd()` (`BuildUsage` — `getActorComputeUnits()` as `Double`, the latter as
its USD cost), `getUsageTotalUsd()` (`Double`), plus `isTerminal()` and `getExtra()`. The status is
one of `READY`, `RUNNING`, `SUCCEEDED`, `FAILED`, `TIMING-OUT`, `TIMED-OUT`, `ABORTING`, `ABORTED`.
Every nested model above (`BuildActVersion`, `BuildMeta`, `BuildStats`, `BuildOptions`, `BuildUsage`) also has its own
Every nested model above (`BuildActVersion`, `ActorDefinition`, `ActorDefinitionMeta`, `ActorDefinitionStorages`, `BuildMeta`, `BuildStats`, `BuildOptions`, `BuildUsage`) also has its own
`getExtra()`, so a field not yet listed here is still reachable rather than dropped.

```java
Expand Down
2 changes: 1 addition & 1 deletion docs/runs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PaginationList<ActorRun> runs = client.runs().list(
| `abort(Boolean gracefully)` | Abort the run (`null` = server default). Completes with `ActorRun`. |
| `metamorph(String targetActorId, Object input, MetamorphOptions)` | Metamorph into another Actor. Completes with `ActorRun`. |
| `reboot()` | Reboot the run. Completes with `ActorRun`. |
| `resurrect(RunResurrectOptions)` | Resurrect a finished run. Completes with `ActorRun`. |
| `resurrect(RunResurrectOptions)` | Resurrect a finished run (status `SUCCEEDED`, `FAILED`, `ABORTED` or `TIMED-OUT`). Completes with `ActorRun`. |
| `charge(RunChargeOptions)` | Charge a pay-per-event run for a named event. Completes with no value (`CompletableFuture<Void>`). |
| `waitForFinish(Long waitSecs)` | Poll until the run finishes (`null` waits indefinitely). Completes with `ActorRun`. |
| `dataset()` / `keyValueStore()` / `requestQueue()` | Clients for the run's default storages. |
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.apify</groupId>
<artifactId>apify-client</artifactId>
<version>0.10.0</version>
<version>0.11.0</version>
<packaging>jar</packaging>

<name>Apify Java Client</name>
Expand Down
12 changes: 12 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
2. UWF_UNWRITTEN_FIELD / UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD on Jackson-populated DTOs/response
shapes ({@code KeyValueStoreKey}, {@code DeletedRequestInfo}, {@code ActorRunMeta}, {@code
TaskOptions}, {@code WebhookLastDispatch}, {@code ActorDefaultRunOptions}, {@code BuildActVersion},
{@code ActorDefinitionMeta}, {@code ActorDefinitionStorages},
{@code BuildMeta}, {@code BuildOptions}, {@code BuildStats}, {@code PricingInfo}, {@code ProxyGroup}, {@code
UserProxy}, {@code WebhookDispatchEventData}, {@code WebhookDispatchWebhookInfo}, the internal
error-response mapping in {@code HttpClientCore}): their fields are written by the
Expand Down Expand Up @@ -75,6 +76,8 @@
<Class name="com.apify.client.webhook.WebhookLastDispatch"/>
<Class name="com.apify.client.actor.ActorDefaultRunOptions"/>
<Class name="com.apify.client.build.BuildActVersion"/>
<Class name="com.apify.client.build.ActorDefinitionMeta"/>
<Class name="com.apify.client.build.ActorDefinitionStorages"/>
<Class name="com.apify.client.actor.SourceCodeFile"/>
<Class name="com.apify.client.build.BuildMeta"/>
<Class name="com.apify.client.build.BuildOptions"/>
Expand Down Expand Up @@ -110,10 +113,19 @@
</Or>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="com.apify.client.build.ActorDefinition"/>
<Or>
<Method name="getMeta"/>
<Method name="getStorages"/>
</Or>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="com.apify.client.build.Build"/>
<Or>
<Method name="getActVersion"/>
<Method name="getActorDefinition"/>
<Method name="getMeta"/>
<Method name="getOptions"/>
<Method name="getStats"/>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/apify/client/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public final class Version {
* The semantic version of this client library (see <a href="https://semver.org/">SemVer</a>).
* Changes to the public interface other than additive ones are considered breaking changes.
*/
public static final String CLIENT_VERSION = "0.10.0";
public static final String CLIENT_VERSION = "0.11.0";

/**
* 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-10-20T121847Z";
public static final String API_SPEC_VERSION = "v2-2026-10-26T112451Z";

private Version() {}
}
148 changes: 148 additions & 0 deletions src/main/java/com/apify/client/build/ActorDefinition.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
package com.apify.client.build;

import com.apify.client.ApifyResource;
import java.util.Collections;
import java.util.Map;
import tools.jackson.databind.JsonNode;

/**
* The definition of an Actor, as stored in its {@code .actor/actor.json}, from {@link
* Build#getActorDefinition()}. Every field is optional.
*/
public final class ActorDefinition extends ApifyResource {
private Integer actorSpecification;
private String name;
private String title;
private String description;
private String version;
private String buildTag;
private ActorDefinitionMeta meta;
private Map<String, String> environmentVariables;
private String dockerfile;
private String dockerContextDir;
private String readme;
private JsonNode input;
private JsonNode output;
private String changelog;
private ActorDefinitionStorages storages;
private JsonNode defaultMemoryMbytes;
private Long minMemoryMbytes;
private Long maxMemoryMbytes;
private Boolean usesStandbyMode;
private JsonNode webServerSchema;
private String webServerMcpPath;

/** The Actor specification version that this Actor follows; always {@code 1}. */
public Integer getActorSpecification() {
return actorSpecification;
}

/** The name of the Actor. */
public String getName() {
return name;
}

/** The human-readable display title of the Actor, shown in Apify Console and Apify Store. */
public String getTitle() {
return title;
}

/** The description of the Actor. */
public String getDescription() {
return description;
}

/** The version of the Actor, a dot-separated sequence of numbers (e.g. {@code "0.1"}). */
public String getVersion() {
return version;
}

/** The tag applied to a successful build of the Actor; {@code latest} when not specified. */
public String getBuildTag() {
return buildTag;
}

/** Additional information about the Actor. */
public ActorDefinitionMeta getMeta() {
return meta;
}

/**
* Environment variables used during local development and deployment; an empty map when none are
* defined.
*/
public Map<String, String> getEnvironmentVariables() {
return environmentVariables == null
? Map.of()
: Collections.unmodifiableMap(environmentVariables);
}

/** The path to the Dockerfile used for building the Actor on the platform. */
public String getDockerfile() {
return dockerfile;
}

/** The path to the directory used as the Docker context when building the Actor. */
public String getDockerContextDir() {
return dockerContextDir;
}

/** The path to the README file for the Actor; {@code null} if there is none. */
public String getReadme() {
return readme;
}

/** The input schema object; {@code null} if the Actor has no input schema. */
public JsonNode getInput() {
return input;
}

/** The output schema object; {@code null} if the Actor has no output schema. */
public JsonNode getOutput() {
return output;
}

/** The path to the CHANGELOG file shown in the Actor's information tab; may be {@code null}. */
public String getChangelog() {
return changelog;
}

/** The schemas of the Actor's storages. */
public ActorDefinitionStorages getStorages() {
return storages;
}

/**
* The default memory in megabytes used when the Actor is started: either a JSON integer or a
* string with a dynamic memory expression (e.g. {@code "get(input, 'startUrls.length', 1) *
* 1024"}).
*/
public JsonNode getDefaultMemoryMbytes() {
return defaultMemoryMbytes;
}

/** The minimum memory in megabytes required by the Actor. */
public Long getMinMemoryMbytes() {
return minMemoryMbytes;
}

/** The maximum memory in megabytes required by the Actor. */
public Long getMaxMemoryMbytes() {
return maxMemoryMbytes;
}

/** Whether Standby mode is enabled for the Actor. */
public Boolean getUsesStandbyMode() {
return usesStandbyMode;
}

/** The OpenAPI v3 specification of the web server running in the Actor. */
public JsonNode getWebServerSchema() {
return webServerSchema;
}

/** The HTTP path where the Actor's web server exposes its MCP server (e.g. {@code "/mcp"}). */
public String getWebServerMcpPath() {
return webServerMcpPath;
}
}
19 changes: 19 additions & 0 deletions src/main/java/com/apify/client/build/ActorDefinitionMeta.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.apify.client.build;

import com.apify.client.ApifyResource;

/** Additional information about an Actor, from {@link ActorDefinition#getMeta()}. */
public final class ActorDefinitionMeta extends ApifyResource {
private String templateId;
private String generatedBy;

/** The ID of the template from which the Actor was created. */
public String getTemplateId() {
return templateId;
}

/** The tool or model that generated the Actor. */
public String getGeneratedBy() {
return generatedBy;
}
}
34 changes: 34 additions & 0 deletions src/main/java/com/apify/client/build/ActorDefinitionStorages.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.apify.client.build;

import com.apify.client.ApifyResource;
import java.util.Collections;
import java.util.Map;
import tools.jackson.databind.JsonNode;

/** The storage schemas of an Actor, from {@link ActorDefinition#getStorages()}. */
public final class ActorDefinitionStorages extends ApifyResource {
private JsonNode dataset;
private Map<String, JsonNode> datasets;
private JsonNode keyValueStore;

/**
* The schema of the items in the Actor's dataset, as defined in the Actor's {@code
* .actor/actor.json}.
*/
public JsonNode getDataset() {
return dataset;
}

/**
* Maps dataset aliases to the schemas of the Actor's datasets; an empty map when the Actor
* defines none.
*/
public Map<String, JsonNode> getDatasets() {
return datasets == null ? Map.of() : Collections.unmodifiableMap(datasets);
}

/** The schema of the Actor's default key-value store. */
public JsonNode getKeyValueStore() {
return keyValueStore;
}
}
9 changes: 9 additions & 0 deletions src/main/java/com/apify/client/build/Build.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public final class Build extends ApifyResource {
private String buildNumber;
private String imageDigest;
private BuildActVersion actVersion;
private ActorDefinition actorDefinition;
private BuildMeta meta;
private BuildStats stats;
private BuildOptions options;
Expand Down Expand Up @@ -78,6 +79,14 @@ public BuildActVersion getActVersion() {
return actVersion;
}

/**
* The definition of the Actor this build was created from, as stored in its {@code
* .actor/actor.json}. {@code null} if the build has none.
*/
public ActorDefinition getActorDefinition() {
return actorDefinition;
}

/** Metadata about how the build was initiated. */
public BuildMeta getMeta() {
return meta;
Expand Down
Loading
Loading