ApiException class.
+ */
+@SuppressWarnings("serial")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class ApiException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ private int code = 0;
+ private Map> responseHeaders = null;
+ private String responseBody = null;
+
+ /**
+ * Constructor for ApiException.
+ */
+ public ApiException() {}
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param throwable a {@link java.lang.Throwable} object
+ */
+ public ApiException(Throwable throwable) {
+ super(throwable);
+ }
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param message the error message
+ */
+ public ApiException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param message the error message
+ * @param throwable a {@link java.lang.Throwable} object
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) {
+ super(message, throwable);
+ this.code = code;
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param message the error message
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
+ public ApiException(String message, int code, Map> responseHeaders, String responseBody) {
+ this(message, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param message the error message
+ * @param throwable a {@link java.lang.Throwable} object
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ */
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) {
+ this(message, throwable, code, responseHeaders, null);
+ }
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
+ public ApiException(int code, Map> responseHeaders, String responseBody) {
+ this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param code HTTP status code
+ * @param message a {@link java.lang.String} object
+ */
+ public ApiException(int code, String message) {
+ super(message);
+ this.code = code;
+ }
+
+ /**
+ * Constructor for ApiException.
+ *
+ * @param code HTTP status code
+ * @param message the error message
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
+ public ApiException(int code, String message, Map> responseHeaders, String responseBody) {
+ this(code, message);
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return A map of list of string
+ */
+ public Map> getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+
+ /**
+ * Get the exception message including HTTP response data.
+ *
+ * @return The exception message
+ */
+ public String getMessage() {
+ return String.format(Locale.ROOT, "Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s",
+ super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders());
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ApiResponse.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiResponse.java
new file mode 100644
index 00000000..a2982a72
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ApiResponse.java
@@ -0,0 +1,76 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API response returned by API call.
+ */
+public class ApiResponse {
+ final private int statusCode;
+ final private Map> headers;
+ final private T data;
+
+ /**
+ * Constructor for ApiResponse.
+ *
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ */
+ public ApiResponse(int statusCode, Map> headers) {
+ this(statusCode, headers, null);
+ }
+
+ /**
+ * Constructor for ApiResponse.
+ *
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ * @param data The object deserialized from response bod
+ */
+ public ApiResponse(int statusCode, Map> headers, T data) {
+ this.statusCode = statusCode;
+ this.headers = headers;
+ this.data = data;
+ }
+
+ /**
+ * Get the status code.
+ *
+ * @return the status code
+ */
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Get the headers.
+ *
+ * @return a {@link java.util.Map} of headers
+ */
+ public Map> getHeaders() {
+ return headers;
+ }
+
+ /**
+ * Get the data.
+ *
+ * @return the data
+ */
+ public T getData() {
+ return data;
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/Configuration.java b/utils/sdk/client/java/src/main/java/invalidPackageName/Configuration.java
new file mode 100644
index 00000000..41433308
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/Configuration.java
@@ -0,0 +1,63 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Supplier;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class Configuration {
+ public static final String VERSION = "6.0.1";
+
+ private static final AtomicReference defaultApiClient = new AtomicReference<>();
+ private static volatile Supplier apiClientFactory = ApiClient::new;
+
+ /**
+ * Get the default API client, which would be used when creating API instances without providing an API client.
+ *
+ * @return Default API client
+ */
+ public static ApiClient getDefaultApiClient() {
+ ApiClient client = defaultApiClient.get();
+ if (client == null) {
+ client = defaultApiClient.updateAndGet(val -> {
+ if (val != null) { // changed by another thread
+ return val;
+ }
+ return apiClientFactory.get();
+ });
+ }
+ return client;
+ }
+
+ /**
+ * Set the default API client, which would be used when creating API instances without providing an API client.
+ *
+ * @param apiClient API client
+ */
+ public static void setDefaultApiClient(ApiClient apiClient) {
+ defaultApiClient.set(apiClient);
+ }
+
+ /**
+ * set the callback used to create new ApiClient objects
+ */
+ public static void setApiClientFactory(Supplier factory) {
+ apiClientFactory = Objects.requireNonNull(factory);
+ }
+
+ private Configuration() {
+ }
+}
\ No newline at end of file
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/GzipRequestInterceptor.java b/utils/sdk/client/java/src/main/java/invalidPackageName/GzipRequestInterceptor.java
new file mode 100644
index 00000000..2601e5ba
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/GzipRequestInterceptor.java
@@ -0,0 +1,85 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import okhttp3.*;
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.GzipSink;
+import okio.Okio;
+
+import java.io.IOException;
+
+/**
+ * Encodes request bodies using gzip.
+ *
+ * Taken from https://github.com/square/okhttp/issues/350
+ */
+class GzipRequestInterceptor implements Interceptor {
+ @Override
+ public Response intercept(Chain chain) throws IOException {
+ Request originalRequest = chain.request();
+ if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
+ return chain.proceed(originalRequest);
+ }
+
+ Request compressedRequest = originalRequest.newBuilder()
+ .header("Content-Encoding", "gzip")
+ .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
+ .build();
+ return chain.proceed(compressedRequest);
+ }
+
+ private RequestBody forceContentLength(final RequestBody requestBody) throws IOException {
+ final Buffer buffer = new Buffer();
+ requestBody.writeTo(buffer);
+ return new RequestBody() {
+ @Override
+ public MediaType contentType() {
+ return requestBody.contentType();
+ }
+
+ @Override
+ public long contentLength() {
+ return buffer.size();
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ sink.write(buffer.snapshot());
+ }
+ };
+ }
+
+ private RequestBody gzip(final RequestBody body) {
+ return new RequestBody() {
+ @Override
+ public MediaType contentType() {
+ return body.contentType();
+ }
+
+ @Override
+ public long contentLength() {
+ return -1; // We don't know the compressed length in advance!
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
+ body.writeTo(gzipSink);
+ gzipSink.close();
+ }
+ };
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/JSON.java b/utils/sdk/client/java/src/main/java/invalidPackageName/JSON.java
new file mode 100644
index 00000000..283f18b9
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/JSON.java
@@ -0,0 +1,446 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonParseException;
+import com.google.gson.TypeAdapter;
+import com.google.gson.internal.bind.util.ISO8601Utils;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import com.google.gson.JsonElement;
+import io.gsonfire.GsonFireBuilder;
+import io.gsonfire.TypeSelector;
+
+import okio.ByteString;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.lang.reflect.Type;
+import java.nio.charset.StandardCharsets;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.ParsePosition;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;
+
+/*
+ * A JSON utility class
+ *
+ * NOTE: in the future, this class may be converted to static, which may break
+ * backward-compatibility
+ */
+public class JSON {
+ private static Gson gson;
+ private static boolean isLenientOnJson = false;
+ private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
+ private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
+ private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
+ private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
+ private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
+
+ @SuppressWarnings("unchecked")
+ public static GsonBuilder createGson() {
+ GsonFireBuilder fireBuilder = new GsonFireBuilder()
+ ;
+ GsonBuilder builder = fireBuilder.createGsonBuilder();
+ return builder;
+ }
+
+ private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
+ JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
+ if (null == element) {
+ throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
+ }
+ return element.getAsString();
+ }
+
+ /**
+ * Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
+ *
+ * @param classByDiscriminatorValue The map of discriminator values to Java classes.
+ * @param discriminatorValue The value of the OpenAPI discriminator in the input data.
+ * @return The Java class that implements the OpenAPI schema
+ */
+ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
+ Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue);
+ if (null == clazz) {
+ throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
+ }
+ return clazz;
+ }
+
+ static {
+ GsonBuilder gsonBuilder = createGson();
+ gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter);
+ gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
+ gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
+ gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
+ gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockDetailsModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockProcessingPerformanceModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.BlockTemplateRequestModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.DbStatInfoModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.HeightModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.InfoModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.MaintainersInfoModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PerformanceModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PosEntryModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockRequestModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.SubmitBlockResponseModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionAttachmentModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionDetailsModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionExtraModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionInputModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TransactionOutputModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxGenerationContextModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxPoolPerformanceModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.TxProcessingPerformanceModel.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.VersionModel.CustomTypeAdapterFactory());
+ gson = gsonBuilder.create();
+ }
+
+ /**
+ * Get Gson.
+ *
+ * @return Gson
+ */
+ public static Gson getGson() {
+ return gson;
+ }
+
+ /**
+ * Set Gson.
+ *
+ * @param gson Gson
+ */
+ public static void setGson(Gson gson) {
+ JSON.gson = gson;
+ }
+
+ public static void setLenientOnJson(boolean lenientOnJson) {
+ isLenientOnJson = lenientOnJson;
+ }
+
+ /**
+ * Serialize the given Java object into JSON string.
+ *
+ * @param obj Object
+ * @return String representation of the JSON
+ */
+ public static String serialize(Object obj) {
+ return gson.toJson(obj);
+ }
+
+ /**
+ * Deserialize the given JSON string to Java object.
+ *
+ * @param Type
+ * @param body The JSON string
+ * @param returnType The type to deserialize into
+ * @return The deserialized Java object
+ */
+ @SuppressWarnings("unchecked")
+ public static T deserialize(String body, Type returnType) {
+ try {
+ if (isLenientOnJson) {
+ JsonReader jsonReader = new JsonReader(new StringReader(body));
+ // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
+ jsonReader.setLenient(true);
+ return gson.fromJson(jsonReader, returnType);
+ } else {
+ return gson.fromJson(body, returnType);
+ }
+ } catch (JsonParseException e) {
+ // Fallback processing when failed to parse JSON form response body:
+ // return the response body string directly for the String return type;
+ if (returnType.equals(String.class)) {
+ return (T) body;
+ } else {
+ throw (e);
+ }
+ }
+ }
+
+ /**
+ * Deserialize the given JSON InputStream to a Java object.
+ *
+ * @param Type
+ * @param inputStream The JSON InputStream
+ * @param returnType The type to deserialize into
+ * @return The deserialized Java object
+ */
+ @SuppressWarnings("unchecked")
+ public static T deserialize(InputStream inputStream, Type returnType) throws IOException {
+ try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
+ if (isLenientOnJson) {
+ // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
+ JsonReader jsonReader = new JsonReader(reader);
+ jsonReader.setLenient(true);
+ return gson.fromJson(jsonReader, returnType);
+ } else {
+ return gson.fromJson(reader, returnType);
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for Byte Array type
+ */
+ public static class ByteArrayAdapter extends TypeAdapter {
+
+ @Override
+ public void write(JsonWriter out, byte[] value) throws IOException {
+ if (value == null) {
+ out.nullValue();
+ } else {
+ out.value(ByteString.of(value).base64());
+ }
+ }
+
+ @Override
+ public byte[] read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String bytesAsBase64 = in.nextString();
+ ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
+ return byteString.toByteArray();
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for JSR310 OffsetDateTime type
+ */
+ public static class OffsetDateTimeTypeAdapter extends TypeAdapter {
+
+ private DateTimeFormatter formatter;
+
+ public OffsetDateTimeTypeAdapter() {
+ this(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
+ }
+
+ public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) {
+ this.formatter = formatter;
+ }
+
+ public void setFormat(DateTimeFormatter dateFormat) {
+ this.formatter = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, OffsetDateTime date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ out.value(formatter.format(date));
+ }
+ }
+
+ @Override
+ public OffsetDateTime read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ if (date.endsWith("+0000")) {
+ date = date.substring(0, date.length()-5) + "Z";
+ }
+ return OffsetDateTime.parse(date, formatter);
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for JSR310 LocalDate type
+ */
+ public static class LocalDateTypeAdapter extends TypeAdapter {
+
+ private DateTimeFormatter formatter;
+
+ public LocalDateTypeAdapter() {
+ this(DateTimeFormatter.ISO_LOCAL_DATE);
+ }
+
+ public LocalDateTypeAdapter(DateTimeFormatter formatter) {
+ this.formatter = formatter;
+ }
+
+ public void setFormat(DateTimeFormatter dateFormat) {
+ this.formatter = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, LocalDate date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ out.value(formatter.format(date));
+ }
+ }
+
+ @Override
+ public LocalDate read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ return LocalDate.parse(date, formatter);
+ }
+ }
+ }
+
+ public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
+ offsetDateTimeTypeAdapter.setFormat(dateFormat);
+ }
+
+ public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
+ localDateTypeAdapter.setFormat(dateFormat);
+ }
+
+ /**
+ * Gson TypeAdapter for java.sql.Date type
+ * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
+ * (more efficient than SimpleDateFormat).
+ */
+ public static class SqlDateTypeAdapter extends TypeAdapter {
+
+ private DateFormat dateFormat;
+
+ public SqlDateTypeAdapter() {}
+
+ public SqlDateTypeAdapter(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ public void setFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, java.sql.Date date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ String value;
+ if (dateFormat != null) {
+ value = dateFormat.format(date);
+ } else {
+ value = date.toString();
+ }
+ out.value(value);
+ }
+ }
+
+ @Override
+ public java.sql.Date read(JsonReader in) throws IOException {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ try {
+ if (dateFormat != null) {
+ return new java.sql.Date(dateFormat.parse(date).getTime());
+ }
+ return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
+ } catch (ParseException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Gson TypeAdapter for java.util.Date type
+ * If the dateFormat is null, ISO8601Utils will be used.
+ */
+ public static class DateTypeAdapter extends TypeAdapter {
+
+ private DateFormat dateFormat;
+
+ public DateTypeAdapter() {}
+
+ public DateTypeAdapter(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ public void setFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ }
+
+ @Override
+ public void write(JsonWriter out, Date date) throws IOException {
+ if (date == null) {
+ out.nullValue();
+ } else {
+ String value;
+ if (dateFormat != null) {
+ value = dateFormat.format(date);
+ } else {
+ value = ISO8601Utils.format(date, true);
+ }
+ out.value(value);
+ }
+ }
+
+ @Override
+ public Date read(JsonReader in) throws IOException {
+ try {
+ switch (in.peek()) {
+ case NULL:
+ in.nextNull();
+ return null;
+ default:
+ String date = in.nextString();
+ try {
+ if (dateFormat != null) {
+ return dateFormat.parse(date);
+ }
+ return ISO8601Utils.parse(date, new ParsePosition(0));
+ } catch (ParseException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ throw new JsonParseException(e);
+ }
+ }
+ }
+
+ public static void setDateFormat(DateFormat dateFormat) {
+ dateTypeAdapter.setFormat(dateFormat);
+ }
+
+ public static void setSqlDateFormat(DateFormat dateFormat) {
+ sqlDateTypeAdapter.setFormat(dateFormat);
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/Pair.java b/utils/sdk/client/java/src/main/java/invalidPackageName/Pair.java
new file mode 100644
index 00000000..7aff7ba5
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/Pair.java
@@ -0,0 +1,37 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class Pair {
+ private final String name;
+ private final String value;
+
+ public Pair(String name, String value) {
+ this.name = isValidString(name) ? name : "";
+ this.value = isValidString(value) ? value : "";
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ private static boolean isValidString(String arg) {
+ return arg != null;
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressRequestBody.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressRequestBody.java
new file mode 100644
index 00000000..017534b1
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressRequestBody.java
@@ -0,0 +1,73 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import okhttp3.MediaType;
+import okhttp3.RequestBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.ForwardingSink;
+import okio.Okio;
+import okio.Sink;
+
+public class ProgressRequestBody extends RequestBody {
+
+ private final RequestBody requestBody;
+
+ private final ApiCallback callback;
+
+ public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) {
+ this.requestBody = requestBody;
+ this.callback = callback;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return requestBody.contentType();
+ }
+
+ @Override
+ public long contentLength() throws IOException {
+ return requestBody.contentLength();
+ }
+
+ @Override
+ public void writeTo(BufferedSink sink) throws IOException {
+ BufferedSink bufferedSink = Okio.buffer(sink(sink));
+ requestBody.writeTo(bufferedSink);
+ bufferedSink.flush();
+ }
+
+ private Sink sink(Sink sink) {
+ return new ForwardingSink(sink) {
+
+ long bytesWritten = 0L;
+ long contentLength = 0L;
+
+ @Override
+ public void write(Buffer source, long byteCount) throws IOException {
+ super.write(source, byteCount);
+ if (contentLength == 0) {
+ contentLength = contentLength();
+ }
+
+ bytesWritten += byteCount;
+ callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength);
+ }
+ };
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressResponseBody.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressResponseBody.java
new file mode 100644
index 00000000..dda8e80a
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ProgressResponseBody.java
@@ -0,0 +1,70 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import okhttp3.MediaType;
+import okhttp3.ResponseBody;
+
+import java.io.IOException;
+
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+import okio.Source;
+
+public class ProgressResponseBody extends ResponseBody {
+
+ private final ResponseBody responseBody;
+ private final ApiCallback callback;
+ private BufferedSource bufferedSource;
+
+ public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) {
+ this.responseBody = responseBody;
+ this.callback = callback;
+ }
+
+ @Override
+ public MediaType contentType() {
+ return responseBody.contentType();
+ }
+
+ @Override
+ public long contentLength() {
+ return responseBody.contentLength();
+ }
+
+ @Override
+ public BufferedSource source() {
+ if (bufferedSource == null) {
+ bufferedSource = Okio.buffer(source(responseBody.source()));
+ }
+ return bufferedSource;
+ }
+
+ private Source source(Source source) {
+ return new ForwardingSource(source) {
+ long totalBytesRead = 0L;
+
+ @Override
+ public long read(Buffer sink, long byteCount) throws IOException {
+ long bytesRead = super.read(sink, byteCount);
+ // read() returns the number of bytes read, or -1 if this source is exhausted.
+ totalBytesRead += bytesRead != -1 ? bytesRead : 0;
+ callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1);
+ return bytesRead;
+ }
+ };
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ServerConfiguration.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerConfiguration.java
new file mode 100644
index 00000000..49a1823e
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerConfiguration.java
@@ -0,0 +1,72 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import java.util.Map;
+
+/**
+ * Representing a Server configuration.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class ServerConfiguration {
+ public String URL;
+ public String description;
+ public Map variables;
+
+ /**
+ * @param URL A URL to the target host.
+ * @param description A description of the host designated by the URL.
+ * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
+ */
+ public ServerConfiguration(String URL, String description, Map variables) {
+ this.URL = URL;
+ this.description = description;
+ this.variables = variables;
+ }
+
+ /**
+ * Format URL template using given variables.
+ *
+ * @param variables A map between a variable name and its value.
+ * @return Formatted URL.
+ */
+ public String URL(Map variables) {
+ String url = this.URL;
+
+ // go through variables and replace placeholders
+ for (Map.Entry variable: this.variables.entrySet()) {
+ String name = variable.getKey();
+ ServerVariable serverVariable = variable.getValue();
+ String value = serverVariable.defaultValue;
+
+ if (variables != null && variables.containsKey(name)) {
+ value = variables.get(name);
+ if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
+ throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
+ }
+ }
+ url = url.replace("{" + name + "}", value);
+ }
+ return url;
+ }
+
+ /**
+ * Format URL template using default server variables.
+ *
+ * @return Formatted URL.
+ */
+ public String URL() {
+ return URL(null);
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/ServerVariable.java b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerVariable.java
new file mode 100644
index 00000000..c1c27ffe
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/ServerVariable.java
@@ -0,0 +1,37 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import java.util.HashSet;
+
+/**
+ * Representing a Server Variable for server URL template substitution.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class ServerVariable {
+ public String description;
+ public String defaultValue;
+ public HashSet enumValues = null;
+
+ /**
+ * @param description A description for the server variable.
+ * @param defaultValue The default value to use for substitution.
+ * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
+ */
+ public ServerVariable(String description, String defaultValue, HashSet enumValues) {
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.enumValues = enumValues;
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/StringUtil.java b/utils/sdk/client/java/src/main/java/invalidPackageName/StringUtil.java
new file mode 100644
index 00000000..e395bb59
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/StringUtil.java
@@ -0,0 +1,83 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) {
+ return true;
+ }
+ if (value != null && value.equalsIgnoreCase(str)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) {
+ return "";
+ }
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+
+ /**
+ * Join a list of strings with the given separator.
+ *
+ * @param list The list of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(Collection list, String separator) {
+ Iterator iterator = list.iterator();
+ StringBuilder out = new StringBuilder();
+ if (iterator.hasNext()) {
+ out.append(iterator.next());
+ }
+ while (iterator.hasNext()) {
+ out.append(separator).append(iterator.next());
+ }
+ return out.toString();
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/ApiKeyAuth.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/ApiKeyAuth.java
new file mode 100644
index 00000000..7a86627f
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/ApiKeyAuth.java
@@ -0,0 +1,80 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName.auth;
+
+import invalidPackageName.ApiException;
+import invalidPackageName.Pair;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class ApiKeyAuth implements Authentication {
+ private final String location;
+ private final String paramName;
+
+ private String apiKey;
+ private String apiKeyPrefix;
+
+ public ApiKeyAuth(String location, String paramName) {
+ this.location = location;
+ this.paramName = paramName;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getParamName() {
+ return paramName;
+ }
+
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ public String getApiKeyPrefix() {
+ return apiKeyPrefix;
+ }
+
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ this.apiKeyPrefix = apiKeyPrefix;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams,
+ String payload, String method, URI uri) throws ApiException {
+ if (apiKey == null) {
+ return;
+ }
+ String value;
+ if (apiKeyPrefix != null) {
+ value = apiKeyPrefix + " " + apiKey;
+ } else {
+ value = apiKey;
+ }
+ if ("query".equals(location)) {
+ queryParams.add(new Pair(paramName, value));
+ } else if ("header".equals(location)) {
+ headerParams.put(paramName, value);
+ } else if ("cookie".equals(location)) {
+ cookieParams.put(paramName, value);
+ }
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/Authentication.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/Authentication.java
new file mode 100644
index 00000000..7db9dcf9
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/Authentication.java
@@ -0,0 +1,37 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName.auth;
+
+import invalidPackageName.Pair;
+import invalidPackageName.ApiException;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public interface Authentication {
+ /**
+ * Apply authentication settings to header and query params.
+ *
+ * @param queryParams List of query parameters
+ * @param headerParams Map of header parameters
+ * @param cookieParams Map of cookie parameters
+ * @param payload HTTP request body
+ * @param method HTTP method
+ * @param uri URI
+ * @throws ApiException if failed to update the parameters
+ */
+ void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException;
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBasicAuth.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBasicAuth.java
new file mode 100644
index 00000000..eb8d81a5
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBasicAuth.java
@@ -0,0 +1,55 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName.auth;
+
+import invalidPackageName.Pair;
+import invalidPackageName.ApiException;
+
+import okhttp3.Credentials;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+public class HttpBasicAuth implements Authentication {
+ private String username;
+ private String password;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams,
+ String payload, String method, URI uri) throws ApiException {
+ if (username == null && password == null) {
+ return;
+ }
+ headerParams.put("Authorization", Credentials.basic(
+ username == null ? "" : username,
+ password == null ? "" : password));
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBearerAuth.java b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBearerAuth.java
new file mode 100644
index 00000000..ff90ba05
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/invalidPackageName/auth/HttpBearerAuth.java
@@ -0,0 +1,75 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package invalidPackageName.auth;
+
+import invalidPackageName.ApiException;
+import invalidPackageName.Pair;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Supplier;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-10-19T15:35:02.750468+01:00[Europe/London]", comments = "Generator version: 7.16.0")
+public class HttpBearerAuth implements Authentication {
+ private final String scheme;
+ private Supplier tokenSupplier;
+
+ public HttpBearerAuth(String scheme) {
+ this.scheme = scheme;
+ }
+
+ /**
+ * Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @return The bearer token
+ */
+ public String getBearerToken() {
+ return tokenSupplier.get();
+ }
+
+ /**
+ * Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param bearerToken The bearer token to send in the Authorization header
+ */
+ public void setBearerToken(String bearerToken) {
+ this.tokenSupplier = () -> bearerToken;
+ }
+
+ /**
+ * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header
+ */
+ public void setBearerToken(Supplier tokenSupplier) {
+ this.tokenSupplier = tokenSupplier;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams,
+ String payload, String method, URI uri) throws ApiException {
+ String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null);
+ if (bearerToken == null) {
+ return;
+ }
+
+ headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
+ }
+
+ private static String upperCaseBearer(String scheme) {
+ return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/lthn/BlockApi.java b/utils/sdk/client/java/src/main/java/lthn/BlockApi.java
new file mode 100644
index 00000000..8cf77f2d
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/lthn/BlockApi.java
@@ -0,0 +1,727 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package lthn;
+
+import invalidPackageName.ApiCallback;
+import invalidPackageName.ApiClient;
+import invalidPackageName.ApiException;
+import invalidPackageName.ApiResponse;
+import invalidPackageName.Configuration;
+import invalidPackageName.Pair;
+import invalidPackageName.ProgressRequestBody;
+import invalidPackageName.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import org.openapitools.client.model.BlockDetailsModel;
+import org.openapitools.client.model.BlockTemplateModel;
+import org.openapitools.client.model.BlockTemplateRequestModel;
+import org.openapitools.client.model.HeightModel;
+import org.openapitools.client.model.SubmitBlockRequestModel;
+import org.openapitools.client.model.SubmitBlockResponseModel;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class BlockApi {
+ private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
+
+ public BlockApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public BlockApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public int getHostIndex() {
+ return localHostIndex;
+ }
+
+ public void setHostIndex(int hostIndex) {
+ this.localHostIndex = hostIndex;
+ }
+
+ public String getCustomBaseUrl() {
+ return localCustomBaseUrl;
+ }
+
+ public void setCustomBaseUrl(String customBaseUrl) {
+ this.localCustomBaseUrl = customBaseUrl;
+ }
+
+ /**
+ * Build call for createBlockTemplate
+ * @param blockTemplateRequestModel (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 500 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call createBlockTemplateCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = blockTemplateRequestModel;
+
+ // create path and map variables
+ String localVarPath = "/block/template";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call createBlockTemplateValidateBeforeCall(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'blockTemplateRequestModel' is set
+ if (blockTemplateRequestModel == null) {
+ throw new ApiException("Missing the required parameter 'blockTemplateRequestModel' when calling createBlockTemplate(Async)");
+ }
+
+ return createBlockTemplateCall(blockTemplateRequestModel, _callback);
+
+ }
+
+ /**
+ * Create a block template for mining
+ *
+ * @param blockTemplateRequestModel (required)
+ * @return BlockTemplateModel
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 500 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public BlockTemplateModel createBlockTemplate(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException {
+ ApiResponse localVarResp = createBlockTemplateWithHttpInfo(blockTemplateRequestModel);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Create a block template for mining
+ *
+ * @param blockTemplateRequestModel (required)
+ * @return ApiResponse<BlockTemplateModel>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 500 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public ApiResponse createBlockTemplateWithHttpInfo(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel) throws ApiException {
+ okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Create a block template for mining (asynchronously)
+ *
+ * @param blockTemplateRequestModel (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 500 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call createBlockTemplateAsync(@javax.annotation.Nonnull BlockTemplateRequestModel blockTemplateRequestModel, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = createBlockTemplateValidateBeforeCall(blockTemplateRequestModel, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getBlock
+ * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call getBlockCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/block/{identifier}"
+ .replace("{" + "identifier" + "}", localVarApiClient.escapeString(identifier.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getBlockValidateBeforeCall(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'identifier' is set
+ if (identifier == null) {
+ throw new ApiException("Missing the required parameter 'identifier' when calling getBlock(Async)");
+ }
+
+ return getBlockCall(identifier, _callback);
+
+ }
+
+ /**
+ * Get a block by its hash or height (ID)
+ *
+ * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
+ * @return BlockDetailsModel
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public BlockDetailsModel getBlock(@javax.annotation.Nonnull String identifier) throws ApiException {
+ ApiResponse localVarResp = getBlockWithHttpInfo(identifier);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Get a block by its hash or height (ID)
+ *
+ * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
+ * @return ApiResponse<BlockDetailsModel>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public ApiResponse getBlockWithHttpInfo(@javax.annotation.Nonnull String identifier) throws ApiException {
+ okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Get a block by its hash or height (ID) (asynchronously)
+ *
+ * @param identifier The hash (hex string) or height (integer) of the block to retrieve. (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call getBlockAsync(@javax.annotation.Nonnull String identifier, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getBlockValidateBeforeCall(identifier, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getBlocks
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | A list of block objects. | - |
+
+ */
+ public okhttp3.Call getBlocksCall(final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/block";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getBlocksValidateBeforeCall(final ApiCallback _callback) throws ApiException {
+ return getBlocksCall(_callback);
+
+ }
+
+ /**
+ * Get one or more blocks, with optional pagination.
+ *
+ * @return List<BlockDetailsModel>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | A list of block objects. | - |
+
+ */
+ public List getBlocks() throws ApiException {
+ ApiResponse> localVarResp = getBlocksWithHttpInfo();
+ return localVarResp.getData();
+ }
+
+ /**
+ * Get one or more blocks, with optional pagination.
+ *
+ * @return ApiResponse<List<BlockDetailsModel>>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | A list of block objects. | - |
+
+ */
+ public ApiResponse> getBlocksWithHttpInfo() throws ApiException {
+ okhttp3.Call localVarCall = getBlocksValidateBeforeCall(null);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Get one or more blocks, with optional pagination. (asynchronously)
+ *
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 404 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | A list of block objects. | - |
+
+ */
+ public okhttp3.Call getBlocksAsync(final ApiCallback> _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getBlocksValidateBeforeCall(_callback);
+ Type localVarReturnType = new TypeToken>(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for getHeight
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call getHeightCall(final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/block/height";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getHeightValidateBeforeCall(final ApiCallback _callback) throws ApiException {
+ return getHeightCall(_callback);
+
+ }
+
+ /**
+ * Get the current blockchain height
+ *
+ * @return HeightModel
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public HeightModel getHeight() throws ApiException {
+ ApiResponse localVarResp = getHeightWithHttpInfo();
+ return localVarResp.getData();
+ }
+
+ /**
+ * Get the current blockchain height
+ *
+ * @return ApiResponse<HeightModel>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public ApiResponse getHeightWithHttpInfo() throws ApiException {
+ okhttp3.Call localVarCall = getHeightValidateBeforeCall(null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Get the current blockchain height (asynchronously)
+ *
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call getHeightAsync(final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getHeightValidateBeforeCall(_callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for submitBlock
+ * @param submitBlockRequestModel (required)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 406 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call submitBlockCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = submitBlockRequestModel;
+
+ // create path and map variables
+ String localVarPath = "/block/submit";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call submitBlockValidateBeforeCall(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException {
+ // verify the required parameter 'submitBlockRequestModel' is set
+ if (submitBlockRequestModel == null) {
+ throw new ApiException("Missing the required parameter 'submitBlockRequestModel' when calling submitBlock(Async)");
+ }
+
+ return submitBlockCall(submitBlockRequestModel, _callback);
+
+ }
+
+ /**
+ * Submit a new block to the network
+ *
+ * @param submitBlockRequestModel (required)
+ * @return SubmitBlockResponseModel
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 406 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public SubmitBlockResponseModel submitBlock(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException {
+ ApiResponse localVarResp = submitBlockWithHttpInfo(submitBlockRequestModel);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Submit a new block to the network
+ *
+ * @param submitBlockRequestModel (required)
+ * @return ApiResponse<SubmitBlockResponseModel>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 406 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public ApiResponse submitBlockWithHttpInfo(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel) throws ApiException {
+ okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Submit a new block to the network (asynchronously)
+ *
+ * @param submitBlockRequestModel (required)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 406 | text/plain | - |
+ | 400 | text/plain | - |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call submitBlockAsync(@javax.annotation.Nonnull SubmitBlockRequestModel submitBlockRequestModel, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = submitBlockValidateBeforeCall(submitBlockRequestModel, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/lthn/InfoApi.java b/utils/sdk/client/java/src/main/java/lthn/InfoApi.java
new file mode 100644
index 00000000..dec1ccb5
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/lthn/InfoApi.java
@@ -0,0 +1,318 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package lthn;
+
+import invalidPackageName.ApiCallback;
+import invalidPackageName.ApiClient;
+import invalidPackageName.ApiException;
+import invalidPackageName.ApiResponse;
+import invalidPackageName.Configuration;
+import invalidPackageName.Pair;
+import invalidPackageName.ProgressRequestBody;
+import invalidPackageName.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import org.openapitools.client.model.InfoModel;
+import org.openapitools.client.model.VersionModel;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class InfoApi {
+ private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
+
+ public InfoApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public InfoApi(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return localVarApiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.localVarApiClient = apiClient;
+ }
+
+ public int getHostIndex() {
+ return localHostIndex;
+ }
+
+ public void setHostIndex(int hostIndex) {
+ this.localHostIndex = hostIndex;
+ }
+
+ public String getCustomBaseUrl() {
+ return localCustomBaseUrl;
+ }
+
+ public void setCustomBaseUrl(String customBaseUrl) {
+ this.localCustomBaseUrl = customBaseUrl;
+ }
+
+ /**
+ * Build call for getInfo
+ * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call getInfoCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/info";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ if (flags != null) {
+ localVarQueryParams.addAll(localVarApiClient.parameterToPair("flags", flags));
+ }
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call getInfoValidateBeforeCall(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException {
+ return getInfoCall(flags, _callback);
+
+ }
+
+ /**
+ * Get detailed information about the blockchain and daemon state
+ *
+ * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
+ * @return InfoModel
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public InfoModel getInfo(@javax.annotation.Nullable String flags) throws ApiException {
+ ApiResponse localVarResp = getInfoWithHttpInfo(flags);
+ return localVarResp.getData();
+ }
+
+ /**
+ * Get detailed information about the blockchain and daemon state
+ *
+ * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
+ * @return ApiResponse<InfoModel>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public ApiResponse getInfoWithHttpInfo(@javax.annotation.Nullable String flags) throws ApiException {
+ okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Get detailed information about the blockchain and daemon state (asynchronously)
+ *
+ * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call getInfoAsync(@javax.annotation.Nullable String flags, final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getInfoValidateBeforeCall(flags, _callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+ /**
+ * Build call for version
+ * @param _callback Callback for upload/download progress
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call versionCall(final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
+ Object localVarPostBody = null;
+
+ // create path and map variables
+ String localVarPath = "/info/version";
+
+ List localVarQueryParams = new ArrayList();
+ List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
+ if (localVarAccept != null) {
+ localVarHeaderParams.put("Accept", localVarAccept);
+ }
+
+ final String[] localVarContentTypes = {
+ };
+ final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
+
+ String[] localVarAuthNames = new String[] { };
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ }
+
+ @SuppressWarnings("rawtypes")
+ private okhttp3.Call versionValidateBeforeCall(final ApiCallback _callback) throws ApiException {
+ return versionCall(_callback);
+
+ }
+
+ /**
+ * Get API version
+ * Returns the current version of the API.
+ * @return VersionModel
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public VersionModel version() throws ApiException {
+ ApiResponse localVarResp = versionWithHttpInfo();
+ return localVarResp.getData();
+ }
+
+ /**
+ * Get API version
+ * Returns the current version of the API.
+ * @return ApiResponse<VersionModel>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public ApiResponse versionWithHttpInfo() throws ApiException {
+ okhttp3.Call localVarCall = versionValidateBeforeCall(null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ /**
+ * Get API version (asynchronously)
+ * Returns the current version of the API.
+ * @param _callback The callback to be executed when the API call finishes
+ * @return The request call
+ * @throws ApiException If fail to process the API call, e.g. serializing the request body object
+ * @http.response.details
+
+ Response Details
+ | Status Code | Description | Response Headers |
+ | 200 | OK | - |
+
+ */
+ public okhttp3.Call versionAsync(final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = versionValidateBeforeCall(_callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+}
diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ApiCallback.java b/utils/sdk/client/java/src/main/java/org/lthn/ApiCallback.java
new file mode 100644
index 00000000..2aeedc6f
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/org/lthn/ApiCallback.java
@@ -0,0 +1,62 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.lthn;
+
+import java.io.IOException;
+
+import java.util.Map;
+import java.util.List;
+
+/**
+ * Callback for asynchronous API call.
+ *
+ * @param The return type
+ */
+public interface ApiCallback {
+ /**
+ * This is called when the API call fails.
+ *
+ * @param e The exception causing the failure
+ * @param statusCode Status code of the response if available, otherwise it would be 0
+ * @param responseHeaders Headers of the response if available, otherwise it would be null
+ */
+ void onFailure(ApiException e, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API call succeeded.
+ *
+ * @param result The result deserialized from response
+ * @param statusCode Status code of the response
+ * @param responseHeaders Headers of the response
+ */
+ void onSuccess(T result, int statusCode, Map> responseHeaders);
+
+ /**
+ * This is called when the API upload processing.
+ *
+ * @param bytesWritten bytes Written
+ * @param contentLength content length of request body
+ * @param done write end
+ */
+ void onUploadProgress(long bytesWritten, long contentLength, boolean done);
+
+ /**
+ * This is called when the API download processing.
+ *
+ * @param bytesRead bytes Read
+ * @param contentLength content length of the response
+ * @param done Read end
+ */
+ void onDownloadProgress(long bytesRead, long contentLength, boolean done);
+}
diff --git a/utils/sdk/client/java/src/main/java/org/lthn/ApiClient.java b/utils/sdk/client/java/src/main/java/org/lthn/ApiClient.java
new file mode 100644
index 00000000..8b9d4fe1
--- /dev/null
+++ b/utils/sdk/client/java/src/main/java/org/lthn/ApiClient.java
@@ -0,0 +1,1592 @@
+/*
+ * Lethean Blockchain API
+ * OpenAPI for Lethean Blockchain
+ *
+ * The version of the OpenAPI document: 6.0.1
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.lthn;
+
+import okhttp3.*;
+import okhttp3.internal.http.HttpMethod;
+import okhttp3.internal.tls.OkHostnameVerifier;
+import okhttp3.logging.HttpLoggingInterceptor;
+import okhttp3.logging.HttpLoggingInterceptor.Level;
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.Okio;
+
+import javax.net.ssl.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Type;
+import java.net.URI;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.SecureRandom;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.text.DateFormat;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.lthn.auth.Authentication;
+import org.lthn.auth.HttpBasicAuth;
+import org.lthn.auth.HttpBearerAuth;
+import org.lthn.auth.ApiKeyAuth;
+
+/**
+ * ApiClient class.
+ */
+public class ApiClient {
+
+ protected String basePath = "http://127.0.0.1:36943";
+ protected List servers = new ArrayList(Arrays.asList(
+ new ServerConfiguration(
+ "http://127.0.0.1:36943",
+ "Local Daemon",
+ new HashMap()
+ ),
+ new ServerConfiguration(
+ "http://seed.lethean.io:36943",
+ "Seed Server",
+ new HashMap()
+ )
+ ));
+ protected Integer serverIndex = 0;
+ protected Map serverVariables = null;
+ protected boolean debugging = false;
+ protected Map defaultHeaderMap = new HashMap();
+ protected Map defaultCookieMap = new HashMap();
+ protected String tempFolderPath = null;
+
+ protected Map authentications;
+
+ protected DateFormat dateFormat;
+ protected DateFormat datetimeFormat;
+ protected boolean lenientDatetimeFormat;
+ protected int dateLength;
+
+ protected InputStream sslCaCert;
+ protected boolean verifyingSsl;
+ protected KeyManager[] keyManagers;
+
+ protected OkHttpClient httpClient;
+ protected JSON json;
+
+ protected HttpLoggingInterceptor loggingInterceptor;
+
+ /**
+ * Basic constructor for ApiClient
+ */
+ public ApiClient() {
+ init();
+ initHttpClient();
+
+ // Setup authentications (key: authentication name, value: authentication).
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ /**
+ * Basic constructor with custom OkHttpClient
+ *
+ * @param client a {@link okhttp3.OkHttpClient} object
+ */
+ public ApiClient(OkHttpClient client) {
+ init();
+
+ httpClient = client;
+
+ // Setup authentications (key: authentication name, value: authentication).
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ protected void initHttpClient() {
+ initHttpClient(Collections.emptyList());
+ }
+
+ protected void initHttpClient(List interceptors) {
+ OkHttpClient.Builder builder = new OkHttpClient.Builder();
+ builder.addNetworkInterceptor(getProgressInterceptor());
+ for (Interceptor interceptor: interceptors) {
+ builder.addInterceptor(interceptor);
+ }
+
+ httpClient = builder.build();
+ }
+
+ protected void init() {
+ verifyingSsl = true;
+
+ json = new JSON();
+
+ // Set default User-Agent.
+ setUserAgent("OpenAPI-Generator/6.0.1/java");
+
+ authentications = new HashMap();
+ }
+
+ /**
+ * Get base path
+ *
+ * @return Base path
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Set base path
+ *
+ * @param basePath Base path of the URL (e.g http://127.0.0.1:36943)
+ * @return An instance of ApiClient
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ this.serverIndex = null;
+ return this;
+ }
+
+ public List getServers() {
+ return servers;
+ }
+
+ public ApiClient setServers(List servers) {
+ this.servers = servers;
+ return this;
+ }
+
+ public Integer getServerIndex() {
+ return serverIndex;
+ }
+
+ public ApiClient setServerIndex(Integer serverIndex) {
+ this.serverIndex = serverIndex;
+ return this;
+ }
+
+ public Map getServerVariables() {
+ return serverVariables;
+ }
+
+ public ApiClient setServerVariables(Map serverVariables) {
+ this.serverVariables = serverVariables;
+ return this;
+ }
+
+ /**
+ * Get HTTP client
+ *
+ * @return An instance of OkHttpClient
+ */
+ public OkHttpClient getHttpClient() {
+ return httpClient;
+ }
+
+ /**
+ * Set HTTP client, which must never be null.
+ *
+ * @param newHttpClient An instance of OkHttpClient
+ * @return ApiClient
+ * @throws java.lang.NullPointerException when newHttpClient is null
+ */
+ public ApiClient setHttpClient(OkHttpClient newHttpClient) {
+ this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!");
+ return this;
+ }
+
+ /**
+ * Get JSON
+ *
+ * @return JSON object
+ */
+ public JSON getJSON() {
+ return json;
+ }
+
+ /**
+ * Set JSON
+ *
+ * @param json JSON object
+ * @return Api client
+ */
+ public ApiClient setJSON(JSON json) {
+ this.json = json;
+ return this;
+ }
+
+ /**
+ * True if isVerifyingSsl flag is on
+ *
+ * @return True if isVerifySsl flag is on
+ */
+ public boolean isVerifyingSsl() {
+ return verifyingSsl;
+ }
+
+ /**
+ * Configure whether to verify certificate and hostname when making https requests.
+ * Default to true.
+ * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks.
+ *
+ * @param verifyingSsl True to verify TLS/SSL connection
+ * @return ApiClient
+ */
+ public ApiClient setVerifyingSsl(boolean verifyingSsl) {
+ this.verifyingSsl = verifyingSsl;
+ applySslSettings();
+ return this;
+ }
+
+ /**
+ * Get SSL CA cert.
+ *
+ * @return Input stream to the SSL CA cert
+ */
+ public InputStream getSslCaCert() {
+ return sslCaCert;
+ }
+
+ /**
+ * Configure the CA certificate to be trusted when making https requests.
+ * Use null to reset to default.
+ *
+ * @param sslCaCert input stream for SSL CA cert
+ * @return ApiClient
+ */
+ public ApiClient setSslCaCert(InputStream sslCaCert) {
+ this.sslCaCert = sslCaCert;
+ applySslSettings();
+ return this;
+ }
+
+ /**
+ * Getter for the field keyManagers.
+ *
+ * @return an array of {@link javax.net.ssl.KeyManager} objects
+ */
+ public KeyManager[] getKeyManagers() {
+ return keyManagers;
+ }
+
+ /**
+ * Configure client keys to use for authorization in an SSL session.
+ * Use null to reset to default.
+ *
+ * @param managers The KeyManagers to use
+ * @return ApiClient
+ */
+ public ApiClient setKeyManagers(KeyManager[] managers) {
+ this.keyManagers = managers;
+ applySslSettings();
+ return this;
+ }
+
+ /**
+ * Getter for the field dateFormat.
+ *
+ * @return a {@link java.text.DateFormat} object
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * Setter for the field dateFormat.
+ *
+ * @param dateFormat a {@link java.text.DateFormat} object
+ * @return a {@link org.lthn.ApiClient} object
+ */
+ public ApiClient setDateFormat(DateFormat dateFormat) {
+ JSON.setDateFormat(dateFormat);
+ return this;
+ }
+
+ /**
+ * Set SqlDateFormat.
+ *
+ * @param dateFormat a {@link java.text.DateFormat} object
+ * @return a {@link org.lthn.ApiClient} object
+ */
+ public ApiClient setSqlDateFormat(DateFormat dateFormat) {
+ JSON.setSqlDateFormat(dateFormat);
+ return this;
+ }
+
+ /**
+ * Set OffsetDateTimeFormat.
+ *
+ * @param dateFormat a {@link java.time.format.DateTimeFormatter} object
+ * @return a {@link org.lthn.ApiClient} object
+ */
+ public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
+ JSON.setOffsetDateTimeFormat(dateFormat);
+ return this;
+ }
+
+ /**
+ * Set LocalDateFormat.
+ *
+ * @param dateFormat a {@link java.time.format.DateTimeFormatter} object
+ * @return a {@link org.lthn.ApiClient} object
+ */
+ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
+ JSON.setLocalDateFormat(dateFormat);
+ return this;
+ }
+
+ /**
+ * Set LenientOnJson.
+ *
+ * @param lenientOnJson a boolean
+ * @return a {@link org.lthn.ApiClient} object
+ */
+ public ApiClient setLenientOnJson(boolean lenientOnJson) {
+ JSON.setLenientOnJson(lenientOnJson);
+ return this;
+ }
+
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ *
+ * @return Map of authentication objects
+ */
+ public Map getAuthentications() {
+ return authentications;
+ }
+
+ /**
+ * Get authentication for the given name.
+ *
+ * @param authName The authentication name
+ * @return The authentication, null if not found
+ */
+ public Authentication getAuthentication(String authName) {
+ return authentications.get(authName);
+ }
+
+
+ /**
+ * Helper method to set username for the first HTTP basic authentication.
+ *
+ * @param username Username
+ */
+ public void setUsername(String username) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setUsername(username);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set password for the first HTTP basic authentication.
+ *
+ * @param password Password
+ */
+ public void setPassword(String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setPassword(password);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key value for the first API key authentication.
+ *
+ * @param apiKey API key
+ */
+ public void setApiKey(String apiKey) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKey(apiKey);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key prefix for the first API key authentication.
+ *
+ * @param apiKeyPrefix API key prefix
+ */
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set access token for the first OAuth2 authentication.
+ *
+ * @param accessToken Access token
+ */
+ public void setAccessToken(String accessToken) {
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set credentials for AWSV4 Signature
+ *
+ * @param accessKey Access Key
+ * @param secretKey Secret Key
+ * @param region Region
+ * @param service Service to access to
+ */
+ public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) {
+ throw new RuntimeException("No AWS4 authentication configured!");
+ }
+
+ /**
+ * Helper method to set credentials for AWSV4 Signature
+ *
+ * @param accessKey Access Key
+ * @param secretKey Secret Key
+ * @param sessionToken Session Token
+ * @param region Region
+ * @param service Service to access to
+ */
+ public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) {
+ throw new RuntimeException("No AWS4 authentication configured!");
+ }
+
+ /**
+ * Set the User-Agent header's value (by adding to the default header map).
+ *
+ * @param userAgent HTTP request's user agent
+ * @return ApiClient
+ */
+ public ApiClient setUserAgent(String userAgent) {
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param key The header's key
+ * @param value The header's value
+ * @return ApiClient
+ */
+ public ApiClient addDefaultHeader(String key, String value) {
+ defaultHeaderMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Add a default cookie.
+ *
+ * @param key The cookie's key
+ * @param value The cookie's value
+ * @return ApiClient
+ */
+ public ApiClient addDefaultCookie(String key, String value) {
+ defaultCookieMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Check that whether debugging is enabled for this API client.
+ *
+ * @return True if debugging is enabled, false otherwise.
+ */
+ public boolean isDebugging() {
+ return debugging;
+ }
+
+ /**
+ * Enable/disable debugging for this API client.
+ *
+ * @param debugging To enable (true) or disable (false) debugging
+ * @return ApiClient
+ */
+ public ApiClient setDebugging(boolean debugging) {
+ if (debugging != this.debugging) {
+ if (debugging) {
+ loggingInterceptor = new HttpLoggingInterceptor();
+ loggingInterceptor.setLevel(Level.BODY);
+ httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build();
+ } else {
+ final OkHttpClient.Builder builder = httpClient.newBuilder();
+ builder.interceptors().remove(loggingInterceptor);
+ httpClient = builder.build();
+ loggingInterceptor = null;
+ }
+ }
+ this.debugging = debugging;
+ return this;
+ }
+
+ /**
+ * The path of temporary folder used to store downloaded files from endpoints
+ * with file response. The default value is null, i.e. using
+ * the system's default temporary folder.
+ *
+ * @see createTempFile
+ * @return Temporary folder path
+ */
+ public String getTempFolderPath() {
+ return tempFolderPath;
+ }
+
+ /**
+ * Set the temporary folder path (for downloading files)
+ *
+ * @param tempFolderPath Temporary folder path
+ * @return ApiClient
+ */
+ public ApiClient setTempFolderPath(String tempFolderPath) {
+ this.tempFolderPath = tempFolderPath;
+ return this;
+ }
+
+ /**
+ * Get connection timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getConnectTimeout() {
+ return httpClient.connectTimeoutMillis();
+ }
+
+ /**
+ * Sets the connect timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link java.lang.Integer#MAX_VALUE}.
+ *
+ * @param connectionTimeout connection timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setConnectTimeout(int connectionTimeout) {
+ httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build();
+ return this;
+ }
+
+ /**
+ * Get read timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getReadTimeout() {
+ return httpClient.readTimeoutMillis();
+ }
+
+ /**
+ * Sets the read timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link java.lang.Integer#MAX_VALUE}.
+ *
+ * @param readTimeout read timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setReadTimeout(int readTimeout) {
+ httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build();
+ return this;
+ }
+
+ /**
+ * Get write timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public int getWriteTimeout() {
+ return httpClient.writeTimeoutMillis();
+ }
+
+ /**
+ * Sets the write timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link java.lang.Integer#MAX_VALUE}.
+ *
+ * @param writeTimeout connection timeout in milliseconds
+ * @return Api client
+ */
+ public ApiClient setWriteTimeout(int writeTimeout) {
+ httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build();
+ return this;
+ }
+
+
+ /**
+ * Format the given parameter object into string.
+ *
+ * @param param Parameter
+ * @return String representation of the parameter
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
+ //Serialize to json string and remove the " enclosing characters
+ String jsonStr = JSON.serialize(param);
+ return jsonStr.substring(1, jsonStr.length() - 1);
+ } else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for (Object o : (Collection) param) {
+ if (b.length() > 0) {
+ b.append(",");
+ }
+ b.append(o);
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /**
+ * Formats the specified query parameter to a list containing a single {@code Pair} object.
+ *
+ * Note that {@code value} must not be a collection.
+ *
+ * @param name The name of the parameter.
+ * @param value The value of the parameter.
+ * @return A list containing a single {@code Pair} object.
+ */
+ public List parameterToPair(String name, Object value) {
+ List params = new ArrayList();
+
+ // preconditions
+ if (name == null || name.isEmpty() || value == null || value instanceof Collection) {
+ return params;
+ }
+
+ params.add(new Pair(name, parameterToString(value)));
+ return params;
+ }
+
+ /**
+ * Formats the specified collection query parameters to a list of {@code Pair} objects.
+ *
+ * Note that the values of each of the returned Pair objects are percent-encoded.
+ *
+ * @param collectionFormat The collection format of the parameter.
+ * @param name The name of the parameter.
+ * @param value The value of the parameter.
+ * @return A list of {@code Pair} objects.
+ */
+ public List