Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.31"
".": "0.1.0-alpha.32"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-2cdd67823c6ac9d1ab68032a695c31a098ad285ffb0c073b9dfc00afe5de9b88.yml
openapi_spec_hash: ac8a965beb9b667b6204a5c573507219
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-3614380ba4315687bbaf6561e9872fd72dd876f9230ce690c35d7efc1250e808.yml
openapi_spec_hash: f1aa17e08d0379766a61de68714c7c21
config_hash: 4cd3173ea1cce7183640aae49cfbb374
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.32 (2026-02-24)

Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/brand-dot-dev/java-sdk/compare/v0.1.0-alpha.31...v0.1.0-alpha.32)

### Features

* **api:** api update ([c79807b](https://github.com/brand-dot-dev/java-sdk/commit/c79807b3193b735f868d6ca667eb149a054a5ad6))

## 0.1.0-alpha.31 (2026-02-23)

Full Changelog: [v0.1.0-alpha.30...v0.1.0-alpha.31](https://github.com/brand-dot-dev/java-sdk/compare/v0.1.0-alpha.30...v0.1.0-alpha.31)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.branddev.api/brand-dev-java)](https://central.sonatype.com/artifact/com.branddev.api/brand-dev-java/0.1.0-alpha.31)
[![javadoc](https://javadoc.io/badge2/com.branddev.api/brand-dev-java/0.1.0-alpha.31/javadoc.svg)](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.31)
[![Maven Central](https://img.shields.io/maven-central/v/com.branddev.api/brand-dev-java)](https://central.sonatype.com/artifact/com.branddev.api/brand-dev-java/0.1.0-alpha.32)
[![javadoc](https://javadoc.io/badge2/com.branddev.api/brand-dev-java/0.1.0-alpha.32/javadoc.svg)](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.32)

<!-- x-release-please-end -->

Expand All @@ -22,7 +22,7 @@ Use the Brand Dev MCP Server to enable AI assistants to interact with this API,

<!-- x-release-please-start-version -->

The REST API documentation can be found on [docs.brand.dev](https://docs.brand.dev/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.31).
The REST API documentation can be found on [docs.brand.dev](https://docs.brand.dev/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.32).

<!-- x-release-please-end -->

Expand All @@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.brand.dev](https://docs.brand.d
### Gradle

```kotlin
implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.31")
implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.32")
```

### Maven
Expand All @@ -42,7 +42,7 @@ implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.31")
<dependency>
<groupId>com.branddev.api</groupId>
<artifactId>brand-dev-java</artifactId>
<version>0.1.0-alpha.31</version>
<version>0.1.0-alpha.32</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ 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
Expand All @@ -16,22 +15,30 @@ import kotlin.jvm.optionals.getOrNull

/**
* Automatically extract comprehensive design system information from a brand's website including
* colors, typography, spacing, shadows, and UI components.
* colors, typography, spacing, shadows, and UI components. Either 'domain' or 'directUrl' must be
* provided as a query parameter, but not both.
*/
class BrandStyleguideParams
private constructor(
private val domain: String,
private val directUrl: String?,
private val domain: String?,
private val prioritize: Prioritize?,
private val timeoutMs: Long?,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
) : Params {

/**
* A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g.,
* 'https://example.com/design-system').
*/
fun directUrl(): Optional<String> = Optional.ofNullable(directUrl)

/**
* Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will
* be automatically normalized and validated.
*/
fun domain(): String = domain
fun domain(): Optional<String> = Optional.ofNullable(domain)

/**
* Optional parameter to prioritize screenshot capture for styleguide extraction. If 'speed',
Expand All @@ -57,20 +64,16 @@ private constructor(

companion object {

/**
* Returns a mutable builder for constructing an instance of [BrandStyleguideParams].
*
* The following fields are required:
* ```java
* .domain()
* ```
*/
@JvmStatic fun none(): BrandStyleguideParams = builder().build()

/** Returns a mutable builder for constructing an instance of [BrandStyleguideParams]. */
@JvmStatic fun builder() = Builder()
}

/** A builder for [BrandStyleguideParams]. */
class Builder internal constructor() {

private var directUrl: String? = null
private var domain: String? = null
private var prioritize: Prioritize? = null
private var timeoutMs: Long? = null
Expand All @@ -79,18 +82,31 @@ private constructor(

@JvmSynthetic
internal fun from(brandStyleguideParams: BrandStyleguideParams) = apply {
directUrl = brandStyleguideParams.directUrl
domain = brandStyleguideParams.domain
prioritize = brandStyleguideParams.prioritize
timeoutMs = brandStyleguideParams.timeoutMs
additionalHeaders = brandStyleguideParams.additionalHeaders.toBuilder()
additionalQueryParams = brandStyleguideParams.additionalQueryParams.toBuilder()
}

/**
* A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g.,
* 'https://example.com/design-system').
*/
fun directUrl(directUrl: String?) = apply { this.directUrl = directUrl }

/** Alias for calling [Builder.directUrl] with `directUrl.orElse(null)`. */
fun directUrl(directUrl: Optional<String>) = directUrl(directUrl.getOrNull())

/**
* Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain
* will be automatically normalized and validated.
*/
fun domain(domain: String) = apply { this.domain = domain }
fun domain(domain: String?) = apply { this.domain = domain }

/** Alias for calling [Builder.domain] with `domain.orElse(null)`. */
fun domain(domain: Optional<String>) = domain(domain.getOrNull())

/**
* Optional parameter to prioritize screenshot capture for styleguide extraction. If
Expand Down Expand Up @@ -221,17 +237,11 @@ private constructor(
* Returns an immutable instance of [BrandStyleguideParams].
*
* 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(): BrandStyleguideParams =
BrandStyleguideParams(
checkRequired("domain", domain),
directUrl,
domain,
prioritize,
timeoutMs,
additionalHeaders.build(),
Expand All @@ -244,7 +254,8 @@ private constructor(
override fun _queryParams(): QueryParams =
QueryParams.builder()
.apply {
put("domain", domain)
directUrl?.let { put("directUrl", it) }
domain?.let { put("domain", it) }
prioritize?.let { put("prioritize", it.toString()) }
timeoutMs?.let { put("timeoutMS", it.toString()) }
putAll(additionalQueryParams)
Expand Down Expand Up @@ -391,6 +402,7 @@ private constructor(
}

return other is BrandStyleguideParams &&
directUrl == other.directUrl &&
domain == other.domain &&
prioritize == other.prioritize &&
timeoutMs == other.timeoutMs &&
Expand All @@ -399,8 +411,15 @@ private constructor(
}

override fun hashCode(): Int =
Objects.hash(domain, prioritize, timeoutMs, additionalHeaders, additionalQueryParams)
Objects.hash(
directUrl,
domain,
prioritize,
timeoutMs,
additionalHeaders,
additionalQueryParams,
)

override fun toString() =
"BrandStyleguideParams{domain=$domain, prioritize=$prioritize, timeoutMs=$timeoutMs, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
"BrandStyleguideParams{directUrl=$directUrl, domain=$domain, prioritize=$prioritize, timeoutMs=$timeoutMs, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -314,17 +314,27 @@ interface BrandServiceAsync {

/**
* Automatically extract comprehensive design system information from a brand's website
* including colors, typography, spacing, shadows, and UI components.
* including colors, typography, spacing, shadows, and UI components. Either 'domain' or
* 'directUrl' must be provided as a query parameter, but not both.
*/
fun styleguide(params: BrandStyleguideParams): CompletableFuture<BrandStyleguideResponse> =
styleguide(params, RequestOptions.none())
fun styleguide(): CompletableFuture<BrandStyleguideResponse> =
styleguide(BrandStyleguideParams.none())

/** @see styleguide */
fun styleguide(
params: BrandStyleguideParams,
params: BrandStyleguideParams = BrandStyleguideParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<BrandStyleguideResponse>

/** @see styleguide */
fun styleguide(
params: BrandStyleguideParams = BrandStyleguideParams.none()
): CompletableFuture<BrandStyleguideResponse> = styleguide(params, RequestOptions.none())

/** @see styleguide */
fun styleguide(requestOptions: RequestOptions): CompletableFuture<BrandStyleguideResponse> =
styleguide(BrandStyleguideParams.none(), requestOptions)

/**
* Scrapes the given URL and returns the raw HTML content of the page. Uses automatic proxy
* escalation to handle blocked sites.
Expand Down Expand Up @@ -663,16 +673,26 @@ interface BrandServiceAsync {
* Returns a raw HTTP response for `get /brand/styleguide`, but is otherwise the same as
* [BrandServiceAsync.styleguide].
*/
fun styleguide(): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>> =
styleguide(BrandStyleguideParams.none())

/** @see styleguide */
fun styleguide(
params: BrandStyleguideParams
params: BrandStyleguideParams = BrandStyleguideParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>>

/** @see styleguide */
fun styleguide(
params: BrandStyleguideParams = BrandStyleguideParams.none()
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>> =
styleguide(params, RequestOptions.none())

/** @see styleguide */
fun styleguide(
params: BrandStyleguideParams,
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>>
requestOptions: RequestOptions
): CompletableFuture<HttpResponseFor<BrandStyleguideResponse>> =
styleguide(BrandStyleguideParams.none(), requestOptions)

/**
* Returns a raw HTTP response for `get /web/scrape/html`, but is otherwise the same as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,26 @@ interface BrandService {

/**
* Automatically extract comprehensive design system information from a brand's website
* including colors, typography, spacing, shadows, and UI components.
* including colors, typography, spacing, shadows, and UI components. Either 'domain' or
* 'directUrl' must be provided as a query parameter, but not both.
*/
fun styleguide(params: BrandStyleguideParams): BrandStyleguideResponse =
styleguide(params, RequestOptions.none())
fun styleguide(): BrandStyleguideResponse = styleguide(BrandStyleguideParams.none())

/** @see styleguide */
fun styleguide(
params: BrandStyleguideParams,
params: BrandStyleguideParams = BrandStyleguideParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): BrandStyleguideResponse

/** @see styleguide */
fun styleguide(
params: BrandStyleguideParams = BrandStyleguideParams.none()
): BrandStyleguideResponse = styleguide(params, RequestOptions.none())

/** @see styleguide */
fun styleguide(requestOptions: RequestOptions): BrandStyleguideResponse =
styleguide(BrandStyleguideParams.none(), requestOptions)

/**
* Scrapes the given URL and returns the raw HTML content of the page. Uses automatic proxy
* escalation to handle blocked sites.
Expand Down Expand Up @@ -658,16 +667,27 @@ interface BrandService {
* [BrandService.styleguide].
*/
@MustBeClosed
fun styleguide(params: BrandStyleguideParams): HttpResponseFor<BrandStyleguideResponse> =
styleguide(params, RequestOptions.none())
fun styleguide(): HttpResponseFor<BrandStyleguideResponse> =
styleguide(BrandStyleguideParams.none())

/** @see styleguide */
@MustBeClosed
fun styleguide(
params: BrandStyleguideParams,
params: BrandStyleguideParams = BrandStyleguideParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): HttpResponseFor<BrandStyleguideResponse>

/** @see styleguide */
@MustBeClosed
fun styleguide(
params: BrandStyleguideParams = BrandStyleguideParams.none()
): HttpResponseFor<BrandStyleguideResponse> = styleguide(params, RequestOptions.none())

/** @see styleguide */
@MustBeClosed
fun styleguide(requestOptions: RequestOptions): HttpResponseFor<BrandStyleguideResponse> =
styleguide(BrandStyleguideParams.none(), requestOptions)

/**
* Returns a raw HTTP response for `get /web/scrape/html`, but is otherwise the same as
* [BrandService.webScrapeHtml].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal class BrandStyleguideParamsTest {
@Test
fun create() {
BrandStyleguideParams.builder()
.directUrl("https://example.com")
.domain("domain")
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
.timeoutMs(1000L)
Expand All @@ -21,6 +22,7 @@ internal class BrandStyleguideParamsTest {
fun queryParams() {
val params =
BrandStyleguideParams.builder()
.directUrl("https://example.com")
.domain("domain")
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
.timeoutMs(1000L)
Expand All @@ -31,6 +33,7 @@ internal class BrandStyleguideParamsTest {
assertThat(queryParams)
.isEqualTo(
QueryParams.builder()
.put("directUrl", "https://example.com")
.put("domain", "domain")
.put("prioritize", "speed")
.put("timeoutMS", "1000")
Expand All @@ -40,10 +43,10 @@ internal class BrandStyleguideParamsTest {

@Test
fun queryParamsWithoutOptionalFields() {
val params = BrandStyleguideParams.builder().domain("domain").build()
val params = BrandStyleguideParams.builder().build()

val queryParams = params._queryParams()

assertThat(queryParams).isEqualTo(QueryParams.builder().put("domain", "domain").build())
assertThat(queryParams).isEqualTo(QueryParams.builder().build())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ internal class BrandServiceAsyncTest {
val responseFuture =
brandServiceAsync.styleguide(
BrandStyleguideParams.builder()
.directUrl("https://example.com")
.domain("domain")
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
.timeoutMs(1000L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ internal class BrandServiceTest {
val response =
brandService.styleguide(
BrandStyleguideParams.builder()
.directUrl("https://example.com")
.domain("domain")
.prioritize(BrandStyleguideParams.Prioritize.SPEED)
.timeoutMs(1000L)
Expand Down
Loading
Loading