ApiException class.
+ */
+@SuppressWarnings("serial")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
+public class ApiException extends RuntimeException {
+ 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("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/src/main/java/com/squidex/api/core/ApiResponse.java b/src/main/java/com/squidex/api/core/ApiResponse.java
new file mode 100644
index 0000000..617755b
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/ApiResponse.java
@@ -0,0 +1,76 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+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/src/main/java/com/squidex/api/core/ClientOptions.java b/src/main/java/com/squidex/api/core/ClientOptions.java
deleted file mode 100644
index 3398069..0000000
--- a/src/main/java/com/squidex/api/core/ClientOptions.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package com.squidex.api.core;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Supplier;
-import okhttp3.OkHttpClient;
-
-public final class ClientOptions {
- private final Environment environment;
-
- private final Map headers;
-
- private final Map> headerSuppliers;
-
- private final OkHttpClient httpClient;
-
- private String appName;
-
- private ClientOptions(
- Environment environment,
- Map headers,
- Map> headerSuppliers,
- OkHttpClient httpClient,
- String appName) {
- this.environment = environment;
- this.headers = new HashMap<>();
- this.headers.putAll(headers);
- this.headers.putAll(Map.of(
- "X-Fern-SDK-Name",
- "com.squidex.fern:api-sdk",
- "X-Fern-SDK-Version",
- "0.0.7",
- "X-Fern-Language",
- "JAVA"));
- this.headerSuppliers = headerSuppliers;
- this.httpClient = httpClient;
- this.appName = appName;
- }
-
- public Environment environment() {
- return this.environment;
- }
-
- public Map headers(RequestOptions requestOptions) {
- Map values = new HashMap<>(this.headers);
- headerSuppliers.forEach((key, supplier) -> {
- values.put(key, supplier.get());
- });
- if (requestOptions != null) {
- values.putAll(requestOptions.getHeaders());
- }
- return values;
- }
-
- public OkHttpClient httpClient() {
- return this.httpClient;
- }
-
- public String appName() {
- return this.appName;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static final class Builder {
- private Environment environment;
-
- private OkHttpClient httpClient;
-
- private final Map headers = new HashMap<>();
-
- private final Map> headerSuppliers = new HashMap<>();
-
- private String appName;
-
- public Builder environment(Environment environment) {
- this.environment = environment;
- return this;
- }
-
- public Builder addHeader(String key, String value) {
- this.headers.put(key, value);
- return this;
- }
-
- public Builder addHeader(String key, Supplier value) {
- this.headerSuppliers.put(key, value);
- return this;
- }
-
- public Builder appName(String appName) {
- this.appName = appName;
- return this;
- }
-
- public Builder httpClient(OkHttpClient httpClient) {
- this.httpClient = httpClient;
- return this;
- }
-
- public ClientOptions build() {
- if (this.httpClient == null) {
- this.httpClient = new OkHttpClient();
- }
-
- return new ClientOptions(environment, headers, headerSuppliers, this.httpClient, this.appName);
- }
- }
-}
diff --git a/src/main/java/com/squidex/api/core/Configuration.java b/src/main/java/com/squidex/api/core/Configuration.java
new file mode 100644
index 0000000..2505e65
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/Configuration.java
@@ -0,0 +1,41 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
+public class Configuration {
+ public static final String VERSION = "1.0.0.0";
+
+ private static ApiClient defaultApiClient = new ApiClient();
+
+ /**
+ * 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() {
+ return defaultApiClient;
+ }
+
+ /**
+ * 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 = apiClient;
+ }
+}
diff --git a/src/main/java/com/squidex/api/core/DateTimeDeserializer.java b/src/main/java/com/squidex/api/core/DateTimeDeserializer.java
deleted file mode 100644
index 91d7746..0000000
--- a/src/main/java/com/squidex/api/core/DateTimeDeserializer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.squidex.api.core;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import java.io.IOException;
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.time.OffsetDateTime;
-import java.time.ZoneOffset;
-import java.time.format.DateTimeFormatter;
-import java.time.temporal.TemporalAccessor;
-import java.time.temporal.TemporalQueries;
-
-/**
- * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects.
- */
-class DateTimeDeserializer extends JsonDeserializer {
- private static final SimpleModule MODULE;
-
- static {
- MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer());
- }
-
- /**
- * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper.
- *
- * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper.
- */
- public static SimpleModule getModule() {
- return MODULE;
- }
-
- @Override
- public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException {
- JsonToken token = parser.currentToken();
- if (token == JsonToken.VALUE_NUMBER_INT) {
- return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC);
- } else {
- TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest(
- parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from);
-
- if (temporal.query(TemporalQueries.offset()) == null) {
- return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC);
- } else {
- return OffsetDateTime.from(temporal);
- }
- }
- }
-}
diff --git a/src/main/java/com/squidex/api/core/Environment.java b/src/main/java/com/squidex/api/core/Environment.java
deleted file mode 100644
index 08db856..0000000
--- a/src/main/java/com/squidex/api/core/Environment.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.squidex.api.core;
-
-public final class Environment {
- public static final Environment DEFAULT = new Environment("https://cloud.squidex.io");
-
- private final String url;
-
- private Environment(String url) {
- this.url = url;
- }
-
- public String getUrl() {
- return this.url;
- }
-
- public static Environment custom(String url) {
- return new Environment(url);
- }
-}
diff --git a/src/main/java/com/squidex/api/core/GzipRequestInterceptor.java b/src/main/java/com/squidex/api/core/GzipRequestInterceptor.java
new file mode 100644
index 0000000..bf84afa
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/GzipRequestInterceptor.java
@@ -0,0 +1,85 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+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/src/main/java/com/squidex/api/core/JSON.java b/src/main/java/com/squidex/api/core/JSON.java
new file mode 100644
index 0000000..49d406f
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/JSON.java
@@ -0,0 +1,1093 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+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 com.google.gson.JsonObject;
+import com.google.gson.JsonPrimitive;
+import io.gsonfire.GsonFireBuilder;
+import io.gsonfire.PostProcessor;
+import io.gsonfire.TypeSelector;
+
+import okio.ByteString;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.lang.reflect.Type;
+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()
+ .registerPostProcessor(com.squidex.api.types.ArrayFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ArrayFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ArrayFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Array"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.AssetsFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.AssetsFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.AssetsFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Assets"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.BooleanFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.BooleanFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.BooleanFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Boolean"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.ComponentFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ComponentFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ComponentFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Component"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.ComponentsFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ComponentsFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ComponentsFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Components"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.DateTimeFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.DateTimeFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.DateTimeFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("DateTime"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.GeolocationFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.GeolocationFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.GeolocationFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Geolocation"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.JsonFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.JsonFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.JsonFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Json"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.NumberFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.NumberFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.NumberFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Number"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.ReferencesFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ReferencesFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ReferencesFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("References"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.RichTextFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.RichTextFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.RichTextFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("RichText"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.StringFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.StringFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.StringFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("String"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.TagsFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.TagsFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.TagsFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("Tags"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.UIFieldPropertiesDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.UIFieldPropertiesDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.UIFieldPropertiesDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("fieldType", new JsonPrimitive("UI"));
+ }
+ }
+ })
+ .registerTypeSelector(com.squidex.api.types.FieldPropertiesDto.class, new TypeSelector() {
+ @Override
+ public Class extends com.squidex.api.types.FieldPropertiesDto> getClassForElement(JsonElement readElement) {
+ Map classByDiscriminatorValue = new HashMap();
+ classByDiscriminatorValue.put("Array", com.squidex.api.types.ArrayFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Assets", com.squidex.api.types.AssetsFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Boolean", com.squidex.api.types.BooleanFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Component", com.squidex.api.types.ComponentFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Components", com.squidex.api.types.ComponentsFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("DateTime", com.squidex.api.types.DateTimeFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Geolocation", com.squidex.api.types.GeolocationFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Json", com.squidex.api.types.JsonFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Number", com.squidex.api.types.NumberFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("References", com.squidex.api.types.ReferencesFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("RichText", com.squidex.api.types.RichTextFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("String", com.squidex.api.types.StringFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("Tags", com.squidex.api.types.TagsFieldPropertiesDto.class);
+ classByDiscriminatorValue.put("UI", com.squidex.api.types.UIFieldPropertiesDto.class);
+ return getClassByDiscriminator(classByDiscriminatorValue,
+ getDiscriminatorValue(readElement, "fieldType"));
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.AlgoliaRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.AlgoliaRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.AlgoliaRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Algolia"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.AzureQueueRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.AzureQueueRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.AzureQueueRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("AzureQueue"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.CommentRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.CommentRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.CommentRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Comment"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.CreateContentRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.CreateContentRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.CreateContentRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("CreateContent"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.DiscourseRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.DiscourseRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.DiscourseRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Discourse"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.ElasticSearchRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ElasticSearchRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ElasticSearchRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("ElasticSearch"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.EmailRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.EmailRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.EmailRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Email"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.FastlyRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.FastlyRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.FastlyRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Fastly"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.MediumRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.MediumRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.MediumRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Medium"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.NotificationRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.NotificationRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.NotificationRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Notification"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.OpenSearchRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.OpenSearchRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.OpenSearchRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("OpenSearch"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.PrerenderRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.PrerenderRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.PrerenderRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Prerender"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.ScriptRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ScriptRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ScriptRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Script"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.SignalRRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.SignalRRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.SignalRRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("SignalR"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.SlackRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.SlackRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.SlackRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Slack"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.TweetRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.TweetRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.TweetRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Tweet"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.TypesenseRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.TypesenseRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.TypesenseRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Typesense"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.WebhookRuleActionDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.WebhookRuleActionDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.WebhookRuleActionDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("actionType", new JsonPrimitive("Webhook"));
+ }
+ }
+ })
+ .registerTypeSelector(com.squidex.api.types.RuleActionDto.class, new TypeSelector() {
+ @Override
+ public Class extends com.squidex.api.types.RuleActionDto> getClassForElement(JsonElement readElement) {
+ Map classByDiscriminatorValue = new HashMap();
+ classByDiscriminatorValue.put("Algolia", com.squidex.api.types.AlgoliaRuleActionDto.class);
+ classByDiscriminatorValue.put("AzureQueue", com.squidex.api.types.AzureQueueRuleActionDto.class);
+ classByDiscriminatorValue.put("Comment", com.squidex.api.types.CommentRuleActionDto.class);
+ classByDiscriminatorValue.put("CreateContent", com.squidex.api.types.CreateContentRuleActionDto.class);
+ classByDiscriminatorValue.put("Discourse", com.squidex.api.types.DiscourseRuleActionDto.class);
+ classByDiscriminatorValue.put("ElasticSearch", com.squidex.api.types.ElasticSearchRuleActionDto.class);
+ classByDiscriminatorValue.put("Email", com.squidex.api.types.EmailRuleActionDto.class);
+ classByDiscriminatorValue.put("Fastly", com.squidex.api.types.FastlyRuleActionDto.class);
+ classByDiscriminatorValue.put("Medium", com.squidex.api.types.MediumRuleActionDto.class);
+ classByDiscriminatorValue.put("Notification", com.squidex.api.types.NotificationRuleActionDto.class);
+ classByDiscriminatorValue.put("OpenSearch", com.squidex.api.types.OpenSearchRuleActionDto.class);
+ classByDiscriminatorValue.put("Prerender", com.squidex.api.types.PrerenderRuleActionDto.class);
+ classByDiscriminatorValue.put("Script", com.squidex.api.types.ScriptRuleActionDto.class);
+ classByDiscriminatorValue.put("SignalR", com.squidex.api.types.SignalRRuleActionDto.class);
+ classByDiscriminatorValue.put("Slack", com.squidex.api.types.SlackRuleActionDto.class);
+ classByDiscriminatorValue.put("Tweet", com.squidex.api.types.TweetRuleActionDto.class);
+ classByDiscriminatorValue.put("Typesense", com.squidex.api.types.TypesenseRuleActionDto.class);
+ classByDiscriminatorValue.put("Webhook", com.squidex.api.types.WebhookRuleActionDto.class);
+ return getClassByDiscriminator(classByDiscriminatorValue,
+ getDiscriminatorValue(readElement, "actionType"));
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.AssetChangedRuleTriggerDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.AssetChangedRuleTriggerDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.AssetChangedRuleTriggerDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("triggerType", new JsonPrimitive("AssetChanged"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.CommentRuleTriggerDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.CommentRuleTriggerDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.CommentRuleTriggerDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("triggerType", new JsonPrimitive("Comment"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.ContentChangedRuleTriggerDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ContentChangedRuleTriggerDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ContentChangedRuleTriggerDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("triggerType", new JsonPrimitive("ContentChanged"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.ManualRuleTriggerDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.ManualRuleTriggerDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.ManualRuleTriggerDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("triggerType", new JsonPrimitive("Manual"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.SchemaChangedRuleTriggerDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.SchemaChangedRuleTriggerDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.SchemaChangedRuleTriggerDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("triggerType", new JsonPrimitive("SchemaChanged"));
+ }
+ }
+ })
+ .registerPostProcessor(com.squidex.api.types.UsageRuleTriggerDto.class, new PostProcessor() {
+ @Override
+ public void postDeserialize(com.squidex.api.types.UsageRuleTriggerDto result, JsonElement src, Gson gson) {
+ }
+
+ @Override
+ public void postSerialize(JsonElement result, com.squidex.api.types.UsageRuleTriggerDto src, Gson gson) {
+ if (result instanceof JsonObject) {
+ ((JsonObject)result).add("triggerType", new JsonPrimitive("Usage"));
+ }
+ }
+ })
+ .registerTypeSelector(com.squidex.api.types.RuleTriggerDto.class, new TypeSelector() {
+ @Override
+ public Class extends com.squidex.api.types.RuleTriggerDto> getClassForElement(JsonElement readElement) {
+ Map classByDiscriminatorValue = new HashMap();
+ classByDiscriminatorValue.put("AssetChanged", com.squidex.api.types.AssetChangedRuleTriggerDto.class);
+ classByDiscriminatorValue.put("Comment", com.squidex.api.types.CommentRuleTriggerDto.class);
+ classByDiscriminatorValue.put("ContentChanged", com.squidex.api.types.ContentChangedRuleTriggerDto.class);
+ classByDiscriminatorValue.put("Manual", com.squidex.api.types.ManualRuleTriggerDto.class);
+ classByDiscriminatorValue.put("SchemaChanged", com.squidex.api.types.SchemaChangedRuleTriggerDto.class);
+ classByDiscriminatorValue.put("Usage", com.squidex.api.types.UsageRuleTriggerDto.class);
+ return getClassByDiscriminator(classByDiscriminatorValue,
+ getDiscriminatorValue(readElement, "triggerType"));
+ }
+ })
+ ;
+ 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 com.squidex.api.types.AddFieldDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AddLanguageDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AddRoleDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AddWorkflowDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AlgoliaRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AllContentsByPostDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AnnotateAssetDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AppDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AppLanguageDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AppLanguagesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AppSettingsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ArrayFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetChangedRuleTriggerDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetFolderDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetFoldersDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetMeta.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetScriptsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssetsFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AssignContributorDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AuthSchemeDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AuthSchemeResponseDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AuthSchemeValueDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.AzureQueueRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BackupJobDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BackupJobsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BooleanFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BulkResultDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BulkUpdateAssetsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BulkUpdateAssetsJobDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BulkUpdateContentsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.BulkUpdateContentsJobDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CallsUsageDtoDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CallsUsagePerDateDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ChangeCategoryDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ChangePlanDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ChangeStatusDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ClientDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ClientsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CommentRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CommentRuleTriggerDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ComponentFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ComponentsFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ConfigureFieldRulesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ConfigureUIFieldsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ContentChangedRuleTriggerDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ContentDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ContentsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ContributorDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ContributorsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ContributorsMetadata.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateAppDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateAssetFolderDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateClientDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateContentRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateRuleDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateSchemaDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateTeamDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CreateUserDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.CurrentStorageDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.DateTimeFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.DiscourseRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.EditorDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ElasticSearchRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.EmailRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ErrorDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.EventConsumerDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.EventConsumersDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.FastlyRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.FeatureDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.FeaturesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.FieldDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.FieldRuleDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.GeolocationFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.HistoryEventDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ImportContentsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.JobDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.JobLogMessageDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.JobsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.JsonFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.LanguageDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.LogDownloadDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ManualRuleTriggerDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.MediumRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.MoveAssetDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.MoveAssetFolderDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.NestedFieldDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.NotificationRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.NumberFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.OpenSearchRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.PatternDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.PlanChangedDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.PlanDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.PlansDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.PrerenderRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.QueryDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.QueryJsonDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ReferencesFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ReferralInfo.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RenameAssetFolderDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RenameTagDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ReorderFieldsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.Resource.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ResourceLink.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ResourcesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RestoreJobDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RestoreRequestDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RichTextFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RoleDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RolesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RuleDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RuleElementDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RuleElementPropertyDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RuleEventDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RuleEventsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.RulesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ScheduleJobDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SchemaChangedRuleTriggerDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SchemaCondition.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SchemaDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SchemaPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SchemaScriptsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SchemasDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.ScriptRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SearchResultDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SignalRRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SimulatedRuleEventDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SimulatedRuleEventsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SlackRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SortNode.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.StatusInfoDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.StorageUsagePerDateDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.StringFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.SynchronizeSchemaDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TagsFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TeamDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TemplateDetailsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TemplateDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TemplatesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TransferToTeamDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TranslateDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TranslationDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TweetRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.TypesenseRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UIFieldPropertiesDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateAppDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateAppSettingsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateAssetScriptsDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateClientDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateFieldDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateLanguageDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateProfileDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateRoleDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateRuleDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateSchemaDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateSettingDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateTeamDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateUserDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpdateWorkflowDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpsertSchemaDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpsertSchemaFieldDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UpsertSchemaNestedFieldDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UsageRuleTriggerDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UserDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UserProperty.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.UsersDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.WebhookRuleActionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.WorkflowDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.WorkflowStepDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.WorkflowTransitionDto.CustomTypeAdapterFactory());
+ gsonBuilder.registerTypeAdapterFactory(new com.squidex.api.types.WorkflowsDto.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);
+ }
+ }
+ }
+
+ /**
+ * 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);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/squidex/api/core/ObjectMappers.java b/src/main/java/com/squidex/api/core/ObjectMappers.java
deleted file mode 100644
index 13495dd..0000000
--- a/src/main/java/com/squidex/api/core/ObjectMappers.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.squidex.api.core;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.databind.json.JsonMapper;
-import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import java.io.IOException;
-
-public final class ObjectMappers {
- public static final ObjectMapper JSON_MAPPER = JsonMapper.builder()
- .addModule(new Jdk8Module())
- .addModule(new JavaTimeModule())
- .addModule(DateTimeDeserializer.getModule())
- .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
- .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
- .build();
-
- private ObjectMappers() {}
-
- public static String stringify(Object o) {
- try {
- return JSON_MAPPER
- .setSerializationInclusion(JsonInclude.Include.ALWAYS)
- .writerWithDefaultPrettyPrinter()
- .writeValueAsString(o);
- } catch (IOException e) {
- return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode());
- }
- }
-}
diff --git a/src/main/java/com/squidex/api/core/Pair.java b/src/main/java/com/squidex/api/core/Pair.java
new file mode 100644
index 0000000..d15d041
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/Pair.java
@@ -0,0 +1,57 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
+public class Pair {
+ private String name = "";
+ private String value = "";
+
+ public Pair (String name, String value) {
+ setName(name);
+ setValue(value);
+ }
+
+ private void setName(String name) {
+ if (!isValidString(name)) {
+ return;
+ }
+
+ this.name = name;
+ }
+
+ private void setValue(String value) {
+ if (!isValidString(value)) {
+ return;
+ }
+
+ this.value = value;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ private boolean isValidString(String arg) {
+ if (arg == null) {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/com/squidex/api/core/ProgressRequestBody.java b/src/main/java/com/squidex/api/core/ProgressRequestBody.java
new file mode 100644
index 0000000..90b24a5
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/ProgressRequestBody.java
@@ -0,0 +1,73 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+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/src/main/java/com/squidex/api/core/ProgressResponseBody.java b/src/main/java/com/squidex/api/core/ProgressResponseBody.java
new file mode 100644
index 0000000..deaaf53
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/ProgressResponseBody.java
@@ -0,0 +1,70 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+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/src/main/java/com/squidex/api/core/RequestOptions.java b/src/main/java/com/squidex/api/core/RequestOptions.java
deleted file mode 100644
index 0c6b4e8..0000000
--- a/src/main/java/com/squidex/api/core/RequestOptions.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.squidex.api.core;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public final class RequestOptions {
- private final String token;
-
- private RequestOptions(String token) {
- this.token = token;
- }
-
- public Map getHeaders() {
- Map headers = new HashMap<>();
- if (this.token != null) {
- headers.put("Authorization", "Bearer " + this.token);
- }
- return headers;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static final class Builder {
- private String token = null;
-
- public Builder token(String token) {
- this.token = token;
- return this;
- }
-
- public RequestOptions build() {
- return new RequestOptions(token);
- }
- }
-}
diff --git a/src/main/java/com/squidex/api/core/RetryInterceptor.java b/src/main/java/com/squidex/api/core/RetryInterceptor.java
deleted file mode 100644
index 2694508..0000000
--- a/src/main/java/com/squidex/api/core/RetryInterceptor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.squidex.api.core;
-
-import java.io.IOException;
-import java.time.Duration;
-import java.util.Optional;
-import java.util.Random;
-import okhttp3.Interceptor;
-import okhttp3.Response;
-
-public class RetryInterceptor implements Interceptor {
-
- private static final Duration ONE_SECOND = Duration.ofSeconds(1);
- private final ExponentialBackoff backoff;
- private final Random random = new Random();
-
- public RetryInterceptor(int maxRetries) {
- this.backoff = new ExponentialBackoff(maxRetries);
- }
-
- @Override
- public Response intercept(Chain chain) throws IOException {
- Response response = chain.proceed(chain.request());
-
- if (shouldRetry(response.code())) {
- return retryChain(chain);
- }
-
- return response;
- }
-
- private Response retryChain(Chain chain) throws IOException {
- Optional nextBackoff = this.backoff.nextBackoff();
-
- while (nextBackoff.isPresent()) {
- try {
- Thread.sleep(nextBackoff.get().toMillis());
- } catch (InterruptedException e) {
- throw new IOException("Interrupted while trying request", e);
- }
- Response response = chain.proceed(chain.request());
- if (shouldRetry(response.code())) {
- nextBackoff = this.backoff.nextBackoff();
- } else {
- return response;
- }
- }
-
- throw new IOException("Max retries reached");
- }
-
- private static boolean shouldRetry(int statusCode) {
- return statusCode == 408 || statusCode == 409 || statusCode == 429 || statusCode >= 500;
- }
-
- private final class ExponentialBackoff {
-
- private final int maxNumRetries;
-
- private int retryNumber = 0;
-
- ExponentialBackoff(int maxNumRetries) {
- this.maxNumRetries = maxNumRetries;
- }
-
- public Optional nextBackoff() {
- retryNumber += 1;
- if (retryNumber > maxNumRetries) {
- return Optional.empty();
- }
-
- int upperBound = (int) Math.pow(2, retryNumber);
- return Optional.of(ONE_SECOND.multipliedBy(random.nextInt(upperBound)));
- }
- }
-}
diff --git a/src/main/java/com/squidex/api/core/ServerConfiguration.java b/src/main/java/com/squidex/api/core/ServerConfiguration.java
new file mode 100644
index 0000000..c213d26
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/ServerConfiguration.java
@@ -0,0 +1,72 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+import java.util.Map;
+
+/**
+ * Representing a Server configuration.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
+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/src/main/java/com/squidex/api/core/ServerVariable.java b/src/main/java/com/squidex/api/core/ServerVariable.java
new file mode 100644
index 0000000..264bca5
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/ServerVariable.java
@@ -0,0 +1,37 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+import java.util.HashSet;
+
+/**
+ * Representing a Server Variable for server URL template substitution.
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
+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/src/main/java/com/squidex/api/core/StringUtil.java b/src/main/java/com/squidex/api/core/StringUtil.java
new file mode 100644
index 0000000..fa54d0c
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/StringUtil.java
@@ -0,0 +1,83 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT")
+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/src/main/java/com/squidex/api/core/Suppliers.java b/src/main/java/com/squidex/api/core/Suppliers.java
deleted file mode 100644
index ff8846f..0000000
--- a/src/main/java/com/squidex/api/core/Suppliers.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * This file was auto-generated by Fern from our API Definition.
- */
-package com.squidex.api.core;
-
-import java.util.Objects;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.function.Supplier;
-
-public final class Suppliers {
- private Suppliers() {}
-
- public static Supplier memoize(Supplier delegate) {
- AtomicReference value = new AtomicReference<>();
- return () -> {
- T val = value.get();
- if (val == null) {
- val = value.updateAndGet(cur -> cur == null ? Objects.requireNonNull(delegate.get()) : cur);
- }
- return val;
- };
- }
-}
diff --git a/src/main/java/com/squidex/api/core/api/AppsApi.java b/src/main/java/com/squidex/api/core/api/AppsApi.java
new file mode 100644
index 0000000..8b9657d
--- /dev/null
+++ b/src/main/java/com/squidex/api/core/api/AppsApi.java
@@ -0,0 +1,5819 @@
+/*
+ * Squidex API
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
+ *
+ * The version of the OpenAPI document: 1.0.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package com.squidex.api.core.api;
+
+import com.squidex.api.core.ApiCallback;
+import com.squidex.api.core.ApiClient;
+import com.squidex.api.core.ApiException;
+import com.squidex.api.core.ApiResponse;
+import com.squidex.api.core.Configuration;
+import com.squidex.api.core.Pair;
+import com.squidex.api.core.ProgressRequestBody;
+import com.squidex.api.core.ProgressResponseBody;
+
+import com.google.gson.reflect.TypeToken;
+
+import java.io.IOException;
+
+
+import com.squidex.api.types.AddLanguageDto;
+import com.squidex.api.types.AddRoleDto;
+import com.squidex.api.types.AddWorkflowDto;
+import com.squidex.api.types.AppDto;
+import com.squidex.api.types.AppLanguagesDto;
+import com.squidex.api.types.AppSettingsDto;
+import com.squidex.api.types.AssetScriptsDto;
+import com.squidex.api.types.AssignContributorDto;
+import com.squidex.api.types.ClientsDto;
+import com.squidex.api.types.ContributorsDto;
+import com.squidex.api.types.CreateAppDto;
+import com.squidex.api.types.CreateClientDto;
+import com.squidex.api.types.ErrorDto;
+import java.io.File;
+import com.squidex.api.types.RolesDto;
+import com.squidex.api.types.TransferToTeamDto;
+import com.squidex.api.types.UpdateAppDto;
+import com.squidex.api.types.UpdateAppSettingsDto;
+import com.squidex.api.types.UpdateAssetScriptsDto;
+import com.squidex.api.types.UpdateClientDto;
+import com.squidex.api.types.UpdateLanguageDto;
+import com.squidex.api.types.UpdateRoleDto;
+import com.squidex.api.types.UpdateWorkflowDto;
+import com.squidex.api.types.WorkflowsDto;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+@SuppressWarnings("ALL")
+public class AppsApi {
+ private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
+
+ public AppsApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public AppsApi(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;
+ }
+
+ private okhttp3.Call getAssetScriptsCall(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 = "/api/apps/$app$/assets/scripts";
+
+ 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 getAssetScriptsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
+ return getAssetScriptsCall(_callback);
+
+ }
+
+
+ private ApiResponse getAssetScriptsWithHttpInfo() throws ApiException {
+ okhttp3.Call localVarCall = getAssetScriptsValidateBeforeCall(null);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ return localVarApiClient.execute(localVarCall, localVarReturnType);
+ }
+
+ private okhttp3.Call getAssetScriptsAsync(final ApiCallback _callback) throws ApiException {
+
+ okhttp3.Call localVarCall = getAssetScriptsValidateBeforeCall(_callback);
+ Type localVarReturnType = new TypeToken(){}.getType();
+ localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
+ return localVarCall;
+ }
+
+ public class APIappAssetsGetAssetScriptsRequest {
+
+ private APIappAssetsGetAssetScriptsRequest() {
+ }
+
+ /**
+ * Build call for getAssetScripts
+ * @param _callback ApiCallback API callback
+ * @return Call to execute
+ * @throws ApiException If fail to serialize the request body object
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | Asset scripts returned. | - |
+ 404 | App not found. | - |
+ 500 | Operation failed. | - |
+
+ */
+ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
+ return getAssetScriptsCall(_callback);
+ }
+
+ /**
+ * Execute getAssetScripts request
+ * @return AssetScriptsDto
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | Asset scripts returned. | - |
+ 404 | App not found. | - |
+ 500 | Operation failed. | - |
+
+ */
+ public AssetScriptsDto execute() throws ApiException {
+ ApiResponse localVarResp = getAssetScriptsWithHttpInfo();
+ return localVarResp.getData();
+ }
+
+ /**
+ * Execute getAssetScripts request with HTTP info returned
+ * @return ApiResponse<AssetScriptsDto>
+ * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
+ * @http.response.details
+
+ Status Code | Description | Response Headers |
+ 200 | Asset scripts returned. | - |
+ 404 | App not found. | - |
+ 500 | Operation failed. | - |
+
+ */
+ public ApiResponse executeWithHttpInfo() throws ApiException {
+ return getAssetScriptsWithHttpInfo();
+ }
+
+ /**
+ * Execute getAssetScripts request (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
+
+ Status Code | Description | Response Headers |
+ 200 | Asset scripts returned. | - |
+ 404 | App not found. | - |
+ 500 | Operation failed. | - |
+
+ */
+ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
+ return getAssetScriptsAsync(_callback);
+ }
+ }
+
+ /**
+ * Get the app asset scripts.
+ *
+ * @return APIappAssetsGetAssetScriptsRequest
+ * @http.response.details
+