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.27"
".": "0.1.0-alpha.28"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-737dbedd830e2c989387e90a9bb5baa3915306ecfef2e46b09d02cb1879f043c.yml
openapi_spec_hash: 7bc21f4c6d5fd39c1a3b22626846ca87
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-73562e26b663cf10185b9e98966accf5f151c6d3cf99b5e060ce5a847045e383.yml
openapi_spec_hash: bf5994966b84f9dda998ad5059ff8318
config_hash: 6f10592c7d0c3bafefc1271472283217
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.28 (2026-02-07)

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

### Features

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


### Chores

* **internal:** upgrade AssertJ ([2656e0a](https://github.com/brand-dot-dev/java-sdk/commit/2656e0ae35284ad0f03187f0d58134162ab81a01))

## 0.1.0-alpha.27 (2026-02-02)

Full Changelog: [v0.1.0-alpha.26...v0.1.0-alpha.27](https://github.com/brand-dot-dev/java-sdk/compare/v0.1.0-alpha.26...v0.1.0-alpha.27)
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.27)
[![javadoc](https://javadoc.io/badge2/com.branddev.api/brand-dev-java/0.1.0-alpha.27/javadoc.svg)](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.27)
[![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.28)
[![javadoc](https://javadoc.io/badge2/com.branddev.api/brand-dev-java/0.1.0-alpha.28/javadoc.svg)](https://javadoc.io/doc/com.branddev.api/brand-dev-java/0.1.0-alpha.28)

<!-- 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.27).
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.28).

<!-- 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.27")
implementation("com.branddev.api:brand-dev-java:0.1.0-alpha.28")
```

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

Expand Down
2 changes: 1 addition & 1 deletion brand-dev-java-client-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.25.3")
testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2")
}
2 changes: 1 addition & 1 deletion brand-dev-java-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
testImplementation(kotlin("test"))
testImplementation(project(":brand-dev-java-client-okhttp"))
testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2")
testImplementation("org.assertj:assertj-core:3.25.3")
testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
testImplementation("org.junit-pioneer:junit-pioneer:1.9.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.branddev.api.core.JsonField
import com.branddev.api.core.JsonMissing
import com.branddev.api.core.JsonValue
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 @@ -32,12 +31,23 @@ private constructor(
) : Params {

/**
* The domain name to analyze
* A specific URL to use directly as the starting point for extraction without domain
* resolution. Useful when you want to extract products from a specific page rather than
* discovering the site's product pages automatically. Either 'domain' or 'directUrl' must be
* provided, but not both.
*
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun directUrl(): Optional<String> = body.directUrl()

/**
* The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but not both.
*
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun domain(): String = body.domain()
fun domain(): Optional<String> = body.domain()

/**
* Maximum number of products to extract.
Expand All @@ -57,6 +67,13 @@ private constructor(
*/
fun timeoutMs(): Optional<Long> = body.timeoutMs()

/**
* Returns the raw JSON value of [directUrl].
*
* Unlike [directUrl], this method doesn't throw if the JSON field has an unexpected type.
*/
fun _directUrl(): JsonField<String> = body._directUrl()

/**
* Returns the raw JSON value of [domain].
*
Expand Down Expand Up @@ -90,14 +107,9 @@ private constructor(

companion object {

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

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

Expand All @@ -120,13 +132,34 @@ private constructor(
*
* This is generally only useful if you are already constructing the body separately.
* Otherwise, it's more convenient to use the top-level setters instead:
* - [directUrl]
* - [domain]
* - [maxProducts]
* - [timeoutMs]
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }

/** The domain name to analyze */
/**
* A specific URL to use directly as the starting point for extraction without domain
* resolution. Useful when you want to extract products from a specific page rather than
* discovering the site's product pages automatically. Either 'domain' or 'directUrl' must
* be provided, but not both.
*/
fun directUrl(directUrl: String) = apply { body.directUrl(directUrl) }

/**
* Sets [Builder.directUrl] to an arbitrary JSON value.
*
* You should usually call [Builder.directUrl] with a well-typed [String] value instead.
* This method is primarily for setting the field to an undocumented or not yet supported
* value.
*/
fun directUrl(directUrl: JsonField<String>) = apply { body.directUrl(directUrl) }

/**
* The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but not
* both.
*/
fun domain(domain: String) = apply { body.domain(domain) }

/**
Expand Down Expand Up @@ -285,13 +318,6 @@ private constructor(
* Returns an immutable instance of [BrandAiProductsParams].
*
* 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(): BrandAiProductsParams =
BrandAiProductsParams(
Expand All @@ -310,6 +336,7 @@ private constructor(
class Body
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val directUrl: JsonField<String>,
private val domain: JsonField<String>,
private val maxProducts: JsonField<Long>,
private val timeoutMs: JsonField<Long>,
Expand All @@ -318,20 +345,35 @@ private constructor(

@JsonCreator
private constructor(
@JsonProperty("directUrl")
@ExcludeMissing
directUrl: JsonField<String> = JsonMissing.of(),
@JsonProperty("domain") @ExcludeMissing domain: JsonField<String> = JsonMissing.of(),
@JsonProperty("maxProducts")
@ExcludeMissing
maxProducts: JsonField<Long> = JsonMissing.of(),
@JsonProperty("timeoutMS") @ExcludeMissing timeoutMs: JsonField<Long> = JsonMissing.of(),
) : this(domain, maxProducts, timeoutMs, mutableMapOf())
) : this(directUrl, domain, maxProducts, timeoutMs, mutableMapOf())

/**
* The domain name to analyze
* A specific URL to use directly as the starting point for extraction without domain
* resolution. Useful when you want to extract products from a specific page rather than
* discovering the site's product pages automatically. Either 'domain' or 'directUrl' must
* be provided, but not both.
*
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun domain(): String = domain.getRequired("domain")
fun directUrl(): Optional<String> = directUrl.getOptional("directUrl")

/**
* The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but not
* both.
*
* @throws BrandDevInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun domain(): Optional<String> = domain.getOptional("domain")

/**
* Maximum number of products to extract.
Expand All @@ -351,6 +393,13 @@ private constructor(
*/
fun timeoutMs(): Optional<Long> = timeoutMs.getOptional("timeoutMS")

/**
* Returns the raw JSON value of [directUrl].
*
* Unlike [directUrl], this method doesn't throw if the JSON field has an unexpected type.
*/
@JsonProperty("directUrl") @ExcludeMissing fun _directUrl(): JsonField<String> = directUrl

/**
* Returns the raw JSON value of [domain].
*
Expand Down Expand Up @@ -388,34 +437,49 @@ private constructor(

companion object {

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

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

private var domain: JsonField<String>? = null
private var directUrl: JsonField<String> = JsonMissing.of()
private var domain: JsonField<String> = JsonMissing.of()
private var maxProducts: JsonField<Long> = JsonMissing.of()
private var timeoutMs: JsonField<Long> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(body: Body) = apply {
directUrl = body.directUrl
domain = body.domain
maxProducts = body.maxProducts
timeoutMs = body.timeoutMs
additionalProperties = body.additionalProperties.toMutableMap()
}

/** The domain name to analyze */
/**
* A specific URL to use directly as the starting point for extraction without domain
* resolution. Useful when you want to extract products from a specific page rather than
* discovering the site's product pages automatically. Either 'domain' or 'directUrl'
* must be provided, but not both.
*/
fun directUrl(directUrl: String) = directUrl(JsonField.of(directUrl))

/**
* Sets [Builder.directUrl] to an arbitrary JSON value.
*
* You should usually call [Builder.directUrl] with a well-typed [String] value instead.
* This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun directUrl(directUrl: JsonField<String>) = apply { this.directUrl = directUrl }

/**
* The domain name to analyze. Either 'domain' or 'directUrl' must be provided, but not
* both.
*/
fun domain(domain: String) = domain(JsonField.of(domain))

/**
Expand Down Expand Up @@ -478,21 +542,9 @@ private constructor(
* Returns an immutable instance of [Body].
*
* 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(): Body =
Body(
checkRequired("domain", domain),
maxProducts,
timeoutMs,
additionalProperties.toMutableMap(),
)
Body(directUrl, domain, maxProducts, timeoutMs, additionalProperties.toMutableMap())
}

private var validated: Boolean = false
Expand All @@ -502,6 +554,7 @@ private constructor(
return@apply
}

directUrl()
domain()
maxProducts()
timeoutMs()
Expand All @@ -524,7 +577,8 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
(if (domain.asKnown().isPresent) 1 else 0) +
(if (directUrl.asKnown().isPresent) 1 else 0) +
(if (domain.asKnown().isPresent) 1 else 0) +
(if (maxProducts.asKnown().isPresent) 1 else 0) +
(if (timeoutMs.asKnown().isPresent) 1 else 0)

Expand All @@ -534,20 +588,21 @@ private constructor(
}

return other is Body &&
directUrl == other.directUrl &&
domain == other.domain &&
maxProducts == other.maxProducts &&
timeoutMs == other.timeoutMs &&
additionalProperties == other.additionalProperties
}

private val hashCode: Int by lazy {
Objects.hash(domain, maxProducts, timeoutMs, additionalProperties)
Objects.hash(directUrl, domain, maxProducts, timeoutMs, additionalProperties)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"Body{domain=$domain, maxProducts=$maxProducts, timeoutMs=$timeoutMs, additionalProperties=$additionalProperties}"
"Body{directUrl=$directUrl, domain=$domain, maxProducts=$maxProducts, timeoutMs=$timeoutMs, additionalProperties=$additionalProperties}"
}

override fun equals(other: Any?): Boolean {
Expand Down
Loading
Loading