diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index dc563e0..3aac699 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,6 +7,10 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
+ pull_request:
+ branches-ignore:
+ - 'stl-preview-head/**'
+ - 'stl-preview-base/**'
jobs:
lint:
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index aaf968a..b56c3d0 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.3"
+ ".": "0.1.0-alpha.4"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index e5a78c5..f0d7da7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 7
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-103a28182099d9866bc8c40db00f3356fe5be36302874e7ee84ee4fd2f593859.yml
-openapi_spec_hash: 30241efa79f9aab6e430c29383d9a2cf
-config_hash: 4ab8d35881cc0191126ff443317e03ba
+configured_endpoints: 10
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-3f6d4c0f819a0d3128951d315ad216df22050fbc47c5f601d261d56f8b1d80a5.yml
+openapi_spec_hash: 8e7953259a1b6bd7440a780eccad1742
+config_hash: 8f3ee44d690a305369555016a77ed016
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 131d2cf..f208513 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,19 @@
# Changelog
+## 0.1.0-alpha.4 (2025-06-19)
+
+Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/brand-dot-dev/java-sdk/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
+
+### Features
+
+* **api:** manual updates ([5d445e8](https://github.com/brand-dot-dev/java-sdk/commit/5d445e85b7a5c05acbdcebaf4f3e2e7ed5c9f909))
+* **api:** manual updates ([8b819ae](https://github.com/brand-dot-dev/java-sdk/commit/8b819ae77d457e0d8cd987f3e83c8070e25e2c13))
+
+
+### Chores
+
+* **ci:** enable for pull requests ([393159f](https://github.com/brand-dot-dev/java-sdk/commit/393159f9bc12a5bb89dd42305ab6601f781a2c29))
+
## 0.1.0-alpha.3 (2025-06-13)
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/brand-dot-dev/java-sdk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
diff --git a/README.md b/README.md
index b39c707..8d0e28b 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.branddev.api/brand-dev-java/0.1.0-alpha.3)
-[](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.3)
+[](https://central.sonatype.com/artifact/com.branddev.api/brand-dev-java/0.1.0-alpha.4)
+[](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.4)
@@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/).
-Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.3).
+Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.4).
@@ -24,7 +24,7 @@ Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.branddev.api/b
### Gradle
```kotlin
-implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.3")
+implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.4")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.3")
com.branddev.api
brand-dev-java
- 0.1.0-alpha.3
+ 0.1.0-alpha.4
```
diff --git a/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandRetrieveSimplifiedParams.kt b/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandRetrieveSimplifiedParams.kt
new file mode 100644
index 0000000..bd09908
--- /dev/null
+++ b/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandRetrieveSimplifiedParams.kt
@@ -0,0 +1,234 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.branddev.api.models.brand
+
+import com.branddev.api.core.Params
+import com.branddev.api.core.checkRequired
+import com.branddev.api.core.http.Headers
+import com.branddev.api.core.http.QueryParams
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Returns a simplified version of brand data containing only essential information: domain, title,
+ * colors, logos, and backdrops. This endpoint is optimized for faster responses and reduced data
+ * transfer.
+ */
+class BrandRetrieveSimplifiedParams
+private constructor(
+ private val domain: String,
+ private val timeoutMs: Long?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /** Domain name to retrieve simplified brand data for */
+ fun domain(): String = domain
+
+ /**
+ * Optional timeout in milliseconds for the request. If the request takes longer than this
+ * value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5
+ * minutes).
+ */
+ fun timeoutMs(): Optional = Optional.ofNullable(timeoutMs)
+
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [BrandRetrieveSimplifiedParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .domain()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BrandRetrieveSimplifiedParams]. */
+ class Builder internal constructor() {
+
+ private var domain: String? = null
+ private var timeoutMs: Long? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(brandRetrieveSimplifiedParams: BrandRetrieveSimplifiedParams) = apply {
+ domain = brandRetrieveSimplifiedParams.domain
+ timeoutMs = brandRetrieveSimplifiedParams.timeoutMs
+ additionalHeaders = brandRetrieveSimplifiedParams.additionalHeaders.toBuilder()
+ additionalQueryParams = brandRetrieveSimplifiedParams.additionalQueryParams.toBuilder()
+ }
+
+ /** Domain name to retrieve simplified brand data for */
+ fun domain(domain: String) = apply { this.domain = domain }
+
+ /**
+ * Optional timeout in milliseconds for the request. If the request takes longer than this
+ * value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5
+ * minutes).
+ */
+ fun timeoutMs(timeoutMs: Long?) = apply { this.timeoutMs = timeoutMs }
+
+ /**
+ * Alias for [Builder.timeoutMs].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun timeoutMs(timeoutMs: Long) = timeoutMs(timeoutMs as Long?)
+
+ /** Alias for calling [Builder.timeoutMs] with `timeoutMs.orElse(null)`. */
+ fun timeoutMs(timeoutMs: Optional) = timeoutMs(timeoutMs.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [BrandRetrieveSimplifiedParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .domain()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): BrandRetrieveSimplifiedParams =
+ BrandRetrieveSimplifiedParams(
+ checkRequired("domain", domain),
+ timeoutMs,
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams =
+ QueryParams.builder()
+ .apply {
+ put("domain", domain)
+ timeoutMs?.let { put("timeoutMS", it.toString()) }
+ putAll(additionalQueryParams)
+ }
+ .build()
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is BrandRetrieveSimplifiedParams && domain == other.domain && timeoutMs == other.timeoutMs && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(domain, timeoutMs, additionalHeaders, additionalQueryParams) /* spotless:on */
+
+ override fun toString() =
+ "BrandRetrieveSimplifiedParams{domain=$domain, timeoutMs=$timeoutMs, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandRetrieveSimplifiedResponse.kt b/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandRetrieveSimplifiedResponse.kt
new file mode 100644
index 0000000..9ca3a72
--- /dev/null
+++ b/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandRetrieveSimplifiedResponse.kt
@@ -0,0 +1,2130 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.branddev.api.models.brand
+
+import com.branddev.api.core.ExcludeMissing
+import com.branddev.api.core.JsonField
+import com.branddev.api.core.JsonMissing
+import com.branddev.api.core.JsonValue
+import com.branddev.api.core.checkKnown
+import com.branddev.api.core.toImmutable
+import com.branddev.api.errors.BrandDevInvalidDataException
+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 java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+class BrandRetrieveSimplifiedResponse
+private constructor(
+ private val brand: JsonField,
+ private val code: JsonField,
+ private val status: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("brand") @ExcludeMissing brand: JsonField = JsonMissing.of(),
+ @JsonProperty("code") @ExcludeMissing code: JsonField = JsonMissing.of(),
+ @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
+ ) : this(brand, code, status, mutableMapOf())
+
+ /**
+ * Simplified brand information
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun brand(): Optional = brand.getOptional("brand")
+
+ /**
+ * HTTP status code of the response
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun code(): Optional = code.getOptional("code")
+
+ /**
+ * Status of the response, e.g., 'ok'
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun status(): Optional = status.getOptional("status")
+
+ /**
+ * Returns the raw JSON value of [brand].
+ *
+ * Unlike [brand], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("brand") @ExcludeMissing fun _brand(): JsonField = brand
+
+ /**
+ * Returns the raw JSON value of [code].
+ *
+ * Unlike [code], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("code") @ExcludeMissing fun _code(): JsonField = code
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ @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
+ * [BrandRetrieveSimplifiedResponse].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BrandRetrieveSimplifiedResponse]. */
+ class Builder internal constructor() {
+
+ private var brand: JsonField = JsonMissing.of()
+ private var code: JsonField = JsonMissing.of()
+ private var status: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(brandRetrieveSimplifiedResponse: BrandRetrieveSimplifiedResponse) =
+ apply {
+ brand = brandRetrieveSimplifiedResponse.brand
+ code = brandRetrieveSimplifiedResponse.code
+ status = brandRetrieveSimplifiedResponse.status
+ additionalProperties =
+ brandRetrieveSimplifiedResponse.additionalProperties.toMutableMap()
+ }
+
+ /** Simplified brand information */
+ fun brand(brand: Brand) = brand(JsonField.of(brand))
+
+ /**
+ * Sets [Builder.brand] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.brand] with a well-typed [Brand] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun brand(brand: JsonField) = apply { this.brand = brand }
+
+ /** HTTP status code of the response */
+ fun code(code: Long) = code(JsonField.of(code))
+
+ /**
+ * Sets [Builder.code] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.code] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun code(code: JsonField) = apply { this.code = code }
+
+ /** Status of the response, e.g., 'ok' */
+ fun status(status: String) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ 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 [BrandRetrieveSimplifiedResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): BrandRetrieveSimplifiedResponse =
+ BrandRetrieveSimplifiedResponse(
+ brand,
+ code,
+ status,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): BrandRetrieveSimplifiedResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ brand().ifPresent { it.validate() }
+ code()
+ status()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 =
+ (brand.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (code.asKnown().isPresent) 1 else 0) +
+ (if (status.asKnown().isPresent) 1 else 0)
+
+ /** Simplified brand information */
+ class Brand
+ private constructor(
+ private val backdrops: JsonField>,
+ private val colors: JsonField>,
+ private val domain: JsonField,
+ private val logos: JsonField>,
+ private val title: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("backdrops")
+ @ExcludeMissing
+ backdrops: JsonField> = JsonMissing.of(),
+ @JsonProperty("colors")
+ @ExcludeMissing
+ colors: JsonField> = JsonMissing.of(),
+ @JsonProperty("domain") @ExcludeMissing domain: JsonField = JsonMissing.of(),
+ @JsonProperty("logos") @ExcludeMissing logos: JsonField> = JsonMissing.of(),
+ @JsonProperty("title") @ExcludeMissing title: JsonField = JsonMissing.of(),
+ ) : this(backdrops, colors, domain, logos, title, mutableMapOf())
+
+ /**
+ * An array of backdrop images for the brand
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun backdrops(): Optional> = backdrops.getOptional("backdrops")
+
+ /**
+ * An array of brand colors
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun colors(): Optional> = colors.getOptional("colors")
+
+ /**
+ * The domain name of the brand
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun domain(): Optional = domain.getOptional("domain")
+
+ /**
+ * An array of logos associated with the brand
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun logos(): Optional> = logos.getOptional("logos")
+
+ /**
+ * The title or name of the brand
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun title(): Optional = title.getOptional("title")
+
+ /**
+ * Returns the raw JSON value of [backdrops].
+ *
+ * Unlike [backdrops], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("backdrops")
+ @ExcludeMissing
+ fun _backdrops(): JsonField> = backdrops
+
+ /**
+ * Returns the raw JSON value of [colors].
+ *
+ * Unlike [colors], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("colors") @ExcludeMissing fun _colors(): JsonField> = colors
+
+ /**
+ * Returns the raw JSON value of [domain].
+ *
+ * Unlike [domain], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("domain") @ExcludeMissing fun _domain(): JsonField = domain
+
+ /**
+ * Returns the raw JSON value of [logos].
+ *
+ * Unlike [logos], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("logos") @ExcludeMissing fun _logos(): JsonField> = logos
+
+ /**
+ * Returns the raw JSON value of [title].
+ *
+ * Unlike [title], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title
+
+ @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 [Brand]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Brand]. */
+ class Builder internal constructor() {
+
+ private var backdrops: JsonField>? = null
+ private var colors: JsonField>? = null
+ private var domain: JsonField = JsonMissing.of()
+ private var logos: JsonField>? = null
+ private var title: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(brand: Brand) = apply {
+ backdrops = brand.backdrops.map { it.toMutableList() }
+ colors = brand.colors.map { it.toMutableList() }
+ domain = brand.domain
+ logos = brand.logos.map { it.toMutableList() }
+ title = brand.title
+ additionalProperties = brand.additionalProperties.toMutableMap()
+ }
+
+ /** An array of backdrop images for the brand */
+ fun backdrops(backdrops: List) = backdrops(JsonField.of(backdrops))
+
+ /**
+ * Sets [Builder.backdrops] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.backdrops] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun backdrops(backdrops: JsonField>) = apply {
+ this.backdrops = backdrops.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Backdrop] to [backdrops].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addBackdrop(backdrop: Backdrop) = apply {
+ backdrops =
+ (backdrops ?: JsonField.of(mutableListOf())).also {
+ checkKnown("backdrops", it).add(backdrop)
+ }
+ }
+
+ /** An array of brand colors */
+ fun colors(colors: List) = colors(JsonField.of(colors))
+
+ /**
+ * Sets [Builder.colors] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.colors] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun colors(colors: JsonField>) = apply {
+ this.colors = colors.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Color] to [colors].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addColor(color: Color) = apply {
+ colors =
+ (colors ?: JsonField.of(mutableListOf())).also {
+ checkKnown("colors", it).add(color)
+ }
+ }
+
+ /** The domain name of the brand */
+ fun domain(domain: String) = domain(JsonField.of(domain))
+
+ /**
+ * Sets [Builder.domain] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.domain] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun domain(domain: JsonField) = apply { this.domain = domain }
+
+ /** An array of logos associated with the brand */
+ fun logos(logos: List) = logos(JsonField.of(logos))
+
+ /**
+ * Sets [Builder.logos] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.logos] with a well-typed `List` value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun logos(logos: JsonField>) = apply {
+ this.logos = logos.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Logo] to [logos].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addLogo(logo: Logo) = apply {
+ logos =
+ (logos ?: JsonField.of(mutableListOf())).also {
+ checkKnown("logos", it).add(logo)
+ }
+ }
+
+ /** The title or name of the brand */
+ fun title(title: String) = title(JsonField.of(title))
+
+ /**
+ * Sets [Builder.title] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.title] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun title(title: JsonField) = apply { this.title = title }
+
+ 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 [Brand].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Brand =
+ Brand(
+ (backdrops ?: JsonMissing.of()).map { it.toImmutable() },
+ (colors ?: JsonMissing.of()).map { it.toImmutable() },
+ domain,
+ (logos ?: JsonMissing.of()).map { it.toImmutable() },
+ title,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Brand = apply {
+ if (validated) {
+ return@apply
+ }
+
+ backdrops().ifPresent { it.forEach { it.validate() } }
+ colors().ifPresent { it.forEach { it.validate() } }
+ domain()
+ logos().ifPresent { it.forEach { it.validate() } }
+ title()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 =
+ (backdrops.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (colors.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (domain.asKnown().isPresent) 1 else 0) +
+ (logos.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (title.asKnown().isPresent) 1 else 0)
+
+ class Backdrop
+ private constructor(
+ private val colors: JsonField>,
+ private val resolution: JsonField,
+ private val url: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("colors")
+ @ExcludeMissing
+ colors: JsonField> = JsonMissing.of(),
+ @JsonProperty("resolution")
+ @ExcludeMissing
+ resolution: JsonField = JsonMissing.of(),
+ @JsonProperty("url") @ExcludeMissing url: JsonField = JsonMissing.of(),
+ ) : this(colors, resolution, url, mutableMapOf())
+
+ /**
+ * Array of colors in the backdrop image
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun colors(): Optional> = colors.getOptional("colors")
+
+ /**
+ * Resolution of the backdrop image
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun resolution(): Optional = resolution.getOptional("resolution")
+
+ /**
+ * URL of the backdrop image
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun url(): Optional = url.getOptional("url")
+
+ /**
+ * Returns the raw JSON value of [colors].
+ *
+ * Unlike [colors], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("colors") @ExcludeMissing fun _colors(): JsonField> = colors
+
+ /**
+ * Returns the raw JSON value of [resolution].
+ *
+ * Unlike [resolution], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("resolution")
+ @ExcludeMissing
+ fun _resolution(): JsonField = resolution
+
+ /**
+ * 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
+
+ @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 [Backdrop]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Backdrop]. */
+ class Builder internal constructor() {
+
+ private var colors: JsonField>? = null
+ private var resolution: JsonField = JsonMissing.of()
+ private var url: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(backdrop: Backdrop) = apply {
+ colors = backdrop.colors.map { it.toMutableList() }
+ resolution = backdrop.resolution
+ url = backdrop.url
+ additionalProperties = backdrop.additionalProperties.toMutableMap()
+ }
+
+ /** Array of colors in the backdrop image */
+ fun colors(colors: List) = colors(JsonField.of(colors))
+
+ /**
+ * Sets [Builder.colors] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.colors] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun colors(colors: JsonField>) = apply {
+ this.colors = colors.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Color] to [colors].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addColor(color: Color) = apply {
+ colors =
+ (colors ?: JsonField.of(mutableListOf())).also {
+ checkKnown("colors", it).add(color)
+ }
+ }
+
+ /** Resolution of the backdrop image */
+ fun resolution(resolution: Resolution) = resolution(JsonField.of(resolution))
+
+ /**
+ * Sets [Builder.resolution] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.resolution] with a well-typed [Resolution] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun resolution(resolution: JsonField) = apply {
+ this.resolution = resolution
+ }
+
+ /** URL of the backdrop image */
+ fun url(url: String) = url(JsonField.of(url))
+
+ /**
+ * 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 }
+
+ 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 [Backdrop].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Backdrop =
+ Backdrop(
+ (colors ?: JsonMissing.of()).map { it.toImmutable() },
+ resolution,
+ url,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Backdrop = apply {
+ if (validated) {
+ return@apply
+ }
+
+ colors().ifPresent { it.forEach { it.validate() } }
+ resolution().ifPresent { it.validate() }
+ url()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 =
+ (colors.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (resolution.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (url.asKnown().isPresent) 1 else 0)
+
+ class Color
+ private constructor(
+ private val hex: JsonField,
+ private val name: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("hex") @ExcludeMissing hex: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ ) : this(hex, name, mutableMapOf())
+
+ /**
+ * Color in hexadecimal format
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun hex(): Optional = hex.getOptional("hex")
+
+ /**
+ * Name of the color
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun name(): Optional = name.getOptional("name")
+
+ /**
+ * Returns the raw JSON value of [hex].
+ *
+ * Unlike [hex], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("hex") @ExcludeMissing fun _hex(): JsonField = hex
+
+ /**
+ * 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
+
+ @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 [Color]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Color]. */
+ class Builder internal constructor() {
+
+ private var hex: JsonField = JsonMissing.of()
+ private var name: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(color: Color) = apply {
+ hex = color.hex
+ name = color.name
+ additionalProperties = color.additionalProperties.toMutableMap()
+ }
+
+ /** Color in hexadecimal format */
+ fun hex(hex: String) = hex(JsonField.of(hex))
+
+ /**
+ * Sets [Builder.hex] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.hex] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun hex(hex: JsonField) = apply { this.hex = hex }
+
+ /** Name of the color */
+ 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 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 [Color].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Color = Color(hex, name, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Color = apply {
+ if (validated) {
+ return@apply
+ }
+
+ hex()
+ name()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 (hex.asKnown().isPresent) 1 else 0) +
+ (if (name.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Color && hex == other.hex && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(hex, name, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Color{hex=$hex, name=$name, additionalProperties=$additionalProperties}"
+ }
+
+ /** Resolution of the backdrop image */
+ class Resolution
+ private constructor(
+ private val aspectRatio: JsonField,
+ private val height: JsonField,
+ private val width: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("aspect_ratio")
+ @ExcludeMissing
+ aspectRatio: JsonField = JsonMissing.of(),
+ @JsonProperty("height")
+ @ExcludeMissing
+ height: JsonField = JsonMissing.of(),
+ @JsonProperty("width") @ExcludeMissing width: JsonField = JsonMissing.of(),
+ ) : this(aspectRatio, height, width, mutableMapOf())
+
+ /**
+ * Aspect ratio of the image (width/height)
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun aspectRatio(): Optional = aspectRatio.getOptional("aspect_ratio")
+
+ /**
+ * Height of the image in pixels
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun height(): Optional = height.getOptional("height")
+
+ /**
+ * Width of the image in pixels
+ *
+ * @throws BrandDevInvalidDataException 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 [aspectRatio].
+ *
+ * Unlike [aspectRatio], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("aspect_ratio")
+ @ExcludeMissing
+ fun _aspectRatio(): JsonField = aspectRatio
+
+ /**
+ * 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 [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 [Resolution]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Resolution]. */
+ class Builder internal constructor() {
+
+ private var aspectRatio: JsonField = JsonMissing.of()
+ private var height: JsonField = JsonMissing.of()
+ private var width: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(resolution: Resolution) = apply {
+ aspectRatio = resolution.aspectRatio
+ height = resolution.height
+ width = resolution.width
+ additionalProperties = resolution.additionalProperties.toMutableMap()
+ }
+
+ /** Aspect ratio of the image (width/height) */
+ fun aspectRatio(aspectRatio: Double) = aspectRatio(JsonField.of(aspectRatio))
+
+ /**
+ * Sets [Builder.aspectRatio] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.aspectRatio] with a well-typed [Double]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun aspectRatio(aspectRatio: JsonField) = apply {
+ this.aspectRatio = aspectRatio
+ }
+
+ /** Height of the image in pixels */
+ fun height(height: Long) = height(JsonField.of(height))
+
+ /**
+ * 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 }
+
+ /** Width of the image in pixels */
+ fun width(width: Long) = width(JsonField.of(width))
+
+ /**
+ * 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 }
+
+ 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 [Resolution].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Resolution =
+ Resolution(aspectRatio, height, width, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Resolution = apply {
+ if (validated) {
+ return@apply
+ }
+
+ aspectRatio()
+ height()
+ width()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 (aspectRatio.asKnown().isPresent) 1 else 0) +
+ (if (height.asKnown().isPresent) 1 else 0) +
+ (if (width.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Resolution && aspectRatio == other.aspectRatio && height == other.height && width == other.width && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(aspectRatio, height, width, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Resolution{aspectRatio=$aspectRatio, height=$height, width=$width, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Backdrop && colors == other.colors && resolution == other.resolution && url == other.url && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(colors, resolution, url, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Backdrop{colors=$colors, resolution=$resolution, url=$url, additionalProperties=$additionalProperties}"
+ }
+
+ class Color
+ private constructor(
+ private val hex: JsonField,
+ private val name: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("hex") @ExcludeMissing hex: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ ) : this(hex, name, mutableMapOf())
+
+ /**
+ * Color in hexadecimal format
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun hex(): Optional = hex.getOptional("hex")
+
+ /**
+ * Name of the color
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun name(): Optional = name.getOptional("name")
+
+ /**
+ * Returns the raw JSON value of [hex].
+ *
+ * Unlike [hex], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("hex") @ExcludeMissing fun _hex(): JsonField = hex
+
+ /**
+ * 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
+
+ @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 [Color]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Color]. */
+ class Builder internal constructor() {
+
+ private var hex: JsonField = JsonMissing.of()
+ private var name: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(color: Color) = apply {
+ hex = color.hex
+ name = color.name
+ additionalProperties = color.additionalProperties.toMutableMap()
+ }
+
+ /** Color in hexadecimal format */
+ fun hex(hex: String) = hex(JsonField.of(hex))
+
+ /**
+ * Sets [Builder.hex] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.hex] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun hex(hex: JsonField) = apply { this.hex = hex }
+
+ /** Name of the color */
+ 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 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 [Color].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Color = Color(hex, name, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Color = apply {
+ if (validated) {
+ return@apply
+ }
+
+ hex()
+ name()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 (hex.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Color && hex == other.hex && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(hex, name, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Color{hex=$hex, name=$name, additionalProperties=$additionalProperties}"
+ }
+
+ class Logo
+ private constructor(
+ private val colors: JsonField>,
+ private val group: JsonField,
+ private val mode: JsonField,
+ private val resolution: JsonField,
+ private val type: JsonField,
+ private val url: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("colors")
+ @ExcludeMissing
+ colors: JsonField> = JsonMissing.of(),
+ @JsonProperty("group") @ExcludeMissing group: JsonField = JsonMissing.of(),
+ @JsonProperty("mode") @ExcludeMissing mode: JsonField = JsonMissing.of(),
+ @JsonProperty("resolution")
+ @ExcludeMissing
+ resolution: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ @JsonProperty("url") @ExcludeMissing url: JsonField = JsonMissing.of(),
+ ) : this(colors, group, mode, resolution, type, url, mutableMapOf())
+
+ /**
+ * Array of colors in the logo
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun colors(): Optional> = colors.getOptional("colors")
+
+ /**
+ * Group identifier for logos
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun group(): Optional = group.getOptional("group")
+
+ /**
+ * Mode of the logo, e.g., 'dark', 'light'
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun mode(): Optional = mode.getOptional("mode")
+
+ /**
+ * Resolution of the logo image
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun resolution(): Optional = resolution.getOptional("resolution")
+
+ /**
+ * Type of the logo based on resolution (e.g., 'icon', 'logo', 'banner')
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun type(): Optional = type.getOptional("type")
+
+ /**
+ * URL of the logo image
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun url(): Optional = url.getOptional("url")
+
+ /**
+ * Returns the raw JSON value of [colors].
+ *
+ * Unlike [colors], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("colors") @ExcludeMissing fun _colors(): JsonField> = colors
+
+ /**
+ * Returns the raw JSON value of [group].
+ *
+ * Unlike [group], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("group") @ExcludeMissing fun _group(): JsonField = group
+
+ /**
+ * Returns the raw JSON value of [mode].
+ *
+ * Unlike [mode], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("mode") @ExcludeMissing fun _mode(): JsonField = mode
+
+ /**
+ * Returns the raw JSON value of [resolution].
+ *
+ * Unlike [resolution], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("resolution")
+ @ExcludeMissing
+ fun _resolution(): JsonField = resolution
+
+ /**
+ * Returns the raw JSON value of [type].
+ *
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+
+ /**
+ * 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
+
+ @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 [Logo]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Logo]. */
+ class Builder internal constructor() {
+
+ private var colors: JsonField>? = null
+ private var group: JsonField = JsonMissing.of()
+ private var mode: JsonField = JsonMissing.of()
+ private var resolution: JsonField = JsonMissing.of()
+ private var type: JsonField = JsonMissing.of()
+ private var url: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(logo: Logo) = apply {
+ colors = logo.colors.map { it.toMutableList() }
+ group = logo.group
+ mode = logo.mode
+ resolution = logo.resolution
+ type = logo.type
+ url = logo.url
+ additionalProperties = logo.additionalProperties.toMutableMap()
+ }
+
+ /** Array of colors in the logo */
+ fun colors(colors: List) = colors(JsonField.of(colors))
+
+ /**
+ * Sets [Builder.colors] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.colors] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun colors(colors: JsonField>) = apply {
+ this.colors = colors.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Color] to [colors].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addColor(color: Color) = apply {
+ colors =
+ (colors ?: JsonField.of(mutableListOf())).also {
+ checkKnown("colors", it).add(color)
+ }
+ }
+
+ /** Group identifier for logos */
+ fun group(group: Long) = group(JsonField.of(group))
+
+ /**
+ * Sets [Builder.group] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.group] with a well-typed [Long] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun group(group: JsonField) = apply { this.group = group }
+
+ /** Mode of the logo, e.g., 'dark', 'light' */
+ fun mode(mode: String) = mode(JsonField.of(mode))
+
+ /**
+ * Sets [Builder.mode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.mode] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun mode(mode: JsonField) = apply { this.mode = mode }
+
+ /** Resolution of the logo image */
+ fun resolution(resolution: Resolution) = resolution(JsonField.of(resolution))
+
+ /**
+ * Sets [Builder.resolution] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.resolution] with a well-typed [Resolution] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun resolution(resolution: JsonField) = apply {
+ this.resolution = resolution
+ }
+
+ /** Type of the logo based on resolution (e.g., 'icon', 'logo', 'banner') */
+ fun type(type: String) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
+ /** URL of the logo image */
+ fun url(url: String) = url(JsonField.of(url))
+
+ /**
+ * 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 }
+
+ 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 [Logo].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Logo =
+ Logo(
+ (colors ?: JsonMissing.of()).map { it.toImmutable() },
+ group,
+ mode,
+ resolution,
+ type,
+ url,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Logo = apply {
+ if (validated) {
+ return@apply
+ }
+
+ colors().ifPresent { it.forEach { it.validate() } }
+ group()
+ mode()
+ resolution().ifPresent { it.validate() }
+ type()
+ url()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 =
+ (colors.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (group.asKnown().isPresent) 1 else 0) +
+ (if (mode.asKnown().isPresent) 1 else 0) +
+ (resolution.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (type.asKnown().isPresent) 1 else 0) +
+ (if (url.asKnown().isPresent) 1 else 0)
+
+ class Color
+ private constructor(
+ private val hex: JsonField,
+ private val name: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("hex") @ExcludeMissing hex: JsonField = JsonMissing.of(),
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ ) : this(hex, name, mutableMapOf())
+
+ /**
+ * Color in hexadecimal format
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun hex(): Optional = hex.getOptional("hex")
+
+ /**
+ * Name of the color
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun name(): Optional = name.getOptional("name")
+
+ /**
+ * Returns the raw JSON value of [hex].
+ *
+ * Unlike [hex], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("hex") @ExcludeMissing fun _hex(): JsonField = hex
+
+ /**
+ * 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
+
+ @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 [Color]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Color]. */
+ class Builder internal constructor() {
+
+ private var hex: JsonField = JsonMissing.of()
+ private var name: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(color: Color) = apply {
+ hex = color.hex
+ name = color.name
+ additionalProperties = color.additionalProperties.toMutableMap()
+ }
+
+ /** Color in hexadecimal format */
+ fun hex(hex: String) = hex(JsonField.of(hex))
+
+ /**
+ * Sets [Builder.hex] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.hex] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun hex(hex: JsonField) = apply { this.hex = hex }
+
+ /** Name of the color */
+ 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 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 [Color].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Color = Color(hex, name, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Color = apply {
+ if (validated) {
+ return@apply
+ }
+
+ hex()
+ name()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 (hex.asKnown().isPresent) 1 else 0) +
+ (if (name.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Color && hex == other.hex && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(hex, name, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Color{hex=$hex, name=$name, additionalProperties=$additionalProperties}"
+ }
+
+ /** Resolution of the logo image */
+ class Resolution
+ private constructor(
+ private val aspectRatio: JsonField,
+ private val height: JsonField,
+ private val width: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("aspect_ratio")
+ @ExcludeMissing
+ aspectRatio: JsonField = JsonMissing.of(),
+ @JsonProperty("height")
+ @ExcludeMissing
+ height: JsonField = JsonMissing.of(),
+ @JsonProperty("width") @ExcludeMissing width: JsonField = JsonMissing.of(),
+ ) : this(aspectRatio, height, width, mutableMapOf())
+
+ /**
+ * Aspect ratio of the image (width/height)
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun aspectRatio(): Optional = aspectRatio.getOptional("aspect_ratio")
+
+ /**
+ * Height of the image in pixels
+ *
+ * @throws BrandDevInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
+ */
+ fun height(): Optional = height.getOptional("height")
+
+ /**
+ * Width of the image in pixels
+ *
+ * @throws BrandDevInvalidDataException 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 [aspectRatio].
+ *
+ * Unlike [aspectRatio], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("aspect_ratio")
+ @ExcludeMissing
+ fun _aspectRatio(): JsonField = aspectRatio
+
+ /**
+ * 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 [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 [Resolution]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Resolution]. */
+ class Builder internal constructor() {
+
+ private var aspectRatio: JsonField = JsonMissing.of()
+ private var height: JsonField = JsonMissing.of()
+ private var width: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(resolution: Resolution) = apply {
+ aspectRatio = resolution.aspectRatio
+ height = resolution.height
+ width = resolution.width
+ additionalProperties = resolution.additionalProperties.toMutableMap()
+ }
+
+ /** Aspect ratio of the image (width/height) */
+ fun aspectRatio(aspectRatio: Double) = aspectRatio(JsonField.of(aspectRatio))
+
+ /**
+ * Sets [Builder.aspectRatio] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.aspectRatio] with a well-typed [Double]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun aspectRatio(aspectRatio: JsonField) = apply {
+ this.aspectRatio = aspectRatio
+ }
+
+ /** Height of the image in pixels */
+ fun height(height: Long) = height(JsonField.of(height))
+
+ /**
+ * 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 }
+
+ /** Width of the image in pixels */
+ fun width(width: Long) = width(JsonField.of(width))
+
+ /**
+ * 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 }
+
+ 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 [Resolution].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Resolution =
+ Resolution(aspectRatio, height, width, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Resolution = apply {
+ if (validated) {
+ return@apply
+ }
+
+ aspectRatio()
+ height()
+ width()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: BrandDevInvalidDataException) {
+ 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 (aspectRatio.asKnown().isPresent) 1 else 0) +
+ (if (height.asKnown().isPresent) 1 else 0) +
+ (if (width.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Resolution && aspectRatio == other.aspectRatio && height == other.height && width == other.width && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(aspectRatio, height, width, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Resolution{aspectRatio=$aspectRatio, height=$height, width=$width, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Logo && colors == other.colors && group == other.group && mode == other.mode && resolution == other.resolution && type == other.type && url == other.url && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(colors, group, mode, resolution, type, url, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Logo{colors=$colors, group=$group, mode=$mode, resolution=$resolution, type=$type, url=$url, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is Brand && backdrops == other.backdrops && colors == other.colors && domain == other.domain && logos == other.logos && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(backdrops, colors, domain, logos, title, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Brand{backdrops=$backdrops, colors=$colors, domain=$domain, logos=$logos, title=$title, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is BrandRetrieveSimplifiedResponse && brand == other.brand && code == other.code && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(brand, code, status, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "BrandRetrieveSimplifiedResponse{brand=$brand, code=$code, status=$status, additionalProperties=$additionalProperties}"
+}
diff --git a/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandScreenshotParams.kt b/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandScreenshotParams.kt
new file mode 100644
index 0000000..0fa8913
--- /dev/null
+++ b/brand-dev-java-core/src/main/kotlin/com/branddev/api/models/brand/BrandScreenshotParams.kt
@@ -0,0 +1,374 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.branddev.api.models.brand
+
+import com.branddev.api.core.Enum
+import com.branddev.api.core.JsonField
+import com.branddev.api.core.Params
+import com.branddev.api.core.checkRequired
+import com.branddev.api.core.http.Headers
+import com.branddev.api.core.http.QueryParams
+import com.branddev.api.errors.BrandDevInvalidDataException
+import com.fasterxml.jackson.annotation.JsonCreator
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Beta feature: Capture a screenshot of a website. Supports both viewport (standard browser view)
+ * and full-page screenshots. Returns a URL to the uploaded screenshot image hosted on our CDN.
+ */
+class BrandScreenshotParams
+private constructor(
+ private val domain: String,
+ private val fullScreenshot: FullScreenshot?,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /**
+ * Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be
+ * automatically normalized and validated.
+ */
+ fun domain(): String = domain
+
+ /**
+ * Optional parameter to determine screenshot type. If 'true', takes a full page screenshot
+ * capturing all content. If 'false' or not provided, takes a viewport screenshot (standard
+ * browser view).
+ */
+ fun fullScreenshot(): Optional = Optional.ofNullable(fullScreenshot)
+
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [BrandScreenshotParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .domain()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [BrandScreenshotParams]. */
+ class Builder internal constructor() {
+
+ private var domain: String? = null
+ private var fullScreenshot: FullScreenshot? = null
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(brandScreenshotParams: BrandScreenshotParams) = apply {
+ domain = brandScreenshotParams.domain
+ fullScreenshot = brandScreenshotParams.fullScreenshot
+ additionalHeaders = brandScreenshotParams.additionalHeaders.toBuilder()
+ additionalQueryParams = brandScreenshotParams.additionalQueryParams.toBuilder()
+ }
+
+ /**
+ * Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be
+ * automatically normalized and validated.
+ */
+ fun domain(domain: String) = apply { this.domain = domain }
+
+ /**
+ * Optional parameter to determine screenshot type. If 'true', takes a full page screenshot
+ * capturing all content. If 'false' or not provided, takes a viewport screenshot (standard
+ * browser view).
+ */
+ fun fullScreenshot(fullScreenshot: FullScreenshot?) = apply {
+ this.fullScreenshot = fullScreenshot
+ }
+
+ /** Alias for calling [Builder.fullScreenshot] with `fullScreenshot.orElse(null)`. */
+ fun fullScreenshot(fullScreenshot: Optional) =
+ fullScreenshot(fullScreenshot.getOrNull())
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map