The public display configuration ({@code publicConfig}) is preserved, so the task can be
- * published again without re-entering it. Requires write permission to the task only (unlike
- * {@link #publish()}, it does not require permission to the task's Actor). Unpublishing a task
- * that is not published does nothing.
+ * published again without re-entering it. Like {@link #publish()}, requires write permission to
+ * both the task and its Actor. Unpublishing a task that is not published does nothing.
*/
public CompletableFuture Not part of the documented {@code Task} schema in the OpenAPI spec, but the API returns it in
- * practice (mirroring the reference JS client's {@code TaskPublicConfig}).
+ * {@link #getCategorization()} is not part of the documented {@code TaskPublicConfig} schema in
+ * the OpenAPI spec, but is kept here for parity with the reference JS client, which also exposes
+ * it. Every other field below is part of the documented schema.
*/
public final class TaskPublicConfig extends ApifyResource {
private Instant publishedAt;
@@ -39,7 +40,10 @@ public String getSeoDescription() {
return seoDescription;
}
- /** The category the task is listed under on its public landing page. */
+ /**
+ * The category the task is listed under on its public landing page. Not part of the documented
+ * schema; see the class-level note.
+ */
public String getCategorization() {
return categorization;
}
diff --git a/src/test/java/com/apify/client/integration/TaskIntegrationTest.java b/src/test/java/com/apify/client/integration/TaskIntegrationTest.java
index 62f702a..4976c4f 100644
--- a/src/test/java/com/apify/client/integration/TaskIntegrationTest.java
+++ b/src/test/java/com/apify/client/integration/TaskIntegrationTest.java
@@ -104,9 +104,11 @@ void taskPublishUnpublish() {
try {
TaskClient tc = client.task(task.getId());
- // unpublish() only requires write permission to the task itself, not its Actor, so it
- // succeeds here even though the task's Actor (apify/hello-world) is unowned by this test
- // account. Reuses the update() PUT and leaves isPublic not-true.
+ // The freshly created task is already unpublished, so this unpublish() call is a no-op per
+ // the spec ("sending the value the task already has does nothing") - it succeeds even
+ // though the task's Actor (apify/hello-world) is unowned by this test account, without that
+ // being evidence that unpublish() needs less permission than publish(): both require write
+ // permission to the task's Actor. Reuses the update() PUT and leaves isPublic not-true.
Task unpublished = tc.unpublish().join();
assertFalse(Boolean.TRUE.equals(unpublished.getIsPublic()));