Skip to content

Commit c525f66

Browse files
Automated Spec Update (#620)
1be182440c72ad64971e24bde25d117dccd0e52f Automated update of the API specification Co-authored-by: dropbox-sdk-updater[bot] <306210582+dropbox-sdk-updater[bot]@users.noreply.github.com> Co-authored-by: dropbox-spec-updater[bot] <306253022+dropbox-spec-updater[bot]@users.noreply.github.com>
1 parent 6d53d11 commit c525f66

7 files changed

Lines changed: 126 additions & 7 deletions

File tree

core/api/core.api

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3746,6 +3746,7 @@ public class com/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder : com/dropbox
37463746
public fun withExcludeMediaInfo (Ljava/lang/Boolean;)Lcom/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder;
37473747
public fun withFormat (Lcom/dropbox/core/v2/files/ThumbnailFormat;)Lcom/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder;
37483748
public fun withMode (Lcom/dropbox/core/v2/files/ThumbnailMode;)Lcom/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder;
3749+
public fun withPreserveTransparency (Ljava/lang/Boolean;)Lcom/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder;
37493750
public fun withQuality (Lcom/dropbox/core/v2/files/ThumbnailQuality;)Lcom/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder;
37503751
public fun withSize (Lcom/dropbox/core/v2/files/ThumbnailSize;)Lcom/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder;
37513752
}
@@ -3880,6 +3881,7 @@ public class com/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder : com/dropbo
38803881
public fun withExcludeMediaInfo (Ljava/lang/Boolean;)Lcom/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder;
38813882
public fun withFormat (Lcom/dropbox/core/v2/files/ThumbnailFormat;)Lcom/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder;
38823883
public fun withMode (Lcom/dropbox/core/v2/files/ThumbnailMode;)Lcom/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder;
3884+
public fun withPreserveTransparency (Ljava/lang/Boolean;)Lcom/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder;
38833885
public fun withQuality (Lcom/dropbox/core/v2/files/ThumbnailQuality;)Lcom/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder;
38843886
public fun withSize (Lcom/dropbox/core/v2/files/ThumbnailSize;)Lcom/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder;
38853887
}
@@ -6589,6 +6591,7 @@ public final class com/dropbox/core/v2/files/ThumbnailV2Error {
65896591
public static final field OTHER Lcom/dropbox/core/v2/files/ThumbnailV2Error;
65906592
public static final field UNSUPPORTED_EXTENSION Lcom/dropbox/core/v2/files/ThumbnailV2Error;
65916593
public static final field UNSUPPORTED_IMAGE Lcom/dropbox/core/v2/files/ThumbnailV2Error;
6594+
public static final field UNSUPPORTED_OUTPUT_FORMAT Lcom/dropbox/core/v2/files/ThumbnailV2Error;
65926595
public fun equals (Ljava/lang/Object;)Z
65936596
public fun getPathValue ()Lcom/dropbox/core/v2/files/LookupError;
65946597
public fun hashCode ()I
@@ -6600,6 +6603,7 @@ public final class com/dropbox/core/v2/files/ThumbnailV2Error {
66006603
public fun isPath ()Z
66016604
public fun isUnsupportedExtension ()Z
66026605
public fun isUnsupportedImage ()Z
6606+
public fun isUnsupportedOutputFormat ()Z
66036607
public static fun path (Lcom/dropbox/core/v2/files/LookupError;)Lcom/dropbox/core/v2/files/ThumbnailV2Error;
66046608
public fun tag ()Lcom/dropbox/core/v2/files/ThumbnailV2Error$Tag;
66056609
public fun toString ()Ljava/lang/String;
@@ -6615,6 +6619,7 @@ public final class com/dropbox/core/v2/files/ThumbnailV2Error$Tag : java/lang/En
66156619
public static final field PATH Lcom/dropbox/core/v2/files/ThumbnailV2Error$Tag;
66166620
public static final field UNSUPPORTED_EXTENSION Lcom/dropbox/core/v2/files/ThumbnailV2Error$Tag;
66176621
public static final field UNSUPPORTED_IMAGE Lcom/dropbox/core/v2/files/ThumbnailV2Error$Tag;
6622+
public static final field UNSUPPORTED_OUTPUT_FORMAT Lcom/dropbox/core/v2/files/ThumbnailV2Error$Tag;
66186623
public static fun valueOf (Ljava/lang/String;)Lcom/dropbox/core/v2/files/ThumbnailV2Error$Tag;
66196624
public static fun values ()[Lcom/dropbox/core/v2/files/ThumbnailV2Error$Tag;
66206625
}

core/build/generated_stone_source/main/refs/javadoc-refs.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

core/build/generated_stone_source/main/src/com/dropbox/core/v2/files/DbxAppGetThumbnailV2Builder.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,23 @@ public DbxAppGetThumbnailV2Builder withExcludeMediaInfo(Boolean excludeMediaInfo
134134
return this;
135135
}
136136

137+
/**
138+
* Set value for optional field.
139+
*
140+
* <p> If left unset or set to {@code null}, defaults to {@code false}. </p>
141+
*
142+
* @param preserveTransparency Whether to preserve the original image's
143+
* transparency in the thumbnail. This is supported only when the output
144+
* format is PNG or WebP. Requests that set this flag with JPEG output
145+
* return an error. Defaults to {@code false} when set to {@code null}.
146+
*
147+
* @return this builder
148+
*/
149+
public DbxAppGetThumbnailV2Builder withPreserveTransparency(Boolean preserveTransparency) {
150+
this._builder.withPreserveTransparency(preserveTransparency);
151+
return this;
152+
}
153+
137154
@Override
138155
public DbxDownloader<PreviewResult> start() throws ThumbnailV2ErrorException, DbxException {
139156
ThumbnailV2Arg arg_ = this._builder.build();

core/build/generated_stone_source/main/src/com/dropbox/core/v2/files/DbxUserGetThumbnailV2Builder.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,23 @@ public DbxUserGetThumbnailV2Builder withExcludeMediaInfo(Boolean excludeMediaInf
134134
return this;
135135
}
136136

137+
/**
138+
* Set value for optional field.
139+
*
140+
* <p> If left unset or set to {@code null}, defaults to {@code false}. </p>
141+
*
142+
* @param preserveTransparency Whether to preserve the original image's
143+
* transparency in the thumbnail. This is supported only when the output
144+
* format is PNG or WebP. Requests that set this flag with JPEG output
145+
* return an error. Defaults to {@code false} when set to {@code null}.
146+
*
147+
* @return this builder
148+
*/
149+
public DbxUserGetThumbnailV2Builder withPreserveTransparency(Boolean preserveTransparency) {
150+
this._builder.withPreserveTransparency(preserveTransparency);
151+
return this;
152+
}
153+
137154
@Override
138155
public DbxDownloader<PreviewResult> start() throws ThumbnailV2ErrorException, DbxException {
139156
ThumbnailV2Arg arg_ = this._builder.build();

core/build/generated_stone_source/main/src/com/dropbox/core/v2/files/ThumbnailV2Arg.java

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class ThumbnailV2Arg {
3434
protected final ThumbnailQuality quality;
3535
@Nullable
3636
protected final Boolean excludeMediaInfo;
37+
protected final boolean preserveTransparency;
3738

3839
/**
3940
* Use {@link newBuilder} to create instances of this class without
@@ -56,11 +57,15 @@ class ThumbnailV2Arg {
5657
* set for photo and video. When this flag is true, {@link
5758
* FileMetadata#getMediaInfo} is not populated. This improves latency
5859
* for use cases where `media_info` is not needed.
60+
* @param preserveTransparency Whether to preserve the original image's
61+
* transparency in the thumbnail. This is supported only when the output
62+
* format is PNG or WebP. Requests that set this flag with JPEG output
63+
* return an error.
5964
*
6065
* @throws IllegalArgumentException If any argument does not meet its
6166
* preconditions.
6267
*/
63-
public ThumbnailV2Arg(@Nonnull PathOrLink resource, @Nonnull ThumbnailFormat format, @Nonnull ThumbnailSize size, @Nonnull ThumbnailMode mode, @Nonnull ThumbnailQuality quality, @Nullable Boolean excludeMediaInfo) {
68+
public ThumbnailV2Arg(@Nonnull PathOrLink resource, @Nonnull ThumbnailFormat format, @Nonnull ThumbnailSize size, @Nonnull ThumbnailMode mode, @Nonnull ThumbnailQuality quality, @Nullable Boolean excludeMediaInfo, boolean preserveTransparency) {
6469
if (resource == null) {
6570
throw new IllegalArgumentException("Required value for 'resource' is null");
6671
}
@@ -82,6 +87,7 @@ public ThumbnailV2Arg(@Nonnull PathOrLink resource, @Nonnull ThumbnailFormat for
8287
}
8388
this.quality = quality;
8489
this.excludeMediaInfo = excludeMediaInfo;
90+
this.preserveTransparency = preserveTransparency;
8591
}
8692

8793
/**
@@ -98,7 +104,7 @@ public ThumbnailV2Arg(@Nonnull PathOrLink resource, @Nonnull ThumbnailFormat for
98104
* preconditions.
99105
*/
100106
public ThumbnailV2Arg(@Nonnull PathOrLink resource) {
101-
this(resource, ThumbnailFormat.JPEG, ThumbnailSize.W64H64, ThumbnailMode.STRICT, ThumbnailQuality.QUALITY_80, null);
107+
this(resource, ThumbnailFormat.JPEG, ThumbnailSize.W64H64, ThumbnailMode.STRICT, ThumbnailQuality.QUALITY_80, null, false);
102108
}
103109

104110
/**
@@ -173,6 +179,18 @@ public Boolean getExcludeMediaInfo() {
173179
return excludeMediaInfo;
174180
}
175181

182+
/**
183+
* Whether to preserve the original image's transparency in the thumbnail.
184+
* This is supported only when the output format is PNG or WebP. Requests
185+
* that set this flag with JPEG output return an error.
186+
*
187+
* @return value for this field, or {@code null} if not present. Defaults to
188+
* false.
189+
*/
190+
public boolean getPreserveTransparency() {
191+
return preserveTransparency;
192+
}
193+
176194
/**
177195
* Returns a new builder for creating an instance of this class.
178196
*
@@ -201,6 +219,7 @@ public static class Builder {
201219
protected ThumbnailMode mode;
202220
protected ThumbnailQuality quality;
203221
protected Boolean excludeMediaInfo;
222+
protected boolean preserveTransparency;
204223

205224
protected Builder(PathOrLink resource) {
206225
if (resource == null) {
@@ -212,6 +231,7 @@ protected Builder(PathOrLink resource) {
212231
this.mode = ThumbnailMode.STRICT;
213232
this.quality = ThumbnailQuality.QUALITY_80;
214233
this.excludeMediaInfo = null;
234+
this.preserveTransparency = false;
215235
}
216236

217237
/**
@@ -332,14 +352,38 @@ public Builder withExcludeMediaInfo(Boolean excludeMediaInfo) {
332352
return this;
333353
}
334354

355+
/**
356+
* Set value for optional field.
357+
*
358+
* <p> If left unset or set to {@code null}, defaults to {@code false}.
359+
* </p>
360+
*
361+
* @param preserveTransparency Whether to preserve the original image's
362+
* transparency in the thumbnail. This is supported only when the
363+
* output format is PNG or WebP. Requests that set this flag with
364+
* JPEG output return an error. Defaults to {@code false} when set
365+
* to {@code null}.
366+
*
367+
* @return this builder
368+
*/
369+
public Builder withPreserveTransparency(Boolean preserveTransparency) {
370+
if (preserveTransparency != null) {
371+
this.preserveTransparency = preserveTransparency;
372+
}
373+
else {
374+
this.preserveTransparency = false;
375+
}
376+
return this;
377+
}
378+
335379
/**
336380
* Builds an instance of {@link ThumbnailV2Arg} configured with this
337381
* builder's values
338382
*
339383
* @return new instance of {@link ThumbnailV2Arg}
340384
*/
341385
public ThumbnailV2Arg build() {
342-
return new ThumbnailV2Arg(resource, format, size, mode, quality, excludeMediaInfo);
386+
return new ThumbnailV2Arg(resource, format, size, mode, quality, excludeMediaInfo, preserveTransparency);
343387
}
344388
}
345389

@@ -351,7 +395,8 @@ public int hashCode() {
351395
this.size,
352396
this.mode,
353397
this.quality,
354-
this.excludeMediaInfo
398+
this.excludeMediaInfo,
399+
this.preserveTransparency
355400
});
356401
return hash;
357402
}
@@ -373,6 +418,7 @@ else if (obj.getClass().equals(this.getClass())) {
373418
&& ((this.mode == other.mode) || (this.mode.equals(other.mode)))
374419
&& ((this.quality == other.quality) || (this.quality.equals(other.quality)))
375420
&& ((this.excludeMediaInfo == other.excludeMediaInfo) || (this.excludeMediaInfo != null && this.excludeMediaInfo.equals(other.excludeMediaInfo)))
421+
&& (this.preserveTransparency == other.preserveTransparency)
376422
;
377423
}
378424
else {
@@ -422,6 +468,8 @@ public void serialize(ThumbnailV2Arg value, JsonGenerator g, boolean collapse) t
422468
g.writeFieldName("exclude_media_info");
423469
StoneSerializers.nullable(StoneSerializers.boolean_()).serialize(value.excludeMediaInfo, g);
424470
}
471+
g.writeFieldName("preserve_transparency");
472+
StoneSerializers.boolean_().serialize(value.preserveTransparency, g);
425473
if (!collapse) {
426474
g.writeEndObject();
427475
}
@@ -442,6 +490,7 @@ public ThumbnailV2Arg deserialize(JsonParser p, boolean collapsed) throws IOExce
442490
ThumbnailMode f_mode = ThumbnailMode.STRICT;
443491
ThumbnailQuality f_quality = ThumbnailQuality.QUALITY_80;
444492
Boolean f_excludeMediaInfo = null;
493+
Boolean f_preserveTransparency = false;
445494
while (p.getCurrentToken() == JsonToken.FIELD_NAME) {
446495
String field = p.getCurrentName();
447496
p.nextToken();
@@ -463,14 +512,17 @@ else if ("quality".equals(field)) {
463512
else if ("exclude_media_info".equals(field)) {
464513
f_excludeMediaInfo = StoneSerializers.nullable(StoneSerializers.boolean_()).deserialize(p);
465514
}
515+
else if ("preserve_transparency".equals(field)) {
516+
f_preserveTransparency = StoneSerializers.boolean_().deserialize(p);
517+
}
466518
else {
467519
skipValue(p);
468520
}
469521
}
470522
if (f_resource == null) {
471523
throw new JsonParseException(p, "Required field \"resource\" missing.");
472524
}
473-
value = new ThumbnailV2Arg(f_resource, f_format, f_size, f_mode, f_quality, f_excludeMediaInfo);
525+
value = new ThumbnailV2Arg(f_resource, f_format, f_size, f_mode, f_quality, f_excludeMediaInfo, f_preserveTransparency);
474526
}
475527
else {
476528
throw new JsonParseException(p, "No subtype found that matches tag: \"" + tag + "\"");

core/build/generated_stone_source/main/src/com/dropbox/core/v2/files/ThumbnailV2Error.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public enum Tag {
6161
* The shared link does not exist.
6262
*/
6363
NOT_FOUND,
64+
/**
65+
* Transparency preservation is supported only for PNG and WebP output.
66+
*/
67+
UNSUPPORTED_OUTPUT_FORMAT,
6468
/**
6569
* Catch-all used for unknown tag values returned by the Dropbox
6670
* servers.
@@ -96,6 +100,10 @@ public enum Tag {
96100
* The shared link does not exist.
97101
*/
98102
public static final ThumbnailV2Error NOT_FOUND = new ThumbnailV2Error().withTag(Tag.NOT_FOUND);
103+
/**
104+
* Transparency preservation is supported only for PNG and WebP output.
105+
*/
106+
public static final ThumbnailV2Error UNSUPPORTED_OUTPUT_FORMAT = new ThumbnailV2Error().withTag(Tag.UNSUPPORTED_OUTPUT_FORMAT);
99107
/**
100108
* Catch-all used for unknown tag values returned by the Dropbox servers.
101109
*
@@ -273,6 +281,17 @@ public boolean isNotFound() {
273281
return this._tag == Tag.NOT_FOUND;
274282
}
275283

284+
/**
285+
* Returns {@code true} if this instance has the tag {@link
286+
* Tag#UNSUPPORTED_OUTPUT_FORMAT}, {@code false} otherwise.
287+
*
288+
* @return {@code true} if this instance is tagged as {@link
289+
* Tag#UNSUPPORTED_OUTPUT_FORMAT}, {@code false} otherwise.
290+
*/
291+
public boolean isUnsupportedOutputFormat() {
292+
return this._tag == Tag.UNSUPPORTED_OUTPUT_FORMAT;
293+
}
294+
276295
/**
277296
* Returns {@code true} if this instance has the tag {@link Tag#OTHER},
278297
* {@code false} otherwise.
@@ -321,6 +340,8 @@ else if (obj instanceof ThumbnailV2Error) {
321340
return true;
322341
case NOT_FOUND:
323342
return true;
343+
case UNSUPPORTED_OUTPUT_FORMAT:
344+
return true;
324345
case OTHER:
325346
return true;
326347
default:
@@ -390,6 +411,10 @@ public void serialize(ThumbnailV2Error value, JsonGenerator g) throws IOExceptio
390411
g.writeString("not_found");
391412
break;
392413
}
414+
case UNSUPPORTED_OUTPUT_FORMAT: {
415+
g.writeString("unsupported_output_format");
416+
break;
417+
}
393418
default: {
394419
g.writeString("other");
395420
}
@@ -438,6 +463,9 @@ else if ("access_denied".equals(tag)) {
438463
else if ("not_found".equals(tag)) {
439464
value = ThumbnailV2Error.NOT_FOUND;
440465
}
466+
else if ("unsupported_output_format".equals(tag)) {
467+
value = ThumbnailV2Error.UNSUPPORTED_OUTPUT_FORMAT;
468+
}
441469
else {
442470
value = ThumbnailV2Error.OTHER;
443471
}

core/src/main/stone

Submodule stone updated 1 file

0 commit comments

Comments
 (0)