Skip to content

Commit 8725baa

Browse files
feat(client): expose request body setter and getter (#106)
1 parent ac0fa47 commit 8725baa

File tree

8 files changed

+81
-10
lines changed

8 files changed

+81
-10
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ private constructor(
206206
)
207207
}
208208

209-
@JvmSynthetic
210-
internal fun _body(): Optional<Map<String, JsonValue>> =
209+
fun _body(): Optional<Map<String, JsonValue>> =
211210
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
212211

213212
fun _pathParam(index: Int): String =

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ private constructor(
120120
this.inferencePipelineId = inferencePipelineId
121121
}
122122

123+
/**
124+
* Sets the entire request body.
125+
*
126+
* This is generally only useful if you are already constructing the body separately.
127+
* Otherwise, it's more convenient to use the top-level setters instead:
128+
* - [description]
129+
* - [name]
130+
* - [referenceDatasetUri]
131+
*/
132+
fun body(body: Body) = apply { this.body = body.toBuilder() }
133+
123134
/** The inference pipeline description. */
124135
fun description(description: String?) = apply { body.description(description) }
125136

@@ -309,7 +320,7 @@ private constructor(
309320
)
310321
}
311322

312-
@JvmSynthetic internal fun _body(): Body = body
323+
fun _body(): Body = body
313324

314325
fun _pathParam(index: Int): String =
315326
when (index) {

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ private constructor(
117117
this.inferencePipelineId = inferencePipelineId
118118
}
119119

120+
/**
121+
* Sets the entire request body.
122+
*
123+
* This is generally only useful if you are already constructing the body separately.
124+
* Otherwise, it's more convenient to use the top-level setters instead:
125+
* - [config]
126+
* - [rows]
127+
*/
128+
fun body(body: Body) = apply { this.body = body.toBuilder() }
129+
120130
/** Configuration for the data stream. Depends on your **Openlayer project task type**. */
121131
fun config(config: Config) = apply { body.config(config) }
122132

@@ -312,7 +322,7 @@ private constructor(
312322
)
313323
}
314324

315-
@JvmSynthetic internal fun _body(): Body = body
325+
fun _body(): Body = body
316326

317327
fun _pathParam(index: Int): String =
318328
when (index) {

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ private constructor(
9898
/** Specify the inference id as a query param. */
9999
fun inferenceId(inferenceId: String) = apply { this.inferenceId = inferenceId }
100100

101+
/**
102+
* Sets the entire request body.
103+
*
104+
* This is generally only useful if you are already constructing the body separately.
105+
* Otherwise, it's more convenient to use the top-level setters instead:
106+
* - [row]
107+
* - [config]
108+
*/
109+
fun body(body: Body) = apply { this.body = body.toBuilder() }
110+
101111
fun row(row: JsonValue) = apply { body.row(row) }
102112

103113
fun config(config: Config?) = apply { body.config(config) }
@@ -254,7 +264,7 @@ private constructor(
254264
)
255265
}
256266

257-
@JvmSynthetic internal fun _body(): Body = body
267+
fun _body(): Body = body
258268

259269
fun _pathParam(index: Int): String =
260270
when (index) {

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,20 @@ private constructor(
319319
additionalQueryParams = projectCreateParams.additionalQueryParams.toBuilder()
320320
}
321321

322+
/**
323+
* Sets the entire request body.
324+
*
325+
* This is generally only useful if you are already constructing the body separately.
326+
* Otherwise, it's more convenient to use the top-level setters instead:
327+
* - [id]
328+
* - [creatorId]
329+
* - [dateCreated]
330+
* - [dateUpdated]
331+
* - [developmentGoalCount]
332+
* - etc.
333+
*/
334+
fun body(body: Body) = apply { this.body = body.toBuilder() }
335+
322336
/** The project id. */
323337
fun id(id: String) = apply { body.id(id) }
324338

@@ -685,7 +699,7 @@ private constructor(
685699
)
686700
}
687701

688-
@JvmSynthetic internal fun _body(): Body = body
702+
fun _body(): Body = body
689703

690704
override fun _headers(): Headers = additionalHeaders
691705

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,20 @@ private constructor(
345345

346346
fun pathProjectId(pathProjectId: String) = apply { this.pathProjectId = pathProjectId }
347347

348+
/**
349+
* Sets the entire request body.
350+
*
351+
* This is generally only useful if you are already constructing the body separately.
352+
* Otherwise, it's more convenient to use the top-level setters instead:
353+
* - [id]
354+
* - [commit]
355+
* - [dateArchived]
356+
* - [dateCreated]
357+
* - [failingGoalCount]
358+
* - etc.
359+
*/
360+
fun body(body: Body) = apply { this.body = body.toBuilder() }
361+
348362
/** The project version (commit) id. */
349363
fun id(id: String) = apply { body.id(id) }
350364

@@ -760,7 +774,7 @@ private constructor(
760774
)
761775
}
762776

763-
@JvmSynthetic internal fun _body(): Body = body
777+
fun _body(): Body = body
764778

765779
fun _pathParam(index: Int): String =
766780
when (index) {

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,20 @@ private constructor(
360360

361361
fun pathProjectId(pathProjectId: String) = apply { this.pathProjectId = pathProjectId }
362362

363+
/**
364+
* Sets the entire request body.
365+
*
366+
* This is generally only useful if you are already constructing the body separately.
367+
* Otherwise, it's more convenient to use the top-level setters instead:
368+
* - [id]
369+
* - [dateCreated]
370+
* - [dateLastEvaluated]
371+
* - [dateLastSampleReceived]
372+
* - [dateOfNextEvaluation]
373+
* - etc.
374+
*/
375+
fun body(body: Body) = apply { this.body = body.toBuilder() }
376+
363377
/** The inference pipeline id. */
364378
fun id(id: String) = apply { body.id(id) }
365379

@@ -782,7 +796,7 @@ private constructor(
782796
)
783797
}
784798

785-
@JvmSynthetic internal fun _body(): Body = body
799+
fun _body(): Body = body
786800

787801
fun _pathParam(index: Int): String =
788802
when (index) {

openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateParams.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ private constructor(
205205
)
206206
}
207207

208-
@JvmSynthetic
209-
internal fun _body(): Optional<Map<String, JsonValue>> =
208+
fun _body(): Optional<Map<String, JsonValue>> =
210209
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
211210

212211
override fun _headers(): Headers = additionalHeaders

0 commit comments

Comments
 (0)