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 @@
{
".": "2.3.0"
".": "2.4.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch/turbopuffer-17e5bcde1d39d5673f2b1bf4446afa000d90a0fdb9ae4b86a05bd15f12f9e547.yml
openapi_spec_hash: 4aaf757ac332b99a28f9a44a47891a5f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch/turbopuffer-0841bbcabedf7be7aa04e2a1fe9092987f51c5cb0d9ad4202eeb1ba4eef1f2b0.yml
openapi_spec_hash: bd6fdabde2b66bca3b7a3427ca943d9d
config_hash: bab72dc9f937352c7a01a37dadd44122
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.4.0 (2026-06-09)

Full Changelog: [v2.3.0...v2.4.0](https://github.com/turbopuffer/turbopuffer-java/compare/v2.3.0...v2.4.0)

### Features

* tpuf-engine: support dest_encryption in copy_from_namespace ([5c016f0](https://github.com/turbopuffer/turbopuffer-java/commit/5c016f0455991991fceceafdaa9fa2217bda80b9))

## 2.3.0 (2026-06-08)

Full Changelog: [v2.2.0...v2.3.0](https://github.com/turbopuffer/turbopuffer-java/compare/v2.2.0...v2.3.0)
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.turbopuffer/turbopuffer-java)](https://central.sonatype.com/artifact/com.turbopuffer/turbopuffer-java/2.3.0)
[![javadoc](https://javadoc.io/badge2/com.turbopuffer/turbopuffer-java/2.3.0/javadoc.svg)](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.3.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.turbopuffer/turbopuffer-java)](https://central.sonatype.com/artifact/com.turbopuffer/turbopuffer-java/2.4.0)
[![javadoc](https://javadoc.io/badge2/com.turbopuffer/turbopuffer-java/2.4.0/javadoc.svg)](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.4.0)

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

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

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

The REST API documentation can be found at [turbopuffer.com/docs/overview](https://turbopuffer.com/docs/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.3.0).
The REST API documentation can be found at [turbopuffer.com/docs/overview](https://turbopuffer.com/docs/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.turbopuffer/turbopuffer-java/2.4.0).

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

Expand All @@ -33,7 +33,7 @@ The REST API documentation can be found at [turbopuffer.com/docs/overview](https
### Gradle

```kotlin
implementation("com.turbopuffer:turbopuffer-java:2.3.0")
implementation("com.turbopuffer:turbopuffer-java:2.4.0")
```

### Maven
Expand All @@ -42,7 +42,7 @@ implementation("com.turbopuffer:turbopuffer-java:2.3.0")
<dependency>
<groupId>com.turbopuffer</groupId>
<artifactId>turbopuffer-java</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.turbopuffer"
version = "2.3.0" // x-release-please-version
version = "2.4.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ private constructor(
*/
fun sourceNamespace(): String = body.sourceNamespace()

/**
* (Optional) The encryption configuration for the destination namespace.
*
* @throws TurbopufferInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun destEncryption(): Optional<Encryption> = body.destEncryption()

/**
* (Optional) An API key for the organization containing the source namespace
*
Expand All @@ -62,6 +70,13 @@ private constructor(
*/
fun _sourceNamespace(): JsonField<String> = body._sourceNamespace()

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

/**
* Returns the raw JSON value of [sourceApiKey].
*
Expand Down Expand Up @@ -126,6 +141,7 @@ 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:
* - [sourceNamespace]
* - [destEncryption]
* - [sourceApiKey]
* - [sourceRegion]
*/
Expand All @@ -147,6 +163,32 @@ private constructor(
body.sourceNamespace(sourceNamespace)
}

/** (Optional) The encryption configuration for the destination namespace. */
fun destEncryption(destEncryption: Encryption) = apply {
body.destEncryption(destEncryption)
}

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

/**
* Alias for calling [destEncryption] with `Encryption.ofCustomerManaged(customerManaged)`.
*/
fun destEncryption(customerManaged: Encryption.CustomerManaged) = apply {
body.destEncryption(customerManaged)
}

/** Alias for calling [destEncryption] with `Encryption.ofDefault()`. */
fun destEncryptionDefault() = apply { body.destEncryptionDefault() }

/** (Optional) An API key for the organization containing the source namespace */
fun sourceApiKey(sourceApiKey: String) = apply { body.sourceApiKey(sourceApiKey) }

Expand Down Expand Up @@ -329,6 +371,7 @@ private constructor(
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val sourceNamespace: JsonField<String>,
private val destEncryption: JsonField<Encryption>,
private val sourceApiKey: JsonField<String>,
private val sourceRegion: JsonField<String>,
private val additionalProperties: MutableMap<String, JsonValue>,
Expand All @@ -339,13 +382,16 @@ private constructor(
@JsonProperty("source_namespace")
@ExcludeMissing
sourceNamespace: JsonField<String> = JsonMissing.of(),
@JsonProperty("dest_encryption")
@ExcludeMissing
destEncryption: JsonField<Encryption> = JsonMissing.of(),
@JsonProperty("source_api_key")
@ExcludeMissing
sourceApiKey: JsonField<String> = JsonMissing.of(),
@JsonProperty("source_region")
@ExcludeMissing
sourceRegion: JsonField<String> = JsonMissing.of(),
) : this(sourceNamespace, sourceApiKey, sourceRegion, mutableMapOf())
) : this(sourceNamespace, destEncryption, sourceApiKey, sourceRegion, mutableMapOf())

/**
* The namespace to copy documents from.
Expand All @@ -355,6 +401,14 @@ private constructor(
*/
fun sourceNamespace(): String = sourceNamespace.getRequired("source_namespace")

/**
* (Optional) The encryption configuration for the destination namespace.
*
* @throws TurbopufferInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun destEncryption(): Optional<Encryption> = destEncryption.getOptional("dest_encryption")

/**
* (Optional) An API key for the organization containing the source namespace
*
Expand All @@ -381,6 +435,16 @@ private constructor(
@ExcludeMissing
fun _sourceNamespace(): JsonField<String> = sourceNamespace

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

/**
* Returns the raw JSON value of [sourceApiKey].
*
Expand Down Expand Up @@ -430,13 +494,15 @@ private constructor(
class Builder internal constructor() {

private var sourceNamespace: JsonField<String>? = null
private var destEncryption: JsonField<Encryption> = JsonMissing.of()
private var sourceApiKey: JsonField<String> = JsonMissing.of()
private var sourceRegion: JsonField<String> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(body: Body) = apply {
sourceNamespace = body.sourceNamespace
destEncryption = body.destEncryption
sourceApiKey = body.sourceApiKey
sourceRegion = body.sourceRegion
additionalProperties = body.additionalProperties.toMutableMap()
Expand All @@ -457,6 +523,31 @@ private constructor(
this.sourceNamespace = sourceNamespace
}

/** (Optional) The encryption configuration for the destination namespace. */
fun destEncryption(destEncryption: Encryption) =
destEncryption(JsonField.of(destEncryption))

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

/**
* Alias for calling [destEncryption] with
* `Encryption.ofCustomerManaged(customerManaged)`.
*/
fun destEncryption(customerManaged: Encryption.CustomerManaged) =
destEncryption(Encryption.ofCustomerManaged(customerManaged))

/** Alias for calling [destEncryption] with `Encryption.ofDefault()`. */
fun destEncryptionDefault() = destEncryption(Encryption.ofDefault())

/** (Optional) An API key for the organization containing the source namespace */
fun sourceApiKey(sourceApiKey: String) = sourceApiKey(JsonField.of(sourceApiKey))

Expand Down Expand Up @@ -519,6 +610,7 @@ private constructor(
fun build(): Body =
Body(
checkRequired("sourceNamespace", sourceNamespace),
destEncryption,
sourceApiKey,
sourceRegion,
additionalProperties.toMutableMap(),
Expand All @@ -542,6 +634,7 @@ private constructor(
}

sourceNamespace()
destEncryption().ifPresent { it.validate() }
sourceApiKey()
sourceRegion()
validated = true
Expand All @@ -564,6 +657,7 @@ private constructor(
@JvmSynthetic
internal fun validity(): Int =
(if (sourceNamespace.asKnown().isPresent) 1 else 0) +
(destEncryption.asKnown().getOrNull()?.validity() ?: 0) +
(if (sourceApiKey.asKnown().isPresent) 1 else 0) +
(if (sourceRegion.asKnown().isPresent) 1 else 0)

Expand All @@ -574,19 +668,26 @@ private constructor(

return other is Body &&
sourceNamespace == other.sourceNamespace &&
destEncryption == other.destEncryption &&
sourceApiKey == other.sourceApiKey &&
sourceRegion == other.sourceRegion &&
additionalProperties == other.additionalProperties
}

private val hashCode: Int by lazy {
Objects.hash(sourceNamespace, sourceApiKey, sourceRegion, additionalProperties)
Objects.hash(
sourceNamespace,
destEncryption,
sourceApiKey,
sourceRegion,
additionalProperties,
)
}

override fun hashCode(): Int = hashCode

override fun toString() =
"Body{sourceNamespace=$sourceNamespace, sourceApiKey=$sourceApiKey, sourceRegion=$sourceRegion, additionalProperties=$additionalProperties}"
"Body{sourceNamespace=$sourceNamespace, destEncryption=$destEncryption, sourceApiKey=$sourceApiKey, sourceRegion=$sourceRegion, additionalProperties=$additionalProperties}"
}

override fun equals(other: Any?): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal class NamespaceCopyFromParamsTest {
NamespaceCopyFromParams.builder()
.namespace("namespace")
.sourceNamespace("source_namespace")
.destEncryption(Encryption.CustomerManaged.builder().keyName("key_name").build())
.sourceApiKey("source_api_key")
.sourceRegion("source_region")
.build()
Expand All @@ -32,13 +33,20 @@ internal class NamespaceCopyFromParamsTest {
NamespaceCopyFromParams.builder()
.namespace("namespace")
.sourceNamespace("source_namespace")
.destEncryption(Encryption.CustomerManaged.builder().keyName("key_name").build())
.sourceApiKey("source_api_key")
.sourceRegion("source_region")
.build()

val body = params._body()

assertThat(body.sourceNamespace()).isEqualTo("source_namespace")
assertThat(body.destEncryption())
.contains(
Encryption.ofCustomerManaged(
Encryption.CustomerManaged.builder().keyName("key_name").build()
)
)
assertThat(body.sourceApiKey()).contains("source_api_key")
assertThat(body.sourceRegion()).contains("source_region")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ internal class NamespaceServiceAsyncTest {
NamespaceCopyFromParams.builder()
.namespace("namespace")
.sourceNamespace("source_namespace")
.destEncryption(
Encryption.CustomerManaged.builder().keyName("key_name").build()
)
.sourceApiKey("source_api_key")
.sourceRegion("source_region")
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ internal class NamespaceServiceTest {
NamespaceCopyFromParams.builder()
.namespace("namespace")
.sourceNamespace("source_namespace")
.destEncryption(
Encryption.CustomerManaged.builder().keyName("key_name").build()
)
.sourceApiKey("source_api_key")
.sourceRegion("source_region")
.build()
Expand Down
Loading