Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .sdk-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.9.1
v2.11.1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>ai.reveng</groupId>
<artifactId>sdk</artifactId>
<version>2.9.1</version>
<version>2.11.1</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -31,7 +31,7 @@ repositories {
}

dependencies {
implementation "ai.reveng:sdk:2.9.1"
implementation "ai.reveng:sdk:2.11.1"
}
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'

group = 'ai.reveng'
version = '2.9.1'
version = '2.11.1'



Expand Down Expand Up @@ -171,7 +171,7 @@ mavenPublishing {
publishToMavenCentral(true)
signAllPublications()

coordinates("ai.reveng", "sdk", "2.9.1")
coordinates("ai.reveng", "sdk", "2.11.1")

pom {
name = "sdk"
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "ai.reveng",
name := "sdk",
version := "2.9.1",
version := "2.11.1",
scalaVersion := "2.11.12",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
Expand Down
1 change: 1 addition & 0 deletions docs/Basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
|**creation** | **OffsetDateTime** | When the binary was uploaded | |
|**sha256Hash** | **String** | The hash of the binary uploaded | |
|**modelName** | **String** | The model name used for analysis | |
|**modelId** | **Integer** | The model ID used for analysis | |
|**ownerUsername** | **String** | The name of the owner of the binary | |
|**analysisScope** | **String** | The scope of the analysis | |
|**isOwner** | **Boolean** | Whether the current user is the owner | |
Expand Down
4 changes: 2 additions & 2 deletions docs/FunctionRename.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**newName** | **String** | The new name for the function | [optional] |
|**newMangledName** | **String** | | [optional] |
|**newName** | **String** | The new name for the function | |
|**newMangledName** | **String** | The new mangled name for the function | |



6 changes: 3 additions & 3 deletions docs/FunctionRenameMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**functionId** | **Integer** | The ID of the function to rename | |
|**newName** | **String** | The new name for the function | [optional] |
|**newMangledName** | **String** | | [optional] |
|**functionId** | **Long** | The ID of the function to rename | |
|**newName** | **String** | The new name for the function | |
|**newMangledName** | **String** | The new mangled name for the function | |



2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>sdk</artifactId>
<packaging>jar</packaging>
<name>sdk</name>
<version>2.9.1</version>
<version>2.11.1</version>
<url>https://github.com/RevEngAI/sdk-java</url>
<description>Java SDK for the RevEng.AI API</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/reveng/invoker/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("OpenAPI-Generator/2.9.1/java");
setUserAgent("OpenAPI-Generator/2.11.1/java");

authentications = new HashMap<String, Authentication>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/reveng/invoker/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Configuration {
public static final String VERSION = "2.9.1";
public static final String VERSION = "2.11.1";

private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
Expand Down
32 changes: 29 additions & 3 deletions src/main/java/ai/reveng/model/Basic.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public class Basic {
@javax.annotation.Nonnull
private String modelName;

public static final String SERIALIZED_NAME_MODEL_ID = "model_id";
@SerializedName(SERIALIZED_NAME_MODEL_ID)
@javax.annotation.Nonnull
private Integer modelId;

public static final String SERIALIZED_NAME_OWNER_USERNAME = "owner_username";
@SerializedName(SERIALIZED_NAME_OWNER_USERNAME)
@javax.annotation.Nonnull
Expand Down Expand Up @@ -210,6 +215,25 @@ public void setModelName(@javax.annotation.Nonnull String modelName) {
}


public Basic modelId(@javax.annotation.Nonnull Integer modelId) {
this.modelId = modelId;
return this;
}

/**
* The model ID used for analysis
* @return modelId
*/
@javax.annotation.Nonnull
public Integer getModelId() {
return modelId;
}

public void setModelId(@javax.annotation.Nonnull Integer modelId) {
this.modelId = modelId;
}


public Basic ownerUsername(@javax.annotation.Nonnull String ownerUsername) {
this.ownerUsername = ownerUsername;
return this;
Expand Down Expand Up @@ -402,6 +426,7 @@ public boolean equals(Object o) {
Objects.equals(this.creation, basic.creation) &&
Objects.equals(this.sha256Hash, basic.sha256Hash) &&
Objects.equals(this.modelName, basic.modelName) &&
Objects.equals(this.modelId, basic.modelId) &&
Objects.equals(this.ownerUsername, basic.ownerUsername) &&
Objects.equals(this.analysisScope, basic.analysisScope) &&
Objects.equals(this.isOwner, basic.isOwner) &&
Expand All @@ -414,7 +439,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(binaryName, binarySize, creation, sha256Hash, modelName, ownerUsername, analysisScope, isOwner, debug, functionCount, isAdvanced, baseAddress, additionalProperties);
return Objects.hash(binaryName, binarySize, creation, sha256Hash, modelName, modelId, ownerUsername, analysisScope, isOwner, debug, functionCount, isAdvanced, baseAddress, additionalProperties);
}

@Override
Expand All @@ -426,6 +451,7 @@ public String toString() {
sb.append(" creation: ").append(toIndentedString(creation)).append("\n");
sb.append(" sha256Hash: ").append(toIndentedString(sha256Hash)).append("\n");
sb.append(" modelName: ").append(toIndentedString(modelName)).append("\n");
sb.append(" modelId: ").append(toIndentedString(modelId)).append("\n");
sb.append(" ownerUsername: ").append(toIndentedString(ownerUsername)).append("\n");
sb.append(" analysisScope: ").append(toIndentedString(analysisScope)).append("\n");
sb.append(" isOwner: ").append(toIndentedString(isOwner)).append("\n");
Expand Down Expand Up @@ -455,10 +481,10 @@ private String toIndentedString(Object o) {

static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>(Arrays.asList("binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "owner_username", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced", "base_address"));
openapiFields = new HashSet<String>(Arrays.asList("binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "model_id", "owner_username", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced", "base_address"));

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>(Arrays.asList("binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "owner_username", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced", "base_address"));
openapiRequiredFields = new HashSet<String>(Arrays.asList("binary_name", "binary_size", "creation", "sha_256_hash", "model_name", "model_id", "owner_username", "analysis_scope", "is_owner", "debug", "function_count", "is_advanced", "base_address"));
}

/**
Expand Down
45 changes: 20 additions & 25 deletions src/main/java/ai/reveng/model/FunctionRename.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Arrays;
import org.openapitools.jackson.nullable.JsonNullable;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
Expand Down Expand Up @@ -54,18 +53,18 @@
public class FunctionRename {
public static final String SERIALIZED_NAME_NEW_NAME = "new_name";
@SerializedName(SERIALIZED_NAME_NEW_NAME)
@javax.annotation.Nullable
private String newName = "";
@javax.annotation.Nonnull
private String newName;

public static final String SERIALIZED_NAME_NEW_MANGLED_NAME = "new_mangled_name";
@SerializedName(SERIALIZED_NAME_NEW_MANGLED_NAME)
@javax.annotation.Nullable
@javax.annotation.Nonnull
private String newMangledName;

public FunctionRename() {
}

public FunctionRename newName(@javax.annotation.Nullable String newName) {
public FunctionRename newName(@javax.annotation.Nonnull String newName) {
this.newName = newName;
return this;
}
Expand All @@ -74,31 +73,31 @@ public FunctionRename newName(@javax.annotation.Nullable String newName) {
* The new name for the function
* @return newName
*/
@javax.annotation.Nullable
@javax.annotation.Nonnull
public String getNewName() {
return newName;
}

public void setNewName(@javax.annotation.Nullable String newName) {
public void setNewName(@javax.annotation.Nonnull String newName) {
this.newName = newName;
}


public FunctionRename newMangledName(@javax.annotation.Nullable String newMangledName) {
public FunctionRename newMangledName(@javax.annotation.Nonnull String newMangledName) {
this.newMangledName = newMangledName;
return this;
}

/**
* Get newMangledName
* The new mangled name for the function
* @return newMangledName
*/
@javax.annotation.Nullable
@javax.annotation.Nonnull
public String getNewMangledName() {
return newMangledName;
}

public void setNewMangledName(@javax.annotation.Nullable String newMangledName) {
public void setNewMangledName(@javax.annotation.Nonnull String newMangledName) {
this.newMangledName = newMangledName;
}

Expand Down Expand Up @@ -162,22 +161,11 @@ public boolean equals(Object o) {
Objects.equals(this.additionalProperties, functionRename.additionalProperties);
}

private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}

@Override
public int hashCode() {
return Objects.hash(newName, newMangledName, additionalProperties);
}

private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -209,7 +197,7 @@ private String toIndentedString(Object o) {
openapiFields = new HashSet<String>(Arrays.asList("new_name", "new_mangled_name"));

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>(0);
openapiRequiredFields = new HashSet<String>(Arrays.asList("new_name", "new_mangled_name"));
}

/**
Expand All @@ -224,11 +212,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field(s) %s in FunctionRename is not found in the empty JSON string", FunctionRename.openapiRequiredFields.toString()));
}
}

// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : FunctionRename.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("new_name") != null && !jsonObj.get("new_name").isJsonNull()) && !jsonObj.get("new_name").isJsonPrimitive()) {
if (!jsonObj.get("new_name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `new_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_name").toString()));
}
if ((jsonObj.get("new_mangled_name") != null && !jsonObj.get("new_mangled_name").isJsonNull()) && !jsonObj.get("new_mangled_name").isJsonPrimitive()) {
if (!jsonObj.get("new_mangled_name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected the field `new_mangled_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("new_mangled_name").toString()));
}
}
Expand Down
Loading