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 @@
v3.22.0
v3.22.2
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>3.22.0</version>
<version>3.22.2</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -31,7 +31,7 @@ repositories {
}

dependencies {
implementation "ai.reveng:sdk:3.22.0"
implementation "ai.reveng:sdk:3.22.2"
}
```

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 = '3.22.0'
version = '3.22.2'



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

coordinates("ai.reveng", "sdk", "3.22.0")
coordinates("ai.reveng", "sdk", "3.22.2")

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 := "3.22.0",
version := "3.22.2",
scalaVersion := "2.11.12",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
Expand Down
2 changes: 1 addition & 1 deletion docs/InverseStringMapItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**string** | **String** | | |
|**addr** | **Integer** | | |
|**addr** | **Long** | | |



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>3.22.0</version>
<version>3.22.2</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/3.22.0/java");
setUserAgent("OpenAPI-Generator/3.22.2/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 = "3.22.0";
public static final String VERSION = "3.22.2";

private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;
Expand Down
46 changes: 23 additions & 23 deletions src/main/java/ai/reveng/model/Addr.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
return null; // this class only serializes 'Addr' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<Integer> adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class));
final TypeAdapter<Long> adapterLong = gson.getDelegateAdapter(this, TypeToken.get(Long.class));
final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class));

return (TypeAdapter<T>) new TypeAdapter<Addr>() {
Expand All @@ -74,9 +74,9 @@ public void write(JsonWriter out, Addr value) throws IOException {
return;
}

// check if the actual instance is of the type `Integer`
if (value.getActualInstance() instanceof Integer) {
JsonPrimitive primitive = adapterInteger.toJsonTree((Integer)value.getActualInstance()).getAsJsonPrimitive();
// check if the actual instance is of the type `Long`
if (value.getActualInstance() instanceof Long) {
JsonPrimitive primitive = adapterLong.toJsonTree((Long)value.getActualInstance()).getAsJsonPrimitive();
elementAdapter.write(out, primitive);
return;
}
Expand All @@ -86,7 +86,7 @@ public void write(JsonWriter out, Addr value) throws IOException {
elementAdapter.write(out, primitive);
return;
}
throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Integer, String");
throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Long, String");
}

@Override
Expand All @@ -97,20 +97,20 @@ public Addr read(JsonReader in) throws IOException {
ArrayList<String> errorMessages = new ArrayList<>();
TypeAdapter actualAdapter = elementAdapter;

// deserialize Integer
// deserialize Long
try {
// validate the JSON object to see if any exception is thrown
if (!jsonElement.getAsJsonPrimitive().isNumber()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()));
}
actualAdapter = adapterInteger;
actualAdapter = adapterLong;
Addr ret = new Addr();
ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement));
return ret;
} catch (Exception e) {
// deserialization failed, continue
errorMessages.add(String.format(Locale.ROOT, "Deserialization for Integer failed with `%s`.", e.getMessage()));
log.log(Level.FINER, "Input data does not match schema 'Integer'", e);
errorMessages.add(String.format(Locale.ROOT, "Deserialization for Long failed with `%s`.", e.getMessage()));
log.log(Level.FINER, "Input data does not match schema 'Long'", e);
}
// deserialize String
try {
Expand Down Expand Up @@ -147,7 +147,7 @@ public Addr(Object o) {
}

static {
schemas.put("Integer", Integer.class);
schemas.put("Long", Long.class);
schemas.put("String", String.class);
}

Expand All @@ -159,7 +159,7 @@ public Map<String, Class<?>> getSchemas() {
/**
* Set the instance that matches the anyOf child schema, check
* the instance parameter is valid against the anyOf child schemas:
* Integer, String
* Long, String
*
* It could be an instance of the 'anyOf' schemas.
*/
Expand All @@ -170,7 +170,7 @@ public void setActualInstance(Object instance) {
return;
}

if (instance instanceof Integer) {
if (instance instanceof Long) {
super.setActualInstance(instance);
return;
}
Expand All @@ -180,14 +180,14 @@ public void setActualInstance(Object instance) {
return;
}

throw new RuntimeException("Invalid instance type. Must be Integer, String");
throw new RuntimeException("Invalid instance type. Must be Long, String");
}

/**
* Get the actual instance, which can be the following:
* Integer, String
* Long, String
*
* @return The actual instance (Integer, String)
* @return The actual instance (Long, String)
*/
@SuppressWarnings("unchecked")
@Override
Expand All @@ -196,14 +196,14 @@ public Object getActualInstance() {
}

/**
* Get the actual instance of `Integer`. If the actual instance is not `Integer`,
* Get the actual instance of `Long`. If the actual instance is not `Long`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `Integer`
* @throws ClassCastException if the instance is not `Integer`
* @return The actual instance of `Long`
* @throws ClassCastException if the instance is not `Long`
*/
public Integer getInteger() throws ClassCastException {
return (Integer)super.getActualInstance();
public Long getLong() throws ClassCastException {
return (Long)super.getActualInstance();
}

/**
Expand All @@ -226,14 +226,14 @@ public String getString() throws ClassCastException {
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
// validate anyOf schemas one by one
ArrayList<String> errorMessages = new ArrayList<>();
// validate the json string with Integer
// validate the json string with Long
try {
if (!jsonElement.getAsJsonPrimitive().isNumber()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString()));
}
return;
} catch (Exception e) {
errorMessages.add(String.format(Locale.ROOT, "Deserialization for Integer failed with `%s`.", e.getMessage()));
errorMessages.add(String.format(Locale.ROOT, "Deserialization for Long failed with `%s`.", e.getMessage()));
// continue to the next one
}
// validate the json string with String
Expand All @@ -246,7 +246,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
errorMessages.add(String.format(Locale.ROOT, "Deserialization for String failed with `%s`.", e.getMessage()));
// continue to the next one
}
throw new IOException(String.format(Locale.ROOT, "The JSON string is invalid for Addr with anyOf schemas: Integer, String. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString()));
throw new IOException(String.format(Locale.ROOT, "The JSON string is invalid for Addr with anyOf schemas: Long, String. no class match the result, expected at least 1. Detailed failure message for anyOf schemas: %s. JSON: %s", errorMessages, jsonElement.toString()));
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ai/reveng/model/InverseStringMapItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class InverseStringMapItem {
public static final String SERIALIZED_NAME_ADDR = "addr";
@SerializedName(SERIALIZED_NAME_ADDR)
@javax.annotation.Nullable
private Integer addr;
private Long addr;

public InverseStringMapItem() {
}
Expand All @@ -83,7 +83,7 @@ public void setString(@javax.annotation.Nonnull String string) {
}


public InverseStringMapItem addr(@javax.annotation.Nullable Integer addr) {
public InverseStringMapItem addr(@javax.annotation.Nullable Long addr) {
this.addr = addr;
return this;
}
Expand All @@ -93,11 +93,11 @@ public InverseStringMapItem addr(@javax.annotation.Nullable Integer addr) {
* @return addr
*/
@javax.annotation.Nullable
public Integer getAddr() {
public Long getAddr() {
return addr;
}

public void setAddr(@javax.annotation.Nullable Integer addr) {
public void setAddr(@javax.annotation.Nullable Long addr) {
this.addr = addr;
}

Expand Down