diff --git a/.sdk-version b/.sdk-version index 7227c77..d6509f0 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v2.9.1 +v2.11.1 diff --git a/README.md b/README.md index 85c8ef9..62d2c0e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 2.9.1 + 2.11.1 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:2.9.1" + implementation "ai.reveng:sdk:2.11.1" } ``` diff --git a/build.gradle b/build.gradle index fc9febf..66a7e0f 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '2.9.1' +version = '2.11.1' @@ -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" diff --git a/build.sbt b/build.sbt index bf1e970..c23221b 100644 --- a/build.sbt +++ b/build.sbt @@ -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"), diff --git a/docs/Basic.md b/docs/Basic.md index bc48866..4494117 100644 --- a/docs/Basic.md +++ b/docs/Basic.md @@ -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 | | diff --git a/docs/FunctionRename.md b/docs/FunctionRename.md index c9498ce..f23802a 100644 --- a/docs/FunctionRename.md +++ b/docs/FunctionRename.md @@ -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 | | diff --git a/docs/FunctionRenameMap.md b/docs/FunctionRenameMap.md index cab6697..941dfc5 100644 --- a/docs/FunctionRenameMap.md +++ b/docs/FunctionRenameMap.md @@ -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 | | diff --git a/pom.xml b/pom.xml index b0cc289..a518ff5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 2.9.1 + 2.11.1 https://github.com/RevEngAI/sdk-java Java SDK for the RevEng.AI API diff --git a/src/main/java/ai/reveng/invoker/ApiClient.java b/src/main/java/ai/reveng/invoker/ApiClient.java index 3899c24..f0103dc 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -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(); } diff --git a/src/main/java/ai/reveng/invoker/Configuration.java b/src/main/java/ai/reveng/invoker/Configuration.java index 5351705..34b97e6 100644 --- a/src/main/java/ai/reveng/invoker/Configuration.java +++ b/src/main/java/ai/reveng/invoker/Configuration.java @@ -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 defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/src/main/java/ai/reveng/model/Basic.java b/src/main/java/ai/reveng/model/Basic.java index 9f3b929..0864c48 100644 --- a/src/main/java/ai/reveng/model/Basic.java +++ b/src/main/java/ai/reveng/model/Basic.java @@ -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 @@ -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; @@ -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) && @@ -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 @@ -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"); @@ -455,10 +481,10 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(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(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(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(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")); } /** diff --git a/src/main/java/ai/reveng/model/FunctionRename.java b/src/main/java/ai/reveng/model/FunctionRename.java index 1500c80..9e24b23 100644 --- a/src/main/java/ai/reveng/model/FunctionRename.java +++ b/src/main/java/ai/reveng/model/FunctionRename.java @@ -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; @@ -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; } @@ -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; } @@ -162,22 +161,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, functionRename.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable 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 int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -209,7 +197,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(Arrays.asList("new_name", "new_mangled_name")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(0); + openapiRequiredFields = new HashSet(Arrays.asList("new_name", "new_mangled_name")); } /** @@ -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())); } } diff --git a/src/main/java/ai/reveng/model/FunctionRenameMap.java b/src/main/java/ai/reveng/model/FunctionRenameMap.java index aac2d28..56e5116 100644 --- a/src/main/java/ai/reveng/model/FunctionRenameMap.java +++ b/src/main/java/ai/reveng/model/FunctionRenameMap.java @@ -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; @@ -55,22 +54,22 @@ public class FunctionRenameMap { public static final String SERIALIZED_NAME_FUNCTION_ID = "function_id"; @SerializedName(SERIALIZED_NAME_FUNCTION_ID) @javax.annotation.Nonnull - private Integer functionId; + private Long functionId; 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 FunctionRenameMap() { } - public FunctionRenameMap functionId(@javax.annotation.Nonnull Integer functionId) { + public FunctionRenameMap functionId(@javax.annotation.Nonnull Long functionId) { this.functionId = functionId; return this; } @@ -80,16 +79,16 @@ public FunctionRenameMap functionId(@javax.annotation.Nonnull Integer functionId * @return functionId */ @javax.annotation.Nonnull - public Integer getFunctionId() { + public Long getFunctionId() { return functionId; } - public void setFunctionId(@javax.annotation.Nonnull Integer functionId) { + public void setFunctionId(@javax.annotation.Nonnull Long functionId) { this.functionId = functionId; } - public FunctionRenameMap newName(@javax.annotation.Nullable String newName) { + public FunctionRenameMap newName(@javax.annotation.Nonnull String newName) { this.newName = newName; return this; } @@ -98,31 +97,31 @@ public FunctionRenameMap 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 FunctionRenameMap newMangledName(@javax.annotation.Nullable String newMangledName) { + public FunctionRenameMap 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; } @@ -187,22 +186,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalProperties, functionRenameMap.additionalProperties); } - private static boolean equalsNullable(JsonNullable a, JsonNullable 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(functionId, newName, newMangledName, additionalProperties); } - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -235,7 +223,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(Arrays.asList("function_id", "new_name", "new_mangled_name")); // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(Arrays.asList("function_id")); + openapiRequiredFields = new HashSet(Arrays.asList("function_id", "new_name", "new_mangled_name")); } /** @@ -258,10 +246,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } 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())); } } diff --git a/src/test/java/ai/reveng/model/BasicTest.java b/src/test/java/ai/reveng/model/BasicTest.java index b29815f..9e98aa3 100644 --- a/src/test/java/ai/reveng/model/BasicTest.java +++ b/src/test/java/ai/reveng/model/BasicTest.java @@ -77,6 +77,14 @@ public void modelNameTest() { // TODO: test modelName } + /** + * Test the property 'modelId' + */ + @Test + public void modelIdTest() { + // TODO: test modelId + } + /** * Test the property 'ownerUsername' */ diff --git a/src/test/java/ai/reveng/model/FunctionRenameMapTest.java b/src/test/java/ai/reveng/model/FunctionRenameMapTest.java index e85aab3..41a4a96 100644 --- a/src/test/java/ai/reveng/model/FunctionRenameMapTest.java +++ b/src/test/java/ai/reveng/model/FunctionRenameMapTest.java @@ -19,7 +19,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/src/test/java/ai/reveng/model/FunctionRenameTest.java b/src/test/java/ai/reveng/model/FunctionRenameTest.java index 17150ac..cb9119b 100644 --- a/src/test/java/ai/reveng/model/FunctionRenameTest.java +++ b/src/test/java/ai/reveng/model/FunctionRenameTest.java @@ -19,7 +19,6 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test;