From 1aa6224f957cf89f8a7c2f7e4bc38a0c02b5d7c5 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:49:32 +0000 Subject: [PATCH] SDK Generation --- .fern/metadata.json | 6 +- README.md | 27 +- build.gradle | 4 +- reference.md | 51 +++- .../java/com/anduril/core/ClientOptions.java | 4 +- .../resources/tasks/AsyncRawTasksClient.java | 44 ++-- .../resources/tasks/AsyncTasksClient.java | 44 ++-- .../resources/tasks/RawTasksClient.java | 44 ++-- .../anduril/resources/tasks/TasksClient.java | 44 ++-- .../tasks/requests/TaskStreamRequest.java | 148 ++++++++++- .../types/TaskStreamRequestStatusFilter.java | 143 +++++++++++ ...skStreamRequestStatusFilterFilterType.java | 97 ++++++++ ...StreamRequestStatusFilterStatusesItem.java | 230 ++++++++++++++++++ 13 files changed, 754 insertions(+), 132 deletions(-) create mode 100644 src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilter.java create mode 100644 src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterFilterType.java create mode 100644 src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterStatusesItem.java diff --git a/.fern/metadata.json b/.fern/metadata.json index aaff6eaf..bbef52c6 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,11 +1,11 @@ { - "cliVersion": "4.53.1", + "cliVersion": "4.54.1", "generatorName": "fernapi/fern-java-sdk", "generatorVersion": "4.0.9", "generatorConfig": { "client-class-name": "Lattice", "package-prefix": "com.anduril" }, - "originGitCommit": "d139ec85d28b73d9598251516d91b3f51152cb46", - "sdkVersion": "5.4.0" + "originGitCommit": "31cf9b8ebaf3f1e840ff708245036a2ca58603df", + "sdkVersion": "5.5.0" } \ No newline at end of file diff --git a/README.md b/README.md index 71c60343..9fc39ee5 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Add the dependency in your `build.gradle` file: ```groovy dependencies { - implementation 'com.anduril:lattice-sdk:5.4.0' + implementation 'com.anduril:lattice-sdk:5.5.0' } ``` @@ -53,7 +53,7 @@ Add the dependency in your `pom.xml` file: com.anduril lattice-sdk - 5.4.0 + 5.5.0 ``` @@ -69,22 +69,13 @@ Instantiate and use the client with the following: package com.example.usage; import com.anduril.Lattice; -import com.anduril.resources.entities.requests.EntityEventRequest; - -public class Example { - public static void main(String[] args) { - Lattice client = Lattice.withCredentials("", "") - .build() - ; - - client.entities().longPollEntityEvents( - EntityEventRequest - .builder() - .sessionToken("sessionToken") - .build() - ); - } -} + +Lattice client = Lattice + .builder() + .server("YOUR_SERVER") + .build(); + +client.entities().longPollEntityEvents(...); ``` ## Authentication diff --git a/build.gradle b/build.gradle index b0fe1894..8c37da1a 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'com.anduril' -version = '5.4.0' +version = '5.5.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'com.anduril' artifactId = 'lattice-sdk' - version = '5.4.0' + version = '5.5.0' from components.java pom { name = 'Anduril Industries, Inc.' diff --git a/reference.md b/reference.md index df0ae98d..2eaece7a 100644 --- a/reference.md +++ b/reference.md @@ -753,12 +753,11 @@ Cancels a task by marking it for cancellation in the system. This method initiates task cancellation based on the task's current state: - If the task has not been sent to an agent, it cancels immediately and transitions the task to a terminal state (`STATUS_DONE_NOT_OK` with `ERROR_CODE_CANCELLED`). -- If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of `DELIVERY_STATUS_PENDING_CANCEL`. - The agent is responsible for determining whether cancellation is possible and updating - the task status accordingly via the `UpdateStatus` endpoint: - - If the task can be cancelled, the agent should update the task status to `STATUS_DONE_NOT_OK`. - - If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using `UpdateStatus` - or the returned task object. +- If the task has already been sent to an agent, the cancellation request is routed to the agent. + The agent is then responsible for deciding whether cancellation is possible or not: + - If the task can be cancelled, the agent must use `UpdateTaskStatus` and set the task status to `STATUS_DONE_NOT_OK`. + - If the task cannot be cancelled, the agent must use `UpdateTaskStatus` to attach a `TaskError` to the task with the error code `ERROR_CODE_REJECTED` + and a `message` explaining why the task cannot be cancelled. @@ -972,8 +971,8 @@ client.tasks().streamTasks( **rateLimit:** `Optional` -The time interval, in milliseconds, after an update for a given task before another one will be sent for the same task. -If set, value must be >= 250. +The time interval, in milliseconds, after an update for a given task before another one will be sent for the same task. +If set, value must be >= 250. @@ -994,6 +993,42 @@ If unset or false, the stream will include any new tasks and task updates, as we **taskType:** `Optional` — Optional filter that only returns tasks with specific types. If not provided, all task types will be streamed. + + + +
+
+ +**updateStartTime:** `Optional` — If provided, returns tasks which have been updated since the given time. + +
+
+ +
+
+ +**parentTaskId:** `Optional` + +A filter for tasks with a specific parent task ID. +Note: This filter is mutually exclusive with all other filter fields (`updateStartTime`, `assignee`, `statusFilter`, `taskType`). +Either provide `parentTaskId` or any combination of the other filters, but not both. + +
+
+ +
+
+ +**assignee:** `Optional` — A filter for tasks assigned to a specific principal. + +
+
+ +
+
+ +**statusFilter:** `Optional` — A filter for task statuses (inclusive or exclusive). +
diff --git a/src/main/java/com/anduril/core/ClientOptions.java b/src/main/java/com/anduril/core/ClientOptions.java index 05c4a825..7d6c3d9f 100644 --- a/src/main/java/com/anduril/core/ClientOptions.java +++ b/src/main/java/com/anduril/core/ClientOptions.java @@ -38,10 +38,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.anduril:lattice-sdk/5.4.0"); + put("User-Agent", "com.anduril:lattice-sdk/5.5.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.anduril:lattice-sdk"); - put("X-Fern-SDK-Version", "5.4.0"); + put("X-Fern-SDK-Version", "5.5.0"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java b/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java index 25bc6d81..1e2a584b 100644 --- a/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java +++ b/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java @@ -417,13 +417,12 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -438,13 +437,12 @@ public CompletableFuture> cancelTask(String taskId) { *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -459,13 +457,12 @@ public CompletableFuture> cancelTask(String taskId, Re *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -480,13 +477,12 @@ public CompletableFuture> cancelTask(String taskId, Ta *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
diff --git a/src/main/java/com/anduril/resources/tasks/AsyncTasksClient.java b/src/main/java/com/anduril/resources/tasks/AsyncTasksClient.java index 75619c5f..9f6cdb04 100644 --- a/src/main/java/com/anduril/resources/tasks/AsyncTasksClient.java +++ b/src/main/java/com/anduril/resources/tasks/AsyncTasksClient.java @@ -196,13 +196,12 @@ public CompletableFuture updateTaskStatus( *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -217,13 +216,12 @@ public CompletableFuture cancelTask(String taskId) { *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -238,13 +236,12 @@ public CompletableFuture cancelTask(String taskId, RequestOptions requestO *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -259,13 +256,12 @@ public CompletableFuture cancelTask(String taskId, TaskCancellation reques *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
diff --git a/src/main/java/com/anduril/resources/tasks/RawTasksClient.java b/src/main/java/com/anduril/resources/tasks/RawTasksClient.java index 12ec5b0b..04535bab 100644 --- a/src/main/java/com/anduril/resources/tasks/RawTasksClient.java +++ b/src/main/java/com/anduril/resources/tasks/RawTasksClient.java @@ -356,13 +356,12 @@ public LatticeHttpResponse updateTaskStatus( *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -377,13 +376,12 @@ public LatticeHttpResponse cancelTask(String taskId) { *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -398,13 +396,12 @@ public LatticeHttpResponse cancelTask(String taskId, RequestOptions reques *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -419,13 +416,12 @@ public LatticeHttpResponse cancelTask(String taskId, TaskCancellation requ *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
diff --git a/src/main/java/com/anduril/resources/tasks/TasksClient.java b/src/main/java/com/anduril/resources/tasks/TasksClient.java index 019655db..60cbc9d3 100644 --- a/src/main/java/com/anduril/resources/tasks/TasksClient.java +++ b/src/main/java/com/anduril/resources/tasks/TasksClient.java @@ -194,13 +194,12 @@ public Task updateTaskStatus(String taskId, TaskStatusUpdate request, RequestOpt *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -215,13 +214,12 @@ public Task cancelTask(String taskId) { *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -236,13 +234,12 @@ public Task cancelTask(String taskId, RequestOptions requestOptions) { *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
@@ -257,13 +254,12 @@ public Task cancelTask(String taskId, TaskCancellation request) { *
    *
  • If the task has not been sent to an agent, it cancels immediately and transitions the task * to a terminal state (STATUS_DONE_NOT_OK with ERROR_CODE_CANCELLED).
  • - *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent with a delivery status of DELIVERY_STATUS_PENDING_CANCEL. - * The agent is responsible for determining whether cancellation is possible and updating - * the task status accordingly via the UpdateStatus endpoint: + *
  • If the task has already been sent to an agent, the cancellation request is routed to the agent. + * The agent is then responsible for deciding whether cancellation is possible or not: *
      - *
    • If the task can be cancelled, the agent should update the task status to STATUS_DONE_NOT_OK.
    • - *
    • If the task cannot be cancelled, the agent should attach an error to the task stating why cancellation is not possible using UpdateStatus - * or the returned task object.
    • + *
    • If the task can be cancelled, the agent must use UpdateTaskStatus and set the task status to STATUS_DONE_NOT_OK.
    • + *
    • If the task cannot be cancelled, the agent must use UpdateTaskStatus to attach a TaskError to the task with the error code ERROR_CODE_REJECTED + * and a message explaining why the task cannot be cancelled.
    • *
    *
  • *
diff --git a/src/main/java/com/anduril/resources/tasks/requests/TaskStreamRequest.java b/src/main/java/com/anduril/resources/tasks/requests/TaskStreamRequest.java index 2febf5b6..1a10e21f 100644 --- a/src/main/java/com/anduril/resources/tasks/requests/TaskStreamRequest.java +++ b/src/main/java/com/anduril/resources/tasks/requests/TaskStreamRequest.java @@ -4,7 +4,9 @@ package com.anduril.resources.tasks.requests; import com.anduril.core.ObjectMappers; +import com.anduril.resources.tasks.types.TaskStreamRequestStatusFilter; import com.anduril.resources.tasks.types.TaskStreamRequestTaskType; +import com.anduril.types.Principal; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -29,6 +31,14 @@ public final class TaskStreamRequest { private final Optional taskType; + private final Optional updateStartTime; + + private final Optional parentTaskId; + + private final Optional assignee; + + private final Optional statusFilter; + private final Map additionalProperties; private TaskStreamRequest( @@ -36,11 +46,19 @@ private TaskStreamRequest( Optional rateLimit, Optional excludePreexistingTasks, Optional taskType, + Optional updateStartTime, + Optional parentTaskId, + Optional assignee, + Optional statusFilter, Map additionalProperties) { this.heartbeatIntervalMs = heartbeatIntervalMs; this.rateLimit = rateLimit; this.excludePreexistingTasks = excludePreexistingTasks; this.taskType = taskType; + this.updateStartTime = updateStartTime; + this.parentTaskId = parentTaskId; + this.assignee = assignee; + this.statusFilter = statusFilter; this.additionalProperties = additionalProperties; } @@ -78,6 +96,40 @@ public Optional getTaskType() { return taskType; } + /** + * @return If provided, returns tasks which have been updated since the given time. + */ + @JsonProperty("updateStartTime") + public Optional getUpdateStartTime() { + return updateStartTime; + } + + /** + * @return A filter for tasks with a specific parent task ID. + * Note: This filter is mutually exclusive with all other filter fields (updateStartTime, assignee, statusFilter, taskType). + * Either provide parentTaskId or any combination of the other filters, but not both. + */ + @JsonProperty("parentTaskId") + public Optional getParentTaskId() { + return parentTaskId; + } + + /** + * @return A filter for tasks assigned to a specific principal. + */ + @JsonProperty("assignee") + public Optional getAssignee() { + return assignee; + } + + /** + * @return A filter for task statuses (inclusive or exclusive). + */ + @JsonProperty("statusFilter") + public Optional getStatusFilter() { + return statusFilter; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -93,12 +145,24 @@ private boolean equalTo(TaskStreamRequest other) { return heartbeatIntervalMs.equals(other.heartbeatIntervalMs) && rateLimit.equals(other.rateLimit) && excludePreexistingTasks.equals(other.excludePreexistingTasks) - && taskType.equals(other.taskType); + && taskType.equals(other.taskType) + && updateStartTime.equals(other.updateStartTime) + && parentTaskId.equals(other.parentTaskId) + && assignee.equals(other.assignee) + && statusFilter.equals(other.statusFilter); } @java.lang.Override public int hashCode() { - return Objects.hash(this.heartbeatIntervalMs, this.rateLimit, this.excludePreexistingTasks, this.taskType); + return Objects.hash( + this.heartbeatIntervalMs, + this.rateLimit, + this.excludePreexistingTasks, + this.taskType, + this.updateStartTime, + this.parentTaskId, + this.assignee, + this.statusFilter); } @java.lang.Override @@ -120,6 +184,14 @@ public static final class Builder { private Optional taskType = Optional.empty(); + private Optional updateStartTime = Optional.empty(); + + private Optional parentTaskId = Optional.empty(); + + private Optional assignee = Optional.empty(); + + private Optional statusFilter = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -130,6 +202,10 @@ public Builder from(TaskStreamRequest other) { rateLimit(other.getRateLimit()); excludePreexistingTasks(other.getExcludePreexistingTasks()); taskType(other.getTaskType()); + updateStartTime(other.getUpdateStartTime()); + parentTaskId(other.getParentTaskId()); + assignee(other.getAssignee()); + statusFilter(other.getStatusFilter()); return this; } @@ -191,9 +267,75 @@ public Builder taskType(TaskStreamRequestTaskType taskType) { return this; } + /** + *

If provided, returns tasks which have been updated since the given time.

+ */ + @JsonSetter(value = "updateStartTime", nulls = Nulls.SKIP) + public Builder updateStartTime(Optional updateStartTime) { + this.updateStartTime = updateStartTime; + return this; + } + + public Builder updateStartTime(String updateStartTime) { + this.updateStartTime = Optional.ofNullable(updateStartTime); + return this; + } + + /** + *

A filter for tasks with a specific parent task ID. + * Note: This filter is mutually exclusive with all other filter fields (updateStartTime, assignee, statusFilter, taskType). + * Either provide parentTaskId or any combination of the other filters, but not both.

+ */ + @JsonSetter(value = "parentTaskId", nulls = Nulls.SKIP) + public Builder parentTaskId(Optional parentTaskId) { + this.parentTaskId = parentTaskId; + return this; + } + + public Builder parentTaskId(String parentTaskId) { + this.parentTaskId = Optional.ofNullable(parentTaskId); + return this; + } + + /** + *

A filter for tasks assigned to a specific principal.

+ */ + @JsonSetter(value = "assignee", nulls = Nulls.SKIP) + public Builder assignee(Optional assignee) { + this.assignee = assignee; + return this; + } + + public Builder assignee(Principal assignee) { + this.assignee = Optional.ofNullable(assignee); + return this; + } + + /** + *

A filter for task statuses (inclusive or exclusive).

+ */ + @JsonSetter(value = "statusFilter", nulls = Nulls.SKIP) + public Builder statusFilter(Optional statusFilter) { + this.statusFilter = statusFilter; + return this; + } + + public Builder statusFilter(TaskStreamRequestStatusFilter statusFilter) { + this.statusFilter = Optional.ofNullable(statusFilter); + return this; + } + public TaskStreamRequest build() { return new TaskStreamRequest( - heartbeatIntervalMs, rateLimit, excludePreexistingTasks, taskType, additionalProperties); + heartbeatIntervalMs, + rateLimit, + excludePreexistingTasks, + taskType, + updateStartTime, + parentTaskId, + assignee, + statusFilter, + additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilter.java b/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilter.java new file mode 100644 index 00000000..9daf2d86 --- /dev/null +++ b/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilter.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.anduril.resources.tasks.types; + +import com.anduril.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TaskStreamRequestStatusFilter.Builder.class) +public final class TaskStreamRequestStatusFilter { + private final Optional> statuses; + + private final Optional filterType; + + private final Map additionalProperties; + + private TaskStreamRequestStatusFilter( + Optional> statuses, + Optional filterType, + Map additionalProperties) { + this.statuses = statuses; + this.filterType = filterType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The statuses to filter by. + */ + @JsonProperty("statuses") + public Optional> getStatuses() { + return statuses; + } + + /** + * @return The type of filter to apply. + */ + @JsonProperty("filterType") + public Optional getFilterType() { + return filterType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskStreamRequestStatusFilter && equalTo((TaskStreamRequestStatusFilter) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TaskStreamRequestStatusFilter other) { + return statuses.equals(other.statuses) && filterType.equals(other.filterType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.statuses, this.filterType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> statuses = Optional.empty(); + + private Optional filterType = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TaskStreamRequestStatusFilter other) { + statuses(other.getStatuses()); + filterType(other.getFilterType()); + return this; + } + + /** + *

The statuses to filter by.

+ */ + @JsonSetter(value = "statuses", nulls = Nulls.SKIP) + public Builder statuses(Optional> statuses) { + this.statuses = statuses; + return this; + } + + public Builder statuses(List statuses) { + this.statuses = Optional.ofNullable(statuses); + return this; + } + + /** + *

The type of filter to apply.

+ */ + @JsonSetter(value = "filterType", nulls = Nulls.SKIP) + public Builder filterType(Optional filterType) { + this.filterType = filterType; + return this; + } + + public Builder filterType(TaskStreamRequestStatusFilterFilterType filterType) { + this.filterType = Optional.ofNullable(filterType); + return this; + } + + public TaskStreamRequestStatusFilter build() { + return new TaskStreamRequestStatusFilter(statuses, filterType, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterFilterType.java b/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterFilterType.java new file mode 100644 index 00000000..7a603729 --- /dev/null +++ b/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterFilterType.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.anduril.resources.tasks.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TaskStreamRequestStatusFilterFilterType { + public static final TaskStreamRequestStatusFilterFilterType FILTER_TYPE_INVALID = + new TaskStreamRequestStatusFilterFilterType(Value.FILTER_TYPE_INVALID, "FILTER_TYPE_INVALID"); + + public static final TaskStreamRequestStatusFilterFilterType FILTER_TYPE_INCLUSIVE = + new TaskStreamRequestStatusFilterFilterType(Value.FILTER_TYPE_INCLUSIVE, "FILTER_TYPE_INCLUSIVE"); + + public static final TaskStreamRequestStatusFilterFilterType FILTER_TYPE_EXCLUSIVE = + new TaskStreamRequestStatusFilterFilterType(Value.FILTER_TYPE_EXCLUSIVE, "FILTER_TYPE_EXCLUSIVE"); + + private final Value value; + + private final String string; + + TaskStreamRequestStatusFilterFilterType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof TaskStreamRequestStatusFilterFilterType + && this.string.equals(((TaskStreamRequestStatusFilterFilterType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FILTER_TYPE_INVALID: + return visitor.visitFilterTypeInvalid(); + case FILTER_TYPE_INCLUSIVE: + return visitor.visitFilterTypeInclusive(); + case FILTER_TYPE_EXCLUSIVE: + return visitor.visitFilterTypeExclusive(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TaskStreamRequestStatusFilterFilterType valueOf(String value) { + switch (value) { + case "FILTER_TYPE_INVALID": + return FILTER_TYPE_INVALID; + case "FILTER_TYPE_INCLUSIVE": + return FILTER_TYPE_INCLUSIVE; + case "FILTER_TYPE_EXCLUSIVE": + return FILTER_TYPE_EXCLUSIVE; + default: + return new TaskStreamRequestStatusFilterFilterType(Value.UNKNOWN, value); + } + } + + public enum Value { + FILTER_TYPE_INVALID, + + FILTER_TYPE_INCLUSIVE, + + FILTER_TYPE_EXCLUSIVE, + + UNKNOWN + } + + public interface Visitor { + T visitFilterTypeInvalid(); + + T visitFilterTypeInclusive(); + + T visitFilterTypeExclusive(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterStatusesItem.java b/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterStatusesItem.java new file mode 100644 index 00000000..08168afe --- /dev/null +++ b/src/main/java/com/anduril/resources/tasks/types/TaskStreamRequestStatusFilterStatusesItem.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.anduril.resources.tasks.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TaskStreamRequestStatusFilterStatusesItem { + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_WILCO = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_WILCO, "STATUS_WILCO"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_DONE_OK = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_DONE_OK, "STATUS_DONE_OK"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_VERSION_REJECTED = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_VERSION_REJECTED, "STATUS_VERSION_REJECTED"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_MACHINE_RECEIPT = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_MACHINE_RECEIPT, "STATUS_MACHINE_RECEIPT"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_INVALID = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_INVALID, "STATUS_INVALID"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_WAITING_FOR_UPDATE = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_WAITING_FOR_UPDATE, "STATUS_WAITING_FOR_UPDATE"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_SCHEDULED_IN_MANAGER = + new TaskStreamRequestStatusFilterStatusesItem( + Value.STATUS_SCHEDULED_IN_MANAGER, "STATUS_SCHEDULED_IN_MANAGER"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_SENT = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_SENT, "STATUS_SENT"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_CREATED = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_CREATED, "STATUS_CREATED"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_EXECUTING = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_EXECUTING, "STATUS_EXECUTING"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_DONE_NOT_OK = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_DONE_NOT_OK, "STATUS_DONE_NOT_OK"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_ACK = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_ACK, "STATUS_ACK"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_REPLACED = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_REPLACED, "STATUS_REPLACED"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_COMPLETE_REQUESTED = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_COMPLETE_REQUESTED, "STATUS_COMPLETE_REQUESTED"); + + public static final TaskStreamRequestStatusFilterStatusesItem STATUS_CANCEL_REQUESTED = + new TaskStreamRequestStatusFilterStatusesItem(Value.STATUS_CANCEL_REQUESTED, "STATUS_CANCEL_REQUESTED"); + + private final Value value; + + private final String string; + + TaskStreamRequestStatusFilterStatusesItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof TaskStreamRequestStatusFilterStatusesItem + && this.string.equals(((TaskStreamRequestStatusFilterStatusesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS_WILCO: + return visitor.visitStatusWilco(); + case STATUS_DONE_OK: + return visitor.visitStatusDoneOk(); + case STATUS_VERSION_REJECTED: + return visitor.visitStatusVersionRejected(); + case STATUS_MACHINE_RECEIPT: + return visitor.visitStatusMachineReceipt(); + case STATUS_INVALID: + return visitor.visitStatusInvalid(); + case STATUS_WAITING_FOR_UPDATE: + return visitor.visitStatusWaitingForUpdate(); + case STATUS_SCHEDULED_IN_MANAGER: + return visitor.visitStatusScheduledInManager(); + case STATUS_SENT: + return visitor.visitStatusSent(); + case STATUS_CREATED: + return visitor.visitStatusCreated(); + case STATUS_EXECUTING: + return visitor.visitStatusExecuting(); + case STATUS_DONE_NOT_OK: + return visitor.visitStatusDoneNotOk(); + case STATUS_ACK: + return visitor.visitStatusAck(); + case STATUS_REPLACED: + return visitor.visitStatusReplaced(); + case STATUS_COMPLETE_REQUESTED: + return visitor.visitStatusCompleteRequested(); + case STATUS_CANCEL_REQUESTED: + return visitor.visitStatusCancelRequested(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TaskStreamRequestStatusFilterStatusesItem valueOf(String value) { + switch (value) { + case "STATUS_WILCO": + return STATUS_WILCO; + case "STATUS_DONE_OK": + return STATUS_DONE_OK; + case "STATUS_VERSION_REJECTED": + return STATUS_VERSION_REJECTED; + case "STATUS_MACHINE_RECEIPT": + return STATUS_MACHINE_RECEIPT; + case "STATUS_INVALID": + return STATUS_INVALID; + case "STATUS_WAITING_FOR_UPDATE": + return STATUS_WAITING_FOR_UPDATE; + case "STATUS_SCHEDULED_IN_MANAGER": + return STATUS_SCHEDULED_IN_MANAGER; + case "STATUS_SENT": + return STATUS_SENT; + case "STATUS_CREATED": + return STATUS_CREATED; + case "STATUS_EXECUTING": + return STATUS_EXECUTING; + case "STATUS_DONE_NOT_OK": + return STATUS_DONE_NOT_OK; + case "STATUS_ACK": + return STATUS_ACK; + case "STATUS_REPLACED": + return STATUS_REPLACED; + case "STATUS_COMPLETE_REQUESTED": + return STATUS_COMPLETE_REQUESTED; + case "STATUS_CANCEL_REQUESTED": + return STATUS_CANCEL_REQUESTED; + default: + return new TaskStreamRequestStatusFilterStatusesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS_INVALID, + + STATUS_CREATED, + + STATUS_SCHEDULED_IN_MANAGER, + + STATUS_SENT, + + STATUS_MACHINE_RECEIPT, + + STATUS_ACK, + + STATUS_WILCO, + + STATUS_EXECUTING, + + STATUS_WAITING_FOR_UPDATE, + + STATUS_DONE_OK, + + STATUS_DONE_NOT_OK, + + STATUS_REPLACED, + + STATUS_CANCEL_REQUESTED, + + STATUS_COMPLETE_REQUESTED, + + STATUS_VERSION_REJECTED, + + UNKNOWN + } + + public interface Visitor { + T visitStatusInvalid(); + + T visitStatusCreated(); + + T visitStatusScheduledInManager(); + + T visitStatusSent(); + + T visitStatusMachineReceipt(); + + T visitStatusAck(); + + T visitStatusWilco(); + + T visitStatusExecuting(); + + T visitStatusWaitingForUpdate(); + + T visitStatusDoneOk(); + + T visitStatusDoneNotOk(); + + T visitStatusReplaced(); + + T visitStatusCancelRequested(); + + T visitStatusCompleteRequested(); + + T visitStatusVersionRejected(); + + T visitUnknown(String unknownType); + } +}