From 6e3cd44965348d4d600b0b1e1caa9743788b8c63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:36:30 +0000 Subject: [PATCH] feat(client): expose request body setter and getter --- .../InferencePipelineDeleteParams.kt | 3 +-- .../InferencePipelineUpdateParams.kt | 13 ++++++++++++- .../inferencepipelines/data/DataStreamParams.kt | 12 +++++++++++- .../inferencepipelines/rows/RowUpdateParams.kt | 12 +++++++++++- .../api/models/projects/ProjectCreateParams.kt | 16 +++++++++++++++- .../projects/commits/CommitCreateParams.kt | 16 +++++++++++++++- .../InferencePipelineCreateParams.kt | 16 +++++++++++++++- .../presignedurl/PresignedUrlCreateParams.kt | 3 +-- 8 files changed, 81 insertions(+), 10 deletions(-) diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineDeleteParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineDeleteParams.kt index 74adcaf7..f1034953 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineDeleteParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineDeleteParams.kt @@ -206,8 +206,7 @@ private constructor( ) } - @JvmSynthetic - internal fun _body(): Optional> = + fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) fun _pathParam(index: Int): String = diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt index 3a9bc18e..9b3e669d 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateParams.kt @@ -120,6 +120,17 @@ private constructor( this.inferencePipelineId = inferencePipelineId } + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [description] + * - [name] + * - [referenceDatasetUri] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + /** The inference pipeline description. */ fun description(description: String?) = apply { body.description(description) } @@ -309,7 +320,7 @@ private constructor( ) } - @JvmSynthetic internal fun _body(): Body = body + fun _body(): Body = body fun _pathParam(index: Int): String = when (index) { diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt index 0c636717..f5f6fcf1 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/data/DataStreamParams.kt @@ -117,6 +117,16 @@ private constructor( this.inferencePipelineId = inferencePipelineId } + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [config] + * - [rows] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + /** Configuration for the data stream. Depends on your **Openlayer project task type**. */ fun config(config: Config) = apply { body.config(config) } @@ -312,7 +322,7 @@ private constructor( ) } - @JvmSynthetic internal fun _body(): Body = body + fun _body(): Body = body fun _pathParam(index: Int): String = when (index) { diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt index 720e088b..f04159d5 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/rows/RowUpdateParams.kt @@ -98,6 +98,16 @@ private constructor( /** Specify the inference id as a query param. */ fun inferenceId(inferenceId: String) = apply { this.inferenceId = inferenceId } + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [row] + * - [config] + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + fun row(row: JsonValue) = apply { body.row(row) } fun config(config: Config?) = apply { body.config(config) } @@ -254,7 +264,7 @@ private constructor( ) } - @JvmSynthetic internal fun _body(): Body = body + fun _body(): Body = body fun _pathParam(index: Int): String = when (index) { diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt index adf8f852..a1c5a3f4 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateParams.kt @@ -319,6 +319,20 @@ private constructor( additionalQueryParams = projectCreateParams.additionalQueryParams.toBuilder() } + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [id] + * - [creatorId] + * - [dateCreated] + * - [dateUpdated] + * - [developmentGoalCount] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + /** The project id. */ fun id(id: String) = apply { body.id(id) } @@ -685,7 +699,7 @@ private constructor( ) } - @JvmSynthetic internal fun _body(): Body = body + fun _body(): Body = body override fun _headers(): Headers = additionalHeaders diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt index 9ca0dea6..98df0084 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/commits/CommitCreateParams.kt @@ -345,6 +345,20 @@ private constructor( fun pathProjectId(pathProjectId: String) = apply { this.pathProjectId = pathProjectId } + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [id] + * - [commit] + * - [dateArchived] + * - [dateCreated] + * - [failingGoalCount] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + /** The project version (commit) id. */ fun id(id: String) = apply { body.id(id) } @@ -760,7 +774,7 @@ private constructor( ) } - @JvmSynthetic internal fun _body(): Body = body + fun _body(): Body = body fun _pathParam(index: Int): String = when (index) { diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt index 4340da74..e0019dbe 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParams.kt @@ -360,6 +360,20 @@ private constructor( fun pathProjectId(pathProjectId: String) = apply { this.pathProjectId = pathProjectId } + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [id] + * - [dateCreated] + * - [dateLastEvaluated] + * - [dateLastSampleReceived] + * - [dateOfNextEvaluation] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + /** The inference pipeline id. */ fun id(id: String) = apply { body.id(id) } @@ -782,7 +796,7 @@ private constructor( ) } - @JvmSynthetic internal fun _body(): Body = body + fun _body(): Body = body fun _pathParam(index: Int): String = when (index) { diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateParams.kt index 10434f89..b4bde349 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateParams.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/storage/presignedurl/PresignedUrlCreateParams.kt @@ -205,8 +205,7 @@ private constructor( ) } - @JvmSynthetic - internal fun _body(): Optional> = + fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) override fun _headers(): Headers = additionalHeaders