diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 10f30916..6b7b74c5 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.2.0"
+ ".": "0.3.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index d4e53809..f925a83b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,3 +1,3 @@
-configured_endpoints: 24
-openapi_spec_hash: c97a5263afcc72ca5a47bc5a87683a78
-config_hash: f0743196c68fb84cbd06a95f134702b3
+configured_endpoints: 25
+openapi_spec_hash: 4eff18b3478c98a9b257ac27fdeb6b49
+config_hash: b415187e3925c414fb2597cdd0a11859
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cce19b3d..ff466380 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.3.0 (2026-01-09)
+
+Full Changelog: [v0.2.0...v0.3.0](https://github.com/openlayer-ai/openlayer-java/compare/v0.2.0...v0.3.0)
+
+### Features
+
+* **closes OPEN-8532:** expose 'tests/{id}/results' endpoint ([8815922](https://github.com/openlayer-ai/openlayer-java/commit/88159223fd10a427d7bfabe640439c1cebea4cc3))
+
## 0.2.0 (2026-01-09)
Full Changelog: [v0.1.1...v0.2.0](https://github.com/openlayer-ai/openlayer-java/compare/v0.1.1...v0.2.0)
diff --git a/README.md b/README.md
index a3129d89..0bc9b920 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.2.0)
-[](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.2.0)
+[](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.3.0)
+[](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.3.0)
@@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/).
-The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.2.0).
+The REST API documentation can be found on [openlayer.com](https://openlayer.com/docs/api-reference/rest/overview). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.3.0).
@@ -24,7 +24,7 @@ The REST API documentation can be found on [openlayer.com](https://openlayer.com
### Gradle
```kotlin
-implementation("com.openlayer.api:openlayer-java:0.2.0")
+implementation("com.openlayer.api:openlayer-java:0.3.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.openlayer.api:openlayer-java:0.2.0")
com.openlayer.api
openlayer-java
- 0.2.0
+ 0.3.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index d440efd6..d977354f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.openlayer.api"
- version = "0.2.0" // x-release-please-version
+ version = "0.3.0" // x-release-please-version
}
subprojects {
diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt
index ee68b7e0..a3c4dbd5 100644
--- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt
+++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/commits/testresults/TestResultListResponse.kt
@@ -195,8 +195,11 @@ private constructor(
private val projectVersionId: JsonField,
private val status: JsonField,
private val statusMessage: JsonField,
+ private val expectedValues: JsonField>,
private val goal: JsonField,
private val goalId: JsonField,
+ private val rows: JsonField,
+ private val rowsBody: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -225,8 +228,15 @@ private constructor(
@JsonProperty("statusMessage")
@ExcludeMissing
statusMessage: JsonField = JsonMissing.of(),
+ @JsonProperty("expectedValues")
+ @ExcludeMissing
+ expectedValues: JsonField> = JsonMissing.of(),
@JsonProperty("goal") @ExcludeMissing goal: JsonField = JsonMissing.of(),
@JsonProperty("goalId") @ExcludeMissing goalId: JsonField = JsonMissing.of(),
+ @JsonProperty("rows") @ExcludeMissing rows: JsonField = JsonMissing.of(),
+ @JsonProperty("rowsBody")
+ @ExcludeMissing
+ rowsBody: JsonField = JsonMissing.of(),
) : this(
id,
dateCreated,
@@ -237,8 +247,11 @@ private constructor(
projectVersionId,
status,
statusMessage,
+ expectedValues,
goal,
goalId,
+ rows,
+ rowsBody,
mutableMapOf(),
)
@@ -316,6 +329,13 @@ private constructor(
*/
fun statusMessage(): Optional = statusMessage.getOptional("statusMessage")
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun expectedValues(): Optional> =
+ expectedValues.getOptional("expectedValues")
+
/**
* @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
@@ -330,6 +350,22 @@ private constructor(
*/
fun goalId(): Optional = goalId.getOptional("goalId")
+ /**
+ * The URL to the rows of the test result.
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun rows(): Optional = rows.getOptional("rows")
+
+ /**
+ * The body of the rows request.
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun rowsBody(): Optional = rowsBody.getOptional("rowsBody")
+
/**
* Returns the raw JSON value of [id].
*
@@ -412,6 +448,16 @@ private constructor(
@ExcludeMissing
fun _statusMessage(): JsonField = statusMessage
+ /**
+ * Returns the raw JSON value of [expectedValues].
+ *
+ * Unlike [expectedValues], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("expectedValues")
+ @ExcludeMissing
+ fun _expectedValues(): JsonField> = expectedValues
+
/**
* Returns the raw JSON value of [goal].
*
@@ -426,6 +472,20 @@ private constructor(
*/
@JsonProperty("goalId") @ExcludeMissing fun _goalId(): JsonField = goalId
+ /**
+ * Returns the raw JSON value of [rows].
+ *
+ * Unlike [rows], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("rows") @ExcludeMissing fun _rows(): JsonField = rows
+
+ /**
+ * Returns the raw JSON value of [rowsBody].
+ *
+ * Unlike [rowsBody], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("rowsBody") @ExcludeMissing fun _rowsBody(): JsonField = rowsBody
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -471,8 +531,11 @@ private constructor(
private var projectVersionId: JsonField? = null
private var status: JsonField? = null
private var statusMessage: JsonField? = null
+ private var expectedValues: JsonField>? = null
private var goal: JsonField = JsonMissing.of()
private var goalId: JsonField = JsonMissing.of()
+ private var rows: JsonField = JsonMissing.of()
+ private var rowsBody: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -486,8 +549,11 @@ private constructor(
projectVersionId = item.projectVersionId
status = item.status
statusMessage = item.statusMessage
+ expectedValues = item.expectedValues.map { it.toMutableList() }
goal = item.goal
goalId = item.goalId
+ rows = item.rows
+ rowsBody = item.rowsBody
additionalProperties = item.additionalProperties.toMutableMap()
}
@@ -643,6 +709,32 @@ private constructor(
this.statusMessage = statusMessage
}
+ fun expectedValues(expectedValues: List) =
+ expectedValues(JsonField.of(expectedValues))
+
+ /**
+ * Sets [Builder.expectedValues] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expectedValues] with a well-typed
+ * `List` value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun expectedValues(expectedValues: JsonField>) = apply {
+ this.expectedValues = expectedValues.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [ExpectedValue] to [expectedValues].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExpectedValue(expectedValue: ExpectedValue) = apply {
+ expectedValues =
+ (expectedValues ?: JsonField.of(mutableListOf())).also {
+ checkKnown("expectedValues", it).add(expectedValue)
+ }
+ }
+
fun goal(goal: Goal) = goal(JsonField.of(goal))
/**
@@ -669,6 +761,33 @@ private constructor(
*/
fun goalId(goalId: JsonField) = apply { this.goalId = goalId }
+ /** The URL to the rows of the test result. */
+ fun rows(rows: String) = rows(JsonField.of(rows))
+
+ /**
+ * Sets [Builder.rows] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.rows] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun rows(rows: JsonField) = apply { this.rows = rows }
+
+ /** The body of the rows request. */
+ fun rowsBody(rowsBody: RowsBody?) = rowsBody(JsonField.ofNullable(rowsBody))
+
+ /** Alias for calling [Builder.rowsBody] with `rowsBody.orElse(null)`. */
+ fun rowsBody(rowsBody: Optional) = rowsBody(rowsBody.getOrNull())
+
+ /**
+ * Sets [Builder.rowsBody] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.rowsBody] with a well-typed [RowsBody] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun rowsBody(rowsBody: JsonField) = apply { this.rowsBody = rowsBody }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -719,8 +838,11 @@ private constructor(
checkRequired("projectVersionId", projectVersionId),
checkRequired("status", status),
checkRequired("statusMessage", statusMessage),
+ (expectedValues ?: JsonMissing.of()).map { it.toImmutable() },
goal,
goalId,
+ rows,
+ rowsBody,
additionalProperties.toMutableMap(),
)
}
@@ -741,8 +863,11 @@ private constructor(
projectVersionId()
status().validate()
statusMessage()
+ expectedValues().ifPresent { it.forEach { it.validate() } }
goal().ifPresent { it.validate() }
goalId()
+ rows()
+ rowsBody().ifPresent { it.validate() }
validated = true
}
@@ -771,8 +896,11 @@ private constructor(
(if (projectVersionId.asKnown().isPresent) 1 else 0) +
(status.asKnown().getOrNull()?.validity() ?: 0) +
(if (statusMessage.asKnown().isPresent) 1 else 0) +
+ (expectedValues.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(goal.asKnown().getOrNull()?.validity() ?: 0) +
- (if (goalId.asKnown().isPresent) 1 else 0)
+ (if (goalId.asKnown().isPresent) 1 else 0) +
+ (if (rows.asKnown().isPresent) 1 else 0) +
+ (rowsBody.asKnown().getOrNull()?.validity() ?: 0)
/** The status of the test. */
class Status @JsonCreator private constructor(private val value: JsonField) : Enum {
@@ -922,6 +1050,277 @@ private constructor(
override fun toString() = value.toString()
}
+ class ExpectedValue
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val lowerThreshold: JsonField,
+ private val measurement: JsonField,
+ private val upperThreshold: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("lowerThreshold")
+ @ExcludeMissing
+ lowerThreshold: JsonField = JsonMissing.of(),
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ measurement: JsonField = JsonMissing.of(),
+ @JsonProperty("upperThreshold")
+ @ExcludeMissing
+ upperThreshold: JsonField = JsonMissing.of(),
+ ) : this(lowerThreshold, measurement, upperThreshold, mutableMapOf())
+
+ /**
+ * the lower threshold for the expected value
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun lowerThreshold(): Optional = lowerThreshold.getOptional("lowerThreshold")
+
+ /**
+ * One of the `measurement` values in the test's thresholds
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun measurement(): Optional = measurement.getOptional("measurement")
+
+ /**
+ * The upper threshold for the expected value
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun upperThreshold(): Optional = upperThreshold.getOptional("upperThreshold")
+
+ /**
+ * Returns the raw JSON value of [lowerThreshold].
+ *
+ * Unlike [lowerThreshold], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("lowerThreshold")
+ @ExcludeMissing
+ fun _lowerThreshold(): JsonField = lowerThreshold
+
+ /**
+ * Returns the raw JSON value of [measurement].
+ *
+ * Unlike [measurement], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ fun _measurement(): JsonField = measurement
+
+ /**
+ * Returns the raw JSON value of [upperThreshold].
+ *
+ * Unlike [upperThreshold], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("upperThreshold")
+ @ExcludeMissing
+ fun _upperThreshold(): JsonField = upperThreshold
+
+ @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 [ExpectedValue]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [ExpectedValue]. */
+ class Builder internal constructor() {
+
+ private var lowerThreshold: JsonField = JsonMissing.of()
+ private var measurement: JsonField = JsonMissing.of()
+ private var upperThreshold: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(expectedValue: ExpectedValue) = apply {
+ lowerThreshold = expectedValue.lowerThreshold
+ measurement = expectedValue.measurement
+ upperThreshold = expectedValue.upperThreshold
+ additionalProperties = expectedValue.additionalProperties.toMutableMap()
+ }
+
+ /** the lower threshold for the expected value */
+ fun lowerThreshold(lowerThreshold: Float?) =
+ lowerThreshold(JsonField.ofNullable(lowerThreshold))
+
+ /**
+ * Alias for [Builder.lowerThreshold].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun lowerThreshold(lowerThreshold: Float) = lowerThreshold(lowerThreshold as Float?)
+
+ /**
+ * Alias for calling [Builder.lowerThreshold] with `lowerThreshold.orElse(null)`.
+ */
+ fun lowerThreshold(lowerThreshold: Optional) =
+ lowerThreshold(lowerThreshold.getOrNull())
+
+ /**
+ * Sets [Builder.lowerThreshold] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.lowerThreshold] with a well-typed [Float] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun lowerThreshold(lowerThreshold: JsonField) = apply {
+ this.lowerThreshold = lowerThreshold
+ }
+
+ /** One of the `measurement` values in the test's thresholds */
+ fun measurement(measurement: String) = measurement(JsonField.of(measurement))
+
+ /**
+ * Sets [Builder.measurement] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.measurement] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun measurement(measurement: JsonField) = apply {
+ this.measurement = measurement
+ }
+
+ /** The upper threshold for the expected value */
+ fun upperThreshold(upperThreshold: Float?) =
+ upperThreshold(JsonField.ofNullable(upperThreshold))
+
+ /**
+ * Alias for [Builder.upperThreshold].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun upperThreshold(upperThreshold: Float) = upperThreshold(upperThreshold as Float?)
+
+ /**
+ * Alias for calling [Builder.upperThreshold] with `upperThreshold.orElse(null)`.
+ */
+ fun upperThreshold(upperThreshold: Optional) =
+ upperThreshold(upperThreshold.getOrNull())
+
+ /**
+ * Sets [Builder.upperThreshold] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.upperThreshold] with a well-typed [Float] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun upperThreshold(upperThreshold: JsonField) = apply {
+ this.upperThreshold = upperThreshold
+ }
+
+ 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 [ExpectedValue].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): ExpectedValue =
+ ExpectedValue(
+ lowerThreshold,
+ measurement,
+ upperThreshold,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): ExpectedValue = apply {
+ if (validated) {
+ return@apply
+ }
+
+ lowerThreshold()
+ measurement()
+ upperThreshold()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 (lowerThreshold.asKnown().isPresent) 1 else 0) +
+ (if (measurement.asKnown().isPresent) 1 else 0) +
+ (if (upperThreshold.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is ExpectedValue &&
+ lowerThreshold == other.lowerThreshold &&
+ measurement == other.measurement &&
+ upperThreshold == other.upperThreshold &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(lowerThreshold, measurement, upperThreshold, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "ExpectedValue{lowerThreshold=$lowerThreshold, measurement=$measurement, upperThreshold=$upperThreshold, additionalProperties=$additionalProperties}"
+ }
+
class Goal
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
@@ -4022,6 +4421,2375 @@ private constructor(
"Goal{id=$id, commentCount=$commentCount, creatorId=$creatorId, dateArchived=$dateArchived, dateCreated=$dateCreated, dateUpdated=$dateUpdated, description=$description, name=$name, number=$number, originProjectVersionId=$originProjectVersionId, subtype=$subtype, suggested=$suggested, thresholds=$thresholds, type=$type, archived=$archived, delayWindow=$delayWindow, evaluationWindow=$evaluationWindow, usesMlModel=$usesMlModel, usesProductionData=$usesProductionData, usesReferenceDataset=$usesReferenceDataset, usesTrainingDataset=$usesTrainingDataset, usesValidationDataset=$usesValidationDataset, additionalProperties=$additionalProperties}"
}
+ /** The body of the rows request. */
+ class RowsBody
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val columnFilters: JsonField>,
+ private val excludeRowIdList: JsonField>,
+ private val notSearchQueryAnd: JsonField>,
+ private val notSearchQueryOr: JsonField>,
+ private val rowIdList: JsonField>,
+ private val searchQueryAnd: JsonField>,
+ private val searchQueryOr: JsonField>,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("columnFilters")
+ @ExcludeMissing
+ columnFilters: JsonField> = JsonMissing.of(),
+ @JsonProperty("excludeRowIdList")
+ @ExcludeMissing
+ excludeRowIdList: JsonField> = JsonMissing.of(),
+ @JsonProperty("notSearchQueryAnd")
+ @ExcludeMissing
+ notSearchQueryAnd: JsonField> = JsonMissing.of(),
+ @JsonProperty("notSearchQueryOr")
+ @ExcludeMissing
+ notSearchQueryOr: JsonField> = JsonMissing.of(),
+ @JsonProperty("rowIdList")
+ @ExcludeMissing
+ rowIdList: JsonField> = JsonMissing.of(),
+ @JsonProperty("searchQueryAnd")
+ @ExcludeMissing
+ searchQueryAnd: JsonField> = JsonMissing.of(),
+ @JsonProperty("searchQueryOr")
+ @ExcludeMissing
+ searchQueryOr: JsonField> = JsonMissing.of(),
+ ) : this(
+ columnFilters,
+ excludeRowIdList,
+ notSearchQueryAnd,
+ notSearchQueryOr,
+ rowIdList,
+ searchQueryAnd,
+ searchQueryOr,
+ mutableMapOf(),
+ )
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun columnFilters(): Optional> =
+ columnFilters.getOptional("columnFilters")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun excludeRowIdList(): Optional> =
+ excludeRowIdList.getOptional("excludeRowIdList")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun notSearchQueryAnd(): Optional> =
+ notSearchQueryAnd.getOptional("notSearchQueryAnd")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun notSearchQueryOr(): Optional> =
+ notSearchQueryOr.getOptional("notSearchQueryOr")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun rowIdList(): Optional> = rowIdList.getOptional("rowIdList")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun searchQueryAnd(): Optional> =
+ searchQueryAnd.getOptional("searchQueryAnd")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun searchQueryOr(): Optional> = searchQueryOr.getOptional("searchQueryOr")
+
+ /**
+ * Returns the raw JSON value of [columnFilters].
+ *
+ * Unlike [columnFilters], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("columnFilters")
+ @ExcludeMissing
+ fun _columnFilters(): JsonField> = columnFilters
+
+ /**
+ * Returns the raw JSON value of [excludeRowIdList].
+ *
+ * Unlike [excludeRowIdList], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("excludeRowIdList")
+ @ExcludeMissing
+ fun _excludeRowIdList(): JsonField> = excludeRowIdList
+
+ /**
+ * Returns the raw JSON value of [notSearchQueryAnd].
+ *
+ * Unlike [notSearchQueryAnd], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("notSearchQueryAnd")
+ @ExcludeMissing
+ fun _notSearchQueryAnd(): JsonField> = notSearchQueryAnd
+
+ /**
+ * Returns the raw JSON value of [notSearchQueryOr].
+ *
+ * Unlike [notSearchQueryOr], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("notSearchQueryOr")
+ @ExcludeMissing
+ fun _notSearchQueryOr(): JsonField> = notSearchQueryOr
+
+ /**
+ * Returns the raw JSON value of [rowIdList].
+ *
+ * Unlike [rowIdList], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("rowIdList")
+ @ExcludeMissing
+ fun _rowIdList(): JsonField> = rowIdList
+
+ /**
+ * Returns the raw JSON value of [searchQueryAnd].
+ *
+ * Unlike [searchQueryAnd], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("searchQueryAnd")
+ @ExcludeMissing
+ fun _searchQueryAnd(): JsonField> = searchQueryAnd
+
+ /**
+ * Returns the raw JSON value of [searchQueryOr].
+ *
+ * Unlike [searchQueryOr], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("searchQueryOr")
+ @ExcludeMissing
+ fun _searchQueryOr(): JsonField> = searchQueryOr
+
+ @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 [RowsBody]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [RowsBody]. */
+ class Builder internal constructor() {
+
+ private var columnFilters: JsonField>? = null
+ private var excludeRowIdList: JsonField>? = null
+ private var notSearchQueryAnd: JsonField>? = null
+ private var notSearchQueryOr: JsonField>? = null
+ private var rowIdList: JsonField>? = null
+ private var searchQueryAnd: JsonField>? = null
+ private var searchQueryOr: JsonField>? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(rowsBody: RowsBody) = apply {
+ columnFilters = rowsBody.columnFilters.map { it.toMutableList() }
+ excludeRowIdList = rowsBody.excludeRowIdList.map { it.toMutableList() }
+ notSearchQueryAnd = rowsBody.notSearchQueryAnd.map { it.toMutableList() }
+ notSearchQueryOr = rowsBody.notSearchQueryOr.map { it.toMutableList() }
+ rowIdList = rowsBody.rowIdList.map { it.toMutableList() }
+ searchQueryAnd = rowsBody.searchQueryAnd.map { it.toMutableList() }
+ searchQueryOr = rowsBody.searchQueryOr.map { it.toMutableList() }
+ additionalProperties = rowsBody.additionalProperties.toMutableMap()
+ }
+
+ fun columnFilters(columnFilters: List?) =
+ columnFilters(JsonField.ofNullable(columnFilters))
+
+ /** Alias for calling [Builder.columnFilters] with `columnFilters.orElse(null)`. */
+ fun columnFilters(columnFilters: Optional>) =
+ columnFilters(columnFilters.getOrNull())
+
+ /**
+ * Sets [Builder.columnFilters] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.columnFilters] with a well-typed
+ * `List` value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun columnFilters(columnFilters: JsonField>) = apply {
+ this.columnFilters = columnFilters.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [ColumnFilter] to [columnFilters].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addColumnFilter(columnFilter: ColumnFilter) = apply {
+ columnFilters =
+ (columnFilters ?: JsonField.of(mutableListOf())).also {
+ checkKnown("columnFilters", it).add(columnFilter)
+ }
+ }
+
+ /** Alias for calling [addColumnFilter] with `ColumnFilter.ofSet(set)`. */
+ fun addColumnFilter(set: ColumnFilter.SetColumnFilter) =
+ addColumnFilter(ColumnFilter.ofSet(set))
+
+ /** Alias for calling [addColumnFilter] with `ColumnFilter.ofNumeric(numeric)`. */
+ fun addColumnFilter(numeric: ColumnFilter.NumericColumnFilter) =
+ addColumnFilter(ColumnFilter.ofNumeric(numeric))
+
+ /** Alias for calling [addColumnFilter] with `ColumnFilter.ofString(string)`. */
+ fun addColumnFilter(string: ColumnFilter.StringColumnFilter) =
+ addColumnFilter(ColumnFilter.ofString(string))
+
+ fun excludeRowIdList(excludeRowIdList: List?) =
+ excludeRowIdList(JsonField.ofNullable(excludeRowIdList))
+
+ /**
+ * Alias for calling [Builder.excludeRowIdList] with
+ * `excludeRowIdList.orElse(null)`.
+ */
+ fun excludeRowIdList(excludeRowIdList: Optional>) =
+ excludeRowIdList(excludeRowIdList.getOrNull())
+
+ /**
+ * Sets [Builder.excludeRowIdList] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.excludeRowIdList] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun excludeRowIdList(excludeRowIdList: JsonField>) = apply {
+ this.excludeRowIdList = excludeRowIdList.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Long] to [Builder.excludeRowIdList].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addExcludeRowIdList(excludeRowIdList: Long) = apply {
+ this.excludeRowIdList =
+ (this.excludeRowIdList ?: JsonField.of(mutableListOf())).also {
+ checkKnown("excludeRowIdList", it).add(excludeRowIdList)
+ }
+ }
+
+ fun notSearchQueryAnd(notSearchQueryAnd: List?) =
+ notSearchQueryAnd(JsonField.ofNullable(notSearchQueryAnd))
+
+ /**
+ * Alias for calling [Builder.notSearchQueryAnd] with
+ * `notSearchQueryAnd.orElse(null)`.
+ */
+ fun notSearchQueryAnd(notSearchQueryAnd: Optional>) =
+ notSearchQueryAnd(notSearchQueryAnd.getOrNull())
+
+ /**
+ * Sets [Builder.notSearchQueryAnd] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.notSearchQueryAnd] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun notSearchQueryAnd(notSearchQueryAnd: JsonField>) = apply {
+ this.notSearchQueryAnd = notSearchQueryAnd.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [Builder.notSearchQueryAnd].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addNotSearchQueryAnd(notSearchQueryAnd: String) = apply {
+ this.notSearchQueryAnd =
+ (this.notSearchQueryAnd ?: JsonField.of(mutableListOf())).also {
+ checkKnown("notSearchQueryAnd", it).add(notSearchQueryAnd)
+ }
+ }
+
+ fun notSearchQueryOr(notSearchQueryOr: List?) =
+ notSearchQueryOr(JsonField.ofNullable(notSearchQueryOr))
+
+ /**
+ * Alias for calling [Builder.notSearchQueryOr] with
+ * `notSearchQueryOr.orElse(null)`.
+ */
+ fun notSearchQueryOr(notSearchQueryOr: Optional>) =
+ notSearchQueryOr(notSearchQueryOr.getOrNull())
+
+ /**
+ * Sets [Builder.notSearchQueryOr] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.notSearchQueryOr] with a well-typed
+ * `List` value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun notSearchQueryOr(notSearchQueryOr: JsonField>) = apply {
+ this.notSearchQueryOr = notSearchQueryOr.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [Builder.notSearchQueryOr].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addNotSearchQueryOr(notSearchQueryOr: String) = apply {
+ this.notSearchQueryOr =
+ (this.notSearchQueryOr ?: JsonField.of(mutableListOf())).also {
+ checkKnown("notSearchQueryOr", it).add(notSearchQueryOr)
+ }
+ }
+
+ fun rowIdList(rowIdList: List?) = rowIdList(JsonField.ofNullable(rowIdList))
+
+ /** Alias for calling [Builder.rowIdList] with `rowIdList.orElse(null)`. */
+ fun rowIdList(rowIdList: Optional>) = rowIdList(rowIdList.getOrNull())
+
+ /**
+ * Sets [Builder.rowIdList] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.rowIdList] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun rowIdList(rowIdList: JsonField>) = apply {
+ this.rowIdList = rowIdList.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Long] to [Builder.rowIdList].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addRowIdList(rowIdList: Long) = apply {
+ this.rowIdList =
+ (this.rowIdList ?: JsonField.of(mutableListOf())).also {
+ checkKnown("rowIdList", it).add(rowIdList)
+ }
+ }
+
+ fun searchQueryAnd(searchQueryAnd: List?) =
+ searchQueryAnd(JsonField.ofNullable(searchQueryAnd))
+
+ /**
+ * Alias for calling [Builder.searchQueryAnd] with `searchQueryAnd.orElse(null)`.
+ */
+ fun searchQueryAnd(searchQueryAnd: Optional>) =
+ searchQueryAnd(searchQueryAnd.getOrNull())
+
+ /**
+ * Sets [Builder.searchQueryAnd] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.searchQueryAnd] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun searchQueryAnd(searchQueryAnd: JsonField>) = apply {
+ this.searchQueryAnd = searchQueryAnd.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [Builder.searchQueryAnd].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addSearchQueryAnd(searchQueryAnd: String) = apply {
+ this.searchQueryAnd =
+ (this.searchQueryAnd ?: JsonField.of(mutableListOf())).also {
+ checkKnown("searchQueryAnd", it).add(searchQueryAnd)
+ }
+ }
+
+ fun searchQueryOr(searchQueryOr: List?) =
+ searchQueryOr(JsonField.ofNullable(searchQueryOr))
+
+ /** Alias for calling [Builder.searchQueryOr] with `searchQueryOr.orElse(null)`. */
+ fun searchQueryOr(searchQueryOr: Optional>) =
+ searchQueryOr(searchQueryOr.getOrNull())
+
+ /**
+ * Sets [Builder.searchQueryOr] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.searchQueryOr] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun searchQueryOr(searchQueryOr: JsonField>) = apply {
+ this.searchQueryOr = searchQueryOr.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [Builder.searchQueryOr].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addSearchQueryOr(searchQueryOr: String) = apply {
+ this.searchQueryOr =
+ (this.searchQueryOr ?: JsonField.of(mutableListOf())).also {
+ checkKnown("searchQueryOr", it).add(searchQueryOr)
+ }
+ }
+
+ 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 [RowsBody].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): RowsBody =
+ RowsBody(
+ (columnFilters ?: JsonMissing.of()).map { it.toImmutable() },
+ (excludeRowIdList ?: JsonMissing.of()).map { it.toImmutable() },
+ (notSearchQueryAnd ?: JsonMissing.of()).map { it.toImmutable() },
+ (notSearchQueryOr ?: JsonMissing.of()).map { it.toImmutable() },
+ (rowIdList ?: JsonMissing.of()).map { it.toImmutable() },
+ (searchQueryAnd ?: JsonMissing.of()).map { it.toImmutable() },
+ (searchQueryOr ?: JsonMissing.of()).map { it.toImmutable() },
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): RowsBody = apply {
+ if (validated) {
+ return@apply
+ }
+
+ columnFilters().ifPresent { it.forEach { it.validate() } }
+ excludeRowIdList()
+ notSearchQueryAnd()
+ notSearchQueryOr()
+ rowIdList()
+ searchQueryAnd()
+ searchQueryOr()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 =
+ (columnFilters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (excludeRowIdList.asKnown().getOrNull()?.size ?: 0) +
+ (notSearchQueryAnd.asKnown().getOrNull()?.size ?: 0) +
+ (notSearchQueryOr.asKnown().getOrNull()?.size ?: 0) +
+ (rowIdList.asKnown().getOrNull()?.size ?: 0) +
+ (searchQueryAnd.asKnown().getOrNull()?.size ?: 0) +
+ (searchQueryOr.asKnown().getOrNull()?.size ?: 0)
+
+ @JsonDeserialize(using = ColumnFilter.Deserializer::class)
+ @JsonSerialize(using = ColumnFilter.Serializer::class)
+ class ColumnFilter
+ private constructor(
+ private val set: SetColumnFilter? = null,
+ private val numeric: NumericColumnFilter? = null,
+ private val string: StringColumnFilter? = null,
+ private val _json: JsonValue? = null,
+ ) {
+
+ fun set(): Optional = Optional.ofNullable(set)
+
+ fun numeric(): Optional = Optional.ofNullable(numeric)
+
+ fun string(): Optional = Optional.ofNullable(string)
+
+ fun isSet(): Boolean = set != null
+
+ fun isNumeric(): Boolean = numeric != null
+
+ fun isString(): Boolean = string != null
+
+ fun asSet(): SetColumnFilter = set.getOrThrow("set")
+
+ fun asNumeric(): NumericColumnFilter = numeric.getOrThrow("numeric")
+
+ fun asString(): StringColumnFilter = string.getOrThrow("string")
+
+ fun _json(): Optional = Optional.ofNullable(_json)
+
+ fun accept(visitor: Visitor): T =
+ when {
+ set != null -> visitor.visitSet(set)
+ numeric != null -> visitor.visitNumeric(numeric)
+ string != null -> visitor.visitString(string)
+ else -> visitor.unknown(_json)
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): ColumnFilter = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accept(
+ object : Visitor {
+ override fun visitSet(set: SetColumnFilter) {
+ set.validate()
+ }
+
+ override fun visitNumeric(numeric: NumericColumnFilter) {
+ numeric.validate()
+ }
+
+ override fun visitString(string: StringColumnFilter) {
+ string.validate()
+ }
+ }
+ )
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ accept(
+ object : Visitor {
+ override fun visitSet(set: SetColumnFilter) = set.validity()
+
+ override fun visitNumeric(numeric: NumericColumnFilter) =
+ numeric.validity()
+
+ override fun visitString(string: StringColumnFilter) = string.validity()
+
+ override fun unknown(json: JsonValue?) = 0
+ }
+ )
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is ColumnFilter &&
+ set == other.set &&
+ numeric == other.numeric &&
+ string == other.string
+ }
+
+ override fun hashCode(): Int = Objects.hash(set, numeric, string)
+
+ override fun toString(): String =
+ when {
+ set != null -> "ColumnFilter{set=$set}"
+ numeric != null -> "ColumnFilter{numeric=$numeric}"
+ string != null -> "ColumnFilter{string=$string}"
+ _json != null -> "ColumnFilter{_unknown=$_json}"
+ else -> throw IllegalStateException("Invalid ColumnFilter")
+ }
+
+ companion object {
+
+ @JvmStatic fun ofSet(set: SetColumnFilter) = ColumnFilter(set = set)
+
+ @JvmStatic
+ fun ofNumeric(numeric: NumericColumnFilter) = ColumnFilter(numeric = numeric)
+
+ @JvmStatic
+ fun ofString(string: StringColumnFilter) = ColumnFilter(string = string)
+ }
+
+ /**
+ * An interface that defines how to map each variant of [ColumnFilter] to a value of
+ * type [T].
+ */
+ interface Visitor {
+
+ fun visitSet(set: SetColumnFilter): T
+
+ fun visitNumeric(numeric: NumericColumnFilter): T
+
+ fun visitString(string: StringColumnFilter): T
+
+ /**
+ * Maps an unknown variant of [ColumnFilter] to a value of type [T].
+ *
+ * An instance of [ColumnFilter] can contain an unknown variant if it was
+ * deserialized from data that doesn't match any known variant. For example, if
+ * the SDK is on an older version than the API, then the API may respond with
+ * new variants that the SDK is unaware of.
+ *
+ * @throws OpenlayerInvalidDataException in the default implementation.
+ */
+ fun unknown(json: JsonValue?): T {
+ throw OpenlayerInvalidDataException("Unknown ColumnFilter: $json")
+ }
+ }
+
+ internal class Deserializer : BaseDeserializer(ColumnFilter::class) {
+
+ override fun ObjectCodec.deserialize(node: JsonNode): ColumnFilter {
+ val json = JsonValue.fromJsonNode(node)
+
+ val bestMatches =
+ sequenceOf(
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ ColumnFilter(set = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { ColumnFilter(numeric = it, _json = json) },
+ tryDeserialize(node, jacksonTypeRef())
+ ?.let { ColumnFilter(string = it, _json = json) },
+ )
+ .filterNotNull()
+ .allMaxBy { it.validity() }
+ .toList()
+ return when (bestMatches.size) {
+ // This can happen if what we're deserializing is completely
+ // incompatible with all the possible variants (e.g. deserializing from
+ // boolean).
+ 0 -> ColumnFilter(_json = json)
+ 1 -> bestMatches.single()
+ // If there's more than one match with the highest validity, then use
+ // the first completely valid match, or simply the first match if none
+ // are completely valid.
+ else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first()
+ }
+ }
+ }
+
+ internal class Serializer : BaseSerializer(ColumnFilter::class) {
+
+ override fun serialize(
+ value: ColumnFilter,
+ generator: JsonGenerator,
+ provider: SerializerProvider,
+ ) {
+ when {
+ value.set != null -> generator.writeObject(value.set)
+ value.numeric != null -> generator.writeObject(value.numeric)
+ value.string != null -> generator.writeObject(value.string)
+ value._json != null -> generator.writeObject(value._json)
+ else -> throw IllegalStateException("Invalid ColumnFilter")
+ }
+ }
+ }
+
+ class SetColumnFilter
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val measurement: JsonField,
+ private val operator: JsonField,
+ private val value: JsonField>,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ measurement: JsonField = JsonMissing.of(),
+ @JsonProperty("operator")
+ @ExcludeMissing
+ operator: JsonField = JsonMissing.of(),
+ @JsonProperty("value")
+ @ExcludeMissing
+ value: JsonField> = JsonMissing.of(),
+ ) : this(measurement, operator, value, mutableMapOf())
+
+ /**
+ * The name of the column.
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun measurement(): String = measurement.getRequired("measurement")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun operator(): Operator = operator.getRequired("operator")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun value(): List = value.getRequired("value")
+
+ /**
+ * Returns the raw JSON value of [measurement].
+ *
+ * Unlike [measurement], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ fun _measurement(): JsonField = measurement
+
+ /**
+ * Returns the raw JSON value of [operator].
+ *
+ * Unlike [operator], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("operator")
+ @ExcludeMissing
+ fun _operator(): JsonField = operator
+
+ /**
+ * Returns the raw JSON value of [value].
+ *
+ * Unlike [value], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("value")
+ @ExcludeMissing
+ fun _value(): JsonField> = value
+
+ @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
+ * [SetColumnFilter].
+ *
+ * The following fields are required:
+ * ```java
+ * .measurement()
+ * .operator()
+ * .value()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [SetColumnFilter]. */
+ class Builder internal constructor() {
+
+ private var measurement: JsonField? = null
+ private var operator: JsonField? = null
+ private var value: JsonField>? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(setColumnFilter: SetColumnFilter) = apply {
+ measurement = setColumnFilter.measurement
+ operator = setColumnFilter.operator
+ value = setColumnFilter.value.map { it.toMutableList() }
+ additionalProperties =
+ setColumnFilter.additionalProperties.toMutableMap()
+ }
+
+ /** The name of the column. */
+ fun measurement(measurement: String) =
+ measurement(JsonField.of(measurement))
+
+ /**
+ * Sets [Builder.measurement] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.measurement] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun measurement(measurement: JsonField) = apply {
+ this.measurement = measurement
+ }
+
+ fun operator(operator: Operator) = operator(JsonField.of(operator))
+
+ /**
+ * Sets [Builder.operator] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.operator] with a well-typed [Operator]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun operator(operator: JsonField) = apply {
+ this.operator = operator
+ }
+
+ fun value(value: List) = value(JsonField.of(value))
+
+ /**
+ * Sets [Builder.value] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.value] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun value(value: JsonField>) = apply {
+ this.value = value.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Value] to [Builder.value].
+ *
+ * @throws IllegalStateException if the field was previously set to a
+ * non-list.
+ */
+ fun addValue(value: Value) = apply {
+ this.value =
+ (this.value ?: JsonField.of(mutableListOf())).also {
+ checkKnown("value", it).add(value)
+ }
+ }
+
+ /** Alias for calling [addValue] with `Value.ofString(string)`. */
+ fun addValue(string: String) = addValue(Value.ofString(string))
+
+ /** Alias for calling [addValue] with `Value.ofNumber(number)`. */
+ fun addValue(number: Double) = addValue(Value.ofNumber(number))
+
+ 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 [SetColumnFilter].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .measurement()
+ * .operator()
+ * .value()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): SetColumnFilter =
+ SetColumnFilter(
+ checkRequired("measurement", measurement),
+ checkRequired("operator", operator),
+ checkRequired("value", value).map { it.toImmutable() },
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): SetColumnFilter = apply {
+ if (validated) {
+ return@apply
+ }
+
+ measurement()
+ operator().validate()
+ value().forEach { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 (measurement.asKnown().isPresent) 1 else 0) +
+ (operator.asKnown().getOrNull()?.validity() ?: 0) +
+ (value.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+
+ class Operator
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data
+ * that doesn't match any known member, and you want to know that value. For
+ * example, if the SDK is on an older version than the API, then the API may
+ * respond with new members that the SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue
+ fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val CONTAINS_NONE = of("contains_none")
+
+ @JvmField val CONTAINS_ANY = of("contains_any")
+
+ @JvmField val CONTAINS_ALL = of("contains_all")
+
+ @JvmField val ONE_OF = of("one_of")
+
+ @JvmField val NONE_OF = of("none_of")
+
+ @JvmStatic fun of(value: String) = Operator(JsonField.of(value))
+ }
+
+ /** An enum containing [Operator]'s known values. */
+ enum class Known {
+ CONTAINS_NONE,
+ CONTAINS_ANY,
+ CONTAINS_ALL,
+ ONE_OF,
+ NONE_OF,
+ }
+
+ /**
+ * An enum containing [Operator]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [Operator] can contain an unknown value in a couple of
+ * cases:
+ * - It was deserialized from data that doesn't match any known member. For
+ * example, if the SDK is on an older version than the API, then the API
+ * may respond with new members that the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ CONTAINS_NONE,
+ CONTAINS_ANY,
+ CONTAINS_ALL,
+ ONE_OF,
+ NONE_OF,
+ /**
+ * An enum member indicating that [Operator] was instantiated with an
+ * unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always
+ * known or if you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ CONTAINS_NONE -> Value.CONTAINS_NONE
+ CONTAINS_ANY -> Value.CONTAINS_ANY
+ CONTAINS_ALL -> Value.CONTAINS_ALL
+ ONE_OF -> Value.ONE_OF
+ NONE_OF -> Value.NONE_OF
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always
+ * known and don't want to throw for the unknown case.
+ *
+ * @throws OpenlayerInvalidDataException if this class instance's value is a
+ * not a known member.
+ */
+ fun known(): Known =
+ when (this) {
+ CONTAINS_NONE -> Known.CONTAINS_NONE
+ CONTAINS_ANY -> Known.CONTAINS_ANY
+ CONTAINS_ALL -> Known.CONTAINS_ALL
+ ONE_OF -> Known.ONE_OF
+ NONE_OF -> Known.NONE_OF
+ else ->
+ throw OpenlayerInvalidDataException("Unknown Operator: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily
+ * for debugging and generally doesn't throw.
+ *
+ * @throws OpenlayerInvalidDataException if this class instance's value does
+ * not have the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ OpenlayerInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Operator = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Operator && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ @JsonDeserialize(using = Value.Deserializer::class)
+ @JsonSerialize(using = Value.Serializer::class)
+ class Value
+ private constructor(
+ private val string: String? = null,
+ private val number: Double? = null,
+ private val _json: JsonValue? = null,
+ ) {
+
+ fun string(): Optional = Optional.ofNullable(string)
+
+ fun number(): Optional = Optional.ofNullable(number)
+
+ fun isString(): Boolean = string != null
+
+ fun isNumber(): Boolean = number != null
+
+ fun asString(): String = string.getOrThrow("string")
+
+ fun asNumber(): Double = number.getOrThrow("number")
+
+ fun _json(): Optional = Optional.ofNullable(_json)
+
+ fun accept(visitor: Visitor): T =
+ when {
+ string != null -> visitor.visitString(string)
+ number != null -> visitor.visitNumber(number)
+ else -> visitor.unknown(_json)
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Value = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accept(
+ object : Visitor {
+ override fun visitString(string: String) {}
+
+ override fun visitNumber(number: Double) {}
+ }
+ )
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this
+ * object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ accept(
+ object : Visitor {
+ override fun visitString(string: String) = 1
+
+ override fun visitNumber(number: Double) = 1
+
+ override fun unknown(json: JsonValue?) = 0
+ }
+ )
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Value &&
+ string == other.string &&
+ number == other.number
+ }
+
+ override fun hashCode(): Int = Objects.hash(string, number)
+
+ override fun toString(): String =
+ when {
+ string != null -> "Value{string=$string}"
+ number != null -> "Value{number=$number}"
+ _json != null -> "Value{_unknown=$_json}"
+ else -> throw IllegalStateException("Invalid Value")
+ }
+
+ companion object {
+
+ @JvmStatic fun ofString(string: String) = Value(string = string)
+
+ @JvmStatic fun ofNumber(number: Double) = Value(number = number)
+ }
+
+ /**
+ * An interface that defines how to map each variant of [Value] to a value
+ * of type [T].
+ */
+ interface Visitor {
+
+ fun visitString(string: String): T
+
+ fun visitNumber(number: Double): T
+
+ /**
+ * Maps an unknown variant of [Value] to a value of type [T].
+ *
+ * An instance of [Value] can contain an unknown variant if it was
+ * deserialized from data that doesn't match any known variant. For
+ * example, if the SDK is on an older version than the API, then the API
+ * may respond with new variants that the SDK is unaware of.
+ *
+ * @throws OpenlayerInvalidDataException in the default implementation.
+ */
+ fun unknown(json: JsonValue?): T {
+ throw OpenlayerInvalidDataException("Unknown Value: $json")
+ }
+ }
+
+ internal class Deserializer : BaseDeserializer(Value::class) {
+
+ override fun ObjectCodec.deserialize(node: JsonNode): Value {
+ val json = JsonValue.fromJsonNode(node)
+
+ val bestMatches =
+ sequenceOf(
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Value(string = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Value(number = it, _json = json)
+ },
+ )
+ .filterNotNull()
+ .allMaxBy { it.validity() }
+ .toList()
+ return when (bestMatches.size) {
+ // This can happen if what we're deserializing is completely
+ // incompatible with all the possible variants (e.g.
+ // deserializing from object).
+ 0 -> Value(_json = json)
+ 1 -> bestMatches.single()
+ // If there's more than one match with the highest validity,
+ // then use the first completely valid match, or simply the
+ // first match if none are completely valid.
+ else ->
+ bestMatches.firstOrNull { it.isValid() }
+ ?: bestMatches.first()
+ }
+ }
+ }
+
+ internal class Serializer : BaseSerializer(Value::class) {
+
+ override fun serialize(
+ value: Value,
+ generator: JsonGenerator,
+ provider: SerializerProvider,
+ ) {
+ when {
+ value.string != null -> generator.writeObject(value.string)
+ value.number != null -> generator.writeObject(value.number)
+ value._json != null -> generator.writeObject(value._json)
+ else -> throw IllegalStateException("Invalid Value")
+ }
+ }
+ }
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is SetColumnFilter &&
+ measurement == other.measurement &&
+ operator == other.operator &&
+ value == other.value &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(measurement, operator, value, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "SetColumnFilter{measurement=$measurement, operator=$operator, value=$value, additionalProperties=$additionalProperties}"
+ }
+
+ class NumericColumnFilter
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val measurement: JsonField,
+ private val operator: JsonField,
+ private val value: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ measurement: JsonField = JsonMissing.of(),
+ @JsonProperty("operator")
+ @ExcludeMissing
+ operator: JsonField = JsonMissing.of(),
+ @JsonProperty("value")
+ @ExcludeMissing
+ value: JsonField = JsonMissing.of(),
+ ) : this(measurement, operator, value, mutableMapOf())
+
+ /**
+ * The name of the column.
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun measurement(): String = measurement.getRequired("measurement")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun operator(): Operator = operator.getRequired("operator")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type (e.g. if the server responded with an unexpected value).
+ */
+ fun value(): Optional = value.getOptional("value")
+
+ /**
+ * Returns the raw JSON value of [measurement].
+ *
+ * Unlike [measurement], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ fun _measurement(): JsonField = measurement
+
+ /**
+ * Returns the raw JSON value of [operator].
+ *
+ * Unlike [operator], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("operator")
+ @ExcludeMissing
+ fun _operator(): JsonField = operator
+
+ /**
+ * Returns the raw JSON value of [value].
+ *
+ * Unlike [value], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value
+
+ @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
+ * [NumericColumnFilter].
+ *
+ * The following fields are required:
+ * ```java
+ * .measurement()
+ * .operator()
+ * .value()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [NumericColumnFilter]. */
+ class Builder internal constructor() {
+
+ private var measurement: JsonField? = null
+ private var operator: JsonField? = null
+ private var value: JsonField? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(numericColumnFilter: NumericColumnFilter) = apply {
+ measurement = numericColumnFilter.measurement
+ operator = numericColumnFilter.operator
+ value = numericColumnFilter.value
+ additionalProperties =
+ numericColumnFilter.additionalProperties.toMutableMap()
+ }
+
+ /** The name of the column. */
+ fun measurement(measurement: String) =
+ measurement(JsonField.of(measurement))
+
+ /**
+ * Sets [Builder.measurement] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.measurement] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun measurement(measurement: JsonField) = apply {
+ this.measurement = measurement
+ }
+
+ fun operator(operator: Operator) = operator(JsonField.of(operator))
+
+ /**
+ * Sets [Builder.operator] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.operator] with a well-typed [Operator]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun operator(operator: JsonField) = apply {
+ this.operator = operator
+ }
+
+ fun value(value: Float?) = value(JsonField.ofNullable(value))
+
+ /**
+ * Alias for [Builder.value].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun value(value: Float) = value(value as Float?)
+
+ /** Alias for calling [Builder.value] with `value.orElse(null)`. */
+ fun value(value: Optional) = value(value.getOrNull())
+
+ /**
+ * Sets [Builder.value] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.value] with a well-typed [Float] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun value(value: JsonField) = apply { this.value = value }
+
+ 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 [NumericColumnFilter].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .measurement()
+ * .operator()
+ * .value()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): NumericColumnFilter =
+ NumericColumnFilter(
+ checkRequired("measurement", measurement),
+ checkRequired("operator", operator),
+ checkRequired("value", value),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): NumericColumnFilter = apply {
+ if (validated) {
+ return@apply
+ }
+
+ measurement()
+ operator().validate()
+ value()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 (measurement.asKnown().isPresent) 1 else 0) +
+ (operator.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (value.asKnown().isPresent) 1 else 0)
+
+ class Operator
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data
+ * that doesn't match any known member, and you want to know that value. For
+ * example, if the SDK is on an older version than the API, then the API may
+ * respond with new members that the SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue
+ fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val GREATER = of(">")
+
+ @JvmField val GREATER_OR_EQUALS = of(">=")
+
+ @JvmField val IS = of("is")
+
+ @JvmField val LESS = of("<")
+
+ @JvmField val LESS_OR_EQUALS = of("<=")
+
+ @JvmField val NOT_EQUALS = of("!=")
+
+ @JvmStatic fun of(value: String) = Operator(JsonField.of(value))
+ }
+
+ /** An enum containing [Operator]'s known values. */
+ enum class Known {
+ GREATER,
+ GREATER_OR_EQUALS,
+ IS,
+ LESS,
+ LESS_OR_EQUALS,
+ NOT_EQUALS,
+ }
+
+ /**
+ * An enum containing [Operator]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [Operator] can contain an unknown value in a couple of
+ * cases:
+ * - It was deserialized from data that doesn't match any known member. For
+ * example, if the SDK is on an older version than the API, then the API
+ * may respond with new members that the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ GREATER,
+ GREATER_OR_EQUALS,
+ IS,
+ LESS,
+ LESS_OR_EQUALS,
+ NOT_EQUALS,
+ /**
+ * An enum member indicating that [Operator] was instantiated with an
+ * unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always
+ * known or if you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ GREATER -> Value.GREATER
+ GREATER_OR_EQUALS -> Value.GREATER_OR_EQUALS
+ IS -> Value.IS
+ LESS -> Value.LESS
+ LESS_OR_EQUALS -> Value.LESS_OR_EQUALS
+ NOT_EQUALS -> Value.NOT_EQUALS
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always
+ * known and don't want to throw for the unknown case.
+ *
+ * @throws OpenlayerInvalidDataException if this class instance's value is a
+ * not a known member.
+ */
+ fun known(): Known =
+ when (this) {
+ GREATER -> Known.GREATER
+ GREATER_OR_EQUALS -> Known.GREATER_OR_EQUALS
+ IS -> Known.IS
+ LESS -> Known.LESS
+ LESS_OR_EQUALS -> Known.LESS_OR_EQUALS
+ NOT_EQUALS -> Known.NOT_EQUALS
+ else ->
+ throw OpenlayerInvalidDataException("Unknown Operator: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily
+ * for debugging and generally doesn't throw.
+ *
+ * @throws OpenlayerInvalidDataException if this class instance's value does
+ * not have the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ OpenlayerInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Operator = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Operator && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is NumericColumnFilter &&
+ measurement == other.measurement &&
+ operator == other.operator &&
+ value == other.value &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(measurement, operator, value, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "NumericColumnFilter{measurement=$measurement, operator=$operator, value=$value, additionalProperties=$additionalProperties}"
+ }
+
+ class StringColumnFilter
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val measurement: JsonField,
+ private val operator: JsonField,
+ private val value: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ measurement: JsonField = JsonMissing.of(),
+ @JsonProperty("operator")
+ @ExcludeMissing
+ operator: JsonField = JsonMissing.of(),
+ @JsonProperty("value")
+ @ExcludeMissing
+ value: JsonField = JsonMissing.of(),
+ ) : this(measurement, operator, value, mutableMapOf())
+
+ /**
+ * The name of the column.
+ *
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun measurement(): String = measurement.getRequired("measurement")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun operator(): Operator = operator.getRequired("operator")
+
+ /**
+ * @throws OpenlayerInvalidDataException if the JSON field has an unexpected
+ * type or is unexpectedly missing or null (e.g. if the server responded with
+ * an unexpected value).
+ */
+ fun value(): Value = value.getRequired("value")
+
+ /**
+ * Returns the raw JSON value of [measurement].
+ *
+ * Unlike [measurement], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("measurement")
+ @ExcludeMissing
+ fun _measurement(): JsonField = measurement
+
+ /**
+ * Returns the raw JSON value of [operator].
+ *
+ * Unlike [operator], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("operator")
+ @ExcludeMissing
+ fun _operator(): JsonField = operator
+
+ /**
+ * Returns the raw JSON value of [value].
+ *
+ * Unlike [value], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value
+
+ @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
+ * [StringColumnFilter].
+ *
+ * The following fields are required:
+ * ```java
+ * .measurement()
+ * .operator()
+ * .value()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [StringColumnFilter]. */
+ class Builder internal constructor() {
+
+ private var measurement: JsonField? = null
+ private var operator: JsonField? = null
+ private var value: JsonField? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(stringColumnFilter: StringColumnFilter) = apply {
+ measurement = stringColumnFilter.measurement
+ operator = stringColumnFilter.operator
+ value = stringColumnFilter.value
+ additionalProperties =
+ stringColumnFilter.additionalProperties.toMutableMap()
+ }
+
+ /** The name of the column. */
+ fun measurement(measurement: String) =
+ measurement(JsonField.of(measurement))
+
+ /**
+ * Sets [Builder.measurement] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.measurement] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun measurement(measurement: JsonField) = apply {
+ this.measurement = measurement
+ }
+
+ fun operator(operator: Operator) = operator(JsonField.of(operator))
+
+ /**
+ * Sets [Builder.operator] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.operator] with a well-typed [Operator]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun operator(operator: JsonField) = apply {
+ this.operator = operator
+ }
+
+ fun value(value: Value) = value(JsonField.of(value))
+
+ /**
+ * Sets [Builder.value] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.value] with a well-typed [Value] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun value(value: JsonField) = apply { this.value = value }
+
+ /** Alias for calling [value] with `Value.ofString(string)`. */
+ fun value(string: String) = value(Value.ofString(string))
+
+ /** Alias for calling [value] with `Value.ofBool(bool)`. */
+ fun value(bool: Boolean) = value(Value.ofBool(bool))
+
+ 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 [StringColumnFilter].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .measurement()
+ * .operator()
+ * .value()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): StringColumnFilter =
+ StringColumnFilter(
+ checkRequired("measurement", measurement),
+ checkRequired("operator", operator),
+ checkRequired("value", value),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): StringColumnFilter = apply {
+ if (validated) {
+ return@apply
+ }
+
+ measurement()
+ operator().validate()
+ value().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 (measurement.asKnown().isPresent) 1 else 0) +
+ (operator.asKnown().getOrNull()?.validity() ?: 0) +
+ (value.asKnown().getOrNull()?.validity() ?: 0)
+
+ class Operator
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data
+ * that doesn't match any known member, and you want to know that value. For
+ * example, if the SDK is on an older version than the API, then the API may
+ * respond with new members that the SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue
+ fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val IS = of("is")
+
+ @JvmField val NOT_EQUALS = of("!=")
+
+ @JvmStatic fun of(value: String) = Operator(JsonField.of(value))
+ }
+
+ /** An enum containing [Operator]'s known values. */
+ enum class Known {
+ IS,
+ NOT_EQUALS,
+ }
+
+ /**
+ * An enum containing [Operator]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [Operator] can contain an unknown value in a couple of
+ * cases:
+ * - It was deserialized from data that doesn't match any known member. For
+ * example, if the SDK is on an older version than the API, then the API
+ * may respond with new members that the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ IS,
+ NOT_EQUALS,
+ /**
+ * An enum member indicating that [Operator] was instantiated with an
+ * unknown value.
+ */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always
+ * known or if you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ IS -> Value.IS
+ NOT_EQUALS -> Value.NOT_EQUALS
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always
+ * known and don't want to throw for the unknown case.
+ *
+ * @throws OpenlayerInvalidDataException if this class instance's value is a
+ * not a known member.
+ */
+ fun known(): Known =
+ when (this) {
+ IS -> Known.IS
+ NOT_EQUALS -> Known.NOT_EQUALS
+ else ->
+ throw OpenlayerInvalidDataException("Unknown Operator: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily
+ * for debugging and generally doesn't throw.
+ *
+ * @throws OpenlayerInvalidDataException if this class instance's value does
+ * not have the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ OpenlayerInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Operator = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ 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 (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Operator && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ @JsonDeserialize(using = Value.Deserializer::class)
+ @JsonSerialize(using = Value.Serializer::class)
+ class Value
+ private constructor(
+ private val string: String? = null,
+ private val bool: Boolean? = null,
+ private val _json: JsonValue? = null,
+ ) {
+
+ fun string(): Optional = Optional.ofNullable(string)
+
+ fun bool(): Optional = Optional.ofNullable(bool)
+
+ fun isString(): Boolean = string != null
+
+ fun isBool(): Boolean = bool != null
+
+ fun asString(): String = string.getOrThrow("string")
+
+ fun asBool(): Boolean = bool.getOrThrow("bool")
+
+ fun _json(): Optional = Optional.ofNullable(_json)
+
+ fun accept(visitor: Visitor): T =
+ when {
+ string != null -> visitor.visitString(string)
+ bool != null -> visitor.visitBool(bool)
+ else -> visitor.unknown(_json)
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Value = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accept(
+ object : Visitor {
+ override fun visitString(string: String) {}
+
+ override fun visitBool(bool: Boolean) {}
+ }
+ )
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OpenlayerInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this
+ * object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ accept(
+ object : Visitor {
+ override fun visitString(string: String) = 1
+
+ override fun visitBool(bool: Boolean) = 1
+
+ override fun unknown(json: JsonValue?) = 0
+ }
+ )
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Value && string == other.string && bool == other.bool
+ }
+
+ override fun hashCode(): Int = Objects.hash(string, bool)
+
+ override fun toString(): String =
+ when {
+ string != null -> "Value{string=$string}"
+ bool != null -> "Value{bool=$bool}"
+ _json != null -> "Value{_unknown=$_json}"
+ else -> throw IllegalStateException("Invalid Value")
+ }
+
+ companion object {
+
+ @JvmStatic fun ofString(string: String) = Value(string = string)
+
+ @JvmStatic fun ofBool(bool: Boolean) = Value(bool = bool)
+ }
+
+ /**
+ * An interface that defines how to map each variant of [Value] to a value
+ * of type [T].
+ */
+ interface Visitor {
+
+ fun visitString(string: String): T
+
+ fun visitBool(bool: Boolean): T
+
+ /**
+ * Maps an unknown variant of [Value] to a value of type [T].
+ *
+ * An instance of [Value] can contain an unknown variant if it was
+ * deserialized from data that doesn't match any known variant. For
+ * example, if the SDK is on an older version than the API, then the API
+ * may respond with new variants that the SDK is unaware of.
+ *
+ * @throws OpenlayerInvalidDataException in the default implementation.
+ */
+ fun unknown(json: JsonValue?): T {
+ throw OpenlayerInvalidDataException("Unknown Value: $json")
+ }
+ }
+
+ internal class Deserializer : BaseDeserializer(Value::class) {
+
+ override fun ObjectCodec.deserialize(node: JsonNode): Value {
+ val json = JsonValue.fromJsonNode(node)
+
+ val bestMatches =
+ sequenceOf(
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Value(string = it, _json = json)
+ },
+ tryDeserialize(node, jacksonTypeRef())?.let {
+ Value(bool = it, _json = json)
+ },
+ )
+ .filterNotNull()
+ .allMaxBy { it.validity() }
+ .toList()
+ return when (bestMatches.size) {
+ // This can happen if what we're deserializing is completely
+ // incompatible with all the possible variants (e.g.
+ // deserializing from object).
+ 0 -> Value(_json = json)
+ 1 -> bestMatches.single()
+ // If there's more than one match with the highest validity,
+ // then use the first completely valid match, or simply the
+ // first match if none are completely valid.
+ else ->
+ bestMatches.firstOrNull { it.isValid() }
+ ?: bestMatches.first()
+ }
+ }
+ }
+
+ internal class Serializer : BaseSerializer(Value::class) {
+
+ override fun serialize(
+ value: Value,
+ generator: JsonGenerator,
+ provider: SerializerProvider,
+ ) {
+ when {
+ value.string != null -> generator.writeObject(value.string)
+ value.bool != null -> generator.writeObject(value.bool)
+ value._json != null -> generator.writeObject(value._json)
+ else -> throw IllegalStateException("Invalid Value")
+ }
+ }
+ }
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is StringColumnFilter &&
+ measurement == other.measurement &&
+ operator == other.operator &&
+ value == other.value &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(measurement, operator, value, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "StringColumnFilter{measurement=$measurement, operator=$operator, value=$value, additionalProperties=$additionalProperties}"
+ }
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is RowsBody &&
+ columnFilters == other.columnFilters &&
+ excludeRowIdList == other.excludeRowIdList &&
+ notSearchQueryAnd == other.notSearchQueryAnd &&
+ notSearchQueryOr == other.notSearchQueryOr &&
+ rowIdList == other.rowIdList &&
+ searchQueryAnd == other.searchQueryAnd &&
+ searchQueryOr == other.searchQueryOr &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ columnFilters,
+ excludeRowIdList,
+ notSearchQueryAnd,
+ notSearchQueryOr,
+ rowIdList,
+ searchQueryAnd,
+ searchQueryOr,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "RowsBody{columnFilters=$columnFilters, excludeRowIdList=$excludeRowIdList, notSearchQueryAnd=$notSearchQueryAnd, notSearchQueryOr=$notSearchQueryOr, rowIdList=$rowIdList, searchQueryAnd=$searchQueryAnd, searchQueryOr=$searchQueryOr, additionalProperties=$additionalProperties}"
+ }
+
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
@@ -4037,8 +6805,11 @@ private constructor(
projectVersionId == other.projectVersionId &&
status == other.status &&
statusMessage == other.statusMessage &&
+ expectedValues == other.expectedValues &&
goal == other.goal &&
goalId == other.goalId &&
+ rows == other.rows &&
+ rowsBody == other.rowsBody &&
additionalProperties == other.additionalProperties
}
@@ -4053,8 +6824,11 @@ private constructor(
projectVersionId,
status,
statusMessage,
+ expectedValues,
goal,
goalId,
+ rows,
+ rowsBody,
additionalProperties,
)
}
@@ -4062,7 +6836,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Item{id=$id, dateCreated=$dateCreated, dateDataEnds=$dateDataEnds, dateDataStarts=$dateDataStarts, dateUpdated=$dateUpdated, inferencePipelineId=$inferencePipelineId, projectVersionId=$projectVersionId, status=$status, statusMessage=$statusMessage, goal=$goal, goalId=$goalId, additionalProperties=$additionalProperties}"
+ "Item{id=$id, dateCreated=$dateCreated, dateDataEnds=$dateDataEnds, dateDataStarts=$dateDataStarts, dateUpdated=$dateUpdated, inferencePipelineId=$inferencePipelineId, projectVersionId=$projectVersionId, status=$status, statusMessage=$statusMessage, expectedValues=$expectedValues, goal=$goal, goalId=$goalId, rows=$rows, rowsBody=$rowsBody, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt
index 29eb854d..309d2e41 100644
--- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt
+++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/testresults/TestResultListResponse.kt
@@ -195,8 +195,11 @@ private constructor(
private val projectVersionId: JsonField,
private val status: JsonField,
private val statusMessage: JsonField,
+ private val expectedValues: JsonField>,
private val goal: JsonField