From 33960a136715e726aa96824b0bff00594c1a5682 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 23 Jan 2026 17:14:15 +0000 Subject: [PATCH] SDK regeneration --- .fern/metadata.json | 6 +- README.md | 26 +++- build.gradle | 16 +-- reference.md | 12 +- src/main/java/com/anduril/AsyncLattice.java | 18 +-- .../java/com/anduril/AsyncLatticeBuilder.java | 127 +----------------- src/main/java/com/anduril/Lattice.java | 18 +-- src/main/java/com/anduril/LatticeBuilder.java | 127 +----------------- .../java/com/anduril/core/ClientOptions.java | 4 +- .../com/anduril/core/OAuthTokenSupplier.java | 10 +- .../AsyncOauthClient.java} | 20 +-- .../AsyncRawOauthClient.java} | 14 +- .../OauthClient.java} | 20 +-- .../RawOauthClient.java} | 14 +- .../requests/GetTokenRequest.java | 2 +- .../types/GetTokenResponse.java | 2 +- .../anduril/types/AgentStreamHeartbeat.java | 125 ----------------- .../types/AgentStreamHeartbeatData.java | 101 -------------- .../types/AgentStreamHeartbeatEvent.java | 75 ----------- .../anduril/types/EntityStreamHeartbeat.java | 17 ++- .../com/anduril/types/HeartbeatObject.java | 17 ++- .../com/anduril/types/IHeartbeatObject.java | 3 +- 22 files changed, 116 insertions(+), 658 deletions(-) rename src/main/java/com/anduril/resources/{oauth2/AsyncOAuth2Client.java => oauth/AsyncOauthClient.java} (60%) rename src/main/java/com/anduril/resources/{oauth2/AsyncRawOAuth2Client.java => oauth/AsyncRawOauthClient.java} (92%) rename src/main/java/com/anduril/resources/{oauth2/OAuth2Client.java => oauth/OauthClient.java} (56%) rename src/main/java/com/anduril/resources/{oauth2/RawOAuth2Client.java => oauth/RawOauthClient.java} (90%) rename src/main/java/com/anduril/resources/{oauth2 => oauth}/requests/GetTokenRequest.java (98%) rename src/main/java/com/anduril/resources/{oauth2 => oauth}/types/GetTokenResponse.java (99%) delete mode 100644 src/main/java/com/anduril/types/AgentStreamHeartbeat.java delete mode 100644 src/main/java/com/anduril/types/AgentStreamHeartbeatData.java delete mode 100644 src/main/java/com/anduril/types/AgentStreamHeartbeatEvent.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 3da9bce5..d0264c45 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,10 +1,10 @@ { - "cliVersion": "3.40.0", + "cliVersion": "3.49.5", "generatorName": "fernapi/fern-java-sdk", - "generatorVersion": "3.29.1", + "generatorVersion": "3.27.6", "generatorConfig": { "client-class-name": "Lattice", "package-prefix": "com.anduril" }, - "sdkVersion": "5.1.0" + "sdkVersion": "6.0.0" } \ No newline at end of file diff --git a/README.md b/README.md index 393fa291..78f400d5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Add the dependency in your `pom.xml` file: com.anduril lattice-sdk - 5.1.0 + 6.0.0 ``` @@ -93,6 +93,30 @@ This SDK supports two authentication methods: If you already have a valid access token, you can use it directly: +```java +Lattice client = Lattice.withToken("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.withCredentials("client-id", "client-secret") + .url("https://api.example.com") + .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") diff --git a/build.gradle b/build.gradle index 6a89afab..04f3ed41 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ java { group = 'com.anduril' -version = '5.1.0' +version = '6.0.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,21 +78,21 @@ publishing { maven(MavenPublication) { groupId = 'com.anduril' artifactId = 'lattice-sdk' - version = '5.1.0' + version = '6.0.0' from components.java pom { - name = 'Anduril Industries, Inc.' - description = 'Anduril Lattice SDK for Java' - url = 'https://developer.anduril.com' + name = 'anduril' + description = 'The official SDK of anduril' + url = 'https://buildwithfern.com' licenses { license { - name = 'Anduril Lattice Software Development Kit License Agreement' + name = 'Custom License (LICENSE)' } } developers { developer { - name = 'Anduril Industries, Inc.' - email = 'lattice-developers@anduril.com' + name = 'anduril' + email = 'developers@anduril.com' } } scm { diff --git a/reference.md b/reference.md index e8ee820b..cccf3789 100644 --- a/reference.md +++ b/reference.md @@ -345,7 +345,7 @@ client.entities().longPollEntityEvents( -
client.entities.streamEntities(request) -> Iterable&lt;StreamEntitiesResponse&gt; +
client.entities.streamEntities(request) -> Iterable<StreamEntitiesResponse>
@@ -914,7 +914,7 @@ client.tasks().listenAsAgent(
## Objects -
client.objects.listObjects() -> SyncPagingIterable&lt;PathMetadata&gt; +
client.objects.listObjects() -> SyncPagingIterable<PathMetadata>
@@ -1243,8 +1243,8 @@ client.objects().getObjectMetadata(
-## OAuth2 -
client.oAuth2.getToken(request) -> GetTokenResponse +## oauth +
client.oauth.getToken(request) -> GetTokenResponse
@@ -1256,7 +1256,7 @@ client.objects().getObjectMetadata(
-Support the client credentials authorization flow +Gets a new short-lived token using the specified client credentials
@@ -1271,7 +1271,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 cf780698..ddf0cd07 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(); } /** @@ -64,12 +64,4 @@ public static AsyncLatticeBuilder._TokenAuth withToken(String token) { public static AsyncLatticeBuilder._CredentialsAuth withCredentials(String clientId, String clientSecret) { return AsyncLatticeBuilder.withCredentials(clientId, clientSecret); } - - /** - * Creates a new client builder. - * @return A builder for configuring and creating the client - */ - public static AsyncLatticeBuilder._Builder builder() { - return AsyncLatticeBuilder.builder(); - } } diff --git a/src/main/java/com/anduril/AsyncLatticeBuilder.java b/src/main/java/com/anduril/AsyncLatticeBuilder.java index 2696fef4..097e28c0 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; @@ -47,16 +47,6 @@ public static _CredentialsAuth withCredentials(String clientId, String clientSec return new _CredentialsAuth(clientId, clientSecret); } - /** - * Creates a new client builder. - * Use this method to start building a client with the classic builder pattern. - * - * @return A builder for configuring authentication and creating the client - */ - public static _Builder builder() { - return new _Builder(); - } - public AsyncLatticeBuilder environment(Environment environment) { this.environment = environment; return this; @@ -249,7 +239,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) @@ -258,117 +248,4 @@ public AsyncLattice build() { return new AsyncLattice(finalOptions); } } - - public static final class _Builder { - private Environment environment; - - private Optional timeout = Optional.empty(); - - private Optional maxRetries = Optional.empty(); - - private OkHttpClient httpClient; - - private final Map headers = new HashMap<>(); - - public _Builder environment(Environment environment) { - this.environment = environment; - return this; - } - - public _Builder url(String url) { - this.environment = Environment.custom(url); - return this; - } - - /** - * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. - */ - public _Builder timeout(int timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - /** - * Sets the maximum number of retries for the client. Defaults to 2 retries. - */ - public _Builder maxRetries(int maxRetries) { - this.maxRetries = Optional.of(maxRetries); - return this; - } - - /** - * Sets the underlying OkHttp client - */ - public _Builder httpClient(OkHttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /** - * Add a custom header to be sent with all requests. - * @param name The header name - * @param value The header value - * @return This builder for method chaining - */ - public _Builder addHeader(String name, String value) { - this.headers.put(name, value); - return this; - } - - /** - * Configure the client to use a pre-generated access token for authentication. - * Use this when you already have a valid access token and want to bypass - * the OAuth client credentials flow. - * - * @param token The access token to use for Authorization header - * @return A builder configured for token authentication - */ - public _TokenAuth token(String token) { - _TokenAuth auth = new _TokenAuth(token); - if (this.environment != null) { - auth.environment = this.environment; - } - if (this.timeout.isPresent()) { - auth.timeout(this.timeout.get()); - } - if (this.maxRetries.isPresent()) { - auth.maxRetries(this.maxRetries.get()); - } - if (this.httpClient != null) { - auth.httpClient(this.httpClient); - } - for (Map.Entry header : this.headers.entrySet()) { - auth.addHeader(header.getKey(), header.getValue()); - } - return auth; - } - - /** - * Configure the client to use OAuth client credentials for authentication. - * The builder will automatically handle token acquisition and refresh. - * - * @param clientId The OAuth client ID - * @param clientSecret The OAuth client secret - * @return A builder configured for OAuth client credentials authentication - */ - public _CredentialsAuth credentials(String clientId, String clientSecret) { - _CredentialsAuth auth = new _CredentialsAuth(clientId, clientSecret); - if (this.environment != null) { - auth.environment = this.environment; - } - if (this.timeout.isPresent()) { - auth.timeout(this.timeout.get()); - } - if (this.maxRetries.isPresent()) { - auth.maxRetries(this.maxRetries.get()); - } - if (this.httpClient != null) { - auth.httpClient(this.httpClient); - } - for (Map.Entry header : this.headers.entrySet()) { - auth.addHeader(header.getKey(), header.getValue()); - } - return auth; - } - } } diff --git a/src/main/java/com/anduril/Lattice.java b/src/main/java/com/anduril/Lattice.java index eb743ff1..886ea3ce 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(); } /** @@ -64,12 +64,4 @@ public static LatticeBuilder._TokenAuth withToken(String token) { public static LatticeBuilder._CredentialsAuth withCredentials(String clientId, String clientSecret) { return LatticeBuilder.withCredentials(clientId, clientSecret); } - - /** - * Creates a new client builder. - * @return A builder for configuring and creating the client - */ - public static LatticeBuilder._Builder builder() { - return LatticeBuilder.builder(); - } } diff --git a/src/main/java/com/anduril/LatticeBuilder.java b/src/main/java/com/anduril/LatticeBuilder.java index dcfbedd9..7ce1b859 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; @@ -47,16 +47,6 @@ public static _CredentialsAuth withCredentials(String clientId, String clientSec return new _CredentialsAuth(clientId, clientSecret); } - /** - * Creates a new client builder. - * Use this method to start building a client with the classic builder pattern. - * - * @return A builder for configuring authentication and creating the client - */ - public static _Builder builder() { - return new _Builder(); - } - public LatticeBuilder environment(Environment environment) { this.environment = environment; return this; @@ -249,7 +239,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) @@ -258,117 +248,4 @@ public Lattice build() { return new Lattice(finalOptions); } } - - public static final class _Builder { - private Environment environment; - - private Optional timeout = Optional.empty(); - - private Optional maxRetries = Optional.empty(); - - private OkHttpClient httpClient; - - private final Map headers = new HashMap<>(); - - public _Builder environment(Environment environment) { - this.environment = environment; - return this; - } - - public _Builder url(String url) { - this.environment = Environment.custom(url); - return this; - } - - /** - * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. - */ - public _Builder timeout(int timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - /** - * Sets the maximum number of retries for the client. Defaults to 2 retries. - */ - public _Builder maxRetries(int maxRetries) { - this.maxRetries = Optional.of(maxRetries); - return this; - } - - /** - * Sets the underlying OkHttp client - */ - public _Builder httpClient(OkHttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /** - * Add a custom header to be sent with all requests. - * @param name The header name - * @param value The header value - * @return This builder for method chaining - */ - public _Builder addHeader(String name, String value) { - this.headers.put(name, value); - return this; - } - - /** - * Configure the client to use a pre-generated access token for authentication. - * Use this when you already have a valid access token and want to bypass - * the OAuth client credentials flow. - * - * @param token The access token to use for Authorization header - * @return A builder configured for token authentication - */ - public _TokenAuth token(String token) { - _TokenAuth auth = new _TokenAuth(token); - if (this.environment != null) { - auth.environment = this.environment; - } - if (this.timeout.isPresent()) { - auth.timeout(this.timeout.get()); - } - if (this.maxRetries.isPresent()) { - auth.maxRetries(this.maxRetries.get()); - } - if (this.httpClient != null) { - auth.httpClient(this.httpClient); - } - for (Map.Entry header : this.headers.entrySet()) { - auth.addHeader(header.getKey(), header.getValue()); - } - return auth; - } - - /** - * Configure the client to use OAuth client credentials for authentication. - * The builder will automatically handle token acquisition and refresh. - * - * @param clientId The OAuth client ID - * @param clientSecret The OAuth client secret - * @return A builder configured for OAuth client credentials authentication - */ - public _CredentialsAuth credentials(String clientId, String clientSecret) { - _CredentialsAuth auth = new _CredentialsAuth(clientId, clientSecret); - if (this.environment != null) { - auth.environment = this.environment; - } - if (this.timeout.isPresent()) { - auth.timeout(this.timeout.get()); - } - if (this.maxRetries.isPresent()) { - auth.maxRetries(this.maxRetries.get()); - } - if (this.httpClient != null) { - auth.httpClient(this.httpClient); - } - for (Map.Entry header : this.headers.entrySet()) { - auth.addHeader(header.getKey(), header.getValue()); - } - return auth; - } - } } diff --git a/src/main/java/com/anduril/core/ClientOptions.java b/src/main/java/com/anduril/core/ClientOptions.java index 4e4b62c5..c68c7a38 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/6.0.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", "6.0.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 f114a00e..d6647e50 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 7b9861a5..70de3549 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 0a76d367..e4405824 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 5da96057..47fe1eef 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 1f221ed8..abb5ea07 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 11e17588..83a32432 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 1c52a01c..68c7e2a8 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/types/AgentStreamHeartbeat.java b/src/main/java/com/anduril/types/AgentStreamHeartbeat.java deleted file mode 100644 index a0dfb963..00000000 --- a/src/main/java/com/anduril/types/AgentStreamHeartbeat.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.anduril.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.databind.annotation.JsonDeserialize; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AgentStreamHeartbeat.Builder.class) -public final class AgentStreamHeartbeat { - private final AgentStreamHeartbeatEvent event; - - private final AgentStreamHeartbeatData data; - - private final Map additionalProperties; - - private AgentStreamHeartbeat( - AgentStreamHeartbeatEvent event, AgentStreamHeartbeatData data, Map additionalProperties) { - this.event = event; - this.data = data; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("event") - public AgentStreamHeartbeatEvent getEvent() { - return event; - } - - @JsonProperty("data") - public AgentStreamHeartbeatData getData() { - return data; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AgentStreamHeartbeat && equalTo((AgentStreamHeartbeat) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AgentStreamHeartbeat other) { - return event.equals(other.event) && data.equals(other.data); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.event, this.data); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static EventStage builder() { - return new Builder(); - } - - public interface EventStage { - DataStage event(@NotNull AgentStreamHeartbeatEvent event); - - Builder from(AgentStreamHeartbeat other); - } - - public interface DataStage { - _FinalStage data(@NotNull AgentStreamHeartbeatData data); - } - - public interface _FinalStage { - AgentStreamHeartbeat build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements EventStage, DataStage, _FinalStage { - private AgentStreamHeartbeatEvent event; - - private AgentStreamHeartbeatData data; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(AgentStreamHeartbeat other) { - event(other.getEvent()); - data(other.getData()); - return this; - } - - @java.lang.Override - @JsonSetter("event") - public DataStage event(@NotNull AgentStreamHeartbeatEvent event) { - this.event = Objects.requireNonNull(event, "event must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("data") - public _FinalStage data(@NotNull AgentStreamHeartbeatData data) { - this.data = Objects.requireNonNull(data, "data must not be null"); - return this; - } - - @java.lang.Override - public AgentStreamHeartbeat build() { - return new AgentStreamHeartbeat(event, data, additionalProperties); - } - } -} diff --git a/src/main/java/com/anduril/types/AgentStreamHeartbeatData.java b/src/main/java/com/anduril/types/AgentStreamHeartbeatData.java deleted file mode 100644 index a1671d3e..00000000 --- a/src/main/java/com/anduril/types/AgentStreamHeartbeatData.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.anduril.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.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = AgentStreamHeartbeatData.Builder.class) -public final class AgentStreamHeartbeatData { - private final Optional timestamp; - - private final Map additionalProperties; - - private AgentStreamHeartbeatData(Optional timestamp, Map additionalProperties) { - this.timestamp = timestamp; - this.additionalProperties = additionalProperties; - } - - /** - * @return The timestamp at which the heartbeat message was sent. - */ - @JsonProperty("timestamp") - public Optional getTimestamp() { - return timestamp; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof AgentStreamHeartbeatData && equalTo((AgentStreamHeartbeatData) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(AgentStreamHeartbeatData other) { - return timestamp.equals(other.timestamp); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.timestamp); - } - - @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 timestamp = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(AgentStreamHeartbeatData other) { - timestamp(other.getTimestamp()); - return this; - } - - /** - *

The timestamp at which the heartbeat message was sent.

- */ - @JsonSetter(value = "timestamp", nulls = Nulls.SKIP) - public Builder timestamp(Optional timestamp) { - this.timestamp = timestamp; - return this; - } - - public Builder timestamp(String timestamp) { - this.timestamp = Optional.ofNullable(timestamp); - return this; - } - - public AgentStreamHeartbeatData build() { - return new AgentStreamHeartbeatData(timestamp, additionalProperties); - } - } -} diff --git a/src/main/java/com/anduril/types/AgentStreamHeartbeatEvent.java b/src/main/java/com/anduril/types/AgentStreamHeartbeatEvent.java deleted file mode 100644 index 079c042e..00000000 --- a/src/main/java/com/anduril/types/AgentStreamHeartbeatEvent.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.anduril.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public final class AgentStreamHeartbeatEvent { - public static final AgentStreamHeartbeatEvent HEARTBEAT = - new AgentStreamHeartbeatEvent(Value.HEARTBEAT, "heartbeat"); - - private final Value value; - - private final String string; - - AgentStreamHeartbeatEvent(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 AgentStreamHeartbeatEvent - && this.string.equals(((AgentStreamHeartbeatEvent) other).string)); - } - - @java.lang.Override - public int hashCode() { - return this.string.hashCode(); - } - - public T visit(Visitor visitor) { - switch (value) { - case HEARTBEAT: - return visitor.visitHeartbeat(); - case UNKNOWN: - default: - return visitor.visitUnknown(string); - } - } - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static AgentStreamHeartbeatEvent valueOf(String value) { - switch (value) { - case "heartbeat": - return HEARTBEAT; - default: - return new AgentStreamHeartbeatEvent(Value.UNKNOWN, value); - } - } - - public enum Value { - HEARTBEAT, - - UNKNOWN - } - - public interface Visitor { - T visitHeartbeat(); - - T visitUnknown(String unknownType); - } -} diff --git a/src/main/java/com/anduril/types/EntityStreamHeartbeat.java b/src/main/java/com/anduril/types/EntityStreamHeartbeat.java index b8980a29..c8d6c5fe 100644 --- a/src/main/java/com/anduril/types/EntityStreamHeartbeat.java +++ b/src/main/java/com/anduril/types/EntityStreamHeartbeat.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -21,21 +20,21 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EntityStreamHeartbeat.Builder.class) public final class EntityStreamHeartbeat implements IHeartbeatObject { - private final Optional timestamp; + private final Optional timestamp; private final Map additionalProperties; - private EntityStreamHeartbeat(Optional timestamp, Map additionalProperties) { + private EntityStreamHeartbeat(Optional timestamp, Map additionalProperties) { this.timestamp = timestamp; this.additionalProperties = additionalProperties; } /** - * @return timestamp of the heartbeat + * @return The timestamp at which the heartbeat message was sent. */ @JsonProperty("timestamp") @java.lang.Override - public Optional getTimestamp() { + public Optional getTimestamp() { return timestamp; } @@ -70,7 +69,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional timestamp = Optional.empty(); + private Optional timestamp = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -83,15 +82,15 @@ public Builder from(EntityStreamHeartbeat other) { } /** - *

timestamp of the heartbeat

+ *

The timestamp at which the heartbeat message was sent.

*/ @JsonSetter(value = "timestamp", nulls = Nulls.SKIP) - public Builder timestamp(Optional timestamp) { + public Builder timestamp(Optional timestamp) { this.timestamp = timestamp; return this; } - public Builder timestamp(OffsetDateTime timestamp) { + public Builder timestamp(String timestamp) { this.timestamp = Optional.ofNullable(timestamp); return this; } diff --git a/src/main/java/com/anduril/types/HeartbeatObject.java b/src/main/java/com/anduril/types/HeartbeatObject.java index 0581615e..664fc72f 100644 --- a/src/main/java/com/anduril/types/HeartbeatObject.java +++ b/src/main/java/com/anduril/types/HeartbeatObject.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -21,21 +20,21 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = HeartbeatObject.Builder.class) public final class HeartbeatObject implements IHeartbeatObject { - private final Optional timestamp; + private final Optional timestamp; private final Map additionalProperties; - private HeartbeatObject(Optional timestamp, Map additionalProperties) { + private HeartbeatObject(Optional timestamp, Map additionalProperties) { this.timestamp = timestamp; this.additionalProperties = additionalProperties; } /** - * @return timestamp of the heartbeat + * @return The timestamp at which the heartbeat message was sent. */ @JsonProperty("timestamp") @java.lang.Override - public Optional getTimestamp() { + public Optional getTimestamp() { return timestamp; } @@ -70,7 +69,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional timestamp = Optional.empty(); + private Optional timestamp = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -83,15 +82,15 @@ public Builder from(HeartbeatObject other) { } /** - *

timestamp of the heartbeat

+ *

The timestamp at which the heartbeat message was sent.

*/ @JsonSetter(value = "timestamp", nulls = Nulls.SKIP) - public Builder timestamp(Optional timestamp) { + public Builder timestamp(Optional timestamp) { this.timestamp = timestamp; return this; } - public Builder timestamp(OffsetDateTime timestamp) { + public Builder timestamp(String timestamp) { this.timestamp = Optional.ofNullable(timestamp); return this; } diff --git a/src/main/java/com/anduril/types/IHeartbeatObject.java b/src/main/java/com/anduril/types/IHeartbeatObject.java index 4cf8b3e8..1bea59a4 100644 --- a/src/main/java/com/anduril/types/IHeartbeatObject.java +++ b/src/main/java/com/anduril/types/IHeartbeatObject.java @@ -3,9 +3,8 @@ */ package com.anduril.types; -import java.time.OffsetDateTime; import java.util.Optional; public interface IHeartbeatObject { - Optional getTimestamp(); + Optional getTimestamp(); }