Skip to content

Commit 1a6b3bf

Browse files
feat(closes OPEN-9425): document /rows endpoint in API reference and …
1 parent 43c1d18 commit 1a6b3bf

File tree

11 files changed

+3834
-3
lines changed

11 files changed

+3834
-3
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
configured_endpoints: 27
2-
openapi_spec_hash: c70c3eccfe803e99c14e97e650b1e314
3-
config_hash: 1f7626e569e1a74574a58d7883170a0e
1+
configured_endpoints: 28
2+
openapi_spec_hash: 5f7962599290c70cb47c05c3b29fdbd8
3+
config_hash: 38b7fc7dfc9af970e9e1cb7b81ccc56b

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowCreateParams.kt

Lines changed: 2959 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 352 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,352 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.openlayer.api.models.inferencepipelines.rows
4+
5+
import com.fasterxml.jackson.annotation.JsonAnyGetter
6+
import com.fasterxml.jackson.annotation.JsonAnySetter
7+
import com.fasterxml.jackson.annotation.JsonCreator
8+
import com.fasterxml.jackson.annotation.JsonProperty
9+
import com.openlayer.api.core.ExcludeMissing
10+
import com.openlayer.api.core.JsonField
11+
import com.openlayer.api.core.JsonMissing
12+
import com.openlayer.api.core.JsonValue
13+
import com.openlayer.api.core.checkKnown
14+
import com.openlayer.api.core.checkRequired
15+
import com.openlayer.api.core.toImmutable
16+
import com.openlayer.api.errors.OpenlayerInvalidDataException
17+
import java.util.Collections
18+
import java.util.Objects
19+
import kotlin.jvm.optionals.getOrNull
20+
21+
class RowCreateResponse
22+
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
23+
private constructor(
24+
private val items: JsonField<List<Item>>,
25+
private val additionalProperties: MutableMap<String, JsonValue>,
26+
) {
27+
28+
@JsonCreator
29+
private constructor(
30+
@JsonProperty("items") @ExcludeMissing items: JsonField<List<Item>> = JsonMissing.of()
31+
) : this(items, mutableMapOf())
32+
33+
/**
34+
* @throws OpenlayerInvalidDataException if the JSON field has an unexpected type or is
35+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
36+
*/
37+
fun items(): List<Item> = items.getRequired("items")
38+
39+
/**
40+
* Returns the raw JSON value of [items].
41+
*
42+
* Unlike [items], this method doesn't throw if the JSON field has an unexpected type.
43+
*/
44+
@JsonProperty("items") @ExcludeMissing fun _items(): JsonField<List<Item>> = items
45+
46+
@JsonAnySetter
47+
private fun putAdditionalProperty(key: String, value: JsonValue) {
48+
additionalProperties.put(key, value)
49+
}
50+
51+
@JsonAnyGetter
52+
@ExcludeMissing
53+
fun _additionalProperties(): Map<String, JsonValue> =
54+
Collections.unmodifiableMap(additionalProperties)
55+
56+
fun toBuilder() = Builder().from(this)
57+
58+
companion object {
59+
60+
/**
61+
* Returns a mutable builder for constructing an instance of [RowCreateResponse].
62+
*
63+
* The following fields are required:
64+
* ```java
65+
* .items()
66+
* ```
67+
*/
68+
@JvmStatic fun builder() = Builder()
69+
}
70+
71+
/** A builder for [RowCreateResponse]. */
72+
class Builder internal constructor() {
73+
74+
private var items: JsonField<MutableList<Item>>? = null
75+
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
76+
77+
@JvmSynthetic
78+
internal fun from(rowCreateResponse: RowCreateResponse) = apply {
79+
items = rowCreateResponse.items.map { it.toMutableList() }
80+
additionalProperties = rowCreateResponse.additionalProperties.toMutableMap()
81+
}
82+
83+
fun items(items: List<Item>) = items(JsonField.of(items))
84+
85+
/**
86+
* Sets [Builder.items] to an arbitrary JSON value.
87+
*
88+
* You should usually call [Builder.items] with a well-typed `List<Item>` value instead.
89+
* This method is primarily for setting the field to an undocumented or not yet supported
90+
* value.
91+
*/
92+
fun items(items: JsonField<List<Item>>) = apply {
93+
this.items = items.map { it.toMutableList() }
94+
}
95+
96+
/**
97+
* Adds a single [Item] to [items].
98+
*
99+
* @throws IllegalStateException if the field was previously set to a non-list.
100+
*/
101+
fun addItem(item: Item) = apply {
102+
items =
103+
(items ?: JsonField.of(mutableListOf())).also { checkKnown("items", it).add(item) }
104+
}
105+
106+
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
107+
this.additionalProperties.clear()
108+
putAllAdditionalProperties(additionalProperties)
109+
}
110+
111+
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
112+
additionalProperties.put(key, value)
113+
}
114+
115+
fun putAllAdditionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
116+
this.additionalProperties.putAll(additionalProperties)
117+
}
118+
119+
fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
120+
121+
fun removeAllAdditionalProperties(keys: Set<String>) = apply {
122+
keys.forEach(::removeAdditionalProperty)
123+
}
124+
125+
/**
126+
* Returns an immutable instance of [RowCreateResponse].
127+
*
128+
* Further updates to this [Builder] will not mutate the returned instance.
129+
*
130+
* The following fields are required:
131+
* ```java
132+
* .items()
133+
* ```
134+
*
135+
* @throws IllegalStateException if any required field is unset.
136+
*/
137+
fun build(): RowCreateResponse =
138+
RowCreateResponse(
139+
checkRequired("items", items).map { it.toImmutable() },
140+
additionalProperties.toMutableMap(),
141+
)
142+
}
143+
144+
private var validated: Boolean = false
145+
146+
fun validate(): RowCreateResponse = apply {
147+
if (validated) {
148+
return@apply
149+
}
150+
151+
items().forEach { it.validate() }
152+
validated = true
153+
}
154+
155+
fun isValid(): Boolean =
156+
try {
157+
validate()
158+
true
159+
} catch (e: OpenlayerInvalidDataException) {
160+
false
161+
}
162+
163+
/**
164+
* Returns a score indicating how many valid values are contained in this object recursively.
165+
*
166+
* Used for best match union deserialization.
167+
*/
168+
@JvmSynthetic
169+
internal fun validity(): Int =
170+
(items.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
171+
172+
class Item
173+
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
174+
private constructor(
175+
private val openlayerRowId: JsonField<Long>,
176+
private val additionalProperties: MutableMap<String, JsonValue>,
177+
) {
178+
179+
@JsonCreator
180+
private constructor(
181+
@JsonProperty("openlayer_row_id")
182+
@ExcludeMissing
183+
openlayerRowId: JsonField<Long> = JsonMissing.of()
184+
) : this(openlayerRowId, mutableMapOf())
185+
186+
/**
187+
* @throws OpenlayerInvalidDataException if the JSON field has an unexpected type or is
188+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
189+
*/
190+
fun openlayerRowId(): Long = openlayerRowId.getRequired("openlayer_row_id")
191+
192+
/**
193+
* Returns the raw JSON value of [openlayerRowId].
194+
*
195+
* Unlike [openlayerRowId], this method doesn't throw if the JSON field has an unexpected
196+
* type.
197+
*/
198+
@JsonProperty("openlayer_row_id")
199+
@ExcludeMissing
200+
fun _openlayerRowId(): JsonField<Long> = openlayerRowId
201+
202+
@JsonAnySetter
203+
private fun putAdditionalProperty(key: String, value: JsonValue) {
204+
additionalProperties.put(key, value)
205+
}
206+
207+
@JsonAnyGetter
208+
@ExcludeMissing
209+
fun _additionalProperties(): Map<String, JsonValue> =
210+
Collections.unmodifiableMap(additionalProperties)
211+
212+
fun toBuilder() = Builder().from(this)
213+
214+
companion object {
215+
216+
/**
217+
* Returns a mutable builder for constructing an instance of [Item].
218+
*
219+
* The following fields are required:
220+
* ```java
221+
* .openlayerRowId()
222+
* ```
223+
*/
224+
@JvmStatic fun builder() = Builder()
225+
}
226+
227+
/** A builder for [Item]. */
228+
class Builder internal constructor() {
229+
230+
private var openlayerRowId: JsonField<Long>? = null
231+
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
232+
233+
@JvmSynthetic
234+
internal fun from(item: Item) = apply {
235+
openlayerRowId = item.openlayerRowId
236+
additionalProperties = item.additionalProperties.toMutableMap()
237+
}
238+
239+
fun openlayerRowId(openlayerRowId: Long) = openlayerRowId(JsonField.of(openlayerRowId))
240+
241+
/**
242+
* Sets [Builder.openlayerRowId] to an arbitrary JSON value.
243+
*
244+
* You should usually call [Builder.openlayerRowId] with a well-typed [Long] value
245+
* instead. This method is primarily for setting the field to an undocumented or not yet
246+
* supported value.
247+
*/
248+
fun openlayerRowId(openlayerRowId: JsonField<Long>) = apply {
249+
this.openlayerRowId = openlayerRowId
250+
}
251+
252+
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
253+
this.additionalProperties.clear()
254+
putAllAdditionalProperties(additionalProperties)
255+
}
256+
257+
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
258+
additionalProperties.put(key, value)
259+
}
260+
261+
fun putAllAdditionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
262+
this.additionalProperties.putAll(additionalProperties)
263+
}
264+
265+
fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
266+
267+
fun removeAllAdditionalProperties(keys: Set<String>) = apply {
268+
keys.forEach(::removeAdditionalProperty)
269+
}
270+
271+
/**
272+
* Returns an immutable instance of [Item].
273+
*
274+
* Further updates to this [Builder] will not mutate the returned instance.
275+
*
276+
* The following fields are required:
277+
* ```java
278+
* .openlayerRowId()
279+
* ```
280+
*
281+
* @throws IllegalStateException if any required field is unset.
282+
*/
283+
fun build(): Item =
284+
Item(
285+
checkRequired("openlayerRowId", openlayerRowId),
286+
additionalProperties.toMutableMap(),
287+
)
288+
}
289+
290+
private var validated: Boolean = false
291+
292+
fun validate(): Item = apply {
293+
if (validated) {
294+
return@apply
295+
}
296+
297+
openlayerRowId()
298+
validated = true
299+
}
300+
301+
fun isValid(): Boolean =
302+
try {
303+
validate()
304+
true
305+
} catch (e: OpenlayerInvalidDataException) {
306+
false
307+
}
308+
309+
/**
310+
* Returns a score indicating how many valid values are contained in this object
311+
* recursively.
312+
*
313+
* Used for best match union deserialization.
314+
*/
315+
@JvmSynthetic
316+
internal fun validity(): Int = (if (openlayerRowId.asKnown().isPresent) 1 else 0)
317+
318+
override fun equals(other: Any?): Boolean {
319+
if (this === other) {
320+
return true
321+
}
322+
323+
return other is Item &&
324+
openlayerRowId == other.openlayerRowId &&
325+
additionalProperties == other.additionalProperties
326+
}
327+
328+
private val hashCode: Int by lazy { Objects.hash(openlayerRowId, additionalProperties) }
329+
330+
override fun hashCode(): Int = hashCode
331+
332+
override fun toString() =
333+
"Item{openlayerRowId=$openlayerRowId, additionalProperties=$additionalProperties}"
334+
}
335+
336+
override fun equals(other: Any?): Boolean {
337+
if (this === other) {
338+
return true
339+
}
340+
341+
return other is RowCreateResponse &&
342+
items == other.items &&
343+
additionalProperties == other.additionalProperties
344+
}
345+
346+
private val hashCode: Int by lazy { Objects.hash(items, additionalProperties) }
347+
348+
override fun hashCode(): Int = hashCode
349+
350+
override fun toString() =
351+
"RowCreateResponse{items=$items, additionalProperties=$additionalProperties}"
352+
}

0 commit comments

Comments
 (0)