From 2a609b9820bd122aa73fdf31a1651fe60228e1dc Mon Sep 17 00:00:00 2001 From: vasanth-autorender Date: Fri, 12 Jun 2026 21:33:54 +0530 Subject: [PATCH 1/8] fix: restore staging workflows in back-sync to prevent pipeline deletion --- .github/workflows/stlc-sync-from-production.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/stlc-sync-from-production.yml b/.github/workflows/stlc-sync-from-production.yml index 12d0fec..d7964a9 100644 --- a/.github/workflows/stlc-sync-from-production.yml +++ b/.github/workflows/stlc-sync-from-production.yml @@ -52,6 +52,12 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git checkout -b stlc/from-prod git merge production/main --no-edit -m "chore: sync release commits from production" + # Restore staging-only workflows stripped by the production overlay step + git checkout origin/main -- \ + .github/workflows/stlc-promote.yml \ + .github/workflows/stlc-sync-from-production.yml + git diff --cached --quiet || \ + git commit -m "chore: restore staging-only workflows after back-sync" git remote set-url origin \ "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" git push origin stlc/from-prod --force From 0f1ece4aa547329b3ff56c56f300a88f365e7738 Mon Sep 17 00:00:00 2001 From: vasanth-autorender Date: Sat, 13 Jun 2026 13:38:47 +0530 Subject: [PATCH 2/8] Build SDK Stainless-Generated-From: 645840fdf56a1ada4215d45db46d8dda05db6d01 --- scripts/mock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mock b/scripts/mock index c7c4aa6..a38c54c 100755 --- a/scripts/mock +++ b/scripts/mock @@ -11,7 +11,7 @@ elif [ -n "$STAINLESS_OPENAPI_SPEC_URL" ]; then URL="$STAINLESS_OPENAPI_SPEC_URL" else # Embedded OpenAPI spec (base64-encoded, gzipped) - EMBEDDED_SPEC="H4sIAAAAAAAAA+1dW3PbuHd/96fAaPoQTyObsmXH9rRNs7vdNm2azSTZl7/tamASsrARL0tSvmzi794BbyJBXA5Iyra80OxkZfGAOAAPzg2/A37fQWgURiTAER2dodHh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6CwYANzPYTwmw7xIALPrHBgA1z7ggDbriFIIaL3V6z+DC8aIeXBKQzMgC4Qcp+NqRMqLM1x5tVneoB5+yLDBtTJduj4pXjtgSFbPygA8ry2VdyTvnxB3df2gldwRrRVOOOXR3TzXl1lwd183dnpK8Zz6O6oWOfQnt6Zr8b3Z0sbf3P/tIedm0evOVlB0t7eHIKJ2e/VIq1P7u95b2jfuyaX+nP/VT92DW/0p9SnLXRK8bLQMkWwMgzgI0V0X8AAGMgFQOp/JyrUAupaFa0CKrUmNndnY7cSBcVVFFJ32SW6r8LID0LLcwslpVVhgrnHhBGLUeVw1e5U7OF51U2g6XDV6kte/3EehUx01PckSY2SmtvwZakzCiuvaFefKF4ot5v/r67yvqL48WuVPYXP99V8riVg63vOFMf0jmiq+x4xXGuOuqVl581bFM/6k5vNfxnutPbeJnGyzT+jfEyf4xV+E5e5goL1HDb8it1qwwK/5N6lFVotnMnP6ij3mtSl6suZ5q83OByPi7bT43uCVKYpXQXkpgbJKLsRr527qif108sHas2mRR9nn6b6dmmXpnSSuUgM5dLOqI+KFVJzlUNkaY5v9igtCbVuSn0fLK85t1ouqbM5nQJTChqQlETir7wIMiEoi9hFV5IKFpS4SYUfY1+lwlFjbOdT/909fS53wl9gqC3AOgWU7bDNJfvToiayeVvxZCvWpXuczG3V70OppBsWnHe36Jr5EdxwPd9ZFPWGu9ZRSNpdJC9JHbFm9dQ6MURDhkFe2fn78EVWoCULjIHSzWTvrOjJl0ugCGcITHEjVvLcp1qSbpxi6Pl/wHamotItKsAAA==" SPEC_TMPFILE="$(mktemp)" trap 'rm -f "$SPEC_TMPFILE"' EXIT echo "$EMBEDDED_SPEC" | base64 --decode | gunzip > "$SPEC_TMPFILE" From d33ab7ce43aafc58454fe59d5286237e987245d2 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Sat, 13 Jun 2026 08:20:23 +0000 Subject: [PATCH 3/8] reseal java custom-code Stainless-Generated-From: ab3e58c4baead53d7e9649f14807c0f0cec6e162 --- scripts/mock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mock b/scripts/mock index a38c54c..a413aac 100755 --- a/scripts/mock +++ b/scripts/mock @@ -11,7 +11,7 @@ elif [ -n "$STAINLESS_OPENAPI_SPEC_URL" ]; then URL="$STAINLESS_OPENAPI_SPEC_URL" else # Embedded OpenAPI spec (base64-encoded, gzipped) - EMBEDDED_SPEC="H4sIAAAAAAAAE+1dWXPbuhX+KxhOH+ypKFGyvGnapr43TZs2TTxx8nJlVQORkISY2wVA27q2/nsHC0lwESXZsmMn8GQcGQKxHJz1wwF4Z0UxCmGMrYF10HbajtWycDiNrMGdxTDzkTWwzhIWfUahhwg4TyY+dsHZ+XurZXmIugTHDEehNbA+/+PiC/8CTCMCktiPoIfDWQsEMIQz8QmGHqCIXONwBgLkYQggpYjRNjjzfYBCL45wyCgg6PcEEwRgKNq7QgtwjSFgcwRubRhjm5fMEeQDigg4S9g8IvgPyAcyAL8gSBABf7lCi7+1rZZ1jQiVI+yq+blRyKDL+BRDGJRmeJHEcUSY1bJQALFvDSwqS/4OExYRUamNI2u55A0FcRSikFHeFkVuQjBbXLhzFCBRBGP8H7QQtFzEvCNV0Eo7zuYjyG4NLDmtCnFTOnDaxnINMnq1wa8wBNCnEZggEJPoGnvIEyRrII2YAOVDhXyo/K8YsrkYdgfGuHPd7QSJz3AMCetQBokgWBxR8X8UIyJafe9ZAyureCHqtSyaBAEkC2tgiRKQVVCcYbUsBmfUGgytr6KAWqPynN+HmGHoY4oArDQAKKJ8WQVTEeQifM3njmyKZyHygKj69fMHylmAMxSi7JfIE2uh+MuzBowkSPIDCplcsNjHrphY5xvlw7hTRNIWMZp8Qy6fZUw4GRiWiz3FPhrLdc2qUkZwOLNaVoDDDyicsbk16HLC4z/0ajhkaCaWPcAhDpLAGnRbVgBv5edTxznunp72DvvHfef0lDcwjUgA2QY9TSOfM1Sl4jJdgTsLhotPU2swzLmUECg4kqGA1jy6bFWKRsuWFSAGPchqSQU9D3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wYIM+Ggz4Va6CwYANzPYTwmw7xIALPrHBgA1z7ggDbriFIIaL3V6z+DC8aIeXBKQzMgC4Qcp+NqRMqLM1x5tVneoB5+yLDBtTJduj4pXjtgSFbPygA8ry2VdyTvnxB3df2gldwRrRVOOOXR3TzXl1lwd183dnpK8Zz6O6oWOfQnt6Zr8b3Z0sbf3P/tIedm0evOVlB0t7eHIKJ2e/VIq1P7u95b2jfuyaX+nP/VT92DW/0p9SnLXRK8bLQMkWwMgzgI0V0X8AAGMgFQOp/JyrUAupaFa0CKrUmNndnY7cSBcVVFFJ32SW6r8LID0LLcwslpVVhgrnHhBGLUeVw1e5U7OF51U2g6XDV6kte/3EehUx01PckSY2SmtvwZakzCiuvaFefKF4ot5v/r67yvqL48WuVPYXP99V8riVg63vOFMf0jmiq+x4xXGuOuqVl581bFM/6k5vNfxnutPbeJnGyzT+jfEyf4xV+E5e5goL1HDb8it1qwwK/5N6lFVotnMnP6ij3mtSl6suZ5q83OByPi7bT43uCVKYpXQXkpgbJKLsRr527qif108sHas2mRR9nn6b6dmmXpnSSuUgM5dLOqI+KFVJzlUNkaY5v9igtCbVuSn0fLK85t1ouqbM5nQJTChqQlETir7wIMiEoi9hFV5IKFpS4SYUfY1+lwlFjbOdT/909fS53wl9gqC3AOgWU7bDNJfvToiayeVvxZCvWpXuczG3V70OppBsWnHe36Jr5EdxwPd9ZFPWGu9ZRSNpdJC9JHbFm9dQ6MURDhkFe2fn78EVWoCULjIHSzWTvrOjJl0ugCGcITHEjVvLcp1qSbpxi6Pl/wHamotItKsAAA==" SPEC_TMPFILE="$(mktemp)" trap 'rm -f "$SPEC_TMPFILE"' EXIT echo "$EMBEDDED_SPEC" | base64 --decode | gunzip > "$SPEC_TMPFILE" From a27e2070769ceb03656ad23ba369a9a0c8cfe340 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 29 Jun 2026 16:50:11 +0000 Subject: [PATCH 4/8] chore: sync openapi.json from northstar-server Stainless-Generated-From: f5b4eaa887d14336ee8da2f5bc83fa3fbe418b06 --- .../uploads/UploadCreateFromUrlParams.kt | 268 ++++++++++++++++-- .../models/files/FileListResponseTest.kt | 120 ++++---- .../models/files/FileRenameResponseTest.kt | 90 +++--- .../models/files/FileRetrieveResponseTest.kt | 90 +++--- .../folders/FolderCreateResponseTest.kt | 42 +-- .../models/folders/FolderListResponseTest.kt | 42 +-- .../folders/FolderRenameResponseTest.kt | 42 +-- .../MultipartUploadCompleteResponseTest.kt | 122 ++++---- .../MultipartUploadStartResponseTest.kt | 68 +++-- .../uploads/UploadCreateFromUrlParamsTest.kt | 6 +- .../UploadCreateFromUrlResponseTest.kt | 122 ++++---- .../uploads/UploadCreateResponseTest.kt | 121 ++++---- .../services/async/UploadServiceAsyncTest.kt | 2 +- .../services/blocking/UploadServiceTest.kt | 2 +- .../proguard/ProGuardCompatibilityTest.kt | 40 +-- scripts/mock | 2 +- 16 files changed, 701 insertions(+), 478 deletions(-) diff --git a/autorender-java-core/src/main/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParams.kt b/autorender-java-core/src/main/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParams.kt index cebb1a9..a41453d 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParams.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParams.kt @@ -6,18 +6,31 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.core.JsonGenerator +import com.fasterxml.jackson.core.ObjectCodec +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.SerializerProvider +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import io.autorender.core.BaseDeserializer +import io.autorender.core.BaseSerializer import io.autorender.core.ExcludeMissing import io.autorender.core.JsonField import io.autorender.core.JsonMissing import io.autorender.core.JsonValue import io.autorender.core.Params +import io.autorender.core.allMaxBy import io.autorender.core.checkRequired +import io.autorender.core.getOrThrow import io.autorender.core.http.Headers import io.autorender.core.http.QueryParams +import io.autorender.core.toImmutable import io.autorender.errors.AutorenderInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** Download a file from a remote URL and store it in AutoRender. */ class UploadCreateFromUrlParams @@ -74,12 +87,12 @@ private constructor( fun randomPrefix(): Optional = body.randomPrefix() /** - * Comma-separated tags + * Tags array or comma-separated string * * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun tags(): Optional = body.tags() + fun tags(): Optional = body.tags() /** * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the @@ -134,7 +147,7 @@ private constructor( * * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type. */ - fun _tags(): JsonField = body._tags() + fun _tags(): JsonField = body._tags() /** * Returns the raw JSON value of [webhookUrl]. @@ -263,16 +276,22 @@ private constructor( body.randomPrefix(randomPrefix) } - /** Comma-separated tags */ - fun tags(tags: String) = apply { body.tags(tags) } + /** Tags array or comma-separated string */ + fun tags(tags: Tags) = apply { body.tags(tags) } /** * Sets [Builder.tags] to an arbitrary JSON value. * - * You should usually call [Builder.tags] with a well-typed [String] value instead. This + * You should usually call [Builder.tags] with a well-typed [Tags] value instead. This * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun tags(tags: JsonField) = apply { body.tags(tags) } + fun tags(tags: JsonField) = apply { body.tags(tags) } + + /** Alias for calling [tags] with `Tags.ofStrings(strings)`. */ + fun tagsOfStrings(strings: List) = apply { body.tagsOfStrings(strings) } + + /** Alias for calling [tags] with `Tags.ofString(string)`. */ + fun tags(string: String) = apply { body.tags(string) } fun webhookUrl(webhookUrl: String) = apply { body.webhookUrl(webhookUrl) } @@ -437,7 +456,7 @@ private constructor( private val folder: JsonField, private val metadata: JsonField, private val randomPrefix: JsonField, - private val tags: JsonField, + private val tags: JsonField, private val webhookUrl: JsonField, private val additionalProperties: MutableMap, ) { @@ -460,7 +479,7 @@ private constructor( @JsonProperty("random_prefix") @ExcludeMissing randomPrefix: JsonField = JsonMissing.of(), - @JsonProperty("tags") @ExcludeMissing tags: JsonField = JsonMissing.of(), + @JsonProperty("tags") @ExcludeMissing tags: JsonField = JsonMissing.of(), @JsonProperty("webhook_url") @ExcludeMissing webhookUrl: JsonField = JsonMissing.of(), @@ -523,12 +542,12 @@ private constructor( fun randomPrefix(): Optional = randomPrefix.getOptional("random_prefix") /** - * Comma-separated tags + * Tags array or comma-separated string * * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun tags(): Optional = tags.getOptional("tags") + fun tags(): Optional = tags.getOptional("tags") /** * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if @@ -586,7 +605,7 @@ private constructor( * * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField = tags + @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField = tags /** * Returns the raw JSON value of [webhookUrl]. @@ -631,7 +650,7 @@ private constructor( private var folder: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() private var randomPrefix: JsonField = JsonMissing.of() - private var tags: JsonField = JsonMissing.of() + private var tags: JsonField = JsonMissing.of() private var webhookUrl: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -721,17 +740,23 @@ private constructor( this.randomPrefix = randomPrefix } - /** Comma-separated tags */ - fun tags(tags: String) = tags(JsonField.of(tags)) + /** Tags array or comma-separated string */ + fun tags(tags: Tags) = tags(JsonField.of(tags)) /** * Sets [Builder.tags] to an arbitrary JSON value. * - * You should usually call [Builder.tags] with a well-typed [String] value instead. This + * You should usually call [Builder.tags] with a well-typed [Tags] value instead. This * method is primarily for setting the field to an undocumented or not yet supported * value. */ - fun tags(tags: JsonField) = apply { this.tags = tags } + fun tags(tags: JsonField) = apply { this.tags = tags } + + /** Alias for calling [tags] with `Tags.ofStrings(strings)`. */ + fun tagsOfStrings(strings: List) = tags(Tags.ofStrings(strings)) + + /** Alias for calling [tags] with `Tags.ofString(string)`. */ + fun tags(string: String) = tags(Tags.ofString(string)) fun webhookUrl(webhookUrl: String) = webhookUrl(JsonField.of(webhookUrl)) @@ -811,7 +836,7 @@ private constructor( folder() metadata() randomPrefix() - tags() + tags().ifPresent { it.validate() } webhookUrl() validated = true } @@ -838,7 +863,7 @@ private constructor( (if (folder.asKnown().isPresent) 1 else 0) + (if (metadata.asKnown().isPresent) 1 else 0) + (if (randomPrefix.asKnown().isPresent) 1 else 0) + - (if (tags.asKnown().isPresent) 1 else 0) + + (tags.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -878,6 +903,211 @@ private constructor( "Body{remoteUrl=$remoteUrl, customId=$customId, fileName=$fileName, folder=$folder, metadata=$metadata, randomPrefix=$randomPrefix, tags=$tags, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } + /** Tags array or comma-separated string */ + @JsonDeserialize(using = Tags.Deserializer::class) + @JsonSerialize(using = Tags.Serializer::class) + class Tags + private constructor( + private val strings: List? = null, + private val string: String? = null, + private val _json: JsonValue? = null, + ) { + + fun strings(): Optional> = Optional.ofNullable(strings) + + fun string(): Optional = Optional.ofNullable(string) + + fun isStrings(): Boolean = strings != null + + fun isString(): Boolean = string != null + + fun asStrings(): List = strings.getOrThrow("strings") + + fun asString(): String = string.getOrThrow("string") + + fun _json(): Optional = Optional.ofNullable(_json) + + /** + * Maps this instance's current variant to a value of type [T] using the given [visitor]. + * + * Note that this method is _not_ forwards compatible with new variants from the API, unless + * [visitor] overrides [Visitor.unknown]. To handle variants not known to this version of + * the SDK gracefully, consider overriding [Visitor.unknown]: + * ```java + * import io.autorender.core.JsonValue; + * import java.util.Optional; + * + * Optional result = tags.accept(new Tags.Visitor>() { + * @Override + * public Optional visitStrings(List strings) { + * return Optional.of(strings.toString()); + * } + * + * // ... + * + * @Override + * public Optional unknown(JsonValue json) { + * // Or inspect the `json`. + * return Optional.empty(); + * } + * }); + * ``` + * + * @throws AutorenderInvalidDataException if [Visitor.unknown] is not overridden in + * [visitor] and the current variant is unknown. + */ + fun accept(visitor: Visitor): T = + when { + strings != null -> visitor.visitStrings(strings) + string != null -> visitor.visitString(string) + else -> visitor.unknown(_json) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws AutorenderInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Tags = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitStrings(strings: List) {} + + override fun visitString(string: String) {} + } + ) + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: AutorenderInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + accept( + object : Visitor { + override fun visitStrings(strings: List) = strings.size + + override fun visitString(string: String) = 1 + + override fun unknown(json: JsonValue?) = 0 + } + ) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Tags && strings == other.strings && string == other.string + } + + override fun hashCode(): Int = Objects.hash(strings, string) + + override fun toString(): String = + when { + strings != null -> "Tags{strings=$strings}" + string != null -> "Tags{string=$string}" + _json != null -> "Tags{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Tags") + } + + companion object { + + @JvmStatic fun ofStrings(strings: List) = Tags(strings = strings.toImmutable()) + + @JvmStatic fun ofString(string: String) = Tags(string = string) + } + + /** An interface that defines how to map each variant of [Tags] to a value of type [T]. */ + interface Visitor { + + fun visitStrings(strings: List): T + + fun visitString(string: String): T + + /** + * Maps an unknown variant of [Tags] to a value of type [T]. + * + * An instance of [Tags] can contain an unknown variant if it was deserialized from data + * that doesn't match any known variant. For example, if the SDK is on an older version + * than the API, then the API may respond with new variants that the SDK is unaware of. + * + * @throws AutorenderInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw AutorenderInvalidDataException("Unknown Tags: $json") + } + } + + internal class Deserializer : BaseDeserializer(Tags::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Tags { + val json = JsonValue.fromJsonNode(node) + + val bestMatches = + sequenceOf( + tryDeserialize(node, jacksonTypeRef())?.let { + Tags(string = it, _json = json) + }, + tryDeserialize(node, jacksonTypeRef>())?.let { + Tags(strings = it, _json = json) + }, + ) + .filterNotNull() + .allMaxBy { it.validity() } + .toList() + return when (bestMatches.size) { + // This can happen if what we're deserializing is completely incompatible with + // all the possible variants (e.g. deserializing from boolean). + 0 -> Tags(_json = json) + 1 -> bestMatches.single() + // If there's more than one match with the highest validity, then use the first + // completely valid match, or simply the first match if none are completely + // valid. + else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first() + } + } + } + + internal class Serializer : BaseSerializer(Tags::class) { + + override fun serialize( + value: Tags, + generator: JsonGenerator, + provider: SerializerProvider, + ) { + when { + value.strings != null -> generator.writeObject(value.strings) + value.string != null -> generator.writeObject(value.string) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Tags") + } + } + } + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt index 569dadd..1b1f07c 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt @@ -17,36 +17,36 @@ internal class FileListResponseTest { FileListResponse.builder() .addFile( FileListResponse.File.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileListResponse.File.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) .meta( FileListResponse.Meta.builder() - .hasNext(false) - .hasPrev(false) - .limit(20L) - .page(1L) - .total(100L) + .hasNext(true) + .hasPrev(true) + .limit(-9007199254740991L) + .page(-9007199254740991L) + .total(-9007199254740991L) .build() ) .build() @@ -54,37 +54,37 @@ internal class FileListResponseTest { assertThat(fileListResponse.files()) .containsExactly( FileListResponse.File.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileListResponse.File.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) assertThat(fileListResponse.meta()) .isEqualTo( FileListResponse.Meta.builder() - .hasNext(false) - .hasPrev(false) - .limit(20L) - .page(1L) - .total(100L) + .hasNext(true) + .hasPrev(true) + .limit(-9007199254740991L) + .page(-9007199254740991L) + .total(-9007199254740991L) .build() ) } @@ -96,36 +96,36 @@ internal class FileListResponseTest { FileListResponse.builder() .addFile( FileListResponse.File.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileListResponse.File.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) .meta( FileListResponse.Meta.builder() - .hasNext(false) - .hasPrev(false) - .limit(20L) - .page(1L) - .total(100L) + .hasNext(true) + .hasPrev(true) + .limit(-9007199254740991L) + .page(-9007199254740991L) + .total(-9007199254740991L) .build() ) .build() diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRenameResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRenameResponseTest.kt index ebce429..e7857ab 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRenameResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRenameResponseTest.kt @@ -17,27 +17,27 @@ internal class FileRenameResponseTest { FileRenameResponse.builder() .data( FileRenameResponse.Data.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileRenameResponse.Data.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) .success(FileRenameResponse.Success.TRUE) @@ -46,27 +46,27 @@ internal class FileRenameResponseTest { assertThat(fileRenameResponse.data()) .isEqualTo( FileRenameResponse.Data.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileRenameResponse.Data.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) assertThat(fileRenameResponse.success()).isEqualTo(FileRenameResponse.Success.TRUE) @@ -79,27 +79,27 @@ internal class FileRenameResponseTest { FileRenameResponse.builder() .data( FileRenameResponse.Data.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileRenameResponse.Data.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) .success(FileRenameResponse.Success.TRUE) diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRetrieveResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRetrieveResponseTest.kt index dbc5a05..5bc42c2 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRetrieveResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileRetrieveResponseTest.kt @@ -17,27 +17,27 @@ internal class FileRetrieveResponseTest { FileRetrieveResponse.builder() .data( FileRetrieveResponse.Data.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileRetrieveResponse.Data.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) .success(FileRetrieveResponse.Success.TRUE) @@ -46,27 +46,27 @@ internal class FileRetrieveResponseTest { assertThat(fileRetrieveResponse.data()) .isEqualTo( FileRetrieveResponse.Data.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileRetrieveResponse.Data.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) assertThat(fileRetrieveResponse.success()).isEqualTo(FileRetrieveResponse.Success.TRUE) @@ -79,27 +79,27 @@ internal class FileRetrieveResponseTest { FileRetrieveResponse.builder() .data( FileRetrieveResponse.Data.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .fileNo("file_abc123") - .folderName(null) - .folderNo(null) - .format("jpg") - .height(1080L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) .metadata( FileRetrieveResponse.Data.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) - .source("direct") + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") .addTag("string") - .updatedAt(null) - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() ) .success(FileRetrieveResponse.Success.TRUE) diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderCreateResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderCreateResponseTest.kt index 4631918..a870e21 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderCreateResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderCreateResponseTest.kt @@ -14,24 +14,24 @@ internal class FolderCreateResponseTest { fun create() { val folderCreateResponse = FolderCreateResponse.builder() - .id("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .folderNo("folder_abc123") - .name("example.jpg") - .parentFolderNo(null) - .path("/example.jpg") - .updatedAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .folderNo("folder_no") + .name("name") + .parentFolderNo("parent_folder_no") + .path("path") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() - assertThat(folderCreateResponse.id()).isEqualTo("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") + assertThat(folderCreateResponse.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(folderCreateResponse.createdAt()) - .isEqualTo(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - assertThat(folderCreateResponse.folderNo()).isEqualTo("folder_abc123") - assertThat(folderCreateResponse.name()).isEqualTo("example.jpg") - assertThat(folderCreateResponse.parentFolderNo()).isEmpty - assertThat(folderCreateResponse.path()).isEqualTo("/example.jpg") + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(folderCreateResponse.folderNo()).isEqualTo("folder_no") + assertThat(folderCreateResponse.name()).isEqualTo("name") + assertThat(folderCreateResponse.parentFolderNo()).contains("parent_folder_no") + assertThat(folderCreateResponse.path()).isEqualTo("path") assertThat(folderCreateResponse.updatedAt()) - .contains(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) } @Test @@ -39,13 +39,13 @@ internal class FolderCreateResponseTest { val jsonMapper = jsonMapper() val folderCreateResponse = FolderCreateResponse.builder() - .id("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .folderNo("folder_abc123") - .name("example.jpg") - .parentFolderNo(null) - .path("/example.jpg") - .updatedAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .folderNo("folder_no") + .name("name") + .parentFolderNo("parent_folder_no") + .path("path") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() val roundtrippedFolderCreateResponse = diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderListResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderListResponseTest.kt index 76c5fe8..b190191 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderListResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderListResponseTest.kt @@ -16,13 +16,13 @@ internal class FolderListResponseTest { FolderListResponse.builder() .addFolder( FolderListResponse.Folder.builder() - .id("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .folderNo("folder_abc123") - .name("My Folder") - .parentFolderNo(null) - .path("/My Folder") - .updatedAt(null) + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .folderNo("folder_no") + .name("name") + .parentFolderNo("parent_folder_no") + .path("path") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) .build() @@ -30,13 +30,13 @@ internal class FolderListResponseTest { assertThat(folderListResponse.folders()) .containsExactly( FolderListResponse.Folder.builder() - .id("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .folderNo("folder_abc123") - .name("My Folder") - .parentFolderNo(null) - .path("/My Folder") - .updatedAt(null) + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .folderNo("folder_no") + .name("name") + .parentFolderNo("parent_folder_no") + .path("path") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) } @@ -48,13 +48,13 @@ internal class FolderListResponseTest { FolderListResponse.builder() .addFolder( FolderListResponse.Folder.builder() - .id("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .folderNo("folder_abc123") - .name("My Folder") - .parentFolderNo(null) - .path("/My Folder") - .updatedAt(null) + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .folderNo("folder_no") + .name("name") + .parentFolderNo("parent_folder_no") + .path("path") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) .build() diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderRenameResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderRenameResponseTest.kt index 56f5531..0a8f865 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderRenameResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/folders/FolderRenameResponseTest.kt @@ -14,24 +14,24 @@ internal class FolderRenameResponseTest { fun create() { val folderRenameResponse = FolderRenameResponse.builder() - .id("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .folderNo("folder_abc123") - .name("example.jpg") - .parentFolderNo(null) - .path("/example.jpg") - .updatedAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .folderNo("folder_no") + .name("name") + .parentFolderNo("parent_folder_no") + .path("path") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() - assertThat(folderRenameResponse.id()).isEqualTo("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") + assertThat(folderRenameResponse.id()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(folderRenameResponse.createdAt()) - .isEqualTo(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - assertThat(folderRenameResponse.folderNo()).isEqualTo("folder_abc123") - assertThat(folderRenameResponse.name()).isEqualTo("example.jpg") - assertThat(folderRenameResponse.parentFolderNo()).isEmpty - assertThat(folderRenameResponse.path()).isEqualTo("/example.jpg") + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(folderRenameResponse.folderNo()).isEqualTo("folder_no") + assertThat(folderRenameResponse.name()).isEqualTo("name") + assertThat(folderRenameResponse.parentFolderNo()).contains("parent_folder_no") + assertThat(folderRenameResponse.path()).isEqualTo("path") assertThat(folderRenameResponse.updatedAt()) - .contains(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) } @Test @@ -39,13 +39,13 @@ internal class FolderRenameResponseTest { val jsonMapper = jsonMapper() val folderRenameResponse = FolderRenameResponse.builder() - .id("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .folderNo("folder_abc123") - .name("example.jpg") - .parentFolderNo(null) - .path("/example.jpg") - .updatedAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .folderNo("folder_no") + .name("name") + .parentFolderNo("parent_folder_no") + .path("path") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() val roundtrippedFolderRenameResponse = diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadCompleteResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadCompleteResponseTest.kt index 4a93a0b..07a81d7 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadCompleteResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadCompleteResponseTest.kt @@ -15,64 +15,62 @@ internal class MultipartUploadCompleteResponseTest { fun create() { val multipartUploadCompleteResponse = MultipartUploadCompleteResponse.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .customId(null) - .extension("jpg") - .fileNo("file_abc123") - .folderNo("folder_abc123") - .height(1080L) - .isDuplicate(false) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .customId("custom_id") + .extension("extension") + .fileNo("file_no") + .folderNo("folder_no") + .height(-9007199254740991L) + .isDuplicate(true) .metadata( MultipartUploadCompleteResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) .addTag("string") - .thumbnail("https://cdn.autorender.io/thumb.jpg") - .uploadSource("direct") - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) - .workspaceId("ws_abc123") - .format("jpg") - .hash("abc123def456") - .isPrivate(false) + .thumbnail("thumbnail") + .uploadSource("upload_source") + .url("url") + .width(-9007199254740991L) + .workspaceId("workspace_id") + .format("format") + .hash("hash") + .isPrivate(true) .build() - assertThat(multipartUploadCompleteResponse.id()).isEqualTo("id_abc123") + assertThat(multipartUploadCompleteResponse.id()).isEqualTo("id") assertThat(multipartUploadCompleteResponse.createdAt()) - .isEqualTo(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - assertThat(multipartUploadCompleteResponse.customId()).isEmpty - assertThat(multipartUploadCompleteResponse.extension()).isEqualTo("jpg") - assertThat(multipartUploadCompleteResponse.fileNo()).isEqualTo("file_abc123") - assertThat(multipartUploadCompleteResponse.folderNo()).contains("folder_abc123") - assertThat(multipartUploadCompleteResponse.height()).contains(1080L) - assertThat(multipartUploadCompleteResponse.isDuplicate()).isEqualTo(false) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(multipartUploadCompleteResponse.customId()).contains("custom_id") + assertThat(multipartUploadCompleteResponse.extension()).isEqualTo("extension") + assertThat(multipartUploadCompleteResponse.fileNo()).isEqualTo("file_no") + assertThat(multipartUploadCompleteResponse.folderNo()).contains("folder_no") + assertThat(multipartUploadCompleteResponse.height()).contains(-9007199254740991L) + assertThat(multipartUploadCompleteResponse.isDuplicate()).isEqualTo(true) assertThat(multipartUploadCompleteResponse.metadata()) .contains( MultipartUploadCompleteResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - assertThat(multipartUploadCompleteResponse.mimeType()).isEqualTo("image/jpeg") - assertThat(multipartUploadCompleteResponse.name()).isEqualTo("example.jpg") - assertThat(multipartUploadCompleteResponse.path()).isEqualTo("/example.jpg") - assertThat(multipartUploadCompleteResponse.size()).isEqualTo(12345L) + assertThat(multipartUploadCompleteResponse.mimeType()).isEqualTo("mime_type") + assertThat(multipartUploadCompleteResponse.name()).isEqualTo("name") + assertThat(multipartUploadCompleteResponse.path()).isEqualTo("path") + assertThat(multipartUploadCompleteResponse.size()).isEqualTo(-9007199254740991L) assertThat(multipartUploadCompleteResponse.tags()).containsExactly("string") - assertThat(multipartUploadCompleteResponse.thumbnail()) - .isEqualTo("https://cdn.autorender.io/thumb.jpg") - assertThat(multipartUploadCompleteResponse.uploadSource()).isEqualTo("direct") - assertThat(multipartUploadCompleteResponse.url()) - .isEqualTo("https://cdn.autorender.io/example.jpg") - assertThat(multipartUploadCompleteResponse.width()).contains(1920L) - assertThat(multipartUploadCompleteResponse.workspaceId()).isEqualTo("ws_abc123") - assertThat(multipartUploadCompleteResponse.format()).contains("jpg") - assertThat(multipartUploadCompleteResponse.hash()).contains("abc123def456") - assertThat(multipartUploadCompleteResponse.isPrivate()).contains(false) + assertThat(multipartUploadCompleteResponse.thumbnail()).isEqualTo("thumbnail") + assertThat(multipartUploadCompleteResponse.uploadSource()).isEqualTo("upload_source") + assertThat(multipartUploadCompleteResponse.url()).isEqualTo("url") + assertThat(multipartUploadCompleteResponse.width()).contains(-9007199254740991L) + assertThat(multipartUploadCompleteResponse.workspaceId()).isEqualTo("workspace_id") + assertThat(multipartUploadCompleteResponse.format()).contains("format") + assertThat(multipartUploadCompleteResponse.hash()).contains("hash") + assertThat(multipartUploadCompleteResponse.isPrivate()).contains(true) } @Test @@ -80,32 +78,32 @@ internal class MultipartUploadCompleteResponseTest { val jsonMapper = jsonMapper() val multipartUploadCompleteResponse = MultipartUploadCompleteResponse.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .customId(null) - .extension("jpg") - .fileNo("file_abc123") - .folderNo("folder_abc123") - .height(1080L) - .isDuplicate(false) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .customId("custom_id") + .extension("extension") + .fileNo("file_no") + .folderNo("folder_no") + .height(-9007199254740991L) + .isDuplicate(true) .metadata( MultipartUploadCompleteResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) .addTag("string") - .thumbnail("https://cdn.autorender.io/thumb.jpg") - .uploadSource("direct") - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) - .workspaceId("ws_abc123") - .format("jpg") - .hash("abc123def456") - .isPrivate(false) + .thumbnail("thumbnail") + .uploadSource("upload_source") + .url("url") + .width(-9007199254740991L) + .workspaceId("workspace_id") + .format("format") + .hash("hash") + .isPrivate(true) .build() val roundtrippedMultipartUploadCompleteResponse = diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadStartResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadStartResponseTest.kt index 5c06aca..3a6fa84 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadStartResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/multipartuploads/MultipartUploadStartResponseTest.kt @@ -13,43 +13,41 @@ internal class MultipartUploadStartResponseTest { fun create() { val multipartUploadStartResponse = MultipartUploadStartResponse.builder() - .expireAt(1704067200L) - .minPartSize(5242880L) - .partSize(5242880L) - .addPart("https://s3.amazonaws.com/bucket/part1?signed=true") + .expireAt(-9007199254740991L) + .minPartSize(-9007199254740991L) + .partSize(-9007199254740991L) + .addPart("string") .policy( MultipartUploadStartResponse.Policy.builder() - .folder("/uploads") - .format("jpg") - .size(104857600L) + .folder("folder") + .format("format") + .size(-9007199254740991L) .addTag("string") .build() ) - .publicKey("pk_abc123") - .sessionId("sess_abc123") - .uuid("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .workspaceId("ws_abc123") + .publicKey("public_key") + .sessionId("session_id") + .uuid("uuid") + .workspaceId("workspace_id") .build() - assertThat(multipartUploadStartResponse.expireAt()).isEqualTo(1704067200L) - assertThat(multipartUploadStartResponse.minPartSize()).isEqualTo(5242880L) - assertThat(multipartUploadStartResponse.partSize()).isEqualTo(5242880L) - assertThat(multipartUploadStartResponse.parts()) - .containsExactly("https://s3.amazonaws.com/bucket/part1?signed=true") + assertThat(multipartUploadStartResponse.expireAt()).isEqualTo(-9007199254740991L) + assertThat(multipartUploadStartResponse.minPartSize()).isEqualTo(-9007199254740991L) + assertThat(multipartUploadStartResponse.partSize()).isEqualTo(-9007199254740991L) + assertThat(multipartUploadStartResponse.parts()).containsExactly("string") assertThat(multipartUploadStartResponse.policy()) .isEqualTo( MultipartUploadStartResponse.Policy.builder() - .folder("/uploads") - .format("jpg") - .size(104857600L) + .folder("folder") + .format("format") + .size(-9007199254740991L) .addTag("string") .build() ) - assertThat(multipartUploadStartResponse.publicKey()).isEqualTo("pk_abc123") - assertThat(multipartUploadStartResponse.sessionId()).isEqualTo("sess_abc123") - assertThat(multipartUploadStartResponse.uuid()) - .isEqualTo("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - assertThat(multipartUploadStartResponse.workspaceId()).isEqualTo("ws_abc123") + assertThat(multipartUploadStartResponse.publicKey()).isEqualTo("public_key") + assertThat(multipartUploadStartResponse.sessionId()).isEqualTo("session_id") + assertThat(multipartUploadStartResponse.uuid()).isEqualTo("uuid") + assertThat(multipartUploadStartResponse.workspaceId()).isEqualTo("workspace_id") } @Test @@ -57,22 +55,22 @@ internal class MultipartUploadStartResponseTest { val jsonMapper = jsonMapper() val multipartUploadStartResponse = MultipartUploadStartResponse.builder() - .expireAt(1704067200L) - .minPartSize(5242880L) - .partSize(5242880L) - .addPart("https://s3.amazonaws.com/bucket/part1?signed=true") + .expireAt(-9007199254740991L) + .minPartSize(-9007199254740991L) + .partSize(-9007199254740991L) + .addPart("string") .policy( MultipartUploadStartResponse.Policy.builder() - .folder("/uploads") - .format("jpg") - .size(104857600L) + .folder("folder") + .format("format") + .size(-9007199254740991L) .addTag("string") .build() ) - .publicKey("pk_abc123") - .sessionId("sess_abc123") - .uuid("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a") - .workspaceId("ws_abc123") + .publicKey("public_key") + .sessionId("session_id") + .uuid("uuid") + .workspaceId("workspace_id") .build() val roundtrippedMultipartUploadStartResponse = diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParamsTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParamsTest.kt index 41ee9cc..60af559 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParamsTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlParamsTest.kt @@ -16,7 +16,7 @@ internal class UploadCreateFromUrlParamsTest { .folder("folder") .metadata("metadata") .randomPrefix("random_prefix") - .tags("tags") + .tagsOfStrings(listOf("string")) .webhookUrl("https://example.com") .build() } @@ -31,7 +31,7 @@ internal class UploadCreateFromUrlParamsTest { .folder("folder") .metadata("metadata") .randomPrefix("random_prefix") - .tags("tags") + .tagsOfStrings(listOf("string")) .webhookUrl("https://example.com") .build() @@ -43,7 +43,7 @@ internal class UploadCreateFromUrlParamsTest { assertThat(body.folder()).contains("folder") assertThat(body.metadata()).contains("metadata") assertThat(body.randomPrefix()).contains("random_prefix") - assertThat(body.tags()).contains("tags") + assertThat(body.tags()).contains(UploadCreateFromUrlParams.Tags.ofStrings(listOf("string"))) assertThat(body.webhookUrl()).contains("https://example.com") } diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlResponseTest.kt index 95ffdc2..573552e 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateFromUrlResponseTest.kt @@ -15,64 +15,62 @@ internal class UploadCreateFromUrlResponseTest { fun create() { val uploadCreateFromUrlResponse = UploadCreateFromUrlResponse.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .customId(null) - .extension("jpg") - .fileNo("file_abc123") - .folderNo("folder_abc123") - .height(1080L) - .isDuplicate(false) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .customId("custom_id") + .extension("extension") + .fileNo("file_no") + .folderNo("folder_no") + .height(-9007199254740991L) + .isDuplicate(true) .metadata( UploadCreateFromUrlResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) .addTag("string") - .thumbnail("https://cdn.autorender.io/thumb.jpg") - .uploadSource("direct") - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) - .workspaceId("ws_abc123") - .format("jpg") - .hash("abc123def456") - .isPrivate(false) + .thumbnail("thumbnail") + .uploadSource("upload_source") + .url("url") + .width(-9007199254740991L) + .workspaceId("workspace_id") + .format("format") + .hash("hash") + .isPrivate(true) .build() - assertThat(uploadCreateFromUrlResponse.id()).isEqualTo("id_abc123") + assertThat(uploadCreateFromUrlResponse.id()).isEqualTo("id") assertThat(uploadCreateFromUrlResponse.createdAt()) - .isEqualTo(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - assertThat(uploadCreateFromUrlResponse.customId()).isEmpty - assertThat(uploadCreateFromUrlResponse.extension()).isEqualTo("jpg") - assertThat(uploadCreateFromUrlResponse.fileNo()).isEqualTo("file_abc123") - assertThat(uploadCreateFromUrlResponse.folderNo()).contains("folder_abc123") - assertThat(uploadCreateFromUrlResponse.height()).contains(1080L) - assertThat(uploadCreateFromUrlResponse.isDuplicate()).isEqualTo(false) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(uploadCreateFromUrlResponse.customId()).contains("custom_id") + assertThat(uploadCreateFromUrlResponse.extension()).isEqualTo("extension") + assertThat(uploadCreateFromUrlResponse.fileNo()).isEqualTo("file_no") + assertThat(uploadCreateFromUrlResponse.folderNo()).contains("folder_no") + assertThat(uploadCreateFromUrlResponse.height()).contains(-9007199254740991L) + assertThat(uploadCreateFromUrlResponse.isDuplicate()).isEqualTo(true) assertThat(uploadCreateFromUrlResponse.metadata()) .contains( UploadCreateFromUrlResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - assertThat(uploadCreateFromUrlResponse.mimeType()).isEqualTo("image/jpeg") - assertThat(uploadCreateFromUrlResponse.name()).isEqualTo("example.jpg") - assertThat(uploadCreateFromUrlResponse.path()).isEqualTo("/example.jpg") - assertThat(uploadCreateFromUrlResponse.size()).isEqualTo(12345L) + assertThat(uploadCreateFromUrlResponse.mimeType()).isEqualTo("mime_type") + assertThat(uploadCreateFromUrlResponse.name()).isEqualTo("name") + assertThat(uploadCreateFromUrlResponse.path()).isEqualTo("path") + assertThat(uploadCreateFromUrlResponse.size()).isEqualTo(-9007199254740991L) assertThat(uploadCreateFromUrlResponse.tags()).containsExactly("string") - assertThat(uploadCreateFromUrlResponse.thumbnail()) - .isEqualTo("https://cdn.autorender.io/thumb.jpg") - assertThat(uploadCreateFromUrlResponse.uploadSource()).isEqualTo("direct") - assertThat(uploadCreateFromUrlResponse.url()) - .isEqualTo("https://cdn.autorender.io/example.jpg") - assertThat(uploadCreateFromUrlResponse.width()).contains(1920L) - assertThat(uploadCreateFromUrlResponse.workspaceId()).isEqualTo("ws_abc123") - assertThat(uploadCreateFromUrlResponse.format()).contains("jpg") - assertThat(uploadCreateFromUrlResponse.hash()).contains("abc123def456") - assertThat(uploadCreateFromUrlResponse.isPrivate()).contains(false) + assertThat(uploadCreateFromUrlResponse.thumbnail()).isEqualTo("thumbnail") + assertThat(uploadCreateFromUrlResponse.uploadSource()).isEqualTo("upload_source") + assertThat(uploadCreateFromUrlResponse.url()).isEqualTo("url") + assertThat(uploadCreateFromUrlResponse.width()).contains(-9007199254740991L) + assertThat(uploadCreateFromUrlResponse.workspaceId()).isEqualTo("workspace_id") + assertThat(uploadCreateFromUrlResponse.format()).contains("format") + assertThat(uploadCreateFromUrlResponse.hash()).contains("hash") + assertThat(uploadCreateFromUrlResponse.isPrivate()).contains(true) } @Test @@ -80,32 +78,32 @@ internal class UploadCreateFromUrlResponseTest { val jsonMapper = jsonMapper() val uploadCreateFromUrlResponse = UploadCreateFromUrlResponse.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .customId(null) - .extension("jpg") - .fileNo("file_abc123") - .folderNo("folder_abc123") - .height(1080L) - .isDuplicate(false) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .customId("custom_id") + .extension("extension") + .fileNo("file_no") + .folderNo("folder_no") + .height(-9007199254740991L) + .isDuplicate(true) .metadata( UploadCreateFromUrlResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) .addTag("string") - .thumbnail("https://cdn.autorender.io/thumb.jpg") - .uploadSource("direct") - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) - .workspaceId("ws_abc123") - .format("jpg") - .hash("abc123def456") - .isPrivate(false) + .thumbnail("thumbnail") + .uploadSource("upload_source") + .url("url") + .width(-9007199254740991L) + .workspaceId("workspace_id") + .format("format") + .hash("hash") + .isPrivate(true) .build() val roundtrippedUploadCreateFromUrlResponse = diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateResponseTest.kt index c2fe87d..efc2d7a 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/uploads/UploadCreateResponseTest.kt @@ -15,63 +15,62 @@ internal class UploadCreateResponseTest { fun create() { val uploadCreateResponse = UploadCreateResponse.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .customId(null) - .extension("jpg") - .fileNo("file_abc123") - .folderNo("folder_abc123") - .height(1080L) - .isDuplicate(false) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .customId("custom_id") + .extension("extension") + .fileNo("file_no") + .folderNo("folder_no") + .height(-9007199254740991L) + .isDuplicate(true) .metadata( UploadCreateResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) .addTag("string") - .thumbnail("https://cdn.autorender.io/thumb.jpg") - .uploadSource("direct") - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) - .workspaceId("ws_abc123") - .format("jpg") - .hash("abc123def456") - .isPrivate(false) + .thumbnail("thumbnail") + .uploadSource("upload_source") + .url("url") + .width(-9007199254740991L) + .workspaceId("workspace_id") + .format("format") + .hash("hash") + .isPrivate(true) .build() - assertThat(uploadCreateResponse.id()).isEqualTo("id_abc123") + assertThat(uploadCreateResponse.id()).isEqualTo("id") assertThat(uploadCreateResponse.createdAt()) - .isEqualTo(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - assertThat(uploadCreateResponse.customId()).isEmpty - assertThat(uploadCreateResponse.extension()).isEqualTo("jpg") - assertThat(uploadCreateResponse.fileNo()).isEqualTo("file_abc123") - assertThat(uploadCreateResponse.folderNo()).contains("folder_abc123") - assertThat(uploadCreateResponse.height()).contains(1080L) - assertThat(uploadCreateResponse.isDuplicate()).isEqualTo(false) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(uploadCreateResponse.customId()).contains("custom_id") + assertThat(uploadCreateResponse.extension()).isEqualTo("extension") + assertThat(uploadCreateResponse.fileNo()).isEqualTo("file_no") + assertThat(uploadCreateResponse.folderNo()).contains("folder_no") + assertThat(uploadCreateResponse.height()).contains(-9007199254740991L) + assertThat(uploadCreateResponse.isDuplicate()).isEqualTo(true) assertThat(uploadCreateResponse.metadata()) .contains( UploadCreateResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - assertThat(uploadCreateResponse.mimeType()).isEqualTo("image/jpeg") - assertThat(uploadCreateResponse.name()).isEqualTo("example.jpg") - assertThat(uploadCreateResponse.path()).isEqualTo("/example.jpg") - assertThat(uploadCreateResponse.size()).isEqualTo(12345L) + assertThat(uploadCreateResponse.mimeType()).isEqualTo("mime_type") + assertThat(uploadCreateResponse.name()).isEqualTo("name") + assertThat(uploadCreateResponse.path()).isEqualTo("path") + assertThat(uploadCreateResponse.size()).isEqualTo(-9007199254740991L) assertThat(uploadCreateResponse.tags()).containsExactly("string") - assertThat(uploadCreateResponse.thumbnail()) - .isEqualTo("https://cdn.autorender.io/thumb.jpg") - assertThat(uploadCreateResponse.uploadSource()).isEqualTo("direct") - assertThat(uploadCreateResponse.url()).isEqualTo("https://cdn.autorender.io/example.jpg") - assertThat(uploadCreateResponse.width()).contains(1920L) - assertThat(uploadCreateResponse.workspaceId()).isEqualTo("ws_abc123") - assertThat(uploadCreateResponse.format()).contains("jpg") - assertThat(uploadCreateResponse.hash()).contains("abc123def456") - assertThat(uploadCreateResponse.isPrivate()).contains(false) + assertThat(uploadCreateResponse.thumbnail()).isEqualTo("thumbnail") + assertThat(uploadCreateResponse.uploadSource()).isEqualTo("upload_source") + assertThat(uploadCreateResponse.url()).isEqualTo("url") + assertThat(uploadCreateResponse.width()).contains(-9007199254740991L) + assertThat(uploadCreateResponse.workspaceId()).isEqualTo("workspace_id") + assertThat(uploadCreateResponse.format()).contains("format") + assertThat(uploadCreateResponse.hash()).contains("hash") + assertThat(uploadCreateResponse.isPrivate()).contains(true) } @Test @@ -79,32 +78,32 @@ internal class UploadCreateResponseTest { val jsonMapper = jsonMapper() val uploadCreateResponse = UploadCreateResponse.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .customId(null) - .extension("jpg") - .fileNo("file_abc123") - .folderNo("folder_abc123") - .height(1080L) - .isDuplicate(false) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .customId("custom_id") + .extension("extension") + .fileNo("file_no") + .folderNo("folder_no") + .height(-9007199254740991L) + .isDuplicate(true) .metadata( UploadCreateResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) .addTag("string") - .thumbnail("https://cdn.autorender.io/thumb.jpg") - .uploadSource("direct") - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) - .workspaceId("ws_abc123") - .format("jpg") - .hash("abc123def456") - .isPrivate(false) + .thumbnail("thumbnail") + .uploadSource("upload_source") + .url("url") + .width(-9007199254740991L) + .workspaceId("workspace_id") + .format("format") + .hash("hash") + .isPrivate(true) .build() val roundtrippedUploadCreateResponse = diff --git a/autorender-java-core/src/test/kotlin/io/autorender/services/async/UploadServiceAsyncTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/services/async/UploadServiceAsyncTest.kt index 74c6800..801a1e7 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/services/async/UploadServiceAsyncTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/services/async/UploadServiceAsyncTest.kt @@ -58,7 +58,7 @@ internal class UploadServiceAsyncTest { .folder("folder") .metadata("metadata") .randomPrefix("random_prefix") - .tags("tags") + .tagsOfStrings(listOf("string")) .webhookUrl("https://example.com") .build() ) diff --git a/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/UploadServiceTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/UploadServiceTest.kt index 72a7993..37561de 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/UploadServiceTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/UploadServiceTest.kt @@ -57,7 +57,7 @@ internal class UploadServiceTest { .folder("folder") .metadata("metadata") .randomPrefix("random_prefix") - .tags("tags") + .tagsOfStrings(listOf("string")) .webhookUrl("https://example.com") .build() ) diff --git a/autorender-java-proguard-test/src/test/kotlin/io/autorender/proguard/ProGuardCompatibilityTest.kt b/autorender-java-proguard-test/src/test/kotlin/io/autorender/proguard/ProGuardCompatibilityTest.kt index f142b53..7a590c2 100644 --- a/autorender-java-proguard-test/src/test/kotlin/io/autorender/proguard/ProGuardCompatibilityTest.kt +++ b/autorender-java-proguard-test/src/test/kotlin/io/autorender/proguard/ProGuardCompatibilityTest.kt @@ -60,32 +60,32 @@ internal class ProGuardCompatibilityTest { val jsonMapper = jsonMapper() val uploadCreateResponse = UploadCreateResponse.builder() - .id("id_abc123") - .createdAt(OffsetDateTime.parse("2024-01-01T00:00:00Z")) - .customId(null) - .extension("jpg") - .fileNo("file_abc123") - .folderNo("folder_abc123") - .height(1080L) - .isDuplicate(false) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .customId("custom_id") + .extension("extension") + .fileNo("file_no") + .folderNo("folder_no") + .height(-9007199254740991L) + .isDuplicate(true) .metadata( UploadCreateResponse.Metadata.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) - .mimeType("image/jpeg") - .name("example.jpg") - .path("/example.jpg") - .size(12345L) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) .addTag("string") - .thumbnail("https://cdn.autorender.io/thumb.jpg") - .uploadSource("direct") - .url("https://cdn.autorender.io/example.jpg") - .width(1920L) - .workspaceId("ws_abc123") - .format("jpg") - .hash("abc123def456") - .isPrivate(false) + .thumbnail("thumbnail") + .uploadSource("upload_source") + .url("url") + .width(-9007199254740991L) + .workspaceId("workspace_id") + .format("format") + .hash("hash") + .isPrivate(true) .build() val roundtrippedUploadCreateResponse = diff --git a/scripts/mock b/scripts/mock index a413aac..80196ab 100755 --- a/scripts/mock +++ b/scripts/mock @@ -11,7 +11,7 @@ elif [ -n "$STAINLESS_OPENAPI_SPEC_URL" ]; then URL="$STAINLESS_OPENAPI_SPEC_URL" else # Embedded OpenAPI spec (base64-encoded, gzipped) - EMBEDDED_SPEC="H4sIAAAAAAAAA+1dWXPbuhX+KxhOH+ypKFGyvGnapr43TZs2TTxx8nJlVQORkISY2wVA27q2/nsHC0lwESXZsmMn8GQcGQKxHJz1wwF4Z0UxCmGMrYF10HbajtWycDiNrMGdxTDzkTWwzhIWfUahhwg4TyY+dsHZ+XurZXmIugTHDEehNbA+/+PiC/8CTCMCktiPoIfDWQsEMIQz8QmGHqCIXONwBgLkYQggpYjRNjjzfYBCL45wyCgg6PcEEwRgKNq7QgtwjSFgcwRubRhjm5fMEeQDigg4S9g8IvgPyAcyAL8gSBABf7lCi7+1rZZ1jQiVI+yq+blRyKDL+BRDGJRmeJHEcUSY1bJQALFvDSwqS/4OExYRUamNI2u55A0FcRSikFHeFkVuQjBbXLhzFCBRBGP8H7QQtFzEvCNV0Eo7zuYjyG4NLDmtCnFTOnDaxnINMnq1wa8wBNCnEZggEJPoGnvIEyRrII2YAOVDhXyo/K8YsrkYdgfGuHPd7QSJz3AMCetQBokgWBxR8X8UIyJafe9ZAyureCHqtSyaBAEkC2tgiRKQVVCcYbUsBmfUGgytr6KAWqPynN+HmGHoY4oArDQAKKJ8WQVTEeQifM3njmyKZyHygKj69f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fs+3y0w3n5y/cLUNgi3+x2jAixmNpXV5Ys7gVEW0TQhRV/wx7Og55FZ5v/JM+ic/DPwb/ni0wc/Pt54V+F0d7jMWrOE/48+uZQqkOpB/LDtm7NF3s4bUsoZxHGpsGcG2Dsw8JrbOseIaTTmL+1oM4Nti8PTZ+/MpS3/Ge3gxuG+gl2+w7YuUKjnaF3hv4Bht6EfebsfbnTwkaIFq19GiP6bJ0WJXGim1wTjxYUephVa1NYaDoEzlXhXBUvkkU7V8XLcVXkrJ5zVTiI/hw6VwXR/RKInt0iwSEHHMwR3BAhDxiv8gRdLWm+4yWOl+zMS/RWnXrUu4HV+mSPN5UyFt2WfRdWEyfqhcv6HcuEFUD9O5hByOJI7ReaorwtqNqylJQ1LF+KVfFeEaBBzAiVAh2dnX9AVzBHqVhMUJ0tJn3wckmUbIQpnoBu4s6lLYPXSifeziUOFv8HixjepfCXAAA=" SPEC_TMPFILE="$(mktemp)" trap 'rm -f "$SPEC_TMPFILE"' EXIT echo "$EMBEDDED_SPEC" | base64 --decode | gunzip > "$SPEC_TMPFILE" From 26e21db9ca015bda4ff92c2dcfbf6354240c4260 Mon Sep 17 00:00:00 2001 From: Karthick Subramanian Date: Sun, 12 Jul 2026 20:29:51 +0530 Subject: [PATCH 5/8] chore: rename autorenderhq -> autorender references (GitHub org rename) (#1) Mechanical cleanup after the org rename autorenderhq -> autorender. Updates GitHub org/repo references (URLs, workflow repo guards, uses:, package metadata, docs). Intentionally left unchanged: SDK mount paths (autorenderhq-), Linear workspace URL, Sentry org slug. No logic changed (string references only). Co-authored-by: Geetha Karthick Co-authored-by: Claude Opus 4.8 (1M context) --- .github/workflows/publish-sonatype.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- .github/workflows/release-please.yml | 2 +- .github/workflows/stlc-promote.yml | 4 ++-- .github/workflows/stlc-sync-from-production.yml | 4 ++-- CONTRIBUTING.md | 2 +- README.md | 2 +- .../src/main/kotlin/io/autorender/core/Check.kt | 2 +- buildSrc/src/main/kotlin/autorender.publish.gradle.kts | 6 +++--- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml index 7f16272..0e71134 100644 --- a/.github/workflows/publish-sonatype.yml +++ b/.github/workflows/publish-sonatype.yml @@ -1,6 +1,6 @@ # This workflow is triggered when a GitHub release is created. # It can also be run manually to re-publish to Sonatype in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/autorenderhq/autorender-java/actions/workflows/publish-sonatype.yml +# You can run this workflow by navigating to https://www.github.com/autorender/autorender-java/actions/workflows/publish-sonatype.yml name: Publish Sonatype on: workflow_dispatch: diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index eefb22f..5ce13fa 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -9,7 +9,7 @@ jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'autorenderhq/autorender-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'autorender/autorender-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 1f3a221..0e98d45 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -10,7 +10,7 @@ permissions: jobs: release-please: - if: github.repository == 'autorenderhq/autorender-java' + if: github.repository == 'autorender/autorender-java' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/stlc-promote.yml b/.github/workflows/stlc-promote.yml index 5522833..d4e6215 100644 --- a/.github/workflows/stlc-promote.yml +++ b/.github/workflows/stlc-promote.yml @@ -11,9 +11,9 @@ permissions: jobs: promote: runs-on: ubuntu-latest - if: github.repository == 'autorenderhq/autorender-java-staging' + if: github.repository == 'autorender/autorender-java-staging' env: - PRODUCTION_REPO: autorenderhq/autorender-java + PRODUCTION_REPO: autorender/autorender-java GH_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }} steps: - name: Check out staging diff --git a/.github/workflows/stlc-sync-from-production.yml b/.github/workflows/stlc-sync-from-production.yml index d7964a9..ea72b9b 100644 --- a/.github/workflows/stlc-sync-from-production.yml +++ b/.github/workflows/stlc-sync-from-production.yml @@ -12,9 +12,9 @@ permissions: jobs: sync: runs-on: ubuntu-latest - if: github.repository == 'autorenderhq/autorender-java-staging' + if: github.repository == 'autorender/autorender-java-staging' env: - PRODUCTION_REPO: autorenderhq/autorender-java + PRODUCTION_REPO: autorender/autorender-java steps: - name: Check out staging uses: actions/checkout@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd37a18..6d29510 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ > **Note:** This SDK is automatically generated from the Autorender API specification. > Code pull requests are not accepted — changes to generated code will be overwritten on the next generation cycle. > -> **Bug reports and feature requests are welcome** — please [open an issue](https://github.com/autorenderhq/autorender-java/issues). +> **Bug reports and feature requests are welcome** — please [open an issue](https://github.com/autorender/autorender-java/issues). --- diff --git a/README.md b/README.md index c7b4c24..f06ac83 100644 --- a/README.md +++ b/README.md @@ -726,4 +726,4 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/autorenderhq/autorender-java/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/autorender/autorender-java/issues) with questions, bugs, or suggestions. diff --git a/autorender-java-core/src/main/kotlin/io/autorender/core/Check.kt b/autorender-java-core/src/main/kotlin/io/autorender/core/Check.kt index 5645adb..b4d564d 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/core/Check.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/core/Check.kt @@ -77,7 +77,7 @@ This can happen if you are either: Double-check that you are depending on compatible Jackson versions. -See https://www.github.com/autorenderhq/autorender-java#jackson for more information. +See https://www.github.com/autorender/autorender-java#jackson for more information. """ .trimIndent() } diff --git a/buildSrc/src/main/kotlin/autorender.publish.gradle.kts b/buildSrc/src/main/kotlin/autorender.publish.gradle.kts index efe38ac..b1bba25 100644 --- a/buildSrc/src/main/kotlin/autorender.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/autorender.publish.gradle.kts @@ -60,9 +60,9 @@ configure { } scm { - connection.set("scm:git:git://github.com/autorenderhq/autorender-java.git") - developerConnection.set("scm:git:git://github.com/autorenderhq/autorender-java.git") - url.set("https://github.com/autorenderhq/autorender-java") + connection.set("scm:git:git://github.com/autorender/autorender-java.git") + developerConnection.set("scm:git:git://github.com/autorender/autorender-java.git") + url.set("https://github.com/autorender/autorender-java") } } } From 2101447469735e2a1f02c49beb39f2fd91cd4819 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 7 Aug 2026 03:56:58 +0000 Subject: [PATCH 6/8] fix: wire SDK pagination and examples Stainless-Generated-From: 8ccecc24f89b45f829399f8e1dcd6db127a8a8aa --- README.md | 139 +- .../client/okhttp/AutorenderOkHttpClient.kt | 13 + .../okhttp/AutorenderOkHttpClientAsync.kt | 13 + .../kotlin/io/autorender/core/AutoPager.kt | 21 + .../io/autorender/core/AutoPagerAsync.kt | 88 + .../io/autorender/core/ClientOptions.kt | 50 + .../main/kotlin/io/autorender/core/Page.kt | 33 + .../kotlin/io/autorender/core/PageAsync.kt | 35 + .../autorender/models/files/FileListPage.kt | 131 ++ .../models/files/FileListPageAsync.kt | 146 ++ .../models/files/FileListPageResponse.kt | 537 +++++ .../models/files/FileListResponse.kt | 1865 ++++++----------- .../services/async/FileServiceAsync.kt | 18 +- .../services/async/FileServiceAsyncImpl.kt | 19 +- .../services/blocking/FileService.kt | 21 +- .../services/blocking/FileServiceImpl.kt | 18 +- .../io/autorender/core/AutoPagerAsyncTest.kt | 182 ++ .../io/autorender/core/AutoPagerTest.kt | 41 + .../models/files/FileListPageResponseTest.kt | 141 ++ .../models/files/FileListResponseTest.kt | 158 +- .../autorender/services/ServiceParamsTest.kt | 5 - .../services/async/FileServiceAsyncTest.kt | 16 +- .../services/blocking/FileServiceTest.kt | 14 +- .../main/kotlin/autorender.publish.gradle.kts | 2 +- scripts/mock | 2 +- 25 files changed, 2323 insertions(+), 1385 deletions(-) create mode 100644 autorender-java-core/src/main/kotlin/io/autorender/core/AutoPager.kt create mode 100644 autorender-java-core/src/main/kotlin/io/autorender/core/AutoPagerAsync.kt create mode 100644 autorender-java-core/src/main/kotlin/io/autorender/core/Page.kt create mode 100644 autorender-java-core/src/main/kotlin/io/autorender/core/PageAsync.kt create mode 100644 autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPage.kt create mode 100644 autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageAsync.kt create mode 100644 autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageResponse.kt create mode 100644 autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerAsyncTest.kt create mode 100644 autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerTest.kt create mode 100644 autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListPageResponseTest.kt diff --git a/README.md b/README.md index f06ac83..52e36c3 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ -The Autorender Java SDK provides convenient access to the [Autorender REST API](https://autorender.mintlify.app/) from applications written in Java. +The Autorender Java SDK provides convenient access to the [Autorender REST API](https://autorender.io/docs) from applications written in Java. -The REST API documentation can be found on [autorender.mintlify.app](https://autorender.mintlify.app/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.autorender/autorender-java/0.0.1). +The REST API documentation can be found on [autorender.io](https://autorender.io/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.autorender/autorender-java/0.0.1). @@ -46,8 +46,8 @@ This library requires Java 8 or later. ```java import io.autorender.client.AutorenderClient; import io.autorender.client.okhttp.AutorenderOkHttpClient; +import io.autorender.models.files.FileListPage; import io.autorender.models.files.FileListParams; -import io.autorender.models.files.FileListResponse; // Configures using the `autorender.apiKey` and `autorender.baseUrl` system properties // Or configures using the `AUTORENDER_API_KEY` and `AUTORENDER_BASE_URL` environment variables @@ -56,7 +56,7 @@ AutorenderClient client = AutorenderOkHttpClient.fromEnv(); FileListParams params = FileListParams.builder() .limit(10L) .build(); -FileListResponse files = client.files().list(params); +FileListPage page = client.files().list(params); ``` ## Client configuration @@ -129,7 +129,7 @@ The `withOptions()` method does not affect the original client or service. To send a request to the Autorender API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class. -For example, `client.files().list(...)` should be called with an instance of `FileListParams`, and it will return an instance of `FileListResponse`. +For example, `client.files().list(...)` should be called with an instance of `FileListParams`, and it will return an instance of `FileListPage`. ## Immutability @@ -146,8 +146,8 @@ The default client is synchronous. To switch to asynchronous execution, call the ```java import io.autorender.client.AutorenderClient; import io.autorender.client.okhttp.AutorenderOkHttpClient; +import io.autorender.models.files.FileListPageAsync; import io.autorender.models.files.FileListParams; -import io.autorender.models.files.FileListResponse; import java.util.concurrent.CompletableFuture; // Configures using the `autorender.apiKey` and `autorender.baseUrl` system properties @@ -157,7 +157,7 @@ AutorenderClient client = AutorenderOkHttpClient.fromEnv(); FileListParams params = FileListParams.builder() .limit(10L) .build(); -CompletableFuture files = client.async().files().list(params); +CompletableFuture page = client.async().files().list(params); ``` Or create an asynchronous client from the beginning: @@ -165,8 +165,8 @@ Or create an asynchronous client from the beginning: ```java import io.autorender.client.AutorenderClientAsync; import io.autorender.client.okhttp.AutorenderOkHttpClientAsync; +import io.autorender.models.files.FileListPageAsync; import io.autorender.models.files.FileListParams; -import io.autorender.models.files.FileListResponse; import java.util.concurrent.CompletableFuture; // Configures using the `autorender.apiKey` and `autorender.baseUrl` system properties @@ -176,7 +176,7 @@ AutorenderClientAsync client = AutorenderOkHttpClientAsync.fromEnv(); FileListParams params = FileListParams.builder() .limit(10L) .build(); -CompletableFuture files = client.files().list(params); +CompletableFuture page = client.files().list(params); ``` The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s. @@ -301,6 +301,106 @@ The SDK throws custom unchecked exception types: - [`AutorenderException`](autorender-java-core/src/main/kotlin/io/autorender/errors/AutorenderException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. +## Pagination + +The SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages. + +### Auto-pagination + +To iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed. + +When using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html) + +```java +import io.autorender.models.files.FileListPage; +import io.autorender.models.files.FileListResponse; + +FileListPage page = client.files().list(); + +// Process as an Iterable +for (FileListResponse file : page.autoPager()) { + System.out.println(file); +} + +// Process as a Stream +page.autoPager() + .stream() + .limit(50) + .forEach(file -> System.out.println(file)); +``` + +When using the asynchronous client, the method returns an [`AsyncStreamResponse`](autorender-java-core/src/main/kotlin/io/autorender/core/http/AsyncStreamResponse.kt): + +```java +import io.autorender.core.http.AsyncStreamResponse; +import io.autorender.models.files.FileListPageAsync; +import io.autorender.models.files.FileListResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +CompletableFuture pageFuture = client.async().files().list(); + +pageFuture.thenRun(page -> page.autoPager().subscribe(file -> { + System.out.println(file); +})); + +// If you need to handle errors or completion of the stream +pageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() { + @Override + public void onNext(FileListResponse file) { + System.out.println(file); + } + + @Override + public void onComplete(Optional error) { + if (error.isPresent()) { + System.out.println("Something went wrong!"); + throw new RuntimeException(error.get()); + } else { + System.out.println("No more!"); + } + } +})); + +// Or use futures +pageFuture.thenRun(page -> page.autoPager() + .subscribe(file -> { + System.out.println(file); + }) + .onCompleteFuture() + .whenComplete((unused, error) -> { + if (error != null) { + System.out.println("Something went wrong!"); + throw new RuntimeException(error); + } else { + System.out.println("No more!"); + } + })); +``` + +### Manual pagination + +To access individual page items and manually request the next page, use the `items()`, +`hasNextPage()`, and `nextPage()` methods: + +```java +import io.autorender.models.files.FileListPage; +import io.autorender.models.files.FileListResponse; + +FileListPage page = client.files().list(); +while (true) { + for (FileListResponse file : page.items()) { + System.out.println(file); + } + + if (!page.hasNextPage()) { + break; + } + + page = page.nextPage(); +} +``` + ## Logging Enable logging by setting the `AUTORENDER_LOG` environment variable to `info`: @@ -606,7 +706,7 @@ To access undocumented response properties, call the `_additionalProperties()` m import io.autorender.core.JsonValue; import java.util.Map; -Map additionalProperties = client.files().list(params)._additionalProperties(); +Map additionalProperties = client.uploads().create(params)._additionalProperties(); JsonValue secretPropertyValue = additionalProperties.get("secretProperty"); String result = secretPropertyValue.accept(new JsonValue.Visitor<>() { @@ -634,21 +734,22 @@ To access a property's raw JSON value, which may be undocumented, call its `_` p ```java import io.autorender.core.JsonField; +import java.io.InputStream; import java.util.Optional; -JsonField field = client.files().list(params)._field(); +JsonField file = client.uploads().create(params)._file(); -if (field.isMissing()) { +if (file.isMissing()) { // The property is absent from the JSON response -} else if (field.isNull()) { +} else if (file.isNull()) { // The property was set to literal null } else { // Check if value was provided as a string // Other methods include `asNumber()`, `asBoolean()`, etc. - Optional jsonString = field.asString(); + Optional jsonString = file.asString(); // Try to deserialize into a custom type - MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class); + MyClass myObject = file.asUnknown().orElseThrow().convert(MyClass.class); } ``` @@ -663,17 +764,17 @@ Validating the response is _not_ forwards compatible with new types from the API If you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`: ```java -import io.autorender.models.files.FileListResponse; +import io.autorender.models.uploads.UploadCreateResponse; -FileListResponse files = client.files().list(params).validate(); +UploadCreateResponse upload = client.uploads().create(params).validate(); ``` Or configure the method call to validate the response using the `responseValidation` method: ```java -import io.autorender.models.files.FileListResponse; +import io.autorender.models.files.FileListPage; -FileListResponse files = client.files().list(RequestOptions.builder().responseValidation(true).build()); +FileListPage page = client.files().list(RequestOptions.builder().responseValidation(true).build()); ``` Or configure the default for all method calls at the client level: diff --git a/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClient.kt b/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClient.kt index a568e6a..fd8d3e3 100644 --- a/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClient.kt +++ b/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClient.kt @@ -9,6 +9,7 @@ import io.autorender.core.ClientOptions import io.autorender.core.LogLevel import io.autorender.core.Sleeper import io.autorender.core.Timeout +import io.autorender.core.http.AsyncStreamResponse import io.autorender.core.http.Headers import io.autorender.core.http.HttpClient import io.autorender.core.http.ProxyAuthenticator @@ -18,6 +19,7 @@ import java.net.Proxy import java.time.Clock import java.time.Duration import java.util.Optional +import java.util.concurrent.Executor import java.util.concurrent.ExecutorService import javax.net.ssl.HostnameVerifier import javax.net.ssl.SSLSocketFactory @@ -201,6 +203,17 @@ class AutorenderOkHttpClient private constructor() { */ fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) } + /** + * The executor to use for running [AsyncStreamResponse.Handler] callbacks. + * + * Defaults to a dedicated cached thread pool. + * + * This class takes ownership of the executor and shuts it down, if possible, when closed. + */ + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + clientOptions.streamHandlerExecutor(streamHandlerExecutor) + } + /** * The interface to use for delaying execution, like during retries. * diff --git a/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClientAsync.kt b/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClientAsync.kt index 4cf1dc7..d6e9633 100644 --- a/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClientAsync.kt +++ b/autorender-java-client-okhttp/src/main/kotlin/io/autorender/client/okhttp/AutorenderOkHttpClientAsync.kt @@ -9,6 +9,7 @@ import io.autorender.core.ClientOptions import io.autorender.core.LogLevel import io.autorender.core.Sleeper import io.autorender.core.Timeout +import io.autorender.core.http.AsyncStreamResponse import io.autorender.core.http.Headers import io.autorender.core.http.HttpClient import io.autorender.core.http.ProxyAuthenticator @@ -18,6 +19,7 @@ import java.net.Proxy import java.time.Clock import java.time.Duration import java.util.Optional +import java.util.concurrent.Executor import java.util.concurrent.ExecutorService import javax.net.ssl.HostnameVerifier import javax.net.ssl.SSLSocketFactory @@ -201,6 +203,17 @@ class AutorenderOkHttpClientAsync private constructor() { */ fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) } + /** + * The executor to use for running [AsyncStreamResponse.Handler] callbacks. + * + * Defaults to a dedicated cached thread pool. + * + * This class takes ownership of the executor and shuts it down, if possible, when closed. + */ + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + clientOptions.streamHandlerExecutor(streamHandlerExecutor) + } + /** * The interface to use for delaying execution, like during retries. * diff --git a/autorender-java-core/src/main/kotlin/io/autorender/core/AutoPager.kt b/autorender-java-core/src/main/kotlin/io/autorender/core/AutoPager.kt new file mode 100644 index 0000000..5248040 --- /dev/null +++ b/autorender-java-core/src/main/kotlin/io/autorender/core/AutoPager.kt @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.core + +import java.util.stream.Stream +import java.util.stream.StreamSupport + +class AutoPager private constructor(private val firstPage: Page) : Iterable { + + companion object { + + fun from(firstPage: Page): AutoPager = AutoPager(firstPage) + } + + override fun iterator(): Iterator = + generateSequence(firstPage) { if (it.hasNextPage()) it.nextPage() else null } + .flatMap { it.items() } + .iterator() + + fun stream(): Stream = StreamSupport.stream(spliterator(), false) +} diff --git a/autorender-java-core/src/main/kotlin/io/autorender/core/AutoPagerAsync.kt b/autorender-java-core/src/main/kotlin/io/autorender/core/AutoPagerAsync.kt new file mode 100644 index 0000000..96dc1b5 --- /dev/null +++ b/autorender-java-core/src/main/kotlin/io/autorender/core/AutoPagerAsync.kt @@ -0,0 +1,88 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.core + +import io.autorender.core.http.AsyncStreamResponse +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.CompletionException +import java.util.concurrent.Executor +import java.util.concurrent.atomic.AtomicReference + +class AutoPagerAsync +private constructor(private val firstPage: PageAsync, private val defaultExecutor: Executor) : + AsyncStreamResponse { + + companion object { + + fun from(firstPage: PageAsync, defaultExecutor: Executor): AutoPagerAsync = + AutoPagerAsync(firstPage, defaultExecutor) + } + + private val onCompleteFuture = CompletableFuture() + private val state = AtomicReference(State.NEW) + + override fun subscribe(handler: AsyncStreamResponse.Handler): AsyncStreamResponse = + subscribe(handler, defaultExecutor) + + override fun subscribe( + handler: AsyncStreamResponse.Handler, + executor: Executor, + ): AsyncStreamResponse = apply { + // TODO(JDK): Use `compareAndExchange` once targeting JDK 9. + check(state.compareAndSet(State.NEW, State.SUBSCRIBED)) { + if (state.get() == State.SUBSCRIBED) "Cannot subscribe more than once" + else "Cannot subscribe after the response is closed" + } + + fun PageAsync.handle(): CompletableFuture { + if (state.get() == State.CLOSED) { + return CompletableFuture.completedFuture(null) + } + + items().forEach { handler.onNext(it) } + return if (hasNextPage()) nextPage().thenCompose { it.handle() } + else CompletableFuture.completedFuture(null) + } + + executor.execute { + firstPage.handle().whenComplete { _, error -> + val actualError = + if (error is CompletionException && error.cause != null) error.cause else error + try { + handler.onComplete(Optional.ofNullable(actualError)) + } finally { + try { + if (actualError == null) { + onCompleteFuture.complete(null) + } else { + onCompleteFuture.completeExceptionally(actualError) + } + } finally { + close() + } + } + } + } + } + + override fun onCompleteFuture(): CompletableFuture = onCompleteFuture + + override fun close() { + val previousState = state.getAndSet(State.CLOSED) + if (previousState == State.CLOSED) { + return + } + + // When the stream is closed, we should always consider it closed. If it closed due + // to an error, then we will have already completed the future earlier, and this + // will be a no-op. + onCompleteFuture.complete(null) + } +} + +private enum class State { + NEW, + SUBSCRIBED, + CLOSED, +} diff --git a/autorender-java-core/src/main/kotlin/io/autorender/core/ClientOptions.kt b/autorender-java-core/src/main/kotlin/io/autorender/core/ClientOptions.kt index 8ed4837..030a688 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/core/ClientOptions.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/core/ClientOptions.kt @@ -3,6 +3,7 @@ package io.autorender.core import com.fasterxml.jackson.databind.json.JsonMapper +import io.autorender.core.http.AsyncStreamResponse import io.autorender.core.http.Headers import io.autorender.core.http.HttpClient import io.autorender.core.http.LoggingHttpClient @@ -12,6 +13,11 @@ import io.autorender.core.http.RetryingHttpClient import java.time.Clock import java.time.Duration import java.util.Optional +import java.util.concurrent.Executor +import java.util.concurrent.ExecutorService +import java.util.concurrent.Executors +import java.util.concurrent.ThreadFactory +import java.util.concurrent.atomic.AtomicLong import kotlin.jvm.optionals.getOrNull /** A class representing the SDK client configuration. */ @@ -41,6 +47,14 @@ private constructor( * needs to be overridden. */ @get:JvmName("jsonMapper") val jsonMapper: JsonMapper, + /** + * The executor to use for running [AsyncStreamResponse.Handler] callbacks. + * + * Defaults to a dedicated cached thread pool. + * + * This class takes ownership of the executor and shuts it down, if possible, when closed. + */ + @get:JvmName("streamHandlerExecutor") val streamHandlerExecutor: Executor, /** * The interface to use for delaying execution, like during retries. * @@ -153,6 +167,7 @@ private constructor( private var httpClient: HttpClient? = null private var checkJacksonVersionCompatibility: Boolean = true private var jsonMapper: JsonMapper = jsonMapper() + private var streamHandlerExecutor: Executor? = null private var sleeper: Sleeper? = null private var clock: Clock = Clock.systemUTC() private var baseUrl: String? = null @@ -169,6 +184,7 @@ private constructor( httpClient = clientOptions.originalHttpClient checkJacksonVersionCompatibility = clientOptions.checkJacksonVersionCompatibility jsonMapper = clientOptions.jsonMapper + streamHandlerExecutor = clientOptions.streamHandlerExecutor sleeper = clientOptions.sleeper clock = clientOptions.clock baseUrl = clientOptions.baseUrl @@ -211,6 +227,20 @@ private constructor( */ fun jsonMapper(jsonMapper: JsonMapper) = apply { this.jsonMapper = jsonMapper } + /** + * The executor to use for running [AsyncStreamResponse.Handler] callbacks. + * + * Defaults to a dedicated cached thread pool. + * + * This class takes ownership of the executor and shuts it down, if possible, when closed. + */ + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = + if (streamHandlerExecutor is ExecutorService) + PhantomReachableExecutorService(streamHandlerExecutor) + else streamHandlerExecutor + } + /** * The interface to use for delaying execution, like during retries. * @@ -427,6 +457,24 @@ private constructor( */ fun build(): ClientOptions { val httpClient = checkRequired("httpClient", httpClient) + val streamHandlerExecutor = + streamHandlerExecutor + ?: PhantomReachableExecutorService( + Executors.newCachedThreadPool( + object : ThreadFactory { + + private val threadFactory: ThreadFactory = + Executors.defaultThreadFactory() + private val count = AtomicLong(0) + + override fun newThread(runnable: Runnable): Thread = + threadFactory.newThread(runnable).also { + it.name = + "autorender-stream-handler-thread-${count.getAndIncrement()}" + } + } + ) + ) val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper()) val headers = Headers.builder() @@ -464,6 +512,7 @@ private constructor( .build(), checkJacksonVersionCompatibility, jsonMapper, + streamHandlerExecutor, sleeper, clock, baseUrl, @@ -490,6 +539,7 @@ private constructor( */ fun close() { httpClient.close() + (streamHandlerExecutor as? ExecutorService)?.shutdown() sleeper.close() } } diff --git a/autorender-java-core/src/main/kotlin/io/autorender/core/Page.kt b/autorender-java-core/src/main/kotlin/io/autorender/core/Page.kt new file mode 100644 index 0000000..d088d9d --- /dev/null +++ b/autorender-java-core/src/main/kotlin/io/autorender/core/Page.kt @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.core + +/** + * An interface representing a single page, with items of type [T], from a paginated endpoint + * response. + * + * Implementations of this interface are expected to request additional pages synchronously. For + * asynchronous pagination, see the [PageAsync] interface. + */ +interface Page { + + /** + * Returns whether there's another page after this one. + * + * The method generally doesn't make requests so the result depends entirely on the data in this + * page. If a significant amount of time has passed between requesting this page and calling + * this method, then the result could be stale. + */ + fun hasNextPage(): Boolean + + /** + * Returns the page after this one by making another request. + * + * @throws IllegalStateException if it's impossible to get the next page. This exception is + * avoidable by calling [hasNextPage] first. + */ + fun nextPage(): Page + + /** Returns the items in this page. */ + fun items(): List +} diff --git a/autorender-java-core/src/main/kotlin/io/autorender/core/PageAsync.kt b/autorender-java-core/src/main/kotlin/io/autorender/core/PageAsync.kt new file mode 100644 index 0000000..afe6214 --- /dev/null +++ b/autorender-java-core/src/main/kotlin/io/autorender/core/PageAsync.kt @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.core + +import java.util.concurrent.CompletableFuture + +/** + * An interface representing a single page, with items of type [T], from a paginated endpoint + * response. + * + * Implementations of this interface are expected to request additional pages asynchronously. For + * synchronous pagination, see the [Page] interface. + */ +interface PageAsync { + + /** + * Returns whether there's another page after this one. + * + * The method generally doesn't make requests so the result depends entirely on the data in this + * page. If a significant amount of time has passed between requesting this page and calling + * this method, then the result could be stale. + */ + fun hasNextPage(): Boolean + + /** + * Returns the page after this one by making another request. + * + * @throws IllegalStateException if it's impossible to get the next page. This exception is + * avoidable by calling [hasNextPage] first. + */ + fun nextPage(): CompletableFuture> + + /** Returns the items in this page. */ + fun items(): List +} diff --git a/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPage.kt b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPage.kt new file mode 100644 index 0000000..705e00d --- /dev/null +++ b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPage.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.models.files + +import io.autorender.core.AutoPager +import io.autorender.core.Page +import io.autorender.core.checkRequired +import io.autorender.services.blocking.FileService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrDefault +import kotlin.jvm.optionals.getOrNull + +/** @see FileService.list */ +class FileListPage +private constructor( + private val service: FileService, + private val params: FileListParams, + private val response: FileListPageResponse, +) : Page { + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.files + */ + fun files(): List = + response._files().getOptional("files").getOrNull() ?: emptyList() + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.meta + */ + fun meta(): Optional = response._meta().getOptional("meta") + + override fun items(): List = files() + + override fun hasNextPage(): Boolean = items().isNotEmpty() + + fun nextPageParams(): FileListParams { + val pageNumber = params.page().getOrDefault(1) + return params.toBuilder().page(pageNumber + 1).build() + } + + override fun nextPage(): FileListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): FileListParams = params + + /** The response that this page was parsed from. */ + fun response(): FileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FileListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FileListPage]. */ + class Builder internal constructor() { + + private var service: FileService? = null + private var params: FileListParams? = null + private var response: FileListPageResponse? = null + + @JvmSynthetic + internal fun from(fileListPage: FileListPage) = apply { + service = fileListPage.service + params = fileListPage.params + response = fileListPage.response + } + + fun service(service: FileService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: FileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FileListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FileListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FileListPage = + FileListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FileListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = "FileListPage{service=$service, params=$params, response=$response}" +} diff --git a/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageAsync.kt b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageAsync.kt new file mode 100644 index 0000000..323c27a --- /dev/null +++ b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.models.files + +import io.autorender.core.AutoPagerAsync +import io.autorender.core.PageAsync +import io.autorender.core.checkRequired +import io.autorender.services.async.FileServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrDefault +import kotlin.jvm.optionals.getOrNull + +/** @see FileServiceAsync.list */ +class FileListPageAsync +private constructor( + private val service: FileServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: FileListParams, + private val response: FileListPageResponse, +) : PageAsync { + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.files + */ + fun files(): List = + response._files().getOptional("files").getOrNull() ?: emptyList() + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.meta + */ + fun meta(): Optional = response._meta().getOptional("meta") + + override fun items(): List = files() + + override fun hasNextPage(): Boolean = items().isNotEmpty() + + fun nextPageParams(): FileListParams { + val pageNumber = params.page().getOrDefault(1) + return params.toBuilder().page(pageNumber + 1).build() + } + + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): FileListParams = params + + /** The response that this page was parsed from. */ + fun response(): FileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FileListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FileListPageAsync]. */ + class Builder internal constructor() { + + private var service: FileServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: FileListParams? = null + private var response: FileListPageResponse? = null + + @JvmSynthetic + internal fun from(fileListPageAsync: FileListPageAsync) = apply { + service = fileListPageAsync.service + streamHandlerExecutor = fileListPageAsync.streamHandlerExecutor + params = fileListPageAsync.params + response = fileListPageAsync.response + } + + fun service(service: FileServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: FileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FileListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FileListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FileListPageAsync = + FileListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FileListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "FileListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageResponse.kt b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageResponse.kt new file mode 100644 index 0000000..2832165 --- /dev/null +++ b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListPageResponse.kt @@ -0,0 +1,537 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.models.files + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import io.autorender.core.ExcludeMissing +import io.autorender.core.JsonField +import io.autorender.core.JsonMissing +import io.autorender.core.JsonValue +import io.autorender.core.checkKnown +import io.autorender.core.checkRequired +import io.autorender.core.toImmutable +import io.autorender.errors.AutorenderInvalidDataException +import java.util.Collections +import java.util.Objects +import kotlin.jvm.optionals.getOrNull + +/** Files list */ +class FileListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val files: JsonField>, + private val meta: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("files") + @ExcludeMissing + files: JsonField> = JsonMissing.of(), + @JsonProperty("meta") @ExcludeMissing meta: JsonField = JsonMissing.of(), + ) : this(files, meta, mutableMapOf()) + + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun files(): List = files.getRequired("files") + + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun meta(): Meta = meta.getRequired("meta") + + /** + * Returns the raw JSON value of [files]. + * + * Unlike [files], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("files") @ExcludeMissing fun _files(): JsonField> = files + + /** + * Returns the raw JSON value of [meta]. + * + * Unlike [meta], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("meta") @ExcludeMissing fun _meta(): JsonField = meta + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FileListPageResponse]. + * + * The following fields are required: + * ```java + * .files() + * .meta() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FileListPageResponse]. */ + class Builder internal constructor() { + + private var files: JsonField>? = null + private var meta: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fileListPageResponse: FileListPageResponse) = apply { + files = fileListPageResponse.files.map { it.toMutableList() } + meta = fileListPageResponse.meta + additionalProperties = fileListPageResponse.additionalProperties.toMutableMap() + } + + fun files(files: List) = files(JsonField.of(files)) + + /** + * Sets [Builder.files] to an arbitrary JSON value. + * + * You should usually call [Builder.files] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun files(files: JsonField>) = apply { + this.files = files.map { it.toMutableList() } + } + + /** + * Adds a single [FileListResponse] to [files]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addFile(file: FileListResponse) = apply { + files = + (files ?: JsonField.of(mutableListOf())).also { checkKnown("files", it).add(file) } + } + + fun meta(meta: Meta) = meta(JsonField.of(meta)) + + /** + * Sets [Builder.meta] to an arbitrary JSON value. + * + * You should usually call [Builder.meta] with a well-typed [Meta] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun meta(meta: JsonField) = apply { this.meta = meta } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [FileListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .files() + * .meta() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FileListPageResponse = + FileListPageResponse( + checkRequired("files", files).map { it.toImmutable() }, + checkRequired("meta", meta), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws AutorenderInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): FileListPageResponse = apply { + if (validated) { + return@apply + } + + files().forEach { it.validate() } + meta().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: AutorenderInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (files.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (meta.asKnown().getOrNull()?.validity() ?: 0) + + class Meta + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val hasNext: JsonField, + private val hasPrev: JsonField, + private val limit: JsonField, + private val page: JsonField, + private val total: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("hasNext") @ExcludeMissing hasNext: JsonField = JsonMissing.of(), + @JsonProperty("hasPrev") @ExcludeMissing hasPrev: JsonField = JsonMissing.of(), + @JsonProperty("limit") @ExcludeMissing limit: JsonField = JsonMissing.of(), + @JsonProperty("page") @ExcludeMissing page: JsonField = JsonMissing.of(), + @JsonProperty("total") @ExcludeMissing total: JsonField = JsonMissing.of(), + ) : this(hasNext, hasPrev, limit, page, total, mutableMapOf()) + + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun hasNext(): Boolean = hasNext.getRequired("hasNext") + + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun hasPrev(): Boolean = hasPrev.getRequired("hasPrev") + + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun limit(): Long = limit.getRequired("limit") + + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun page(): Long = page.getRequired("page") + + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun total(): Long = total.getRequired("total") + + /** + * Returns the raw JSON value of [hasNext]. + * + * Unlike [hasNext], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("hasNext") @ExcludeMissing fun _hasNext(): JsonField = hasNext + + /** + * Returns the raw JSON value of [hasPrev]. + * + * Unlike [hasPrev], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("hasPrev") @ExcludeMissing fun _hasPrev(): JsonField = hasPrev + + /** + * Returns the raw JSON value of [limit]. + * + * Unlike [limit], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("limit") @ExcludeMissing fun _limit(): JsonField = limit + + /** + * Returns the raw JSON value of [page]. + * + * Unlike [page], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("page") @ExcludeMissing fun _page(): JsonField = page + + /** + * Returns the raw JSON value of [total]. + * + * Unlike [total], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("total") @ExcludeMissing fun _total(): JsonField = total + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Meta]. + * + * The following fields are required: + * ```java + * .hasNext() + * .hasPrev() + * .limit() + * .page() + * .total() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Meta]. */ + class Builder internal constructor() { + + private var hasNext: JsonField? = null + private var hasPrev: JsonField? = null + private var limit: JsonField? = null + private var page: JsonField? = null + private var total: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(meta: Meta) = apply { + hasNext = meta.hasNext + hasPrev = meta.hasPrev + limit = meta.limit + page = meta.page + total = meta.total + additionalProperties = meta.additionalProperties.toMutableMap() + } + + fun hasNext(hasNext: Boolean) = hasNext(JsonField.of(hasNext)) + + /** + * Sets [Builder.hasNext] to an arbitrary JSON value. + * + * You should usually call [Builder.hasNext] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun hasNext(hasNext: JsonField) = apply { this.hasNext = hasNext } + + fun hasPrev(hasPrev: Boolean) = hasPrev(JsonField.of(hasPrev)) + + /** + * Sets [Builder.hasPrev] to an arbitrary JSON value. + * + * You should usually call [Builder.hasPrev] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun hasPrev(hasPrev: JsonField) = apply { this.hasPrev = hasPrev } + + fun limit(limit: Long) = limit(JsonField.of(limit)) + + /** + * Sets [Builder.limit] to an arbitrary JSON value. + * + * You should usually call [Builder.limit] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun limit(limit: JsonField) = apply { this.limit = limit } + + fun page(page: Long) = page(JsonField.of(page)) + + /** + * Sets [Builder.page] to an arbitrary JSON value. + * + * You should usually call [Builder.page] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun page(page: JsonField) = apply { this.page = page } + + fun total(total: Long) = total(JsonField.of(total)) + + /** + * Sets [Builder.total] to an arbitrary JSON value. + * + * You should usually call [Builder.total] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun total(total: JsonField) = apply { this.total = total } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Meta]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .hasNext() + * .hasPrev() + * .limit() + * .page() + * .total() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Meta = + Meta( + checkRequired("hasNext", hasNext), + checkRequired("hasPrev", hasPrev), + checkRequired("limit", limit), + checkRequired("page", page), + checkRequired("total", total), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws AutorenderInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Meta = apply { + if (validated) { + return@apply + } + + hasNext() + hasPrev() + limit() + page() + total() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: AutorenderInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (hasNext.asKnown().isPresent) 1 else 0) + + (if (hasPrev.asKnown().isPresent) 1 else 0) + + (if (limit.asKnown().isPresent) 1 else 0) + + (if (page.asKnown().isPresent) 1 else 0) + + (if (total.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Meta && + hasNext == other.hasNext && + hasPrev == other.hasPrev && + limit == other.limit && + page == other.page && + total == other.total && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(hasNext, hasPrev, limit, page, total, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Meta{hasNext=$hasNext, hasPrev=$hasPrev, limit=$limit, page=$page, total=$total, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FileListPageResponse && + files == other.files && + meta == other.meta && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(files, meta, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FileListPageResponse{files=$files, meta=$meta, additionalProperties=$additionalProperties}" +} diff --git a/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListResponse.kt b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListResponse.kt index 5b86d2b..642c29e 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListResponse.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/models/files/FileListResponse.kt @@ -20,1319 +20,773 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Files list */ class FileListResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val files: JsonField>, - private val meta: JsonField, + private val id: JsonField, + private val createdAt: JsonField, + private val fileNo: JsonField, + private val folderName: JsonField, + private val folderNo: JsonField, + private val format: JsonField, + private val height: JsonField, + private val metadata: JsonField, + private val mimeType: JsonField, + private val name: JsonField, + private val path: JsonField, + private val size: JsonField, + private val source: JsonField, + private val tags: JsonField>, + private val updatedAt: JsonField, + private val url: JsonField, + private val width: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("files") @ExcludeMissing files: JsonField> = JsonMissing.of(), - @JsonProperty("meta") @ExcludeMissing meta: JsonField = JsonMissing.of(), - ) : this(files, meta, mutableMapOf()) + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("file_no") @ExcludeMissing fileNo: JsonField = JsonMissing.of(), + @JsonProperty("folder_name") + @ExcludeMissing + folderName: JsonField = JsonMissing.of(), + @JsonProperty("folder_no") @ExcludeMissing folderNo: JsonField = JsonMissing.of(), + @JsonProperty("format") @ExcludeMissing format: JsonField = JsonMissing.of(), + @JsonProperty("height") @ExcludeMissing height: JsonField = JsonMissing.of(), + @JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(), + @JsonProperty("mime_type") @ExcludeMissing mimeType: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("path") @ExcludeMissing path: JsonField = JsonMissing.of(), + @JsonProperty("size") @ExcludeMissing size: JsonField = JsonMissing.of(), + @JsonProperty("source") @ExcludeMissing source: JsonField = JsonMissing.of(), + @JsonProperty("tags") @ExcludeMissing tags: JsonField> = JsonMissing.of(), + @JsonProperty("updated_at") + @ExcludeMissing + updatedAt: JsonField = JsonMissing.of(), + @JsonProperty("url") @ExcludeMissing url: JsonField = JsonMissing.of(), + @JsonProperty("width") @ExcludeMissing width: JsonField = JsonMissing.of(), + ) : this( + id, + createdAt, + fileNo, + folderName, + folderNo, + format, + height, + metadata, + mimeType, + name, + path, + size, + source, + tags, + updatedAt, + url, + width, + mutableMapOf(), + ) /** * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun files(): List = files.getRequired("files") + fun id(): String = id.getRequired("id") /** * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun meta(): Meta = meta.getRequired("meta") + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") /** - * Returns the raw JSON value of [files]. - * - * Unlike [files], this method doesn't throw if the JSON field has an unexpected type. + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - @JsonProperty("files") @ExcludeMissing fun _files(): JsonField> = files + fun fileNo(): String = fileNo.getRequired("file_no") /** - * Returns the raw JSON value of [meta]. - * - * Unlike [meta], this method doesn't throw if the JSON field has an unexpected type. + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - @JsonProperty("meta") @ExcludeMissing fun _meta(): JsonField = meta - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + fun folderName(): Optional = folderName.getOptional("folder_name") - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [FileListResponse]. - * - * The following fields are required: - * ```java - * .files() - * .meta() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [FileListResponse]. */ - class Builder internal constructor() { - - private var files: JsonField>? = null - private var meta: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(fileListResponse: FileListResponse) = apply { - files = fileListResponse.files.map { it.toMutableList() } - meta = fileListResponse.meta - additionalProperties = fileListResponse.additionalProperties.toMutableMap() - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun folderNo(): Optional = folderNo.getOptional("folder_no") - fun files(files: List) = files(JsonField.of(files)) + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun format(): Optional = format.getOptional("format") - /** - * Sets [Builder.files] to an arbitrary JSON value. - * - * You should usually call [Builder.files] with a well-typed `List` value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun files(files: JsonField>) = apply { - this.files = files.map { it.toMutableList() } - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun height(): Optional = height.getOptional("height") - /** - * Adds a single [File] to [files]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addFile(file: File) = apply { - files = - (files ?: JsonField.of(mutableListOf())).also { checkKnown("files", it).add(file) } - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun metadata(): Optional = metadata.getOptional("metadata") - fun meta(meta: Meta) = meta(JsonField.of(meta)) + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun mimeType(): String = mimeType.getRequired("mime_type") - /** - * Sets [Builder.meta] to an arbitrary JSON value. - * - * You should usually call [Builder.meta] with a well-typed [Meta] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun meta(meta: JsonField) = apply { this.meta = meta } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun path(): String = path.getRequired("path") - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun size(): Long = size.getRequired("size") - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun source(): String = source.getRequired("source") - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun tags(): List = tags.getRequired("tags") - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun updatedAt(): Optional = updatedAt.getOptional("updated_at") - /** - * Returns an immutable instance of [FileListResponse]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .files() - * .meta() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): FileListResponse = - FileListResponse( - checkRequired("files", files).map { it.toImmutable() }, - checkRequired("meta", meta), - additionalProperties.toMutableMap(), - ) - } + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun url(): String = url.getRequired("url") - private var validated: Boolean = false + /** + * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun width(): Optional = width.getOptional("width") /** - * Validates that the types of all values in this object match their expected types recursively. + * Returns the raw JSON value of [id]. * - * This method is _not_ forwards compatible with new types from the API for existing fields. - * - * @throws AutorenderInvalidDataException if any value type in this object doesn't match its - * expected type. + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. */ - fun validate(): FileListResponse = apply { - if (validated) { - return@apply - } - - files().forEach { it.validate() } - meta().validate() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: AutorenderInvalidDataException) { - false - } + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id /** - * Returns a score indicating how many valid values are contained in this object recursively. + * Returns the raw JSON value of [createdAt]. * - * Used for best match union deserialization. + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. */ - @JvmSynthetic - internal fun validity(): Int = - (files.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (meta.asKnown().getOrNull()?.validity() ?: 0) - - class File - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val id: JsonField, - private val createdAt: JsonField, - private val fileNo: JsonField, - private val folderName: JsonField, - private val folderNo: JsonField, - private val format: JsonField, - private val height: JsonField, - private val metadata: JsonField, - private val mimeType: JsonField, - private val name: JsonField, - private val path: JsonField, - private val size: JsonField, - private val source: JsonField, - private val tags: JsonField>, - private val updatedAt: JsonField, - private val url: JsonField, - private val width: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), - @JsonProperty("file_no") @ExcludeMissing fileNo: JsonField = JsonMissing.of(), - @JsonProperty("folder_name") - @ExcludeMissing - folderName: JsonField = JsonMissing.of(), - @JsonProperty("folder_no") - @ExcludeMissing - folderNo: JsonField = JsonMissing.of(), - @JsonProperty("format") @ExcludeMissing format: JsonField = JsonMissing.of(), - @JsonProperty("height") @ExcludeMissing height: JsonField = JsonMissing.of(), - @JsonProperty("metadata") - @ExcludeMissing - metadata: JsonField = JsonMissing.of(), - @JsonProperty("mime_type") - @ExcludeMissing - mimeType: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), - @JsonProperty("path") @ExcludeMissing path: JsonField = JsonMissing.of(), - @JsonProperty("size") @ExcludeMissing size: JsonField = JsonMissing.of(), - @JsonProperty("source") @ExcludeMissing source: JsonField = JsonMissing.of(), - @JsonProperty("tags") @ExcludeMissing tags: JsonField> = JsonMissing.of(), - @JsonProperty("updated_at") - @ExcludeMissing - updatedAt: JsonField = JsonMissing.of(), - @JsonProperty("url") @ExcludeMissing url: JsonField = JsonMissing.of(), - @JsonProperty("width") @ExcludeMissing width: JsonField = JsonMissing.of(), - ) : this( - id, - createdAt, - fileNo, - folderName, - folderNo, - format, - height, - metadata, - mimeType, - name, - path, - size, - source, - tags, - updatedAt, - url, - width, - mutableMapOf(), - ) - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun id(): String = id.getRequired("id") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun fileNo(): String = fileNo.getRequired("file_no") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun folderName(): Optional = folderName.getOptional("folder_name") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun folderNo(): Optional = folderNo.getOptional("folder_no") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun format(): Optional = format.getOptional("format") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun height(): Optional = height.getOptional("height") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun metadata(): Optional = metadata.getOptional("metadata") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun mimeType(): String = mimeType.getRequired("mime_type") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun name(): String = name.getRequired("name") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun path(): String = path.getRequired("path") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun size(): Long = size.getRequired("size") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun source(): String = source.getRequired("source") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun tags(): List = tags.getRequired("tags") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun updatedAt(): Optional = updatedAt.getOptional("updated_at") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun url(): String = url.getRequired("url") - - /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun width(): Optional = width.getOptional("width") - - /** - * Returns the raw JSON value of [id]. - * - * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - /** - * Returns the raw JSON value of [createdAt]. - * - * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - - /** - * Returns the raw JSON value of [fileNo]. - * - * Unlike [fileNo], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("file_no") @ExcludeMissing fun _fileNo(): JsonField = fileNo - - /** - * Returns the raw JSON value of [folderName]. - * - * Unlike [folderName], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("folder_name") - @ExcludeMissing - fun _folderName(): JsonField = folderName - - /** - * Returns the raw JSON value of [folderNo]. - * - * Unlike [folderNo], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("folder_no") @ExcludeMissing fun _folderNo(): JsonField = folderNo - - /** - * Returns the raw JSON value of [format]. - * - * Unlike [format], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("format") @ExcludeMissing fun _format(): JsonField = format - - /** - * Returns the raw JSON value of [height]. - * - * Unlike [height], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("height") @ExcludeMissing fun _height(): JsonField = height - - /** - * Returns the raw JSON value of [metadata]. - * - * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata - - /** - * Returns the raw JSON value of [mimeType]. - * - * Unlike [mimeType], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("mime_type") @ExcludeMissing fun _mimeType(): JsonField = mimeType - - /** - * Returns the raw JSON value of [name]. - * - * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - - /** - * Returns the raw JSON value of [path]. - * - * Unlike [path], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("path") @ExcludeMissing fun _path(): JsonField = path - - /** - * Returns the raw JSON value of [size]. - * - * Unlike [size], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("size") @ExcludeMissing fun _size(): JsonField = size - - /** - * Returns the raw JSON value of [source]. - * - * Unlike [source], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("source") @ExcludeMissing fun _source(): JsonField = source - - /** - * Returns the raw JSON value of [tags]. - * - * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField> = tags - - /** - * Returns the raw JSON value of [updatedAt]. - * - * Unlike [updatedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("updated_at") - @ExcludeMissing - fun _updatedAt(): JsonField = updatedAt - - /** - * Returns the raw JSON value of [url]. - * - * Unlike [url], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("url") @ExcludeMissing fun _url(): JsonField = url - - /** - * Returns the raw JSON value of [width]. - * - * Unlike [width], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("width") @ExcludeMissing fun _width(): JsonField = width - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [File]. - * - * The following fields are required: - * ```java - * .id() - * .createdAt() - * .fileNo() - * .folderName() - * .folderNo() - * .format() - * .height() - * .metadata() - * .mimeType() - * .name() - * .path() - * .size() - * .source() - * .tags() - * .updatedAt() - * .url() - * .width() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [File]. */ - class Builder internal constructor() { - - private var id: JsonField? = null - private var createdAt: JsonField? = null - private var fileNo: JsonField? = null - private var folderName: JsonField? = null - private var folderNo: JsonField? = null - private var format: JsonField? = null - private var height: JsonField? = null - private var metadata: JsonField? = null - private var mimeType: JsonField? = null - private var name: JsonField? = null - private var path: JsonField? = null - private var size: JsonField? = null - private var source: JsonField? = null - private var tags: JsonField>? = null - private var updatedAt: JsonField? = null - private var url: JsonField? = null - private var width: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(file: File) = apply { - id = file.id - createdAt = file.createdAt - fileNo = file.fileNo - folderName = file.folderName - folderNo = file.folderNo - format = file.format - height = file.height - metadata = file.metadata - mimeType = file.mimeType - name = file.name - path = file.path - size = file.size - source = file.source - tags = file.tags.map { it.toMutableList() } - updatedAt = file.updatedAt - url = file.url - width = file.width - additionalProperties = file.additionalProperties.toMutableMap() - } - - fun id(id: String) = id(JsonField.of(id)) - - /** - * Sets [Builder.id] to an arbitrary JSON value. - * - * You should usually call [Builder.id] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun id(id: JsonField) = apply { this.id = id } - - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - /** - * Sets [Builder.createdAt] to an arbitrary JSON value. - * - * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun createdAt(createdAt: JsonField) = apply { - this.createdAt = createdAt - } - - fun fileNo(fileNo: String) = fileNo(JsonField.of(fileNo)) - - /** - * Sets [Builder.fileNo] to an arbitrary JSON value. - * - * You should usually call [Builder.fileNo] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun fileNo(fileNo: JsonField) = apply { this.fileNo = fileNo } - - fun folderName(folderName: String?) = folderName(JsonField.ofNullable(folderName)) - - /** Alias for calling [Builder.folderName] with `folderName.orElse(null)`. */ - fun folderName(folderName: Optional) = folderName(folderName.getOrNull()) - - /** - * Sets [Builder.folderName] to an arbitrary JSON value. - * - * You should usually call [Builder.folderName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun folderName(folderName: JsonField) = apply { this.folderName = folderName } - - fun folderNo(folderNo: String?) = folderNo(JsonField.ofNullable(folderNo)) - - /** Alias for calling [Builder.folderNo] with `folderNo.orElse(null)`. */ - fun folderNo(folderNo: Optional) = folderNo(folderNo.getOrNull()) - - /** - * Sets [Builder.folderNo] to an arbitrary JSON value. - * - * You should usually call [Builder.folderNo] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun folderNo(folderNo: JsonField) = apply { this.folderNo = folderNo } - - fun format(format: String?) = format(JsonField.ofNullable(format)) - - /** Alias for calling [Builder.format] with `format.orElse(null)`. */ - fun format(format: Optional) = format(format.getOrNull()) - - /** - * Sets [Builder.format] to an arbitrary JSON value. - * - * You should usually call [Builder.format] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun format(format: JsonField) = apply { this.format = format } - - fun height(height: Long?) = height(JsonField.ofNullable(height)) - - /** - * Alias for [Builder.height]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun height(height: Long) = height(height as Long?) - - /** Alias for calling [Builder.height] with `height.orElse(null)`. */ - fun height(height: Optional) = height(height.getOrNull()) - - /** - * Sets [Builder.height] to an arbitrary JSON value. - * - * You should usually call [Builder.height] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun height(height: JsonField) = apply { this.height = height } - - fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata)) - - /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ - fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) - - /** - * Sets [Builder.metadata] to an arbitrary JSON value. - * - * You should usually call [Builder.metadata] with a well-typed [Metadata] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun metadata(metadata: JsonField) = apply { this.metadata = metadata } - - fun mimeType(mimeType: String) = mimeType(JsonField.of(mimeType)) - - /** - * Sets [Builder.mimeType] to an arbitrary JSON value. - * - * You should usually call [Builder.mimeType] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun mimeType(mimeType: JsonField) = apply { this.mimeType = mimeType } - - fun name(name: String) = name(JsonField.of(name)) - - /** - * Sets [Builder.name] to an arbitrary JSON value. - * - * You should usually call [Builder.name] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun name(name: JsonField) = apply { this.name = name } - - fun path(path: String) = path(JsonField.of(path)) - - /** - * Sets [Builder.path] to an arbitrary JSON value. - * - * You should usually call [Builder.path] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun path(path: JsonField) = apply { this.path = path } - - fun size(size: Long) = size(JsonField.of(size)) - - /** - * Sets [Builder.size] to an arbitrary JSON value. - * - * You should usually call [Builder.size] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun size(size: JsonField) = apply { this.size = size } - - fun source(source: String) = source(JsonField.of(source)) - - /** - * Sets [Builder.source] to an arbitrary JSON value. - * - * You should usually call [Builder.source] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun source(source: JsonField) = apply { this.source = source } + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt - fun tags(tags: List) = tags(JsonField.of(tags)) + /** + * Returns the raw JSON value of [fileNo]. + * + * Unlike [fileNo], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("file_no") @ExcludeMissing fun _fileNo(): JsonField = fileNo - /** - * Sets [Builder.tags] to an arbitrary JSON value. - * - * You should usually call [Builder.tags] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun tags(tags: JsonField>) = apply { - this.tags = tags.map { it.toMutableList() } - } + /** + * Returns the raw JSON value of [folderName]. + * + * Unlike [folderName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("folder_name") @ExcludeMissing fun _folderName(): JsonField = folderName - /** - * Adds a single [String] to [tags]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addTag(tag: String) = apply { - tags = - (tags ?: JsonField.of(mutableListOf())).also { checkKnown("tags", it).add(tag) } - } + /** + * Returns the raw JSON value of [folderNo]. + * + * Unlike [folderNo], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("folder_no") @ExcludeMissing fun _folderNo(): JsonField = folderNo - fun updatedAt(updatedAt: OffsetDateTime?) = updatedAt(JsonField.ofNullable(updatedAt)) + /** + * Returns the raw JSON value of [format]. + * + * Unlike [format], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("format") @ExcludeMissing fun _format(): JsonField = format - /** Alias for calling [Builder.updatedAt] with `updatedAt.orElse(null)`. */ - fun updatedAt(updatedAt: Optional) = updatedAt(updatedAt.getOrNull()) + /** + * Returns the raw JSON value of [height]. + * + * Unlike [height], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("height") @ExcludeMissing fun _height(): JsonField = height - /** - * Sets [Builder.updatedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun updatedAt(updatedAt: JsonField) = apply { - this.updatedAt = updatedAt - } + /** + * Returns the raw JSON value of [metadata]. + * + * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata - fun url(url: String) = url(JsonField.of(url)) + /** + * Returns the raw JSON value of [mimeType]. + * + * Unlike [mimeType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("mime_type") @ExcludeMissing fun _mimeType(): JsonField = mimeType - /** - * Sets [Builder.url] to an arbitrary JSON value. - * - * You should usually call [Builder.url] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun url(url: JsonField) = apply { this.url = url } + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - fun width(width: Long?) = width(JsonField.ofNullable(width)) + /** + * Returns the raw JSON value of [path]. + * + * Unlike [path], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("path") @ExcludeMissing fun _path(): JsonField = path - /** - * Alias for [Builder.width]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun width(width: Long) = width(width as Long?) + /** + * Returns the raw JSON value of [size]. + * + * Unlike [size], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("size") @ExcludeMissing fun _size(): JsonField = size - /** Alias for calling [Builder.width] with `width.orElse(null)`. */ - fun width(width: Optional) = width(width.getOrNull()) + /** + * Returns the raw JSON value of [source]. + * + * Unlike [source], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("source") @ExcludeMissing fun _source(): JsonField = source - /** - * Sets [Builder.width] to an arbitrary JSON value. - * - * You should usually call [Builder.width] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun width(width: JsonField) = apply { this.width = width } + /** + * Returns the raw JSON value of [tags]. + * + * Unlike [tags], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField> = tags - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + /** + * Returns the raw JSON value of [updatedAt]. + * + * Unlike [updatedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("updated_at") + @ExcludeMissing + fun _updatedAt(): JsonField = updatedAt - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + /** + * Returns the raw JSON value of [url]. + * + * Unlike [url], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("url") @ExcludeMissing fun _url(): JsonField = url - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } + /** + * Returns the raw JSON value of [width]. + * + * Unlike [width], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("width") @ExcludeMissing fun _width(): JsonField = width - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** - * Returns an immutable instance of [File]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .id() - * .createdAt() - * .fileNo() - * .folderName() - * .folderNo() - * .format() - * .height() - * .metadata() - * .mimeType() - * .name() - * .path() - * .size() - * .source() - * .tags() - * .updatedAt() - * .url() - * .width() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): File = - File( - checkRequired("id", id), - checkRequired("createdAt", createdAt), - checkRequired("fileNo", fileNo), - checkRequired("folderName", folderName), - checkRequired("folderNo", folderNo), - checkRequired("format", format), - checkRequired("height", height), - checkRequired("metadata", metadata), - checkRequired("mimeType", mimeType), - checkRequired("name", name), - checkRequired("path", path), - checkRequired("size", size), - checkRequired("source", source), - checkRequired("tags", tags).map { it.toImmutable() }, - checkRequired("updatedAt", updatedAt), - checkRequired("url", url), - checkRequired("width", width), - additionalProperties.toMutableMap(), - ) - } + fun toBuilder() = Builder().from(this) - private var validated: Boolean = false + companion object { /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing fields. + * Returns a mutable builder for constructing an instance of [FileListResponse]. * - * @throws AutorenderInvalidDataException if any value type in this object doesn't match its - * expected type. + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .fileNo() + * .folderName() + * .folderNo() + * .format() + * .height() + * .metadata() + * .mimeType() + * .name() + * .path() + * .size() + * .source() + * .tags() + * .updatedAt() + * .url() + * .width() + * ``` */ - fun validate(): File = apply { - if (validated) { - return@apply - } + @JvmStatic fun builder() = Builder() + } - id() - createdAt() - fileNo() - folderName() - folderNo() - format() - height() - metadata().ifPresent { it.validate() } - mimeType() - name() - path() - size() - source() - tags() - updatedAt() - url() - width() - validated = true + /** A builder for [FileListResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var createdAt: JsonField? = null + private var fileNo: JsonField? = null + private var folderName: JsonField? = null + private var folderNo: JsonField? = null + private var format: JsonField? = null + private var height: JsonField? = null + private var metadata: JsonField? = null + private var mimeType: JsonField? = null + private var name: JsonField? = null + private var path: JsonField? = null + private var size: JsonField? = null + private var source: JsonField? = null + private var tags: JsonField>? = null + private var updatedAt: JsonField? = null + private var url: JsonField? = null + private var width: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fileListResponse: FileListResponse) = apply { + id = fileListResponse.id + createdAt = fileListResponse.createdAt + fileNo = fileListResponse.fileNo + folderName = fileListResponse.folderName + folderNo = fileListResponse.folderNo + format = fileListResponse.format + height = fileListResponse.height + metadata = fileListResponse.metadata + mimeType = fileListResponse.mimeType + name = fileListResponse.name + path = fileListResponse.path + size = fileListResponse.size + source = fileListResponse.source + tags = fileListResponse.tags.map { it.toMutableList() } + updatedAt = fileListResponse.updatedAt + url = fileListResponse.url + width = fileListResponse.width + additionalProperties = fileListResponse.additionalProperties.toMutableMap() } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: AutorenderInvalidDataException) { - false - } + fun id(id: String) = id(JsonField.of(id)) /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Sets [Builder.id] to an arbitrary JSON value. * - * Used for best match union deserialization. + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - @JvmSynthetic - internal fun validity(): Int = - (if (id.asKnown().isPresent) 1 else 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + - (if (fileNo.asKnown().isPresent) 1 else 0) + - (if (folderName.asKnown().isPresent) 1 else 0) + - (if (folderNo.asKnown().isPresent) 1 else 0) + - (if (format.asKnown().isPresent) 1 else 0) + - (if (height.asKnown().isPresent) 1 else 0) + - (metadata.asKnown().getOrNull()?.validity() ?: 0) + - (if (mimeType.asKnown().isPresent) 1 else 0) + - (if (name.asKnown().isPresent) 1 else 0) + - (if (path.asKnown().isPresent) 1 else 0) + - (if (size.asKnown().isPresent) 1 else 0) + - (if (source.asKnown().isPresent) 1 else 0) + - (tags.asKnown().getOrNull()?.size ?: 0) + - (if (updatedAt.asKnown().isPresent) 1 else 0) + - (if (url.asKnown().isPresent) 1 else 0) + - (if (width.asKnown().isPresent) 1 else 0) - - class Metadata - @JsonCreator - private constructor( - @com.fasterxml.jackson.annotation.JsonValue - private val additionalProperties: Map - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun toBuilder() = Builder().from(this) - - companion object { - - /** Returns a mutable builder for constructing an instance of [Metadata]. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [Metadata]. */ - class Builder internal constructor() { + fun id(id: JsonField) = apply { this.id = id } - private var additionalProperties: MutableMap = mutableMapOf() + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - @JvmSynthetic - internal fun from(metadata: Metadata) = apply { - additionalProperties = metadata.additionalProperties.toMutableMap() - } + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + fun fileNo(fileNo: String) = fileNo(JsonField.of(fileNo)) - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + /** + * Sets [Builder.fileNo] to an arbitrary JSON value. + * + * You should usually call [Builder.fileNo] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun fileNo(fileNo: JsonField) = apply { this.fileNo = fileNo } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } + fun folderName(folderName: String?) = folderName(JsonField.ofNullable(folderName)) - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + /** Alias for calling [Builder.folderName] with `folderName.orElse(null)`. */ + fun folderName(folderName: Optional) = folderName(folderName.getOrNull()) - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + /** + * Sets [Builder.folderName] to an arbitrary JSON value. + * + * You should usually call [Builder.folderName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun folderName(folderName: JsonField) = apply { this.folderName = folderName } - /** - * Returns an immutable instance of [Metadata]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): Metadata = Metadata(additionalProperties.toImmutable()) - } + fun folderNo(folderNo: String?) = folderNo(JsonField.ofNullable(folderNo)) - private var validated: Boolean = false + /** Alias for calling [Builder.folderNo] with `folderNo.orElse(null)`. */ + fun folderNo(folderNo: Optional) = folderNo(folderNo.getOrNull()) - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing - * fields. - * - * @throws AutorenderInvalidDataException if any value type in this object doesn't match - * its expected type. - */ - fun validate(): Metadata = apply { - if (validated) { - return@apply - } + /** + * Sets [Builder.folderNo] to an arbitrary JSON value. + * + * You should usually call [Builder.folderNo] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun folderNo(folderNo: JsonField) = apply { this.folderNo = folderNo } - validated = true - } + fun format(format: String?) = format(JsonField.ofNullable(format)) - fun isValid(): Boolean = - try { - validate() - true - } catch (e: AutorenderInvalidDataException) { - false - } + /** Alias for calling [Builder.format] with `format.orElse(null)`. */ + fun format(format: Optional) = format(format.getOrNull()) - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } + /** + * Sets [Builder.format] to an arbitrary JSON value. + * + * You should usually call [Builder.format] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun format(format: JsonField) = apply { this.format = format } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + fun height(height: Long?) = height(JsonField.ofNullable(height)) - return other is Metadata && additionalProperties == other.additionalProperties - } + /** + * Alias for [Builder.height]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun height(height: Long) = height(height as Long?) - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /** Alias for calling [Builder.height] with `height.orElse(null)`. */ + fun height(height: Optional) = height(height.getOrNull()) - override fun hashCode(): Int = hashCode + /** + * Sets [Builder.height] to an arbitrary JSON value. + * + * You should usually call [Builder.height] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun height(height: JsonField) = apply { this.height = height } - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - } + fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata)) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + /** Alias for calling [Builder.metadata] with `metadata.orElse(null)`. */ + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) - return other is File && - id == other.id && - createdAt == other.createdAt && - fileNo == other.fileNo && - folderName == other.folderName && - folderNo == other.folderNo && - format == other.format && - height == other.height && - metadata == other.metadata && - mimeType == other.mimeType && - name == other.name && - path == other.path && - size == other.size && - source == other.source && - tags == other.tags && - updatedAt == other.updatedAt && - url == other.url && - width == other.width && - additionalProperties == other.additionalProperties - } + /** + * Sets [Builder.metadata] to an arbitrary JSON value. + * + * You should usually call [Builder.metadata] with a well-typed [Metadata] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun metadata(metadata: JsonField) = apply { this.metadata = metadata } - private val hashCode: Int by lazy { - Objects.hash( - id, - createdAt, - fileNo, - folderName, - folderNo, - format, - height, - metadata, - mimeType, - name, - path, - size, - source, - tags, - updatedAt, - url, - width, - additionalProperties, - ) - } + fun mimeType(mimeType: String) = mimeType(JsonField.of(mimeType)) - override fun hashCode(): Int = hashCode + /** + * Sets [Builder.mimeType] to an arbitrary JSON value. + * + * You should usually call [Builder.mimeType] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun mimeType(mimeType: JsonField) = apply { this.mimeType = mimeType } - override fun toString() = - "File{id=$id, createdAt=$createdAt, fileNo=$fileNo, folderName=$folderName, folderNo=$folderNo, format=$format, height=$height, metadata=$metadata, mimeType=$mimeType, name=$name, path=$path, size=$size, source=$source, tags=$tags, updatedAt=$updatedAt, url=$url, width=$width, additionalProperties=$additionalProperties}" - } + fun name(name: String) = name(JsonField.of(name)) - class Meta - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val hasNext: JsonField, - private val hasPrev: JsonField, - private val limit: JsonField, - private val page: JsonField, - private val total: JsonField, - private val additionalProperties: MutableMap, - ) { + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } - @JsonCreator - private constructor( - @JsonProperty("hasNext") @ExcludeMissing hasNext: JsonField = JsonMissing.of(), - @JsonProperty("hasPrev") @ExcludeMissing hasPrev: JsonField = JsonMissing.of(), - @JsonProperty("limit") @ExcludeMissing limit: JsonField = JsonMissing.of(), - @JsonProperty("page") @ExcludeMissing page: JsonField = JsonMissing.of(), - @JsonProperty("total") @ExcludeMissing total: JsonField = JsonMissing.of(), - ) : this(hasNext, hasPrev, limit, page, total, mutableMapOf()) + fun path(path: String) = path(JsonField.of(path)) /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * Sets [Builder.path] to an arbitrary JSON value. + * + * You should usually call [Builder.path] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun hasNext(): Boolean = hasNext.getRequired("hasNext") + fun path(path: JsonField) = apply { this.path = path } + + fun size(size: Long) = size(JsonField.of(size)) /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * Sets [Builder.size] to an arbitrary JSON value. + * + * You should usually call [Builder.size] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun hasPrev(): Boolean = hasPrev.getRequired("hasPrev") + fun size(size: JsonField) = apply { this.size = size } + + fun source(source: String) = source(JsonField.of(source)) /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * Sets [Builder.source] to an arbitrary JSON value. + * + * You should usually call [Builder.source] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun limit(): Long = limit.getRequired("limit") + fun source(source: JsonField) = apply { this.source = source } + + fun tags(tags: List) = tags(JsonField.of(tags)) /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * Sets [Builder.tags] to an arbitrary JSON value. + * + * You should usually call [Builder.tags] with a well-typed `List` value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. */ - fun page(): Long = page.getRequired("page") + fun tags(tags: JsonField>) = apply { + this.tags = tags.map { it.toMutableList() } + } /** - * @throws AutorenderInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * Adds a single [String] to [tags]. + * + * @throws IllegalStateException if the field was previously set to a non-list. */ - fun total(): Long = total.getRequired("total") + fun addTag(tag: String) = apply { + tags = (tags ?: JsonField.of(mutableListOf())).also { checkKnown("tags", it).add(tag) } + } + + fun updatedAt(updatedAt: OffsetDateTime?) = updatedAt(JsonField.ofNullable(updatedAt)) + + /** Alias for calling [Builder.updatedAt] with `updatedAt.orElse(null)`. */ + fun updatedAt(updatedAt: Optional) = updatedAt(updatedAt.getOrNull()) /** - * Returns the raw JSON value of [hasNext]. + * Sets [Builder.updatedAt] to an arbitrary JSON value. * - * Unlike [hasNext], this method doesn't throw if the JSON field has an unexpected type. + * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - @JsonProperty("hasNext") @ExcludeMissing fun _hasNext(): JsonField = hasNext + fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } + + fun url(url: String) = url(JsonField.of(url)) /** - * Returns the raw JSON value of [hasPrev]. + * Sets [Builder.url] to an arbitrary JSON value. * - * Unlike [hasPrev], this method doesn't throw if the JSON field has an unexpected type. + * You should usually call [Builder.url] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - @JsonProperty("hasPrev") @ExcludeMissing fun _hasPrev(): JsonField = hasPrev + fun url(url: JsonField) = apply { this.url = url } + + fun width(width: Long?) = width(JsonField.ofNullable(width)) /** - * Returns the raw JSON value of [limit]. + * Alias for [Builder.width]. * - * Unlike [limit], this method doesn't throw if the JSON field has an unexpected type. + * This unboxed primitive overload exists for backwards compatibility. */ - @JsonProperty("limit") @ExcludeMissing fun _limit(): JsonField = limit + fun width(width: Long) = width(width as Long?) + + /** Alias for calling [Builder.width] with `width.orElse(null)`. */ + fun width(width: Optional) = width(width.getOrNull()) /** - * Returns the raw JSON value of [page]. + * Sets [Builder.width] to an arbitrary JSON value. * - * Unlike [page], this method doesn't throw if the JSON field has an unexpected type. + * You should usually call [Builder.width] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - @JsonProperty("page") @ExcludeMissing fun _page(): JsonField = page + fun width(width: JsonField) = apply { this.width = width } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns the raw JSON value of [total]. + * Returns an immutable instance of [FileListResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. * - * Unlike [total], this method doesn't throw if the JSON field has an unexpected type. + * The following fields are required: + * ```java + * .id() + * .createdAt() + * .fileNo() + * .folderName() + * .folderNo() + * .format() + * .height() + * .metadata() + * .mimeType() + * .name() + * .path() + * .size() + * .source() + * .tags() + * .updatedAt() + * .url() + * .width() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - @JsonProperty("total") @ExcludeMissing fun _total(): JsonField = total + fun build(): FileListResponse = + FileListResponse( + checkRequired("id", id), + checkRequired("createdAt", createdAt), + checkRequired("fileNo", fileNo), + checkRequired("folderName", folderName), + checkRequired("folderNo", folderNo), + checkRequired("format", format), + checkRequired("height", height), + checkRequired("metadata", metadata), + checkRequired("mimeType", mimeType), + checkRequired("name", name), + checkRequired("path", path), + checkRequired("size", size), + checkRequired("source", source), + checkRequired("tags", tags).map { it.toImmutable() }, + checkRequired("updatedAt", updatedAt), + checkRequired("url", url), + checkRequired("width", width), + additionalProperties.toMutableMap(), + ) + } - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws AutorenderInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): FileListResponse = apply { + if (validated) { + return@apply + } + + id() + createdAt() + fileNo() + folderName() + folderNo() + format() + height() + metadata().ifPresent { it.validate() } + mimeType() + name() + path() + size() + source() + tags() + updatedAt() + url() + width() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: AutorenderInvalidDataException) { + false } + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (id.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (if (fileNo.asKnown().isPresent) 1 else 0) + + (if (folderName.asKnown().isPresent) 1 else 0) + + (if (folderNo.asKnown().isPresent) 1 else 0) + + (if (format.asKnown().isPresent) 1 else 0) + + (if (height.asKnown().isPresent) 1 else 0) + + (metadata.asKnown().getOrNull()?.validity() ?: 0) + + (if (mimeType.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (path.asKnown().isPresent) 1 else 0) + + (if (size.asKnown().isPresent) 1 else 0) + + (if (source.asKnown().isPresent) 1 else 0) + + (tags.asKnown().getOrNull()?.size ?: 0) + + (if (updatedAt.asKnown().isPresent) 1 else 0) + + (if (url.asKnown().isPresent) 1 else 0) + + (if (width.asKnown().isPresent) 1 else 0) + + class Metadata + @JsonCreator + private constructor( + @com.fasterxml.jackson.annotation.JsonValue + private val additionalProperties: Map + ) { + @JsonAnyGetter @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) companion object { - /** - * Returns a mutable builder for constructing an instance of [Meta]. - * - * The following fields are required: - * ```java - * .hasNext() - * .hasPrev() - * .limit() - * .page() - * .total() - * ``` - */ + /** Returns a mutable builder for constructing an instance of [Metadata]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [Meta]. */ + /** A builder for [Metadata]. */ class Builder internal constructor() { - private var hasNext: JsonField? = null - private var hasPrev: JsonField? = null - private var limit: JsonField? = null - private var page: JsonField? = null - private var total: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(meta: Meta) = apply { - hasNext = meta.hasNext - hasPrev = meta.hasPrev - limit = meta.limit - page = meta.page - total = meta.total - additionalProperties = meta.additionalProperties.toMutableMap() + internal fun from(metadata: Metadata) = apply { + additionalProperties = metadata.additionalProperties.toMutableMap() } - fun hasNext(hasNext: Boolean) = hasNext(JsonField.of(hasNext)) - - /** - * Sets [Builder.hasNext] to an arbitrary JSON value. - * - * You should usually call [Builder.hasNext] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun hasNext(hasNext: JsonField) = apply { this.hasNext = hasNext } - - fun hasPrev(hasPrev: Boolean) = hasPrev(JsonField.of(hasPrev)) - - /** - * Sets [Builder.hasPrev] to an arbitrary JSON value. - * - * You should usually call [Builder.hasPrev] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun hasPrev(hasPrev: JsonField) = apply { this.hasPrev = hasPrev } - - fun limit(limit: Long) = limit(JsonField.of(limit)) - - /** - * Sets [Builder.limit] to an arbitrary JSON value. - * - * You should usually call [Builder.limit] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun limit(limit: JsonField) = apply { this.limit = limit } - - fun page(page: Long) = page(JsonField.of(page)) - - /** - * Sets [Builder.page] to an arbitrary JSON value. - * - * You should usually call [Builder.page] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun page(page: JsonField) = apply { this.page = page } - - fun total(total: Long) = total(JsonField.of(total)) - - /** - * Sets [Builder.total] to an arbitrary JSON value. - * - * You should usually call [Builder.total] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun total(total: JsonField) = apply { this.total = total } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1353,30 +807,11 @@ private constructor( } /** - * Returns an immutable instance of [Meta]. + * Returns an immutable instance of [Metadata]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .hasNext() - * .hasPrev() - * .limit() - * .page() - * .total() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ - fun build(): Meta = - Meta( - checkRequired("hasNext", hasNext), - checkRequired("hasPrev", hasPrev), - checkRequired("limit", limit), - checkRequired("page", page), - checkRequired("total", total), - additionalProperties.toMutableMap(), - ) + fun build(): Metadata = Metadata(additionalProperties.toImmutable()) } private var validated: Boolean = false @@ -1390,16 +825,11 @@ private constructor( * @throws AutorenderInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): Meta = apply { + fun validate(): Metadata = apply { if (validated) { return@apply } - hasNext() - hasPrev() - limit() - page() - total() validated = true } @@ -1419,34 +849,21 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (hasNext.asKnown().isPresent) 1 else 0) + - (if (hasPrev.asKnown().isPresent) 1 else 0) + - (if (limit.asKnown().isPresent) 1 else 0) + - (if (page.asKnown().isPresent) 1 else 0) + - (if (total.asKnown().isPresent) 1 else 0) + additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Meta && - hasNext == other.hasNext && - hasPrev == other.hasPrev && - limit == other.limit && - page == other.page && - total == other.total && - additionalProperties == other.additionalProperties + return other is Metadata && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash(hasNext, hasPrev, limit, page, total, additionalProperties) - } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode - override fun toString() = - "Meta{hasNext=$hasNext, hasPrev=$hasPrev, limit=$limit, page=$page, total=$total, additionalProperties=$additionalProperties}" + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1455,15 +872,51 @@ private constructor( } return other is FileListResponse && - files == other.files && - meta == other.meta && + id == other.id && + createdAt == other.createdAt && + fileNo == other.fileNo && + folderName == other.folderName && + folderNo == other.folderNo && + format == other.format && + height == other.height && + metadata == other.metadata && + mimeType == other.mimeType && + name == other.name && + path == other.path && + size == other.size && + source == other.source && + tags == other.tags && + updatedAt == other.updatedAt && + url == other.url && + width == other.width && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(files, meta, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash( + id, + createdAt, + fileNo, + folderName, + folderNo, + format, + height, + metadata, + mimeType, + name, + path, + size, + source, + tags, + updatedAt, + url, + width, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode override fun toString() = - "FileListResponse{files=$files, meta=$meta, additionalProperties=$additionalProperties}" + "FileListResponse{id=$id, createdAt=$createdAt, fileNo=$fileNo, folderName=$folderName, folderNo=$folderNo, format=$format, height=$height, metadata=$metadata, mimeType=$mimeType, name=$name, path=$path, size=$size, source=$source, tags=$tags, updatedAt=$updatedAt, url=$url, width=$width, additionalProperties=$additionalProperties}" } diff --git a/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsync.kt b/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsync.kt index 5813393..ff925df 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsync.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsync.kt @@ -7,8 +7,8 @@ import io.autorender.core.RequestOptions import io.autorender.core.http.HttpResponse import io.autorender.core.http.HttpResponseFor import io.autorender.models.files.FileDeleteParams +import io.autorender.models.files.FileListPageAsync import io.autorender.models.files.FileListParams -import io.autorender.models.files.FileListResponse import io.autorender.models.files.FileRenameParams import io.autorender.models.files.FileRenameResponse import io.autorender.models.files.FileRetrieveParams @@ -67,20 +67,20 @@ interface FileServiceAsync { retrieve(fileNo, FileRetrieveParams.none(), requestOptions) /** List/search files with pagination, filtering, and sorting. */ - fun list(): CompletableFuture = list(FileListParams.none()) + fun list(): CompletableFuture = list(FileListParams.none()) /** @see list */ fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ - fun list(params: FileListParams = FileListParams.none()): CompletableFuture = + fun list(params: FileListParams = FileListParams.none()): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(FileListParams.none(), requestOptions) /** Delete file */ @@ -190,25 +190,25 @@ interface FileServiceAsync { * Returns a raw HTTP response for `get /api/v1/files`, but is otherwise the same as * [FileServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(FileListParams.none()) /** @see list */ fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: FileListParams = FileListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(FileListParams.none(), requestOptions) /** diff --git a/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsyncImpl.kt b/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsyncImpl.kt index 51fb0f7..1a1b689 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsyncImpl.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/services/async/FileServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import io.autorender.core.http.json import io.autorender.core.http.parseable import io.autorender.core.prepareAsync import io.autorender.models.files.FileDeleteParams +import io.autorender.models.files.FileListPageAsync +import io.autorender.models.files.FileListPageResponse import io.autorender.models.files.FileListParams -import io.autorender.models.files.FileListResponse import io.autorender.models.files.FileRenameParams import io.autorender.models.files.FileRenameResponse import io.autorender.models.files.FileRetrieveParams @@ -51,7 +52,7 @@ class FileServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun list( params: FileListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /api/v1/files withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -115,13 +116,13 @@ class FileServiceAsyncImpl internal constructor(private val clientOptions: Clien } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: FileListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -141,6 +142,14 @@ class FileServiceAsyncImpl internal constructor(private val clientOptions: Clien it.validate() } } + .let { + FileListPageAsync.builder() + .service(FileServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileService.kt b/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileService.kt index 17aae69..c90b4cb 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileService.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileService.kt @@ -8,8 +8,8 @@ import io.autorender.core.RequestOptions import io.autorender.core.http.HttpResponse import io.autorender.core.http.HttpResponseFor import io.autorender.models.files.FileDeleteParams +import io.autorender.models.files.FileListPage import io.autorender.models.files.FileListParams -import io.autorender.models.files.FileListResponse import io.autorender.models.files.FileRenameParams import io.autorender.models.files.FileRenameResponse import io.autorender.models.files.FileRetrieveParams @@ -62,20 +62,20 @@ interface FileService { retrieve(fileNo, FileRetrieveParams.none(), requestOptions) /** List/search files with pagination, filtering, and sorting. */ - fun list(): FileListResponse = list(FileListParams.none()) + fun list(): FileListPage = list(FileListParams.none()) /** @see list */ fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): FileListResponse + ): FileListPage /** @see list */ - fun list(params: FileListParams = FileListParams.none()): FileListResponse = + fun list(params: FileListParams = FileListParams.none()): FileListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): FileListResponse = + fun list(requestOptions: RequestOptions): FileListPage = list(FileListParams.none(), requestOptions) /** Delete file */ @@ -180,24 +180,23 @@ interface FileService { * Returns a raw HTTP response for `get /api/v1/files`, but is otherwise the same as * [FileService.list]. */ - @MustBeClosed fun list(): HttpResponseFor = list(FileListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(FileListParams.none()) /** @see list */ @MustBeClosed fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed - fun list( - params: FileListParams = FileListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + fun list(params: FileListParams = FileListParams.none()): HttpResponseFor = + list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(FileListParams.none(), requestOptions) /** diff --git a/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileServiceImpl.kt b/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileServiceImpl.kt index 43898e2..344e2e6 100644 --- a/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileServiceImpl.kt +++ b/autorender-java-core/src/main/kotlin/io/autorender/services/blocking/FileServiceImpl.kt @@ -18,8 +18,9 @@ import io.autorender.core.http.json import io.autorender.core.http.parseable import io.autorender.core.prepare import io.autorender.models.files.FileDeleteParams +import io.autorender.models.files.FileListPage +import io.autorender.models.files.FileListPageResponse import io.autorender.models.files.FileListParams -import io.autorender.models.files.FileListResponse import io.autorender.models.files.FileRenameParams import io.autorender.models.files.FileRenameResponse import io.autorender.models.files.FileRetrieveParams @@ -46,7 +47,7 @@ class FileServiceImpl internal constructor(private val clientOptions: ClientOpti // get /api/v1/files/{fileNo} withRawResponse().retrieve(params, requestOptions).parse() - override fun list(params: FileListParams, requestOptions: RequestOptions): FileListResponse = + override fun list(params: FileListParams, requestOptions: RequestOptions): FileListPage = // get /api/v1/files withRawResponse().list(params, requestOptions).parse() @@ -105,13 +106,13 @@ class FileServiceImpl internal constructor(private val clientOptions: ClientOpti } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: FileListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -129,6 +130,13 @@ class FileServiceImpl internal constructor(private val clientOptions: ClientOpti it.validate() } } + .let { + FileListPage.builder() + .service(FileServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerAsyncTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerAsyncTest.kt new file mode 100644 index 0000000..09db952 --- /dev/null +++ b/autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerAsyncTest.kt @@ -0,0 +1,182 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.core + +import io.autorender.core.http.AsyncStreamResponse +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.catchThrowable +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +import org.mockito.junit.jupiter.MockitoExtension +import org.mockito.kotlin.any +import org.mockito.kotlin.clearInvocations +import org.mockito.kotlin.doAnswer +import org.mockito.kotlin.inOrder +import org.mockito.kotlin.mock +import org.mockito.kotlin.never +import org.mockito.kotlin.spy +import org.mockito.kotlin.times +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever + +@ExtendWith(MockitoExtension::class) +internal class AutoPagerAsyncTest { + + companion object { + + private val ERROR = RuntimeException("ERROR!") + } + + private class PageAsyncImpl( + private val items: List, + private val hasNext: Boolean = true, + ) : PageAsync { + + val nextPageFuture: CompletableFuture> = CompletableFuture() + + override fun hasNextPage(): Boolean = hasNext + + override fun nextPage(): CompletableFuture> = nextPageFuture + + override fun items(): List = items + } + + private val executor = + spy { + doAnswer { invocation -> invocation.getArgument(0).run() } + .whenever(it) + .execute(any()) + } + private val handler = mock>() + + @Test + fun subscribe_whenAlreadySubscribed_throws() { + val autoPagerAsync = AutoPagerAsync.from(PageAsyncImpl(emptyList()), executor) + autoPagerAsync.subscribe {} + clearInvocations(executor) + + val throwable = catchThrowable { autoPagerAsync.subscribe {} } + + assertThat(throwable).isInstanceOf(IllegalStateException::class.java) + assertThat(throwable).hasMessage("Cannot subscribe more than once") + verify(executor, never()).execute(any()) + } + + @Test + fun subscribe_whenClosed_throws() { + val autoPagerAsync = AutoPagerAsync.from(PageAsyncImpl(emptyList()), executor) + autoPagerAsync.close() + + val throwable = catchThrowable { autoPagerAsync.subscribe {} } + + assertThat(throwable).isInstanceOf(IllegalStateException::class.java) + assertThat(throwable).hasMessage("Cannot subscribe after the response is closed") + verify(executor, never()).execute(any()) + } + + @Test + fun subscribe_whenFirstPageNonEmpty_runsHandler() { + val page = PageAsyncImpl(listOf("item1", "item2", "item3"), hasNext = false) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + + autoPagerAsync.subscribe(handler) + + inOrder(executor, handler) { + verify(executor, times(1)).execute(any()) + verify(handler, times(1)).onNext("item1") + verify(handler, times(1)).onNext("item2") + verify(handler, times(1)).onNext("item3") + verify(handler, times(1)).onComplete(Optional.empty()) + } + } + + @Test + fun subscribe_whenFutureCompletesAfterClose_doesNothing() { + val page = PageAsyncImpl(listOf("page1")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe(handler) + autoPagerAsync.close() + + page.nextPageFuture.complete(PageAsyncImpl(listOf("page2"))) + + verify(handler, times(1)).onNext("page1") + verify(handler, never()).onNext("page2") + verify(handler, times(1)).onComplete(Optional.empty()) + verify(executor, times(1)).execute(any()) + } + + @Test + fun subscribe_whenFutureErrors_callsOnComplete() { + val page = PageAsyncImpl(emptyList()) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe(handler) + + page.nextPageFuture.completeExceptionally(ERROR) + + verify(executor, times(1)).execute(any()) + verify(handler, never()).onNext(any()) + verify(handler, times(1)).onComplete(Optional.of(ERROR)) + } + + @Test + fun subscribe_whenFutureCompletes_runsHandler() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + + autoPagerAsync.subscribe(handler) + + verify(handler, never()).onComplete(any()) + inOrder(executor, handler) { + verify(executor, times(1)).execute(any()) + verify(handler, times(1)).onNext("chunk1") + verify(handler, times(1)).onNext("chunk2") + } + clearInvocations(executor, handler) + + page.nextPageFuture.complete(PageAsyncImpl(listOf("chunk3", "chunk4"), hasNext = false)) + + verify(executor, never()).execute(any()) + inOrder(handler) { + verify(handler, times(1)).onNext("chunk3") + verify(handler, times(1)).onNext("chunk4") + verify(handler, times(1)).onComplete(Optional.empty()) + } + } + + @Test + fun onCompleteFuture_whenNextPageFutureNotCompleted_onCompleteFutureNotCompleted() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe {} + + val onCompletableFuture = autoPagerAsync.onCompleteFuture() + + assertThat(onCompletableFuture).isNotCompleted + } + + @Test + fun onCompleteFuture_whenNextPageFutureErrors_onCompleteFutureCompletedExceptionally() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe {} + page.nextPageFuture.completeExceptionally(ERROR) + + val onCompletableFuture = autoPagerAsync.onCompleteFuture() + + assertThat(onCompletableFuture).isCompletedExceptionally + } + + @Test + fun onCompleteFuture_whenNoNextPage_onCompleteFutureCompleted() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2"), hasNext = false) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe {} + + val onCompletableFuture = autoPagerAsync.onCompleteFuture() + + assertThat(onCompletableFuture).isCompleted + } +} diff --git a/autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerTest.kt new file mode 100644 index 0000000..053fc5d --- /dev/null +++ b/autorender-java-core/src/test/kotlin/io/autorender/core/AutoPagerTest.kt @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.core + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class AutoPagerTest { + + private class PageImpl( + private val items: List, + private val nextPage: Page? = null, + ) : Page { + + override fun hasNextPage(): Boolean = nextPage != null + + override fun nextPage(): Page = nextPage!! + + override fun items(): List = items + } + + @Test + fun iterator() { + val firstPage = + PageImpl(listOf("chunk1", "chunk2"), nextPage = PageImpl(listOf("chunk3", "chunk4"))) + + val autoPager = AutoPager.from(firstPage) + + assertThat(autoPager).containsExactly("chunk1", "chunk2", "chunk3", "chunk4") + } + + @Test + fun stream() { + val firstPage = + PageImpl(listOf("chunk1", "chunk2"), nextPage = PageImpl(listOf("chunk3", "chunk4"))) + + val autoPager = AutoPager.from(firstPage) + + assertThat(autoPager.stream()).containsExactly("chunk1", "chunk2", "chunk3", "chunk4") + } +} diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListPageResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListPageResponseTest.kt new file mode 100644 index 0000000..db4052a --- /dev/null +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListPageResponseTest.kt @@ -0,0 +1,141 @@ +// File generated from our OpenAPI spec by Stainless. + +package io.autorender.models.files + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import io.autorender.core.JsonValue +import io.autorender.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FileListPageResponseTest { + + @Test + fun create() { + val fileListPageResponse = + FileListPageResponse.builder() + .addFile( + FileListResponse.builder() + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) + .metadata( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") + .addTag("string") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) + .build() + ) + .meta( + FileListPageResponse.Meta.builder() + .hasNext(true) + .hasPrev(true) + .limit(-9007199254740991L) + .page(-9007199254740991L) + .total(-9007199254740991L) + .build() + ) + .build() + + assertThat(fileListPageResponse.files()) + .containsExactly( + FileListResponse.builder() + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) + .metadata( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") + .addTag("string") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) + .build() + ) + assertThat(fileListPageResponse.meta()) + .isEqualTo( + FileListPageResponse.Meta.builder() + .hasNext(true) + .hasPrev(true) + .limit(-9007199254740991L) + .page(-9007199254740991L) + .total(-9007199254740991L) + .build() + ) + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val fileListPageResponse = + FileListPageResponse.builder() + .addFile( + FileListResponse.builder() + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) + .metadata( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") + .addTag("string") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) + .build() + ) + .meta( + FileListPageResponse.Meta.builder() + .hasNext(true) + .hasPrev(true) + .limit(-9007199254740991L) + .page(-9007199254740991L) + .total(-9007199254740991L) + .build() + ) + .build() + + val roundtrippedFileListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(fileListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFileListPageResponse).isEqualTo(fileListPageResponse) + } +} diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt index 1b1f07c..49ce6bd 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt @@ -15,78 +15,53 @@ internal class FileListResponseTest { fun create() { val fileListResponse = FileListResponse.builder() - .addFile( - FileListResponse.File.builder() - .id("id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileNo("file_no") - .folderName("folder_name") - .folderNo("folder_no") - .format("format") - .height(-9007199254740991L) - .metadata( - FileListResponse.File.Metadata.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .mimeType("mime_type") - .name("name") - .path("path") - .size(-9007199254740991L) - .source("source") - .addTag("string") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .url("url") - .width(-9007199254740991L) - .build() - ) - .meta( - FileListResponse.Meta.builder() - .hasNext(true) - .hasPrev(true) - .limit(-9007199254740991L) - .page(-9007199254740991L) - .total(-9007199254740991L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) + .metadata( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") + .addTag("string") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() - assertThat(fileListResponse.files()) - .containsExactly( - FileListResponse.File.builder() - .id("id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileNo("file_no") - .folderName("folder_name") - .folderNo("folder_no") - .format("format") - .height(-9007199254740991L) - .metadata( - FileListResponse.File.Metadata.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .mimeType("mime_type") - .name("name") - .path("path") - .size(-9007199254740991L) - .source("source") - .addTag("string") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .url("url") - .width(-9007199254740991L) - .build() - ) - assertThat(fileListResponse.meta()) - .isEqualTo( - FileListResponse.Meta.builder() - .hasNext(true) - .hasPrev(true) - .limit(-9007199254740991L) - .page(-9007199254740991L) - .total(-9007199254740991L) + assertThat(fileListResponse.id()).isEqualTo("id") + assertThat(fileListResponse.createdAt()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(fileListResponse.fileNo()).isEqualTo("file_no") + assertThat(fileListResponse.folderName()).contains("folder_name") + assertThat(fileListResponse.folderNo()).contains("folder_no") + assertThat(fileListResponse.format()).contains("format") + assertThat(fileListResponse.height()).contains(-9007199254740991L) + assertThat(fileListResponse.metadata()) + .contains( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) + assertThat(fileListResponse.mimeType()).isEqualTo("mime_type") + assertThat(fileListResponse.name()).isEqualTo("name") + assertThat(fileListResponse.path()).isEqualTo("path") + assertThat(fileListResponse.size()).isEqualTo(-9007199254740991L) + assertThat(fileListResponse.source()).isEqualTo("source") + assertThat(fileListResponse.tags()).containsExactly("string") + assertThat(fileListResponse.updatedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(fileListResponse.url()).isEqualTo("url") + assertThat(fileListResponse.width()).contains(-9007199254740991L) } @Test @@ -94,40 +69,27 @@ internal class FileListResponseTest { val jsonMapper = jsonMapper() val fileListResponse = FileListResponse.builder() - .addFile( - FileListResponse.File.builder() - .id("id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileNo("file_no") - .folderName("folder_name") - .folderNo("folder_no") - .format("format") - .height(-9007199254740991L) - .metadata( - FileListResponse.File.Metadata.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .mimeType("mime_type") - .name("name") - .path("path") - .size(-9007199254740991L) - .source("source") - .addTag("string") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .url("url") - .width(-9007199254740991L) - .build() - ) - .meta( - FileListResponse.Meta.builder() - .hasNext(true) - .hasPrev(true) - .limit(-9007199254740991L) - .page(-9007199254740991L) - .total(-9007199254740991L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) + .metadata( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") + .addTag("string") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() val roundtrippedFileListResponse = diff --git a/autorender-java-core/src/test/kotlin/io/autorender/services/ServiceParamsTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/services/ServiceParamsTest.kt index 744c051..d3b5146 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/services/ServiceParamsTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/services/ServiceParamsTest.kt @@ -77,11 +77,6 @@ internal class ServiceParamsTest { fileService.list( FileListParams.builder() - .folderNo("folder_no") - .limit(1L) - .page(1L) - .search("search") - .sort(FileListParams.Sort.NAME_ASC) .putAdditionalHeader("Secret-Header", "42") .putAdditionalQueryParam("secret_query_param", "42") .build() diff --git a/autorender-java-core/src/test/kotlin/io/autorender/services/async/FileServiceAsyncTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/services/async/FileServiceAsyncTest.kt index b9e21dc..9a1fc74 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/services/async/FileServiceAsyncTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/services/async/FileServiceAsyncTest.kt @@ -4,7 +4,6 @@ package io.autorender.services.async import io.autorender.TestServerExtension import io.autorender.client.okhttp.AutorenderOkHttpClientAsync -import io.autorender.models.files.FileListParams import io.autorender.models.files.FileRenameParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,19 +35,10 @@ internal class FileServiceAsyncTest { .build() val fileServiceAsync = client.files() - val filesFuture = - fileServiceAsync.list( - FileListParams.builder() - .folderNo("folder_no") - .limit(1L) - .page(1L) - .search("search") - .sort(FileListParams.Sort.NAME_ASC) - .build() - ) + val pageFuture = fileServiceAsync.list() - val files = filesFuture.get() - files.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/FileServiceTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/FileServiceTest.kt index 3f9fbb6..35ab757 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/FileServiceTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/services/blocking/FileServiceTest.kt @@ -4,7 +4,6 @@ package io.autorender.services.blocking import io.autorender.TestServerExtension import io.autorender.client.okhttp.AutorenderOkHttpClient -import io.autorender.models.files.FileListParams import io.autorender.models.files.FileRenameParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,18 +34,9 @@ internal class FileServiceTest { .build() val fileService = client.files() - val files = - fileService.list( - FileListParams.builder() - .folderNo("folder_no") - .limit(1L) - .page(1L) - .search("search") - .sort(FileListParams.Sort.NAME_ASC) - .build() - ) + val page = fileService.list() - files.validate() + page.response().validate() } @Test diff --git a/buildSrc/src/main/kotlin/autorender.publish.gradle.kts b/buildSrc/src/main/kotlin/autorender.publish.gradle.kts index b1bba25..ab1af19 100644 --- a/buildSrc/src/main/kotlin/autorender.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/autorender.publish.gradle.kts @@ -44,7 +44,7 @@ configure { pom { name.set("AutoRender Public API") description.set("REST API for uploading, managing, and serving media assets. All endpoints\nrequire an API key via the x-api-key header or Authorization: Bearer .") - url.set("https://autorender.mintlify.app/") + url.set("https://autorender.io/docs") licenses { license { diff --git a/scripts/mock b/scripts/mock index 80196ab..f898145 100755 --- a/scripts/mock +++ b/scripts/mock @@ -11,7 +11,7 @@ elif [ -n "$STAINLESS_OPENAPI_SPEC_URL" ]; then URL="$STAINLESS_OPENAPI_SPEC_URL" else # Embedded OpenAPI spec (base64-encoded, gzipped) - EMBEDDED_SPEC="H4sIAAAAAAAAA+1dW3PbuhH+KxhOH6ypLpTsnBNrOk19kqZNm0k8cfJSSdXA4krCMQnwAKBs1dZ/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Cn0fbLEq1KPVAcdj2rfmSHk7bspWzDGOzzZwbYOzDttektXuELZ3G/a1t6tzg+4rQ9PkbQ3XNf3Q/uKGrn2C174CNK1XaOnrr6B/g6M22z4K/rw5apDtEy94+2yP6bIMWFftEN4UmHm1T6GFmrU3bQrMusKEKG6p4kSzahipeTqii4PVsqMJC9OfQuDqI7lVA9PwSCQ454GCO4IYIecD9Kk/Q1IrqW15iecnOvEQv1anHkhtYrU/2OFMpY9Frp+9tauFEvRxYvw+YsBKofwczCFkcqfVCk5WzBVWnLCVjDcsXONW8AwNoEDNCpUBHZ+cf0BXMUaYWs6kuzSZ78HLFLtkIUzwBXcWdc1tuXqsceDvnOFz8H51lcs9SlQAA" SPEC_TMPFILE="$(mktemp)" trap 'rm -f "$SPEC_TMPFILE"' EXIT echo "$EMBEDDED_SPEC" | base64 --decode | gunzip > "$SPEC_TMPFILE" From 43e265f4d6cc4caf2f55239c6e447cadd311c422 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 7 Aug 2026 03:57:13 +0000 Subject: [PATCH 7/8] chore: strip internal workflows; preserve production-managed files --- .github/workflows/stlc-promote.yml | 88 ------------------- .../workflows/stlc-sync-from-production.yml | 80 ----------------- CHANGELOG.md | 86 ++++++++++++++++++ 3 files changed, 86 insertions(+), 168 deletions(-) delete mode 100644 .github/workflows/stlc-promote.yml delete mode 100644 .github/workflows/stlc-sync-from-production.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/stlc-promote.yml b/.github/workflows/stlc-promote.yml deleted file mode 100644 index d4e6215..0000000 --- a/.github/workflows/stlc-promote.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Promote SDKs - -on: - workflow_dispatch: - push: - branches: [main] - -permissions: - contents: read - -jobs: - promote: - runs-on: ubuntu-latest - if: github.repository == 'autorender/autorender-java-staging' - env: - PRODUCTION_REPO: autorender/autorender-java - GH_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }} - steps: - - name: Check out staging - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Fetch production main - run: | - git remote add production \ - "https://x-access-token:${GH_TOKEN}@github.com/${PRODUCTION_REPO}.git" - git fetch production main - - - name: Check if production is already in sync - id: diff - run: | - MERGED=$(git merge-tree --write-tree production/main origin/main 2>/dev/null) || MERGED=conflict - PRODUCTION_TREE=$(git rev-parse 'production/main^{tree}') - if [ "$MERGED" = "$PRODUCTION_TREE" ]; then - echo "Production already contains staging content. Nothing to release." - echo "synced=true" >> "$GITHUB_OUTPUT" - else - echo "synced=false" >> "$GITHUB_OUTPUT" - fi - - - name: Push staging main to the release branch on production - if: steps.diff.outputs.synced == 'false' - run: | - git push production origin/main:refs/heads/stainless/release --force - - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b stlc-patch-release origin/main - - # Strip staging-only workflows — must not exist in production - git rm -f .github/workflows/stlc-promote.yml \ - .github/workflows/stlc-sync-from-production.yml 2>/dev/null || true - - # Overlay files production owns so stlc regeneration never causes conflicts - for f in CHANGELOG.md gradle.properties; do - if git ls-tree production/main -- "$f" | grep -q .; then - PROD_BLOB=$(git ls-tree production/main -- "$f" | awk '{print $3}') - STAGE_BLOB=$(git ls-tree HEAD -- "$f" | awk '{print $3}') - if [ "$PROD_BLOB" != "$STAGE_BLOB" ]; then - git checkout production/main -- "$f" - fi - fi - done - - git commit -m "chore: strip internal workflows; preserve production-managed files" || true - git push production HEAD:refs/heads/stainless/release --force - - - name: Open or update the release PR on production - if: steps.diff.outputs.synced == 'false' - run: | - EXISTING_PR=$(gh pr list \ - --repo "${PRODUCTION_REPO}" \ - --head stainless/release \ - --state open \ - --json number \ - --jq '.[0].number') - if [ -z "${EXISTING_PR}" ]; then - gh pr create \ - --repo "${PRODUCTION_REPO}" \ - --base main \ - --head stainless/release \ - --title "Release SDK updates" \ - --body "$(git log --oneline production/main..origin/main)" - else - echo "Release PR #${EXISTING_PR} already exists. Force-push has updated it." - fi diff --git a/.github/workflows/stlc-sync-from-production.yml b/.github/workflows/stlc-sync-from-production.yml deleted file mode 100644 index ea72b9b..0000000 --- a/.github/workflows/stlc-sync-from-production.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Sync from production - -on: - schedule: - - cron: '0 */6 * * *' - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -jobs: - sync: - runs-on: ubuntu-latest - if: github.repository == 'autorender/autorender-java-staging' - env: - PRODUCTION_REPO: autorender/autorender-java - steps: - - name: Check out staging - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Fetch production main - env: - PRODUCTION_REPO_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }} - run: | - git remote add production \ - "https://x-access-token:${PRODUCTION_REPO_TOKEN}@github.com/${PRODUCTION_REPO}.git" - git fetch production main - - - name: Check if staging is behind production - id: check - run: | - MERGED=$(git merge-tree --write-tree origin/main production/main 2>/dev/null) || MERGED=conflict - STAGING_TREE=$(git rev-parse 'origin/main^{tree}') - if [ "$MERGED" = "$STAGING_TREE" ] || [ "$MERGED" = "conflict" ]; then - echo "Staging is up to date with production." - echo "needs_sync=false" >> "$GITHUB_OUTPUT" - else - echo "Production has commits not in staging. Back-sync needed." - echo "needs_sync=true" >> "$GITHUB_OUTPUT" - fi - - - name: Create back-sync branch and PR - if: steps.check.outputs.needs_sync == 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b stlc/from-prod - git merge production/main --no-edit -m "chore: sync release commits from production" - # Restore staging-only workflows stripped by the production overlay step - git checkout origin/main -- \ - .github/workflows/stlc-promote.yml \ - .github/workflows/stlc-sync-from-production.yml - git diff --cached --quiet || \ - git commit -m "chore: restore staging-only workflows after back-sync" - git remote set-url origin \ - "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" - git push origin stlc/from-prod --force - - EXISTING_PR=$(gh pr list \ - --repo "${{ github.repository }}" \ - --head stlc/from-prod \ - --state open \ - --json number \ - --jq '.[0].number') - if [ -z "${EXISTING_PR}" ]; then - gh pr create \ - --repo "${{ github.repository }}" \ - --base main \ - --head stlc/from-prod \ - --title "chore: sync release commits from production" \ - --body "Pulls version bump and changelog commits from production back to staging so the next stlc build reseals cleanly." - else - echo "Back-sync PR #${EXISTING_PR} already exists." - fi diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3de1a89 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,86 @@ +# Changelog + +## [0.1.2](https://github.com/autorender/autorender-java/compare/v0.1.1...v0.1.2) (2026-06-29) + + +### Chores + +* remove Stainless attribution from README and SECURITY ([4c839ff](https://github.com/autorender/autorender-java/commit/4c839ffd8ac8f49d033fcccd7b45cb355682edeb)) +* strip internal workflows; preserve production-managed files ([d7db835](https://github.com/autorender/autorender-java/commit/d7db835edad9054485f1681e0c8f50e1fc608f31)) + +## [0.1.1](https://github.com/autorender/autorender-java/compare/v0.1.0...v0.1.1) (2026-06-12) + + +### Bug Fixes + +* preserve production-managed files in release branch ([5f201f6](https://github.com/autorender/autorender-java/commit/5f201f628121874fcba612e72bdbad4e281312ee)) +* strip internal workflows from production release branch ([e22f717](https://github.com/autorender/autorender-java/commit/e22f71702056aebae1014511c6577f22aec98ccb)) +* update promote workflow and add back-sync from production ([ea351cb](https://github.com/autorender/autorender-java/commit/ea351cbb61e6d03c9cb5c981d310e9ab4036e4b2)) +* use blob comparison in overlay; add language-specific version files ([43eb184](https://github.com/autorender/autorender-java/commit/43eb18450e1120c831eeb531d2e8c57d2a2a47c5)) +* use persist-credentials: false in sync workflow ([bc21325](https://github.com/autorender/autorender-java/commit/bc21325184ef3a9b9888892bc561982fd538282b)) + + +### Chores + +* preserve production-managed files ([1a161c0](https://github.com/autorender/autorender-java/commit/1a161c02ba29c3896a148263c1aa244e5296266e)) +* remove staging-only workflows from production ([274d4bf](https://github.com/autorender/autorender-java/commit/274d4bf7f0d5e87a015b39fe1ba0fdce940a1bf4)) +* remove staging-only workflows from production ([e0aa612](https://github.com/autorender/autorender-java/commit/e0aa612fa59d094fc1a220c748fa6f54f211c17e)) +* strip internal workflows; preserve production-managed files ([8c90eef](https://github.com/autorender/autorender-java/commit/8c90eefa171972573cb2411be6a8f9c2526903ff)) + + +### Documentation + +* add auto-generated notice to CONTRIBUTING.md ([f05fd86](https://github.com/autorender/autorender-java/commit/f05fd86ee647fab2541d9d9cf53fb0a4be739232)) + +## [0.1.0](https://github.com/autorender/autorender-java/compare/v0.0.1...v0.1.0) (2026-06-05) + + +### Features + +* add stlc generate workflow and setup-stlc action ([46dcabc](https://github.com/autorender/autorender-java/commit/46dcabc3bf5f36c26501615579733b319e1bf3f5)) +* add test CI job ([b7e7e4b](https://github.com/autorender/autorender-java/commit/b7e7e4b5bae5806cf909e8b7fa3f92dcd8cdf966)) +* **api:** api update ([4a25743](https://github.com/autorender/autorender-java/commit/4a25743bc83d927d5da0f5256c423d2db71e46e7)) +* **api:** api update ([7618774](https://github.com/autorender/autorender-java/commit/761877438f3f9765636206285452768d6cedc983)) +* **api:** api update ([679128f](https://github.com/autorender/autorender-java/commit/679128f65767e2b4728510b42ffaf7239f0c7f29)) +* **api:** api update ([3398fa9](https://github.com/autorender/autorender-java/commit/3398fa964eea6575fb7122687ecfb1778eb4eb81)) +* **api:** api update ([fc9c207](https://github.com/autorender/autorender-java/commit/fc9c2075cd13fe74ae8d1b2402d40516c085baa2)) +* **api:** api update ([7954298](https://github.com/autorender/autorender-java/commit/795429833d8988cbf6fab813f05d6a8c4275c163)) +* **api:** api update ([8710a6b](https://github.com/autorender/autorender-java/commit/8710a6bfe1abc311dab028982aa6331195a12e19)) +* **api:** api update ([62e949a](https://github.com/autorender/autorender-java/commit/62e949af64533abc68ac8750df91cda9cdc5b89e)) +* **api:** api update ([ad8f968](https://github.com/autorender/autorender-java/commit/ad8f968403b0d4f2195c7ba93f398f626fca6f20)) +* **api:** api update ([6b95de0](https://github.com/autorender/autorender-java/commit/6b95de0048e5e37f32c1677d9732d3eac8b97af9)) +* **client:** improve logging ([d2ef3ca](https://github.com/autorender/autorender-java/commit/d2ef3ca911392de596039b3a60cc98c5ddcfed22)) +* **client:** more robust error parsing ([cc6c971](https://github.com/autorender/autorender-java/commit/cc6c971f614a3dfd67cc1fa6f3ec0222e264f9d7)) +* **client:** support proxy authentication ([6c88520](https://github.com/autorender/autorender-java/commit/6c88520c6ae3fbebd6c6047e9b4d5a6830663b62)) +* initial stlc build ([0289b62](https://github.com/autorender/autorender-java/commit/0289b6285d833947f012d2d256055581cfc01ab7)) +* **ruby:** enable rubygems publishing with release-please ([8133572](https://github.com/autorender/autorender-java/commit/813357209143c8227c7c910d651ff159446f3f39)) +* support setting headers via env ([3aa428c](https://github.com/autorender/autorender-java/commit/3aa428c03071d55fd63546c69eced73bb5299824)) + + +### Bug Fixes + +* switch ServiceParamsTest to multipart assertion ([2cb8ba5](https://github.com/autorender/autorender-java/commit/2cb8ba55ceea33b335db6663f8b35882ecdf2b3a)) +* **tests:** use multipart assertion for upload ServiceParamsTest ([12d3056](https://github.com/autorender/autorender-java/commit/12d3056a6bd82319c28af545bd94404de48f17c4)) + + +### Performance Improvements + +* **client:** create one json mapper ([ee277c8](https://github.com/autorender/autorender-java/commit/ee277c89d8422bf2976f12488588cddf4c32ede8)) + + +### Chores + +* redact api-key headers in debug logs ([9641f64](https://github.com/autorender/autorender-java/commit/9641f64d749020c22b49f6fe4af0492f0f6021e2)) +* remove duplicated dokka setup ([7b87515](https://github.com/autorender/autorender-java/commit/7b87515c337e05c660287b844b5e9bca52828cd7)) +* **tests:** bump steady to v0.22.1 ([0618328](https://github.com/autorender/autorender-java/commit/0618328091c5e9423c41194aa01ec9e96e1163dc)) +* trigger release-please ([a2d7ee2](https://github.com/autorender/autorender-java/commit/a2d7ee2d1dbcfe2503c80ca4c4e5fce966186d7f)) + + +### Documentation + +* clarify forwards compat behavior ([f018951](https://github.com/autorender/autorender-java/commit/f0189517d29331bcfea895be43b563542963085b)) + + +### Styles + +* format ServiceParamsTest per ktfmt ([500e625](https://github.com/autorender/autorender-java/commit/500e62518088f0ec1138c755862647656f1be97e)) From 0dd8517e2bff6ecf02caf53f7cd8ad2f9b316275 Mon Sep 17 00:00:00 2001 From: Vasanthakumar RB Date: Fri, 7 Aug 2026 09:46:54 +0530 Subject: [PATCH 8/8] fix: keep generated file response tests --- .../models/files/FileListResponseTest.kt | 158 +++++++----------- 1 file changed, 60 insertions(+), 98 deletions(-) diff --git a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt index 1b1f07c..49ce6bd 100644 --- a/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt +++ b/autorender-java-core/src/test/kotlin/io/autorender/models/files/FileListResponseTest.kt @@ -15,78 +15,53 @@ internal class FileListResponseTest { fun create() { val fileListResponse = FileListResponse.builder() - .addFile( - FileListResponse.File.builder() - .id("id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileNo("file_no") - .folderName("folder_name") - .folderNo("folder_no") - .format("format") - .height(-9007199254740991L) - .metadata( - FileListResponse.File.Metadata.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .mimeType("mime_type") - .name("name") - .path("path") - .size(-9007199254740991L) - .source("source") - .addTag("string") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .url("url") - .width(-9007199254740991L) - .build() - ) - .meta( - FileListResponse.Meta.builder() - .hasNext(true) - .hasPrev(true) - .limit(-9007199254740991L) - .page(-9007199254740991L) - .total(-9007199254740991L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) + .metadata( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") + .addTag("string") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() - assertThat(fileListResponse.files()) - .containsExactly( - FileListResponse.File.builder() - .id("id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileNo("file_no") - .folderName("folder_name") - .folderNo("folder_no") - .format("format") - .height(-9007199254740991L) - .metadata( - FileListResponse.File.Metadata.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .mimeType("mime_type") - .name("name") - .path("path") - .size(-9007199254740991L) - .source("source") - .addTag("string") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .url("url") - .width(-9007199254740991L) - .build() - ) - assertThat(fileListResponse.meta()) - .isEqualTo( - FileListResponse.Meta.builder() - .hasNext(true) - .hasPrev(true) - .limit(-9007199254740991L) - .page(-9007199254740991L) - .total(-9007199254740991L) + assertThat(fileListResponse.id()).isEqualTo("id") + assertThat(fileListResponse.createdAt()) + .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(fileListResponse.fileNo()).isEqualTo("file_no") + assertThat(fileListResponse.folderName()).contains("folder_name") + assertThat(fileListResponse.folderNo()).contains("folder_no") + assertThat(fileListResponse.format()).contains("format") + assertThat(fileListResponse.height()).contains(-9007199254740991L) + assertThat(fileListResponse.metadata()) + .contains( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) + assertThat(fileListResponse.mimeType()).isEqualTo("mime_type") + assertThat(fileListResponse.name()).isEqualTo("name") + assertThat(fileListResponse.path()).isEqualTo("path") + assertThat(fileListResponse.size()).isEqualTo(-9007199254740991L) + assertThat(fileListResponse.source()).isEqualTo("source") + assertThat(fileListResponse.tags()).containsExactly("string") + assertThat(fileListResponse.updatedAt()) + .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(fileListResponse.url()).isEqualTo("url") + assertThat(fileListResponse.width()).contains(-9007199254740991L) } @Test @@ -94,40 +69,27 @@ internal class FileListResponseTest { val jsonMapper = jsonMapper() val fileListResponse = FileListResponse.builder() - .addFile( - FileListResponse.File.builder() - .id("id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileNo("file_no") - .folderName("folder_name") - .folderNo("folder_no") - .format("format") - .height(-9007199254740991L) - .metadata( - FileListResponse.File.Metadata.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .mimeType("mime_type") - .name("name") - .path("path") - .size(-9007199254740991L) - .source("source") - .addTag("string") - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .url("url") - .width(-9007199254740991L) - .build() - ) - .meta( - FileListResponse.Meta.builder() - .hasNext(true) - .hasPrev(true) - .limit(-9007199254740991L) - .page(-9007199254740991L) - .total(-9007199254740991L) + .id("id") + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .fileNo("file_no") + .folderName("folder_name") + .folderNo("folder_no") + .format("format") + .height(-9007199254740991L) + .metadata( + FileListResponse.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) + .mimeType("mime_type") + .name("name") + .path("path") + .size(-9007199254740991L) + .source("source") + .addTag("string") + .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .url("url") + .width(-9007199254740991L) .build() val roundtrippedFileListResponse =