From 988cf73efb0e214d2184ffe060b23e0dbbf9ec96 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 13 Jul 2026 08:02:16 +0000 Subject: [PATCH] Update SDK to version v3.114.2 - Generated from OpenAPI spec version v3.114.2 - Auto-generated by GitHub Actions --- .sdk-version | 2 +- README.md | 6 +- build.gradle | 4 +- build.sbt | 2 +- docs/EventTOOLCALLPROGRESS.md | 25 ++ docs/SseEventToolCallProgressData.md | 16 + pom.xml | 2 +- .../java/ai/reveng/invoker/ApiClient.java | 2 +- .../java/ai/reveng/invoker/Configuration.java | 2 +- src/main/java/ai/reveng/invoker/JSON.java | 2 + .../reveng/model/EventTOOLCALLPROGRESS.java | 424 ++++++++++++++++++ .../reveng/model/ServerSentEventsInner.java | 58 ++- .../model/SseEventToolCallProgressData.java | 289 ++++++++++++ 13 files changed, 819 insertions(+), 15 deletions(-) create mode 100644 docs/EventTOOLCALLPROGRESS.md create mode 100644 docs/SseEventToolCallProgressData.md create mode 100644 src/main/java/ai/reveng/model/EventTOOLCALLPROGRESS.java create mode 100644 src/main/java/ai/reveng/model/SseEventToolCallProgressData.java diff --git a/.sdk-version b/.sdk-version index 0c62fbe..4ba1813 100644 --- a/.sdk-version +++ b/.sdk-version @@ -1 +1 @@ -v3.113.0 +v3.114.2 diff --git a/README.md b/README.md index 26af275..be9c9f6 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add this dependency to your project's POM: ai.reveng sdk - 3.113.0 + 3.114.2 compile ``` @@ -31,7 +31,7 @@ repositories { } dependencies { - implementation "ai.reveng:sdk:3.113.0" + implementation "ai.reveng:sdk:3.114.2" } ``` @@ -490,6 +490,7 @@ Class | Method | HTTP request | Description - [EventTITLEUPDATED](docs/EventTITLEUPDATED.md) - [EventTOOLCALLARGSDELTA](docs/EventTOOLCALLARGSDELTA.md) - [EventTOOLCALLEND](docs/EventTOOLCALLEND.md) + - [EventTOOLCALLPROGRESS](docs/EventTOOLCALLPROGRESS.md) - [EventTOOLCALLRESULT](docs/EventTOOLCALLRESULT.md) - [EventTOOLCALLSTART](docs/EventTOOLCALLSTART.md) - [EventTOOLCONFIRMATIONREQUIRED](docs/EventTOOLCONFIRMATIONREQUIRED.md) @@ -685,6 +686,7 @@ Class | Method | HTTP request | Description - [SseEventTitleUpdatedData](docs/SseEventTitleUpdatedData.md) - [SseEventToolCallArgsDeltaData](docs/SseEventToolCallArgsDeltaData.md) - [SseEventToolCallEndData](docs/SseEventToolCallEndData.md) + - [SseEventToolCallProgressData](docs/SseEventToolCallProgressData.md) - [SseEventToolCallResultData](docs/SseEventToolCallResultData.md) - [SseEventToolCallStartData](docs/SseEventToolCallStartData.md) - [SseEventToolConfirmationRequiredData](docs/SseEventToolConfirmationRequiredData.md) diff --git a/build.gradle b/build.gradle index 7a82db4..cbd88e7 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'ai.reveng' -version = '3.113.0' +version = '3.114.2' @@ -171,7 +171,7 @@ mavenPublishing { publishToMavenCentral(true) signAllPublications() - coordinates("ai.reveng", "sdk", "3.113.0") + coordinates("ai.reveng", "sdk", "3.114.2") pom { name = "sdk" diff --git a/build.sbt b/build.sbt index b8e651a..5b8faf0 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "ai.reveng", name := "sdk", - version := "3.113.0", + version := "3.114.2", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), compile / javacOptions ++= Seq("-Xlint:deprecation"), diff --git a/docs/EventTOOLCALLPROGRESS.md b/docs/EventTOOLCALLPROGRESS.md new file mode 100644 index 0000000..236a869 --- /dev/null +++ b/docs/EventTOOLCALLPROGRESS.md @@ -0,0 +1,25 @@ + + +# EventTOOLCALLPROGRESS + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**SseEventToolCallProgressData**](SseEventToolCallProgressData.md) | | | +|**event** | [**EventEnum**](#EventEnum) | The event name. | | +|**id** | **Integer** | The event ID. | [optional] | +|**retry** | **Integer** | The retry time in milliseconds. | [optional] | + + + +## Enum: EventEnum + +| Name | Value | +|---- | -----| +| TOOL_CALL_PROGRESS | "TOOL_CALL_PROGRESS" | +| UNKNOWN_DEFAULT_OPEN_API | "unknown_default_open_api" | + + + diff --git a/docs/SseEventToolCallProgressData.md b/docs/SseEventToolCallProgressData.md new file mode 100644 index 0000000..10fbd67 --- /dev/null +++ b/docs/SseEventToolCallProgressData.md @@ -0,0 +1,16 @@ + + +# SseEventToolCallProgressData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | **Object** | | | +|**eventId** | **Long** | | | +|**sourceRunId** | **String** | | [optional] | +|**type** | **String** | | | + + + diff --git a/pom.xml b/pom.xml index 0cba5bc..922d6a7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ sdk jar sdk - 3.113.0 + 3.114.2 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 544fa26..9691a75 100644 --- a/src/main/java/ai/reveng/invoker/ApiClient.java +++ b/src/main/java/ai/reveng/invoker/ApiClient.java @@ -148,7 +148,7 @@ protected void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/3.113.0/java"); + setUserAgent("OpenAPI-Generator/3.114.2/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 c10cfcf..e7a9eb4 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 = "3.113.0"; + public static final String VERSION = "3.114.2"; private static final AtomicReference defaultApiClient = new AtomicReference<>(); private static volatile Supplier apiClientFactory = ApiClient::new; diff --git a/src/main/java/ai/reveng/invoker/JSON.java b/src/main/java/ai/reveng/invoker/JSON.java index 1a79d33..19e060a 100644 --- a/src/main/java/ai/reveng/invoker/JSON.java +++ b/src/main/java/ai/reveng/invoker/JSON.java @@ -337,6 +337,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTITLEUPDATED.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLARGSDELTA.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLEND.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLPROGRESS.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLRESULT.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCALLSTART.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.EventTOOLCONFIRMATIONREQUIRED.CustomTypeAdapterFactory()); @@ -523,6 +524,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventTitleUpdatedData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallArgsDeltaData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallEndData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallProgressData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallResultData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolCallStartData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new ai.reveng.model.SseEventToolConfirmationRequiredData.CustomTypeAdapterFactory()); diff --git a/src/main/java/ai/reveng/model/EventTOOLCALLPROGRESS.java b/src/main/java/ai/reveng/model/EventTOOLCALLPROGRESS.java new file mode 100644 index 0000000..ae51b57 --- /dev/null +++ b/src/main/java/ai/reveng/model/EventTOOLCALLPROGRESS.java @@ -0,0 +1,424 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import ai.reveng.model.SseEventToolCallProgressData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * EventTOOLCALLPROGRESS + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class EventTOOLCALLPROGRESS { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SseEventToolCallProgressData data; + + /** + * The event name. + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + TOOL_CALL_PROGRESS("TOOL_CALL_PROGRESS"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EventEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EventEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EventEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EventEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EVENT = "event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nonnull + private EventEnum event; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private Integer id; + + public static final String SERIALIZED_NAME_RETRY = "retry"; + @SerializedName(SERIALIZED_NAME_RETRY) + @javax.annotation.Nullable + private Integer retry; + + public EventTOOLCALLPROGRESS() { + } + + public EventTOOLCALLPROGRESS data(@javax.annotation.Nonnull SseEventToolCallProgressData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SseEventToolCallProgressData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SseEventToolCallProgressData data) { + this.data = data; + } + + + public EventTOOLCALLPROGRESS event(@javax.annotation.Nonnull EventEnum event) { + this.event = event; + return this; + } + + /** + * The event name. + * @return event + */ + @javax.annotation.Nonnull + public EventEnum getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nonnull EventEnum event) { + this.event = event; + } + + + public EventTOOLCALLPROGRESS id(@javax.annotation.Nullable Integer id) { + this.id = id; + return this; + } + + /** + * The event ID. + * @return id + */ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + public void setId(@javax.annotation.Nullable Integer id) { + this.id = id; + } + + + public EventTOOLCALLPROGRESS retry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; + return this; + } + + /** + * The retry time in milliseconds. + * @return retry + */ + @javax.annotation.Nullable + public Integer getRetry() { + return retry; + } + + public void setRetry(@javax.annotation.Nullable Integer retry) { + this.retry = retry; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EventTOOLCALLPROGRESS instance itself + */ + public EventTOOLCALLPROGRESS putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventTOOLCALLPROGRESS eventTOOLCALLPROGRESS = (EventTOOLCALLPROGRESS) o; + return Objects.equals(this.data, eventTOOLCALLPROGRESS.data) && + Objects.equals(this.event, eventTOOLCALLPROGRESS.event) && + Objects.equals(this.id, eventTOOLCALLPROGRESS.id) && + Objects.equals(this.retry, eventTOOLCALLPROGRESS.retry)&& + Objects.equals(this.additionalProperties, eventTOOLCALLPROGRESS.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, event, id, retry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventTOOLCALLPROGRESS {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" retry: ").append(toIndentedString(retry)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event", "id", "retry")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "event")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EventTOOLCALLPROGRESS + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventTOOLCALLPROGRESS.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in EventTOOLCALLPROGRESS is not found in the empty JSON string", EventTOOLCALLPROGRESS.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventTOOLCALLPROGRESS.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + SseEventToolCallProgressData.validateJsonElement(jsonObj.get("data")); + if (!jsonObj.get("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("event").toString())); + } + // validate the required field `event` + EventEnum.validateJsonElement(jsonObj.get("event")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventTOOLCALLPROGRESS.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventTOOLCALLPROGRESS' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLPROGRESS.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventTOOLCALLPROGRESS value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EventTOOLCALLPROGRESS read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventTOOLCALLPROGRESS instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventTOOLCALLPROGRESS given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventTOOLCALLPROGRESS + * @throws IOException if the JSON string is invalid with respect to EventTOOLCALLPROGRESS + */ + public static EventTOOLCALLPROGRESS fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventTOOLCALLPROGRESS.class); + } + + /** + * Convert an instance of EventTOOLCALLPROGRESS to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/ai/reveng/model/ServerSentEventsInner.java b/src/main/java/ai/reveng/model/ServerSentEventsInner.java index 4b18a69..e5a4c4d 100644 --- a/src/main/java/ai/reveng/model/ServerSentEventsInner.java +++ b/src/main/java/ai/reveng/model/ServerSentEventsInner.java @@ -26,6 +26,7 @@ import ai.reveng.model.EventTITLEUPDATED; import ai.reveng.model.EventTOOLCALLARGSDELTA; import ai.reveng.model.EventTOOLCALLEND; +import ai.reveng.model.EventTOOLCALLPROGRESS; import ai.reveng.model.EventTOOLCALLRESULT; import ai.reveng.model.EventTOOLCALLSTART; import ai.reveng.model.EventTOOLCONFIRMATIONREQUIRED; @@ -98,6 +99,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter adapterEventTITLEUPDATED = gson.getDelegateAdapter(this, TypeToken.get(EventTITLEUPDATED.class)); final TypeAdapter adapterEventTOOLCALLARGSDELTA = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLARGSDELTA.class)); final TypeAdapter adapterEventTOOLCALLEND = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLEND.class)); + final TypeAdapter adapterEventTOOLCALLPROGRESS = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLPROGRESS.class)); final TypeAdapter adapterEventTOOLCALLRESULT = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLRESULT.class)); final TypeAdapter adapterEventTOOLCALLSTART = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCALLSTART.class)); final TypeAdapter adapterEventTOOLCONFIRMATIONREQUIRED = gson.getDelegateAdapter(this, TypeToken.get(EventTOOLCONFIRMATIONREQUIRED.class)); @@ -188,6 +190,12 @@ public void write(JsonWriter out, ServerSentEventsInner value) throws IOExceptio elementAdapter.write(out, element); return; } + // check if the actual instance is of the type `EventTOOLCALLPROGRESS` + if (value.getActualInstance() instanceof EventTOOLCALLPROGRESS) { + JsonElement element = adapterEventTOOLCALLPROGRESS.toJsonTree((EventTOOLCALLPROGRESS)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } // check if the actual instance is of the type `EventTOOLCALLRESULT` if (value.getActualInstance() instanceof EventTOOLCALLRESULT) { JsonElement element = adapterEventTOOLCALLRESULT.toJsonTree((EventTOOLCALLRESULT)value.getActualInstance()); @@ -206,7 +214,7 @@ public void write(JsonWriter out, ServerSentEventsInner value) throws IOExceptio elementAdapter.write(out, element); return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); } @Override @@ -374,6 +382,18 @@ public ServerSentEventsInner read(JsonReader in) throws IOException { errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for EventTOOLCALLEND failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'EventTOOLCALLEND'", e); } + // deserialize EventTOOLCALLPROGRESS + try { + // validate the JSON object to see if any exception is thrown + EventTOOLCALLPROGRESS.validateJsonElement(jsonElement); + actualAdapter = adapterEventTOOLCALLPROGRESS; + match++; + log.log(Level.FINER, "Input data matches schema 'EventTOOLCALLPROGRESS'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for EventTOOLCALLPROGRESS failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EventTOOLCALLPROGRESS'", e); + } // deserialize EventTOOLCALLRESULT try { // validate the JSON object to see if any exception is thrown @@ -449,6 +469,7 @@ public ServerSentEventsInner(Object o) { schemas.put("EventTITLEUPDATED", EventTITLEUPDATED.class); schemas.put("EventTOOLCALLARGSDELTA", EventTOOLCALLARGSDELTA.class); schemas.put("EventTOOLCALLEND", EventTOOLCALLEND.class); + schemas.put("EventTOOLCALLPROGRESS", EventTOOLCALLPROGRESS.class); schemas.put("EventTOOLCALLRESULT", EventTOOLCALLRESULT.class); schemas.put("EventTOOLCALLSTART", EventTOOLCALLSTART.class); schemas.put("EventTOOLCONFIRMATIONREQUIRED", EventTOOLCONFIRMATIONREQUIRED.class); @@ -462,7 +483,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED + * EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED * * It could be an instance of the 'oneOf' schemas. */ @@ -533,6 +554,11 @@ public void setActualInstance(Object instance) { return; } + if (instance instanceof EventTOOLCALLPROGRESS) { + super.setActualInstance(instance); + return; + } + if (instance instanceof EventTOOLCALLRESULT) { super.setActualInstance(instance); return; @@ -548,14 +574,14 @@ public void setActualInstance(Object instance) { return; } - throw new RuntimeException("Invalid instance type. Must be EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); + throw new RuntimeException("Invalid instance type. Must be EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED"); } /** * Get the actual instance, which can be the following: - * EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED + * EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED * - * @return The actual instance (EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED) + * @return The actual instance (EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED) */ @SuppressWarnings("unchecked") @Override @@ -719,6 +745,18 @@ public EventTOOLCALLEND getEventTOOLCALLEND() throws ClassCastException { return (EventTOOLCALLEND)super.getActualInstance(); } + /** + * Get the actual instance of `EventTOOLCALLPROGRESS`. If the actual instance is not `EventTOOLCALLPROGRESS`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EventTOOLCALLPROGRESS` + * @throws ClassCastException if the instance is not `EventTOOLCALLPROGRESS` + */ + @SuppressWarnings("unchecked") + public EventTOOLCALLPROGRESS getEventTOOLCALLPROGRESS() throws ClassCastException { + return (EventTOOLCALLPROGRESS)super.getActualInstance(); + } + /** * Get the actual instance of `EventTOOLCALLRESULT`. If the actual instance is not `EventTOOLCALLRESULT`, * the ClassCastException will be thrown. @@ -869,6 +907,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for EventTOOLCALLEND failed with `%s`.", e.getMessage())); // continue to the next one } + // validate the json string with EventTOOLCALLPROGRESS + try { + EventTOOLCALLPROGRESS.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format(java.util.Locale.ROOT, "Deserialization for EventTOOLCALLPROGRESS failed with `%s`.", e.getMessage())); + // continue to the next one + } // validate the json string with EventTOOLCALLRESULT try { EventTOOLCALLRESULT.validateJsonElement(jsonElement); @@ -894,7 +940,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // continue to the next one } if (validCount != 1) { - throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for ServerSentEventsInner with oneOf schemas: EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + throw new IOException(String.format(java.util.Locale.ROOT, "The JSON string is invalid for ServerSentEventsInner with oneOf schemas: EventCONTEXTCOMPACTED, EventRUNCANCELLED, EventRUNERROR, EventRUNFINISHED, EventRUNSTARTED, EventSTEPFINISHED, EventSTEPSTARTED, EventTEXTMESSAGECONTENT, EventTEXTMESSAGEEND, EventTEXTMESSAGESTART, EventTITLEUPDATED, EventTOOLCALLARGSDELTA, EventTOOLCALLEND, EventTOOLCALLPROGRESS, EventTOOLCALLRESULT, EventTOOLCALLSTART, EventTOOLCONFIRMATIONREQUIRED. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/ai/reveng/model/SseEventToolCallProgressData.java b/src/main/java/ai/reveng/model/SseEventToolCallProgressData.java new file mode 100644 index 0000000..2f77f3b --- /dev/null +++ b/src/main/java/ai/reveng/model/SseEventToolCallProgressData.java @@ -0,0 +1,289 @@ +/* + * RevEng.AI API + * RevEng.AI is an AI-powered binary analysis platform for reverse engineering and malware analysis. It provides similarity search across executable binaries and functions, AI-driven decompilation, dynamic execution analysis, firmware unpacking, and integration with external threat intelligence sources like VirusTotal. + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package ai.reveng.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import ai.reveng.invoker.JSON; + +/** + * SseEventToolCallProgressData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class SseEventToolCallProgressData { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data = null; + + public static final String SERIALIZED_NAME_EVENT_ID = "event_id"; + @SerializedName(SERIALIZED_NAME_EVENT_ID) + @javax.annotation.Nonnull + private Long eventId; + + public static final String SERIALIZED_NAME_SOURCE_RUN_ID = "source_run_id"; + @SerializedName(SERIALIZED_NAME_SOURCE_RUN_ID) + @javax.annotation.Nullable + private String sourceRunId; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public SseEventToolCallProgressData() { + } + + public SseEventToolCallProgressData data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public SseEventToolCallProgressData eventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get eventId + * @return eventId + */ + @javax.annotation.Nonnull + public Long getEventId() { + return eventId; + } + + public void setEventId(@javax.annotation.Nonnull Long eventId) { + this.eventId = eventId; + } + + + public SseEventToolCallProgressData sourceRunId(@javax.annotation.Nullable String sourceRunId) { + this.sourceRunId = sourceRunId; + return this; + } + + /** + * Get sourceRunId + * @return sourceRunId + */ + @javax.annotation.Nullable + public String getSourceRunId() { + return sourceRunId; + } + + public void setSourceRunId(@javax.annotation.Nullable String sourceRunId) { + this.sourceRunId = sourceRunId; + } + + + public SseEventToolCallProgressData type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SseEventToolCallProgressData sseEventToolCallProgressData = (SseEventToolCallProgressData) o; + return Objects.equals(this.data, sseEventToolCallProgressData.data) && + Objects.equals(this.eventId, sseEventToolCallProgressData.eventId) && + Objects.equals(this.sourceRunId, sseEventToolCallProgressData.sourceRunId) && + Objects.equals(this.type, sseEventToolCallProgressData.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, eventId, sourceRunId, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SseEventToolCallProgressData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" sourceRunId: ").append(toIndentedString(sourceRunId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(Arrays.asList("data", "event_id", "source_run_id", "type")); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(Arrays.asList("data", "event_id", "type")); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SseEventToolCallProgressData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SseEventToolCallProgressData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in SseEventToolCallProgressData is not found in the empty JSON string", SseEventToolCallProgressData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SseEventToolCallProgressData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` in the JSON string is not defined in the `SseEventToolCallProgressData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SseEventToolCallProgressData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("source_run_id") != null && !jsonObj.get("source_run_id").isJsonNull()) && !jsonObj.get("source_run_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `source_run_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source_run_id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SseEventToolCallProgressData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SseEventToolCallProgressData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SseEventToolCallProgressData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SseEventToolCallProgressData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SseEventToolCallProgressData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SseEventToolCallProgressData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SseEventToolCallProgressData + * @throws IOException if the JSON string is invalid with respect to SseEventToolCallProgressData + */ + public static SseEventToolCallProgressData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SseEventToolCallProgressData.class); + } + + /** + * Convert an instance of SseEventToolCallProgressData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} +