Skip to content

Commit

Permalink
Release 0.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 20, 2023
1 parent 2bfaeed commit 55ce9ac
Show file tree
Hide file tree
Showing 210 changed files with 449 additions and 519 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ publishing {
maven(MavenPublication) {
groupId = 'io.squidex'
artifactId = 'squidex'
version = '0.0.8'
version = '0.0.12'
from components.java
}
}
Expand Down
111 changes: 0 additions & 111 deletions src/main/java/com/squidex/api/core/ClientOptions.java

This file was deleted.

13 changes: 13 additions & 0 deletions src/main/java/com/squidex/api/core/ObjectMappers.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
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.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()
Expand All @@ -14,4 +16,15 @@ public final class ObjectMappers {
.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());
}
}
}
9 changes: 6 additions & 3 deletions src/main/java/com/squidex/api/resources/apps/AppsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,16 @@ public AppDto uploadImage(File file, AppsUploadImageRequest request, RequestOpti
.addPathSegments("image")
.build();
MultipartBody.Builder _multipartBody = new MultipartBody.Builder().setType(MultipartBody.FORM);
_multipartBody.addFormDataPart("file", null, RequestBody.create(null, file));
try {
_multipartBody.addFormDataPart("file", null, RequestBody.create(null, file));
} catch (Exception e) {
throw new RuntimeException(e);
}
RequestBody _requestBody = _multipartBody.build();
Request.Builder _requestBuilder = new Request.Builder()
.url(_httpUrl)
.method("POST", _requestBody)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
.headers(Headers.of(clientOptions.headers(requestOptions)));
Request _request = _requestBuilder.build();
try {
Response _response = clientOptions.httpClient().newCall(_request).execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down Expand Up @@ -41,7 +42,7 @@ public int hashCode() {

@Override
public String toString() {
return "AddLanguageDto{" + "language: " + language + "}";
return ObjectMappers.stringify(this);
}

public static LanguageStage builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down Expand Up @@ -41,7 +42,7 @@ public int hashCode() {

@Override
public String toString() {
return "AddRoleDto{" + "name: " + name + "}";
return ObjectMappers.stringify(this);
}

public static NameStage builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down Expand Up @@ -41,7 +42,7 @@ public int hashCode() {

@Override
public String toString() {
return "AddWorkflowDto{" + "name: " + name + "}";
return ObjectMappers.stringify(this);
}

public static NameStage builder() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.squidex.api.resources.apps.requests;

import com.squidex.api.core.ObjectMappers;

public final class AppsUploadImageRequest {
private AppsUploadImageRequest() {}

Expand All @@ -11,6 +13,6 @@ public boolean equals(Object other) {

@Override
public String toString() {
return "AppsUploadImageRequest{" + "}";
return ObjectMappers.stringify(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;
import java.util.Optional;

Expand Down Expand Up @@ -54,7 +55,7 @@ public int hashCode() {

@Override
public String toString() {
return "CreateAppDto{" + "name: " + name + ", template: " + template + "}";
return ObjectMappers.stringify(this);
}

public static NameStage builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down Expand Up @@ -41,7 +42,7 @@ public int hashCode() {

@Override
public String toString() {
return "CreateClientDto{" + "id: " + id + "}";
return ObjectMappers.stringify(this);
}

public static IdStage builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;
import java.util.Optional;

Expand Down Expand Up @@ -43,7 +44,7 @@ public int hashCode() {

@Override
public String toString() {
return "TransferToTeamDto{" + "teamId: " + teamId + "}";
return ObjectMappers.stringify(this);
}

public static Builder builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;
import java.util.Optional;

Expand Down Expand Up @@ -54,7 +55,7 @@ public int hashCode() {

@Override
public String toString() {
return "UpdateAppDto{" + "label: " + label + ", description: " + description + "}";
return ObjectMappers.stringify(this);
}

public static Builder builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import com.squidex.api.types.EditorDto;
import com.squidex.api.types.PatternDto;
import java.util.ArrayList;
Expand Down Expand Up @@ -87,8 +88,7 @@ public int hashCode() {

@Override
public String toString() {
return "UpdateAppSettingsDto{" + "patterns: " + patterns + ", editors: " + editors + ", hideScheduler: "
+ hideScheduler + ", hideDateTimeModeButton: " + hideDateTimeModeButton + "}";
return ObjectMappers.stringify(this);
}

public static Builder builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;
import java.util.Optional;

Expand Down Expand Up @@ -122,8 +123,7 @@ public int hashCode() {

@Override
public String toString() {
return "UpdateAssetScriptsDto{" + "query: " + query + ", queryPre: " + queryPre + ", create: " + create
+ ", update: " + update + ", annotate: " + annotate + ", move: " + move + ", delete: " + delete + "}";
return ObjectMappers.stringify(this);
}

public static Builder builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.Objects;
import java.util.Optional;

Expand Down Expand Up @@ -96,8 +97,7 @@ public int hashCode() {

@Override
public String toString() {
return "UpdateClientDto{" + "name: " + name + ", role: " + role + ", allowAnonymous: " + allowAnonymous
+ ", apiCallsLimit: " + apiCallsLimit + ", apiTrafficLimit: " + apiTrafficLimit + "}";
return ObjectMappers.stringify(this);
}

public static Builder builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -69,8 +70,7 @@ public int hashCode() {

@Override
public String toString() {
return "UpdateLanguageDto{" + "isMaster: " + isMaster + ", isOptional: " + isOptional + ", fallback: "
+ fallback + "}";
return ObjectMappers.stringify(this);
}

public static Builder builder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.squidex.api.core.ObjectMappers;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -57,7 +58,7 @@ public int hashCode() {

@Override
public String toString() {
return "UpdateRoleDto{" + "permissions: " + permissions + ", properties: " + properties + "}";
return ObjectMappers.stringify(this);
}

public static Builder builder() {
Expand Down
Loading

0 comments on commit 55ce9ac

Please sign in to comment.