diff --git a/.fern/metadata.json b/.fern/metadata.json
index 3da9bce..0f0f30e 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -1,10 +1,10 @@
{
- "cliVersion": "3.40.0",
+ "cliVersion": "3.51.2",
"generatorName": "fernapi/fern-java-sdk",
"generatorVersion": "3.29.1",
"generatorConfig": {
"client-class-name": "Lattice",
"package-prefix": "com.anduril"
},
- "sdkVersion": "5.1.0"
+ "sdkVersion": "5.2.0"
}
\ No newline at end of file
diff --git a/README.md b/README.md
index 393fa29..50dd7ca 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@ The Lattice SDK Java library provides convenient access to the Lattice SDK APIs
- [Installation](#installation)
- [Support](#support)
- [Usage](#usage)
+- [Authentication](#authentication)
- [Environments](#environments)
- [Base Url](#base-url)
- [Exception Handling](#exception-handling)
@@ -52,7 +53,7 @@ Add the dependency in your `pom.xml` file:
com.andurillattice-sdk
- 5.1.0
+ 5.2.0
```
@@ -111,6 +112,32 @@ Lattice client = Lattice.builder()
.build();
```
+## Authentication
+
+This SDK supports two authentication methods:
+
+### Option 1: Direct Bearer Token
+
+If you already have a valid access token, you can use it directly:
+
+```java
+Lattice client = Lattice.builder()
+ .token("your-access-token")
+ .url("https://api.example.com")
+ .build();
+```
+
+### Option 2: OAuth Client Credentials
+
+The SDK can automatically handle token acquisition and refresh:
+
+```java
+Lattice client = Lattice.builder()
+ .credentials("client-id", "client-secret")
+ .url("https://api.example.com")
+ .build();
+```
+
## Environments
This SDK allows you to configure different environments for API requests.
diff --git a/build.gradle b/build.gradle
index 6a89afa..078fd98 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,7 +47,7 @@ java {
group = 'com.anduril'
-version = '5.1.0'
+version = '5.2.0'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.anduril'
artifactId = 'lattice-sdk'
- version = '5.1.0'
+ version = '5.2.0'
from components.java
pom {
name = 'Anduril Industries, Inc.'
diff --git a/reference.md b/reference.md
index e8ee820..8386af5 100644
--- a/reference.md
+++ b/reference.md
@@ -832,6 +832,97 @@ any of the remaining parameters, but not both.
+
+
+
+
+client.tasks.streamTasks(request) -> Iterable<StreamTasksResponse>
+
+
+
+#### 📝 Description
+
+
+
+
+
+
+
+Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+
+The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+
+
+**heartbeatIntervalMs:** `Optional` — The time interval, in milliseconds, that determines the frequency at which to send heartbeat events. Defaults to 30000 (30 seconds).
+
+
+
+
+
+
+
+**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.
+
+
+
+
+
+
+
+**excludePreexistingTasks:** `Optional`
+
+Optional flag to only include tasks created or updated after the stream is initiated, and not any previous preexisting tasks.
+If unset or false, the stream will include any new tasks and task updates, as well as all preexisting tasks.
+
+
+
+
+
+
+
+**taskType:** `Optional` — Optional filter that only returns tasks with specific types. If not provided, all task types will be streamed.
+
+
+
+Establishes a server streaming connection that delivers tasks to taskable agents for execution
+using Server-Sent Events (SSE).
+
+This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+
+The stream delivers three types of requests:
+- `ExecuteRequest`: Contains a new task for the agent to execute
+- `CancelRequest`: Indicates a task should be canceled
+- `CompleteRequest`: Indicates a task should be completed
+
+Additionally, heartbeat messages are sent periodically to maintain the connection.
+
+This is recommended method for taskable agents to receive and process tasks in real-time.
+Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+
+When an agent receives a task, it should update the task status using the `UpdateStatus` endpoint
+to provide progress information back to Tasks API.
+
+
+**agentSelector:** `Optional` — The selector criteria to determine which tasks the agent receives.
+
+
+
+
+
+
+
+**heartbeatIntervalMs:** `Optional` — The time interval, defined in seconds, that determines the frequency at which to send heartbeat events. Defaults to 30s.
+
+
-Support the client credentials authorization flow
+Gets a new short-lived token using the specified client credentials
@@ -1271,7 +1444,7 @@ Support the client credentials authorization flow
```java
-client.oAuth2().getToken(
+client.oauth().getToken(
GetTokenRequest
.builder()
.build()
diff --git a/src/main/java/com/anduril/AsyncLattice.java b/src/main/java/com/anduril/AsyncLattice.java
index cf78069..d18fc60 100644
--- a/src/main/java/com/anduril/AsyncLattice.java
+++ b/src/main/java/com/anduril/AsyncLattice.java
@@ -6,7 +6,7 @@
import com.anduril.core.ClientOptions;
import com.anduril.core.Suppliers;
import com.anduril.resources.entities.AsyncEntitiesClient;
-import com.anduril.resources.oauth2.AsyncOAuth2Client;
+import com.anduril.resources.oauth.AsyncOauthClient;
import com.anduril.resources.objects.AsyncObjectsClient;
import com.anduril.resources.tasks.AsyncTasksClient;
import java.util.function.Supplier;
@@ -20,14 +20,14 @@ public class AsyncLattice {
protected final Supplier objectsClient;
- protected final Supplier oAuth2Client;
+ protected final Supplier oauthClient;
public AsyncLattice(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.entitiesClient = Suppliers.memoize(() -> new AsyncEntitiesClient(clientOptions));
this.tasksClient = Suppliers.memoize(() -> new AsyncTasksClient(clientOptions));
this.objectsClient = Suppliers.memoize(() -> new AsyncObjectsClient(clientOptions));
- this.oAuth2Client = Suppliers.memoize(() -> new AsyncOAuth2Client(clientOptions));
+ this.oauthClient = Suppliers.memoize(() -> new AsyncOauthClient(clientOptions));
}
public AsyncEntitiesClient entities() {
@@ -42,8 +42,8 @@ public AsyncObjectsClient objects() {
return this.objectsClient.get();
}
- public AsyncOAuth2Client oAuth2() {
- return this.oAuth2Client.get();
+ public AsyncOauthClient oauth() {
+ return this.oauthClient.get();
}
/**
diff --git a/src/main/java/com/anduril/AsyncLatticeBuilder.java b/src/main/java/com/anduril/AsyncLatticeBuilder.java
index 2696fef..7071172 100644
--- a/src/main/java/com/anduril/AsyncLatticeBuilder.java
+++ b/src/main/java/com/anduril/AsyncLatticeBuilder.java
@@ -6,7 +6,7 @@
import com.anduril.core.ClientOptions;
import com.anduril.core.Environment;
import com.anduril.core.OAuthTokenSupplier;
-import com.anduril.resources.oauth2.OAuth2Client;
+import com.anduril.resources.oauth.OauthClient;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@@ -249,7 +249,7 @@ public static final class _CredentialsAuth extends AsyncLatticeBuilder {
public AsyncLattice build() {
validateConfiguration();
ClientOptions baseOptions = buildClientOptions();
- OAuth2Client authClient = new OAuth2Client(baseOptions);
+ OauthClient authClient = new OauthClient(baseOptions);
OAuthTokenSupplier oAuthTokenSupplier =
new OAuthTokenSupplier(this.clientId, this.clientSecret, authClient);
ClientOptions finalOptions = ClientOptions.Builder.from(baseOptions)
diff --git a/src/main/java/com/anduril/Lattice.java b/src/main/java/com/anduril/Lattice.java
index eb743ff..bd8b30c 100644
--- a/src/main/java/com/anduril/Lattice.java
+++ b/src/main/java/com/anduril/Lattice.java
@@ -6,7 +6,7 @@
import com.anduril.core.ClientOptions;
import com.anduril.core.Suppliers;
import com.anduril.resources.entities.EntitiesClient;
-import com.anduril.resources.oauth2.OAuth2Client;
+import com.anduril.resources.oauth.OauthClient;
import com.anduril.resources.objects.ObjectsClient;
import com.anduril.resources.tasks.TasksClient;
import java.util.function.Supplier;
@@ -20,14 +20,14 @@ public class Lattice {
protected final Supplier objectsClient;
- protected final Supplier oAuth2Client;
+ protected final Supplier oauthClient;
public Lattice(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
this.entitiesClient = Suppliers.memoize(() -> new EntitiesClient(clientOptions));
this.tasksClient = Suppliers.memoize(() -> new TasksClient(clientOptions));
this.objectsClient = Suppliers.memoize(() -> new ObjectsClient(clientOptions));
- this.oAuth2Client = Suppliers.memoize(() -> new OAuth2Client(clientOptions));
+ this.oauthClient = Suppliers.memoize(() -> new OauthClient(clientOptions));
}
public EntitiesClient entities() {
@@ -42,8 +42,8 @@ public ObjectsClient objects() {
return this.objectsClient.get();
}
- public OAuth2Client oAuth2() {
- return this.oAuth2Client.get();
+ public OauthClient oauth() {
+ return this.oauthClient.get();
}
/**
diff --git a/src/main/java/com/anduril/LatticeBuilder.java b/src/main/java/com/anduril/LatticeBuilder.java
index dcfbedd..2928d08 100644
--- a/src/main/java/com/anduril/LatticeBuilder.java
+++ b/src/main/java/com/anduril/LatticeBuilder.java
@@ -6,7 +6,7 @@
import com.anduril.core.ClientOptions;
import com.anduril.core.Environment;
import com.anduril.core.OAuthTokenSupplier;
-import com.anduril.resources.oauth2.OAuth2Client;
+import com.anduril.resources.oauth.OauthClient;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@@ -249,7 +249,7 @@ public static final class _CredentialsAuth extends LatticeBuilder {
public Lattice build() {
validateConfiguration();
ClientOptions baseOptions = buildClientOptions();
- OAuth2Client authClient = new OAuth2Client(baseOptions);
+ OauthClient authClient = new OauthClient(baseOptions);
OAuthTokenSupplier oAuthTokenSupplier =
new OAuthTokenSupplier(this.clientId, this.clientSecret, authClient);
ClientOptions finalOptions = ClientOptions.Builder.from(baseOptions)
diff --git a/src/main/java/com/anduril/core/ClientOptions.java b/src/main/java/com/anduril/core/ClientOptions.java
index 4e4b62c..b8861c9 100644
--- a/src/main/java/com/anduril/core/ClientOptions.java
+++ b/src/main/java/com/anduril/core/ClientOptions.java
@@ -35,10 +35,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap() {
{
- put("User-Agent", "com.anduril:lattice-sdk/5.1.0");
+ put("User-Agent", "com.anduril:lattice-sdk/5.2.0");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.anduril.fern:api-sdk");
- put("X-Fern-SDK-Version", "5.1.0");
+ put("X-Fern-SDK-Version", "5.2.0");
}
});
this.headerSuppliers = headerSuppliers;
diff --git a/src/main/java/com/anduril/core/OAuthTokenSupplier.java b/src/main/java/com/anduril/core/OAuthTokenSupplier.java
index f114a00..d6647e5 100644
--- a/src/main/java/com/anduril/core/OAuthTokenSupplier.java
+++ b/src/main/java/com/anduril/core/OAuthTokenSupplier.java
@@ -3,9 +3,9 @@
*/
package com.anduril.core;
-import com.anduril.resources.oauth2.OAuth2Client;
-import com.anduril.resources.oauth2.requests.GetTokenRequest;
-import com.anduril.resources.oauth2.types.GetTokenResponse;
+import com.anduril.resources.oauth.OauthClient;
+import com.anduril.resources.oauth.requests.GetTokenRequest;
+import com.anduril.resources.oauth.types.GetTokenResponse;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.function.Supplier;
@@ -17,13 +17,13 @@ public final class OAuthTokenSupplier implements Supplier {
private final String clientSecret;
- private final OAuth2Client authClient;
+ private final OauthClient authClient;
private String accessToken;
private Instant expiresAt;
- public OAuthTokenSupplier(String clientId, String clientSecret, OAuth2Client authClient) {
+ public OAuthTokenSupplier(String clientId, String clientSecret, OauthClient authClient) {
this.clientId = clientId;
this.clientSecret = clientSecret;
this.authClient = authClient;
diff --git a/src/main/java/com/anduril/resources/oauth2/AsyncOAuth2Client.java b/src/main/java/com/anduril/resources/oauth/AsyncOauthClient.java
similarity index 60%
rename from src/main/java/com/anduril/resources/oauth2/AsyncOAuth2Client.java
rename to src/main/java/com/anduril/resources/oauth/AsyncOauthClient.java
index 7b9861a..70de354 100644
--- a/src/main/java/com/anduril/resources/oauth2/AsyncOAuth2Client.java
+++ b/src/main/java/com/anduril/resources/oauth/AsyncOauthClient.java
@@ -1,40 +1,40 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.anduril.resources.oauth2;
+package com.anduril.resources.oauth;
import com.anduril.core.ClientOptions;
import com.anduril.core.RequestOptions;
-import com.anduril.resources.oauth2.requests.GetTokenRequest;
-import com.anduril.resources.oauth2.types.GetTokenResponse;
+import com.anduril.resources.oauth.requests.GetTokenRequest;
+import com.anduril.resources.oauth.types.GetTokenResponse;
import java.util.concurrent.CompletableFuture;
-public class AsyncOAuth2Client {
+public class AsyncOauthClient {
protected final ClientOptions clientOptions;
- private final AsyncRawOAuth2Client rawClient;
+ private final AsyncRawOauthClient rawClient;
- public AsyncOAuth2Client(ClientOptions clientOptions) {
+ public AsyncOauthClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
- this.rawClient = new AsyncRawOAuth2Client(clientOptions);
+ this.rawClient = new AsyncRawOauthClient(clientOptions);
}
/**
* Get responses with HTTP metadata like headers
*/
- public AsyncRawOAuth2Client withRawResponse() {
+ public AsyncRawOauthClient withRawResponse() {
return this.rawClient;
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public CompletableFuture getToken(GetTokenRequest request) {
return this.rawClient.getToken(request).thenApply(response -> response.body());
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public CompletableFuture getToken(GetTokenRequest request, RequestOptions requestOptions) {
return this.rawClient.getToken(request, requestOptions).thenApply(response -> response.body());
diff --git a/src/main/java/com/anduril/resources/oauth2/AsyncRawOAuth2Client.java b/src/main/java/com/anduril/resources/oauth/AsyncRawOauthClient.java
similarity index 92%
rename from src/main/java/com/anduril/resources/oauth2/AsyncRawOAuth2Client.java
rename to src/main/java/com/anduril/resources/oauth/AsyncRawOauthClient.java
index 0a76d36..e440582 100644
--- a/src/main/java/com/anduril/resources/oauth2/AsyncRawOAuth2Client.java
+++ b/src/main/java/com/anduril/resources/oauth/AsyncRawOauthClient.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.anduril.resources.oauth2;
+package com.anduril.resources.oauth;
import com.anduril.core.ClientOptions;
import com.anduril.core.LatticeApiException;
@@ -11,8 +11,8 @@
import com.anduril.core.RequestOptions;
import com.anduril.errors.BadRequestError;
import com.anduril.errors.UnauthorizedError;
-import com.anduril.resources.oauth2.requests.GetTokenRequest;
-import com.anduril.resources.oauth2.types.GetTokenResponse;
+import com.anduril.resources.oauth.requests.GetTokenRequest;
+import com.anduril.resources.oauth.types.GetTokenResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
@@ -27,22 +27,22 @@
import okhttp3.ResponseBody;
import org.jetbrains.annotations.NotNull;
-public class AsyncRawOAuth2Client {
+public class AsyncRawOauthClient {
protected final ClientOptions clientOptions;
- public AsyncRawOAuth2Client(ClientOptions clientOptions) {
+ public AsyncRawOauthClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public CompletableFuture> getToken(GetTokenRequest request) {
return getToken(request, null);
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public CompletableFuture> getToken(
GetTokenRequest request, RequestOptions requestOptions) {
diff --git a/src/main/java/com/anduril/resources/oauth2/OAuth2Client.java b/src/main/java/com/anduril/resources/oauth/OauthClient.java
similarity index 56%
rename from src/main/java/com/anduril/resources/oauth2/OAuth2Client.java
rename to src/main/java/com/anduril/resources/oauth/OauthClient.java
index 5da9605..47fe1ee 100644
--- a/src/main/java/com/anduril/resources/oauth2/OAuth2Client.java
+++ b/src/main/java/com/anduril/resources/oauth/OauthClient.java
@@ -1,39 +1,39 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.anduril.resources.oauth2;
+package com.anduril.resources.oauth;
import com.anduril.core.ClientOptions;
import com.anduril.core.RequestOptions;
-import com.anduril.resources.oauth2.requests.GetTokenRequest;
-import com.anduril.resources.oauth2.types.GetTokenResponse;
+import com.anduril.resources.oauth.requests.GetTokenRequest;
+import com.anduril.resources.oauth.types.GetTokenResponse;
-public class OAuth2Client {
+public class OauthClient {
protected final ClientOptions clientOptions;
- private final RawOAuth2Client rawClient;
+ private final RawOauthClient rawClient;
- public OAuth2Client(ClientOptions clientOptions) {
+ public OauthClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
- this.rawClient = new RawOAuth2Client(clientOptions);
+ this.rawClient = new RawOauthClient(clientOptions);
}
/**
* Get responses with HTTP metadata like headers
*/
- public RawOAuth2Client withRawResponse() {
+ public RawOauthClient withRawResponse() {
return this.rawClient;
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public GetTokenResponse getToken(GetTokenRequest request) {
return this.rawClient.getToken(request).body();
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public GetTokenResponse getToken(GetTokenRequest request, RequestOptions requestOptions) {
return this.rawClient.getToken(request, requestOptions).body();
diff --git a/src/main/java/com/anduril/resources/oauth2/RawOAuth2Client.java b/src/main/java/com/anduril/resources/oauth/RawOauthClient.java
similarity index 90%
rename from src/main/java/com/anduril/resources/oauth2/RawOAuth2Client.java
rename to src/main/java/com/anduril/resources/oauth/RawOauthClient.java
index 1f221ed..abb5ea0 100644
--- a/src/main/java/com/anduril/resources/oauth2/RawOAuth2Client.java
+++ b/src/main/java/com/anduril/resources/oauth/RawOauthClient.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.anduril.resources.oauth2;
+package com.anduril.resources.oauth;
import com.anduril.core.ClientOptions;
import com.anduril.core.LatticeApiException;
@@ -11,8 +11,8 @@
import com.anduril.core.RequestOptions;
import com.anduril.errors.BadRequestError;
import com.anduril.errors.UnauthorizedError;
-import com.anduril.resources.oauth2.requests.GetTokenRequest;
-import com.anduril.resources.oauth2.types.GetTokenResponse;
+import com.anduril.resources.oauth.requests.GetTokenRequest;
+import com.anduril.resources.oauth.types.GetTokenResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import okhttp3.FormBody;
@@ -23,22 +23,22 @@
import okhttp3.Response;
import okhttp3.ResponseBody;
-public class RawOAuth2Client {
+public class RawOauthClient {
protected final ClientOptions clientOptions;
- public RawOAuth2Client(ClientOptions clientOptions) {
+ public RawOauthClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public LatticeHttpResponse getToken(GetTokenRequest request) {
return getToken(request, null);
}
/**
- * Support the client credentials authorization flow
+ * Gets a new short-lived token using the specified client credentials
*/
public LatticeHttpResponse getToken(GetTokenRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
diff --git a/src/main/java/com/anduril/resources/oauth2/requests/GetTokenRequest.java b/src/main/java/com/anduril/resources/oauth/requests/GetTokenRequest.java
similarity index 98%
rename from src/main/java/com/anduril/resources/oauth2/requests/GetTokenRequest.java
rename to src/main/java/com/anduril/resources/oauth/requests/GetTokenRequest.java
index 11e1758..83a3243 100644
--- a/src/main/java/com/anduril/resources/oauth2/requests/GetTokenRequest.java
+++ b/src/main/java/com/anduril/resources/oauth/requests/GetTokenRequest.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.anduril.resources.oauth2.requests;
+package com.anduril.resources.oauth.requests;
import com.anduril.core.ObjectMappers;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
diff --git a/src/main/java/com/anduril/resources/oauth2/types/GetTokenResponse.java b/src/main/java/com/anduril/resources/oauth/types/GetTokenResponse.java
similarity index 99%
rename from src/main/java/com/anduril/resources/oauth2/types/GetTokenResponse.java
rename to src/main/java/com/anduril/resources/oauth/types/GetTokenResponse.java
index 1c52a01..68c7e2a 100644
--- a/src/main/java/com/anduril/resources/oauth2/types/GetTokenResponse.java
+++ b/src/main/java/com/anduril/resources/oauth/types/GetTokenResponse.java
@@ -1,7 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
-package com.anduril.resources.oauth2.types;
+package com.anduril.resources.oauth.types;
import com.anduril.core.ObjectMappers;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
diff --git a/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java b/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java
index 84bbf6a..86cece5 100644
--- a/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java
+++ b/src/main/java/com/anduril/resources/tasks/AsyncRawTasksClient.java
@@ -10,14 +10,20 @@
import com.anduril.core.MediaTypes;
import com.anduril.core.ObjectMappers;
import com.anduril.core.RequestOptions;
+import com.anduril.core.ResponseBodyReader;
+import com.anduril.core.Stream;
import com.anduril.errors.BadRequestError;
import com.anduril.errors.NotFoundError;
import com.anduril.errors.UnauthorizedError;
import com.anduril.resources.tasks.requests.AgentListener;
+import com.anduril.resources.tasks.requests.AgentStreamRequest;
import com.anduril.resources.tasks.requests.GetTaskRequest;
import com.anduril.resources.tasks.requests.TaskCreation;
import com.anduril.resources.tasks.requests.TaskQuery;
import com.anduril.resources.tasks.requests.TaskStatusUpdate;
+import com.anduril.resources.tasks.requests.TaskStreamRequest;
+import com.anduril.resources.tasks.types.StreamAsAgentResponse;
+import com.anduril.resources.tasks.types.StreamTasksResponse;
import com.anduril.types.AgentRequest;
import com.anduril.types.Task;
import com.anduril.types.TaskQueryResults;
@@ -541,6 +547,109 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
return future;
}
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public CompletableFuture>> streamTasks() {
+ return streamTasks(TaskStreamRequest.builder().build());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public CompletableFuture>> streamTasks(
+ RequestOptions requestOptions) {
+ return streamTasks(TaskStreamRequest.builder().build(), requestOptions);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public CompletableFuture>> streamTasks(
+ TaskStreamRequest request) {
+ return streamTasks(request, null);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
This method creates a persistent connection from Tasks API to an agent, allowing the server
@@ -696,4 +805,152 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
});
return future;
}
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public CompletableFuture>> streamAsAgent() {
+ return streamAsAgent(AgentStreamRequest.builder().build());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public CompletableFuture>> streamAsAgent(
+ RequestOptions requestOptions) {
+ return streamAsAgent(AgentStreamRequest.builder().build(), requestOptions);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public CompletableFuture>> streamAsAgent(
+ AgentStreamRequest request) {
+ return streamAsAgent(request, null);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public CompletableFuture> streamTasks() {
+ return this.rawClient.streamTasks().thenApply(response -> response.body());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public CompletableFuture> streamTasks(RequestOptions requestOptions) {
+ return this.rawClient.streamTasks(requestOptions).thenApply(response -> response.body());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public CompletableFuture> streamTasks(TaskStreamRequest request) {
+ return this.rawClient.streamTasks(request).thenApply(response -> response.body());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public CompletableFuture> streamTasks(
+ TaskStreamRequest request, RequestOptions requestOptions) {
+ return this.rawClient.streamTasks(request, requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Establishes a server streaming connection that delivers tasks to taskable agents for execution.
*
This method creates a persistent connection from Tasks API to an agent, allowing the server
@@ -356,4 +397,85 @@ public CompletableFuture listenAsAgent(AgentListener request) {
public CompletableFuture listenAsAgent(AgentListener request, RequestOptions requestOptions) {
return this.rawClient.listenAsAgent(request, requestOptions).thenApply(response -> response.body());
}
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public CompletableFuture> streamAsAgent() {
+ return this.rawClient.streamAsAgent().thenApply(response -> response.body());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public CompletableFuture> streamAsAgent(RequestOptions requestOptions) {
+ return this.rawClient.streamAsAgent(requestOptions).thenApply(response -> response.body());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public CompletableFuture> streamAsAgent(AgentStreamRequest request) {
+ return this.rawClient.streamAsAgent(request).thenApply(response -> response.body());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public LatticeHttpResponse> streamTasks() {
+ return streamTasks(TaskStreamRequest.builder().build());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public LatticeHttpResponse> streamTasks(RequestOptions requestOptions) {
+ return streamTasks(TaskStreamRequest.builder().build(), requestOptions);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public LatticeHttpResponse> streamTasks(TaskStreamRequest request) {
+ return streamTasks(request, null);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
This method creates a persistent connection from Tasks API to an agent, allowing the server
@@ -596,4 +686,132 @@ public LatticeHttpResponse listenAsAgent(AgentListener request, Re
throw new LatticeException("Network error executing HTTP request", e);
}
}
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public LatticeHttpResponse> streamAsAgent() {
+ return streamAsAgent(AgentStreamRequest.builder().build());
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public LatticeHttpResponse> streamAsAgent(RequestOptions requestOptions) {
+ return streamAsAgent(AgentStreamRequest.builder().build(), requestOptions);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public LatticeHttpResponse> streamAsAgent(AgentStreamRequest request) {
+ return streamAsAgent(request, null);
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public Iterable streamTasks() {
+ return this.rawClient.streamTasks().body();
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public Iterable streamTasks(RequestOptions requestOptions) {
+ return this.rawClient.streamTasks(requestOptions).body();
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public Iterable streamTasks(TaskStreamRequest request) {
+ return this.rawClient.streamTasks(request).body();
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers task updates in real-time using Server-Sent Events (SSE).
+ *
The stream delivers all existing non-terminal tasks when first connected, followed by real-time
+ * updates for task creation and status changes. Additionally, heartbeat messages are sent periodically to maintain the connection.
+ */
+ public Iterable streamTasks(TaskStreamRequest request, RequestOptions requestOptions) {
+ return this.rawClient.streamTasks(request, requestOptions).body();
+ }
+
/**
* Establishes a server streaming connection that delivers tasks to taskable agents for execution.
*
This method creates a persistent connection from Tasks API to an agent, allowing the server
@@ -354,4 +394,84 @@ public AgentRequest listenAsAgent(AgentListener request) {
public AgentRequest listenAsAgent(AgentListener request, RequestOptions requestOptions) {
return this.rawClient.listenAsAgent(request, requestOptions).body();
}
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public Iterable streamAsAgent() {
+ return this.rawClient.streamAsAgent().body();
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public Iterable streamAsAgent(RequestOptions requestOptions) {
+ return this.rawClient.streamAsAgent(requestOptions).body();
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public Iterable streamAsAgent(AgentStreamRequest request) {
+ return this.rawClient.streamAsAgent(request).body();
+ }
+
+ /**
+ * Establishes a server streaming connection that delivers tasks to taskable agents for execution
+ * using Server-Sent Events (SSE).
+ *
This method creates a connection from the Tasks API to an agent that streams relevant tasks to the listener agent. The agent receives a stream of tasks that match the entities specified by the tasks' selector criteria.
+ *
The stream delivers three types of requests:
+ *
+ *
ExecuteRequest: Contains a new task for the agent to execute
+ *
CancelRequest: Indicates a task should be canceled
+ *
CompleteRequest: Indicates a task should be completed
+ *
+ *
Additionally, heartbeat messages are sent periodically to maintain the connection.
+ *
This is recommended method for taskable agents to receive and process tasks in real-time.
+ * Agents should maintain connection to this stream and process incoming tasks according to their capabilities.
+ *
When an agent receives a task, it should update the task status using the UpdateStatus endpoint
+ * to provide progress information back to Tasks API.
+ */
+ public Iterable streamAsAgent(AgentStreamRequest request, RequestOptions requestOptions) {
+ return this.rawClient.streamAsAgent(request, requestOptions).body();
+ }
}
diff --git a/src/main/java/com/anduril/resources/tasks/requests/AgentStreamRequest.java b/src/main/java/com/anduril/resources/tasks/requests/AgentStreamRequest.java
new file mode 100644
index 0000000..69c1e8f
--- /dev/null
+++ b/src/main/java/com/anduril/resources/tasks/requests/AgentStreamRequest.java
@@ -0,0 +1,133 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.anduril.resources.tasks.requests;
+
+import com.anduril.core.ObjectMappers;
+import com.anduril.types.EntityIdsSelector;
+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.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+@JsonInclude(JsonInclude.Include.NON_ABSENT)
+@JsonDeserialize(builder = AgentStreamRequest.Builder.class)
+public final class AgentStreamRequest {
+ private final Optional agentSelector;
+
+ private final Optional heartbeatIntervalMs;
+
+ private final Map additionalProperties;
+
+ private AgentStreamRequest(
+ Optional agentSelector,
+ Optional heartbeatIntervalMs,
+ Map additionalProperties) {
+ this.agentSelector = agentSelector;
+ this.heartbeatIntervalMs = heartbeatIntervalMs;
+ this.additionalProperties = additionalProperties;
+ }
+
+ /**
+ * @return The selector criteria to determine which tasks the agent receives.
+ */
+ @JsonProperty("agentSelector")
+ public Optional getAgentSelector() {
+ return agentSelector;
+ }
+
+ /**
+ * @return The time interval, defined in seconds, that determines the frequency at which to send heartbeat events. Defaults to 30s.
+ */
+ @JsonProperty("heartbeatIntervalMs")
+ public Optional getHeartbeatIntervalMs() {
+ return heartbeatIntervalMs;
+ }
+
+ @java.lang.Override
+ public boolean equals(Object other) {
+ if (this == other) return true;
+ return other instanceof AgentStreamRequest && equalTo((AgentStreamRequest) other);
+ }
+
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ private boolean equalTo(AgentStreamRequest other) {
+ return agentSelector.equals(other.agentSelector) && heartbeatIntervalMs.equals(other.heartbeatIntervalMs);
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ return Objects.hash(this.agentSelector, this.heartbeatIntervalMs);
+ }
+
+ @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 agentSelector = Optional.empty();
+
+ private Optional heartbeatIntervalMs = Optional.empty();
+
+ @JsonAnySetter
+ private Map additionalProperties = new HashMap<>();
+
+ private Builder() {}
+
+ public Builder from(AgentStreamRequest other) {
+ agentSelector(other.getAgentSelector());
+ heartbeatIntervalMs(other.getHeartbeatIntervalMs());
+ return this;
+ }
+
+ /**
+ *