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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Add the dependency in your `pom.xml` file:
<dependency>
<groupId>com.anduril</groupId>
<artifactId>lattice-sdk</artifactId>
<version>3.1.0</version>
<version>4.0.0</version>
</dependency>
```

Expand Down Expand Up @@ -103,9 +103,9 @@ When the API returns a non-success status code (4xx or 5xx response), an API exc
```java
import com.anduril.core.AndurilApiApiException;

try {
try{
client.entities().longPollEntityEvents(...);
} catch (AndurilApiApiException e) {
} catch (AndurilApiApiException e){
// Do something with the API exception...
}
```
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ java {

group = 'com.anduril'

version = '3.1.0'
version = '4.0.0'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand Down Expand Up @@ -79,7 +79,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.anduril'
artifactId = 'lattice-sdk'
version = '3.1.0'
version = '4.0.0'
from components.java
pom {
name = 'Anduril Industries, Inc.'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/anduril/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ private ClientOptions(
this.headers.putAll(headers);
this.headers.putAll(new HashMap<String, String>() {
{
put("User-Agent", "com.anduril:lattice-sdk/3.1.0");
put("User-Agent", "com.anduril:lattice-sdk/4.0.0");
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.anduril.fern:api-sdk");
put("X-Fern-SDK-Version", "3.1.0");
put("X-Fern-SDK-Version", "4.0.0");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
99 changes: 34 additions & 65 deletions src/main/java/com/anduril/types/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,55 +13,40 @@
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = Status.Builder.class)
public final class Status {
private final Optional<Integer> code;
private final Optional<String> platformActivity;

private final Optional<String> message;

private final Optional<List<GoogleProtobufAny>> details;
private final Optional<String> role;

private final Map<String, Object> additionalProperties;

private Status(
Optional<Integer> code,
Optional<String> message,
Optional<List<GoogleProtobufAny>> details,
Map<String, Object> additionalProperties) {
this.code = code;
this.message = message;
this.details = details;
private Status(Optional<String> platformActivity, Optional<String> role, Map<String, Object> additionalProperties) {
this.platformActivity = platformActivity;
this.role = role;
this.additionalProperties = additionalProperties;
}

/**
* @return The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
* @return A string that describes the activity that the entity is performing.
* Examples include &quot;RECONNAISSANCE&quot;, &quot;INTERDICTION&quot;, &quot;RETURN TO BASE (RTB)&quot;, &quot;PREPARING FOR LAUNCH&quot;.
*/
@JsonProperty("code")
public Optional<Integer> getCode() {
return code;
@JsonProperty("platformActivity")
public Optional<String> getPlatformActivity() {
return platformActivity;
}

/**
* @return A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
* @return A human-readable string that describes the role the entity is currently performing. E.g. &quot;Team Member&quot;, &quot;Commander&quot;.
*/
@JsonProperty("message")
public Optional<String> getMessage() {
return message;
}

/**
* @return A list of messages that carry the error details. There is a common set of message types for APIs to use.
*/
@JsonProperty("details")
public Optional<List<GoogleProtobufAny>> getDetails() {
return details;
@JsonProperty("role")
public Optional<String> getRole() {
return role;
}

@java.lang.Override
Expand All @@ -76,12 +61,12 @@ public Map<String, Object> getAdditionalProperties() {
}

private boolean equalTo(Status other) {
return code.equals(other.code) && message.equals(other.message) && details.equals(other.details);
return platformActivity.equals(other.platformActivity) && role.equals(other.role);
}

@java.lang.Override
public int hashCode() {
return Objects.hash(this.code, this.message, this.details);
return Objects.hash(this.platformActivity, this.role);
}

@java.lang.Override
Expand All @@ -95,68 +80,52 @@ public static Builder builder() {

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder {
private Optional<Integer> code = Optional.empty();

private Optional<String> message = Optional.empty();
private Optional<String> platformActivity = Optional.empty();

private Optional<List<GoogleProtobufAny>> details = Optional.empty();
private Optional<String> role = Optional.empty();

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();

private Builder() {}

public Builder from(Status other) {
code(other.getCode());
message(other.getMessage());
details(other.getDetails());
return this;
}

/**
* <p>The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].</p>
*/
@JsonSetter(value = "code", nulls = Nulls.SKIP)
public Builder code(Optional<Integer> code) {
this.code = code;
return this;
}

public Builder code(Integer code) {
this.code = Optional.ofNullable(code);
platformActivity(other.getPlatformActivity());
role(other.getRole());
return this;
}

/**
* <p>A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.</p>
* <p>A string that describes the activity that the entity is performing.
* Examples include &quot;RECONNAISSANCE&quot;, &quot;INTERDICTION&quot;, &quot;RETURN TO BASE (RTB)&quot;, &quot;PREPARING FOR LAUNCH&quot;.</p>
*/
@JsonSetter(value = "message", nulls = Nulls.SKIP)
public Builder message(Optional<String> message) {
this.message = message;
@JsonSetter(value = "platformActivity", nulls = Nulls.SKIP)
public Builder platformActivity(Optional<String> platformActivity) {
this.platformActivity = platformActivity;
return this;
}

public Builder message(String message) {
this.message = Optional.ofNullable(message);
public Builder platformActivity(String platformActivity) {
this.platformActivity = Optional.ofNullable(platformActivity);
return this;
}

/**
* <p>A list of messages that carry the error details. There is a common set of message types for APIs to use.</p>
* <p>A human-readable string that describes the role the entity is currently performing. E.g. &quot;Team Member&quot;, &quot;Commander&quot;.</p>
*/
@JsonSetter(value = "details", nulls = Nulls.SKIP)
public Builder details(Optional<List<GoogleProtobufAny>> details) {
this.details = details;
@JsonSetter(value = "role", nulls = Nulls.SKIP)
public Builder role(Optional<String> role) {
this.role = role;
return this;
}

public Builder details(List<GoogleProtobufAny> details) {
this.details = Optional.ofNullable(details);
public Builder role(String role) {
this.role = Optional.ofNullable(role);
return this;
}

public Status build() {
return new Status(code, message, details, additionalProperties);
return new Status(platformActivity, role, additionalProperties);
}
}
}
Loading