Skip to content

Commit

Permalink
Merge pull request #128 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-java after onfido-openapi-spec update (08508b9)
  • Loading branch information
dvacca-onfido authored Sep 20, 2024
2 parents 0343f5c + fe4d146 commit 8e91bbc
Show file tree
Hide file tree
Showing 17 changed files with 3,259 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .release.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"source": {
"repo_url": "https://github.com/onfido/onfido-openapi-spec",
"short_sha": "a33e3b2",
"long_sha": "a33e3b25defea6110ec610051560df2c20bd1f65",
"version": "v3.4.0"
"short_sha": "08508b9",
"long_sha": "08508b9517238b3becb4265130633a418a8ee319",
"version": "v3.5.0"
},
"release": "v4.2.0"
"release": "v4.3.0"
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.onfido</groupId>
<artifactId>onfido-api-java</artifactId>
<version>4.2.0</version>
<version>4.3.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -59,7 +59,7 @@ Add this dependency to your project's build file:
}
dependencies {
implementation "com.onfido:onfido-api-java:4.2.0"
implementation "com.onfido:onfido-api-java:4.3.0"
}
```

Expand All @@ -73,10 +73,10 @@ mvn clean package

Then manually install the following JARs:

- `target/onfido-api-java-4.2.0.jar`
- `target/onfido-api-java-4.3.0.jar`
- `target/lib/*.jar`

The latest version can be found at: https://search.maven.org/artifact/com.onfido/4.2.0
The latest version can be found at: https://search.maven.org/artifact/com.onfido/4.3.0

## Getting Started

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

group = 'com.onfido'
version = '4.2.0'
version = '4.3.0'

buildscript {
repositories {
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 := "com.onfido",
name := "onfido-api-java",
version := "4.2.0",
version := "4.3.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
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>onfido-api-java</artifactId>
<packaging>jar</packaging>
<name>onfido-api-java</name>
<version>4.2.0</version>
<version>4.3.0</version>
<url>https://documentation.onfido.com</url>
<description>Official Java API client library for the Onfido API</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/onfido/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("onfido-java/4.2.0");
setUserAgent("onfido-java/4.3.0");

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

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0")
public class Configuration {
public static final String VERSION = "4.2.0";
public static final String VERSION = "4.3.0";

private static ApiClient defaultApiClient = new ApiClient();

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/onfido/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,14 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistAmlReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedBreakdown.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedProperties.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInnerAddressInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInnerAliasInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInnerAssociateInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInnerAttributeInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInnerEventInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInnerEventInnerSource.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedPropertiesRecordsInnerSourceInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistEnhancedReport.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistMonitor.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new com.onfido.model.WatchlistMonitorBuilder.CustomTypeAdapterFactory());
Expand Down
27 changes: 19 additions & 8 deletions src/main/java/com/onfido/model/WatchlistEnhancedProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.onfido.model.WatchlistEnhancedPropertiesRecordsInner;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -55,17 +56,17 @@
public class WatchlistEnhancedProperties {
public static final String SERIALIZED_NAME_RECORDS = "records";
@SerializedName(SERIALIZED_NAME_RECORDS)
private List<String> records = new ArrayList<>();
private List<WatchlistEnhancedPropertiesRecordsInner> records = new ArrayList<>();

public WatchlistEnhancedProperties() {
}

public WatchlistEnhancedProperties records(List<String> records) {
public WatchlistEnhancedProperties records(List<WatchlistEnhancedPropertiesRecordsInner> records) {
this.records = records;
return this;
}

public WatchlistEnhancedProperties addRecordsItem(String recordsItem) {
public WatchlistEnhancedProperties addRecordsItem(WatchlistEnhancedPropertiesRecordsInner recordsItem) {
if (this.records == null) {
this.records = new ArrayList<>();
}
Expand All @@ -78,11 +79,11 @@ public WatchlistEnhancedProperties addRecordsItem(String recordsItem) {
* @return records
**/
@javax.annotation.Nullable
public List<String> getRecords() {
public List<WatchlistEnhancedPropertiesRecordsInner> getRecords() {
return records;
}

public void setRecords(List<String> records) {
public void setRecords(List<WatchlistEnhancedPropertiesRecordsInner> records) {
this.records = records;
}

Expand Down Expand Up @@ -197,9 +198,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
// ensure the optional json data is an array if present
if (jsonObj.get("records") != null && !jsonObj.get("records").isJsonNull() && !jsonObj.get("records").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `records` to be an array in the JSON string but got `%s`", jsonObj.get("records").toString()));
if (jsonObj.get("records") != null && !jsonObj.get("records").isJsonNull()) {
JsonArray jsonArrayrecords = jsonObj.getAsJsonArray("records");
if (jsonArrayrecords != null) {
// ensure the json data is an array
if (!jsonObj.get("records").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `records` to be an array in the JSON string but got `%s`", jsonObj.get("records").toString()));
}

// validate the optional field `records` (array)
for (int i = 0; i < jsonArrayrecords.size(); i++) {
WatchlistEnhancedPropertiesRecordsInner.validateJsonElement(jsonArrayrecords.get(i));
};
}
}
}

Expand Down
Loading

0 comments on commit 8e91bbc

Please sign in to comment.