Skip to content

Commit

Permalink
Release 0.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Sep 9, 2023
1 parent 292a146 commit 6f1f607
Show file tree
Hide file tree
Showing 62 changed files with 796 additions and 69 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.12'
version = '0.0.13'
from components.java
}
}
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/com/squidex/api/resources/assets/AssetsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.MediaType;
Expand All @@ -48,25 +47,19 @@ public AssetsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}

public InputStream getAssetContentBySlug(
String idOrSlug, Optional<String> more, AssetsGetAssetContentBySlugRequest request) {
public InputStream getAssetContentBySlug(String idOrSlug, String more, AssetsGetAssetContentBySlugRequest request) {
return getAssetContentBySlug(idOrSlug, more, request, null);
}

public InputStream getAssetContentBySlug(
String idOrSlug,
Optional<String> more,
AssetsGetAssetContentBySlugRequest request,
RequestOptions requestOptions) {
String idOrSlug, String more, AssetsGetAssetContentBySlugRequest request, RequestOptions requestOptions) {
HttpUrl.Builder _httpUrl = HttpUrl.parse(
this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("api/assets")
.addPathSegment(clientOptions.appName())
.addPathSegment(idOrSlug);
if (more.isPresent()) {
_httpUrl.addPathSegment(more.get());
}
.addPathSegment(idOrSlug)
.addPathSegment(more);
if (request.getVersion().isPresent()) {
_httpUrl.addQueryParameter("version", request.getVersion().get().toString());
}
Expand Down Expand Up @@ -106,6 +99,9 @@ public InputStream getAssetContentBySlug(
if (request.getForce().isPresent()) {
_httpUrl.addQueryParameter("force", request.getForce().get().toString());
}
if (request.getDeleted().isPresent()) {
_httpUrl.addQueryParameter("deleted", request.getDeleted().get().toString());
}
if (request.getFormat().isPresent()) {
_httpUrl.addQueryParameter("format", request.getFormat().get().toString());
}
Expand Down Expand Up @@ -178,6 +174,9 @@ public InputStream getAssetContent(String id, AssetsGetAssetContentRequest reque
if (request.getForce().isPresent()) {
_httpUrl.addQueryParameter("force", request.getForce().get().toString());
}
if (request.getDeleted().isPresent()) {
_httpUrl.addQueryParameter("deleted", request.getDeleted().get().toString());
}
if (request.getFormat().isPresent()) {
_httpUrl.addQueryParameter("format", request.getFormat().get().toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public final class AssetsGetAssetContentBySlugRequest {

private final Optional<Boolean> force;

private final Optional<Boolean> deleted;

private final Optional<ImageFormat> format;

private AssetsGetAssetContentBySlugRequest(
Expand All @@ -57,6 +59,7 @@ private AssetsGetAssetContentBySlugRequest(
Optional<Boolean> nofocus,
Optional<Boolean> auto,
Optional<Boolean> force,
Optional<Boolean> deleted,
Optional<ImageFormat> format) {
this.version = version;
this.cache = cache;
Expand All @@ -71,6 +74,7 @@ private AssetsGetAssetContentBySlugRequest(
this.nofocus = nofocus;
this.auto = auto;
this.force = force;
this.deleted = deleted;
this.format = format;
}

Expand Down Expand Up @@ -178,6 +182,14 @@ public Optional<Boolean> getForce() {
return force;
}

/**
* @return Also return deleted content items.
*/
@JsonProperty("deleted")
public Optional<Boolean> getDeleted() {
return deleted;
}

/**
* @return True to force a new resize even if it already stored.
*/
Expand Down Expand Up @@ -207,6 +219,7 @@ private boolean equalTo(AssetsGetAssetContentBySlugRequest other) {
&& nofocus.equals(other.nofocus)
&& auto.equals(other.auto)
&& force.equals(other.force)
&& deleted.equals(other.deleted)
&& format.equals(other.format);
}

Expand All @@ -226,6 +239,7 @@ public int hashCode() {
this.nofocus,
this.auto,
this.force,
this.deleted,
this.format);
}

Expand Down Expand Up @@ -266,6 +280,8 @@ public static final class Builder {

private Optional<Boolean> force = Optional.empty();

private Optional<Boolean> deleted = Optional.empty();

private Optional<ImageFormat> format = Optional.empty();

private Builder() {}
Expand All @@ -284,6 +300,7 @@ public Builder from(AssetsGetAssetContentBySlugRequest other) {
nofocus(other.getNofocus());
auto(other.getAuto());
force(other.getForce());
deleted(other.getDeleted());
format(other.getFormat());
return this;
}
Expand Down Expand Up @@ -431,6 +448,17 @@ public Builder force(Boolean force) {
return this;
}

@JsonSetter(value = "deleted", nulls = Nulls.SKIP)
public Builder deleted(Optional<Boolean> deleted) {
this.deleted = deleted;
return this;
}

public Builder deleted(Boolean deleted) {
this.deleted = Optional.of(deleted);
return this;
}

@JsonSetter(value = "format", nulls = Nulls.SKIP)
public Builder format(Optional<ImageFormat> format) {
this.format = format;
Expand All @@ -445,7 +473,7 @@ public Builder format(ImageFormat format) {
public AssetsGetAssetContentBySlugRequest build() {
return new AssetsGetAssetContentBySlugRequest(
version, cache, download, width, height, quality, mode, bg, focusX, focusY, nofocus, auto, force,
format);
deleted, format);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public final class AssetsGetAssetContentRequest {

private final Optional<Boolean> force;

private final Optional<Boolean> deleted;

private final Optional<ImageFormat> format;

private AssetsGetAssetContentRequest(
Expand All @@ -57,6 +59,7 @@ private AssetsGetAssetContentRequest(
Optional<Boolean> nofocus,
Optional<Boolean> auto,
Optional<Boolean> force,
Optional<Boolean> deleted,
Optional<ImageFormat> format) {
this.version = version;
this.cache = cache;
Expand All @@ -71,6 +74,7 @@ private AssetsGetAssetContentRequest(
this.nofocus = nofocus;
this.auto = auto;
this.force = force;
this.deleted = deleted;
this.format = format;
}

Expand Down Expand Up @@ -178,6 +182,14 @@ public Optional<Boolean> getForce() {
return force;
}

/**
* @return Also return deleted content items.
*/
@JsonProperty("deleted")
public Optional<Boolean> getDeleted() {
return deleted;
}

/**
* @return True to force a new resize even if it already stored.
*/
Expand Down Expand Up @@ -206,6 +218,7 @@ private boolean equalTo(AssetsGetAssetContentRequest other) {
&& nofocus.equals(other.nofocus)
&& auto.equals(other.auto)
&& force.equals(other.force)
&& deleted.equals(other.deleted)
&& format.equals(other.format);
}

Expand All @@ -225,6 +238,7 @@ public int hashCode() {
this.nofocus,
this.auto,
this.force,
this.deleted,
this.format);
}

Expand Down Expand Up @@ -265,6 +279,8 @@ public static final class Builder {

private Optional<Boolean> force = Optional.empty();

private Optional<Boolean> deleted = Optional.empty();

private Optional<ImageFormat> format = Optional.empty();

private Builder() {}
Expand All @@ -283,6 +299,7 @@ public Builder from(AssetsGetAssetContentRequest other) {
nofocus(other.getNofocus());
auto(other.getAuto());
force(other.getForce());
deleted(other.getDeleted());
format(other.getFormat());
return this;
}
Expand Down Expand Up @@ -430,6 +447,17 @@ public Builder force(Boolean force) {
return this;
}

@JsonSetter(value = "deleted", nulls = Nulls.SKIP)
public Builder deleted(Optional<Boolean> deleted) {
this.deleted = deleted;
return this;
}

public Builder deleted(Boolean deleted) {
this.deleted = Optional.of(deleted);
return this;
}

@JsonSetter(value = "format", nulls = Nulls.SKIP)
public Builder format(Optional<ImageFormat> format) {
this.format = format;
Expand All @@ -444,7 +472,7 @@ public Builder format(ImageFormat format) {
public AssetsGetAssetContentRequest build() {
return new AssetsGetAssetContentRequest(
version, cache, download, width, height, quality, mode, bg, focusX, focusY, nofocus, auto, force,
format);
deleted, format);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.squidex.api.types.UpsertCommentDto;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.MediaType;
Expand All @@ -26,22 +25,20 @@ public CommentsClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}

public List<String> getWatchingUsers(Optional<String> resource) {
public List<String> getWatchingUsers(String resource) {
return getWatchingUsers(resource, null);
}

public List<String> getWatchingUsers(Optional<String> resource, RequestOptions requestOptions) {
HttpUrl.Builder _httpUrl = HttpUrl.parse(
this.clientOptions.environment().getUrl())
public List<String> getWatchingUsers(String resource, RequestOptions requestOptions) {
HttpUrl _httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("api/apps")
.addPathSegment(clientOptions.appName())
.addPathSegments("watching");
if (resource.isPresent()) {
_httpUrl.addPathSegment(resource.get());
}
.addPathSegments("watching")
.addPathSegment(resource)
.build();
Request _request = new Request.Builder()
.url(_httpUrl.build())
.url(_httpUrl)
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public ContentsDto getContents(String schema, ContentsGetContentsRequest request
.method("GET", _requestBody)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
if (request.getFields().isPresent()) {
_requestBuilder.addHeader("X-Fields", request.getFields().get());
}
if (request.getFlatten().isPresent()) {
_requestBuilder.addHeader("X-Flatten", request.getFlatten().get().toString());
}
Expand Down Expand Up @@ -193,6 +196,9 @@ public ContentsDto getContentsPost(
.method("POST", _requestBody)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
if (request.getFields().isPresent()) {
_requestBuilder.addHeader("X-Fields", request.getFields().get());
}
if (request.getFlatten().isPresent()) {
_requestBuilder.addHeader("X-Flatten", request.getFlatten().get().toString());
}
Expand Down Expand Up @@ -246,6 +252,9 @@ public ContentDto getContent(
.method("GET", _requestBody)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
if (request.getFields().isPresent()) {
_requestBuilder.addHeader("X-Fields", request.getFields().get());
}
if (request.getFlatten().isPresent()) {
_requestBuilder.addHeader("X-Flatten", request.getFlatten().get().toString());
}
Expand Down Expand Up @@ -513,6 +522,9 @@ public ContentsDto getReferences(
.method("GET", _requestBody)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
if (request.getFields().isPresent()) {
_requestBuilder.addHeader("X-Fields", request.getFields().get());
}
if (request.getFlatten().isPresent()) {
_requestBuilder.addHeader("X-Flatten", request.getFlatten().get().toString());
}
Expand Down Expand Up @@ -567,6 +579,9 @@ public ContentsDto getReferencing(
.method("GET", _requestBody)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Content-Type", "application/json");
if (request.getFields().isPresent()) {
_requestBuilder.addHeader("X-Fields", request.getFields().get());
}
if (request.getFlatten().isPresent()) {
_requestBuilder.addHeader("X-Flatten", request.getFlatten().get().toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Optional<Boolean> getUnpublished() {
}

/**
* @return Only resolve these languages (comma-separated).
* @return The list of languages to resolve (comma-separated).
*/
@JsonProperty("X-Languages")
public Optional<String> getLanguages() {
Expand Down Expand Up @@ -201,7 +201,7 @@ public _FinalStage dueTime(Optional<OffsetDateTime> dueTime) {
}

/**
* <p>Only resolve these languages (comma-separated).</p>
* <p>The list of languages to resolve (comma-separated).</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Optional<Boolean> getUnpublished() {
}

/**
* @return Only resolve these languages (comma-separated).
* @return The list of languages to resolve (comma-separated).
*/
@JsonProperty("X-Languages")
public Optional<String> getLanguages() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Optional<Boolean> getUnpublished() {
}

/**
* @return Only resolve these languages (comma-separated).
* @return The list of languages to resolve (comma-separated).
*/
@JsonProperty("X-Languages")
public Optional<String> getLanguages() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Optional<Boolean> getUnpublished() {
}

/**
* @return Only resolve these languages (comma-separated).
* @return The list of languages to resolve (comma-separated).
*/
@JsonProperty("X-Languages")
public Optional<String> getLanguages() {
Expand Down
Loading

0 comments on commit 6f1f607

Please sign in to comment.