From 1c4e1bd16d71bd85a311e32d360ca072a90b51af Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 02:12:48 +0000 Subject: [PATCH 1/3] feat(stlc): configurable CI runner and private-production-repo support in workflow templates --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e7a47c6..e61f04f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 15 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/openlayer-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: @@ -45,7 +45,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/openlayer-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: From df645bfc1a5cbd004d80c3aae5104f4b0ab12531 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 13:35:48 +0000 Subject: [PATCH 2/3] chore(closes OPEN-11851): expose update project endpoint --- .stats.yml | 6 +- .../InferencePipelineRetrieveResponse.kt | 214 +- .../InferencePipelineUpdateResponse.kt | 214 +- .../models/projects/ProjectCreateParams.kt | 363 ++- .../models/projects/ProjectCreateResponse.kt | 212 +- .../models/projects/ProjectListResponse.kt | 214 +- .../models/projects/ProjectUpdateParams.kt | 871 +++++++ .../models/projects/ProjectUpdateResponse.kt | 2082 +++++++++++++++++ .../InferencePipelineCreateParams.kt | 214 +- .../InferencePipelineCreateResponse.kt | 214 +- .../InferencePipelineListResponse.kt | 223 +- .../api/services/async/ProjectServiceAsync.kt | 78 + .../services/async/ProjectServiceAsyncImpl.kt | 43 + .../api/services/blocking/ProjectService.kt | 78 + .../services/blocking/ProjectServiceImpl.kt | 40 + .../InferencePipelineRetrieveResponseTest.kt | 12 + .../InferencePipelineUpdateResponseTest.kt | 12 + .../projects/ProjectCreateParamsTest.kt | 13 + .../projects/ProjectCreateResponseTest.kt | 13 + .../projects/ProjectListResponseTest.kt | 12 + .../projects/ProjectUpdateParamsTest.kt | 64 + .../projects/ProjectUpdateResponseTest.kt | 167 ++ .../InferencePipelineCreateParamsTest.kt | 12 + .../InferencePipelineCreateResponseTest.kt | 12 + .../InferencePipelineListResponseTest.kt | 12 + .../services/async/ProjectServiceAsyncTest.kt | 31 + .../InferencePipelineServiceAsyncTest.kt | 4 + .../services/blocking/ProjectServiceTest.kt | 30 + .../projects/InferencePipelineServiceTest.kt | 4 + 29 files changed, 5445 insertions(+), 19 deletions(-) create mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateParams.kt create mode 100644 openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponse.kt create mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateParamsTest.kt create mode 100644 openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponseTest.kt diff --git a/.stats.yml b/.stats.yml index 0deea569..60080a09 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,3 +1,3 @@ -configured_endpoints: 31 -openapi_spec_hash: a574ef9082e992c25120554886a9ab7a -config_hash: 2d4f9621ceae4bb25977853a964a0e54 +configured_endpoints: 32 +openapi_spec_hash: 72e2dd8871904fe6c130d1c81b033d5a +config_hash: f75dd97d47c446f8fdc8bcb36f445eea diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt index 38994255..4c9e736e 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponse.kt @@ -6836,8 +6836,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -6877,10 +6881,20 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -6896,8 +6910,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -7014,6 +7032,15 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -7028,6 +7055,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -7144,6 +7195,16 @@ private constructor( @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -7160,6 +7221,32 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -7215,8 +7302,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -7235,8 +7326,12 @@ private constructor( taskType = project.taskType versionCount = project.versionCount workspaceId = project.workspaceId + dataRetentionDays = project.dataRetentionDays description = project.description gitRepo = project.gitRepo + modelDeveloper = project.modelDeveloper + modelTypes = project.modelTypes.map { it.toMutableList() } + purpose = project.purpose additionalProperties = project.additionalProperties.toMutableMap() } @@ -7434,6 +7529,38 @@ private constructor( this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -7465,6 +7592,69 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7525,8 +7715,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -7561,8 +7755,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -7596,8 +7794,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) /** Links to the project. */ class Links @@ -8701,8 +8903,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -8722,8 +8928,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -8731,7 +8941,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } class Workspace diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt index 5d46c0e8..193ba8a9 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponse.kt @@ -6836,8 +6836,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -6877,10 +6881,20 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -6896,8 +6910,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -7014,6 +7032,15 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -7028,6 +7055,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -7144,6 +7195,16 @@ private constructor( @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -7160,6 +7221,32 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -7215,8 +7302,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -7235,8 +7326,12 @@ private constructor( taskType = project.taskType versionCount = project.versionCount workspaceId = project.workspaceId + dataRetentionDays = project.dataRetentionDays description = project.description gitRepo = project.gitRepo + modelDeveloper = project.modelDeveloper + modelTypes = project.modelTypes.map { it.toMutableList() } + purpose = project.purpose additionalProperties = project.additionalProperties.toMutableMap() } @@ -7434,6 +7529,38 @@ private constructor( this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -7465,6 +7592,69 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7525,8 +7715,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -7561,8 +7755,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -7596,8 +7794,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) /** Links to the project. */ class Links @@ -8701,8 +8903,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -8722,8 +8928,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -8731,7 +8941,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } class Workspace 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 56ecdcb6..950cd7f8 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 @@ -12,9 +12,11 @@ import com.openlayer.api.core.JsonField import com.openlayer.api.core.JsonMissing import com.openlayer.api.core.JsonValue import com.openlayer.api.core.Params +import com.openlayer.api.core.checkKnown import com.openlayer.api.core.checkRequired import com.openlayer.api.core.http.Headers import com.openlayer.api.core.http.QueryParams +import com.openlayer.api.core.toImmutable import com.openlayer.api.errors.OpenlayerInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -142,6 +144,15 @@ private constructor( */ fun workspaceId(): Optional = body.workspaceId() + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = body.dataRetentionDays() + /** * The project description. * @@ -156,6 +167,30 @@ private constructor( */ fun gitRepo(): Optional = body.gitRepo() + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = body.modelDeveloper() + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelTypes(): Optional> = body.modelTypes() + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun purpose(): Optional = body.purpose() + /** * Returns the raw JSON value of [id]. * @@ -257,6 +292,14 @@ private constructor( */ fun _workspaceId(): JsonField = body._workspaceId() + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _dataRetentionDays(): JsonField = body._dataRetentionDays() + /** * Returns the raw JSON value of [description]. * @@ -271,6 +314,27 @@ private constructor( */ fun _gitRepo(): JsonField = body._gitRepo() + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _modelDeveloper(): JsonField = body._modelDeveloper() + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _modelTypes(): JsonField> = body._modelTypes() + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _purpose(): JsonField = body._purpose() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -523,6 +587,37 @@ private constructor( */ fun workspaceId(workspaceId: JsonField) = apply { body.workspaceId(workspaceId) } + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = apply { + body.dataRetentionDays(dataRetentionDays) + } + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + body.dataRetentionDays(dataRetentionDays) + } + /** The project description. */ fun description(description: String?) = apply { body.description(description) } @@ -551,6 +646,60 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { body.gitRepo(gitRepo) } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = apply { body.modelDeveloper(modelDeveloper) } + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + body.modelDeveloper(modelDeveloper) + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = apply { body.modelTypes(modelTypes) } + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { body.modelTypes(modelTypes) } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { body.addModelType(modelType) } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = apply { body.purpose(purpose) } + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun purpose(purpose: JsonField) = apply { body.purpose(purpose) } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -724,8 +873,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -765,10 +918,20 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -784,8 +947,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -902,6 +1069,15 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -916,6 +1092,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -1032,6 +1232,16 @@ private constructor( @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -1048,6 +1258,32 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1103,8 +1339,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1123,8 +1363,12 @@ private constructor( taskType = body.taskType versionCount = body.versionCount workspaceId = body.workspaceId + dataRetentionDays = body.dataRetentionDays description = body.description gitRepo = body.gitRepo + modelDeveloper = body.modelDeveloper + modelTypes = body.modelTypes.map { it.toMutableList() } + purpose = body.purpose additionalProperties = body.additionalProperties.toMutableMap() } @@ -1322,6 +1566,38 @@ private constructor( this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -1353,6 +1629,69 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1413,8 +1752,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -1449,8 +1792,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -1484,8 +1831,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1507,8 +1858,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -1528,8 +1883,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -1537,7 +1896,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Body{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } /** Links to the project. */ diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt index ec1d77e4..3ca748e3 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectCreateResponse.kt @@ -11,7 +11,9 @@ import com.openlayer.api.core.ExcludeMissing import com.openlayer.api.core.JsonField import com.openlayer.api.core.JsonMissing import com.openlayer.api.core.JsonValue +import com.openlayer.api.core.checkKnown import com.openlayer.api.core.checkRequired +import com.openlayer.api.core.toImmutable import com.openlayer.api.errors.OpenlayerInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -36,8 +38,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -71,10 +77,20 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -90,8 +106,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -208,6 +228,15 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -222,6 +251,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -335,6 +388,16 @@ private constructor( */ @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -349,6 +412,31 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -404,8 +492,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -424,8 +516,12 @@ private constructor( taskType = projectCreateResponse.taskType versionCount = projectCreateResponse.versionCount workspaceId = projectCreateResponse.workspaceId + dataRetentionDays = projectCreateResponse.dataRetentionDays description = projectCreateResponse.description gitRepo = projectCreateResponse.gitRepo + modelDeveloper = projectCreateResponse.modelDeveloper + modelTypes = projectCreateResponse.modelTypes.map { it.toMutableList() } + purpose = projectCreateResponse.purpose additionalProperties = projectCreateResponse.additionalProperties.toMutableMap() } @@ -614,6 +710,36 @@ private constructor( */ fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -642,6 +768,68 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -702,8 +890,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -737,8 +929,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -771,8 +967,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) /** Links to the project. */ class Links @@ -1840,8 +2040,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -1861,8 +2065,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -1870,5 +2078,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ProjectCreateResponse{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "ProjectCreateResponse{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt index 40b9490a..6949d350 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectListResponse.kt @@ -197,8 +197,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -238,10 +242,20 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -257,8 +271,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -375,6 +393,15 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -389,6 +416,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -505,6 +556,16 @@ private constructor( @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -521,6 +582,32 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -576,8 +663,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -596,8 +687,12 @@ private constructor( taskType = item.taskType versionCount = item.versionCount workspaceId = item.workspaceId + dataRetentionDays = item.dataRetentionDays description = item.description gitRepo = item.gitRepo + modelDeveloper = item.modelDeveloper + modelTypes = item.modelTypes.map { it.toMutableList() } + purpose = item.purpose additionalProperties = item.additionalProperties.toMutableMap() } @@ -795,6 +890,38 @@ private constructor( this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -826,6 +953,69 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -886,8 +1076,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -922,8 +1116,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -957,8 +1155,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) /** Links to the project. */ class Links @@ -2062,8 +2264,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -2083,8 +2289,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -2092,7 +2302,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Item{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Item{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateParams.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateParams.kt new file mode 100644 index 00000000..883d2b34 --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateParams.kt @@ -0,0 +1,871 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.projects + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.openlayer.api.core.ExcludeMissing +import com.openlayer.api.core.JsonField +import com.openlayer.api.core.JsonMissing +import com.openlayer.api.core.JsonValue +import com.openlayer.api.core.Params +import com.openlayer.api.core.checkKnown +import com.openlayer.api.core.http.Headers +import com.openlayer.api.core.http.QueryParams +import com.openlayer.api.core.toImmutable +import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Update a project's metadata. */ +class ProjectUpdateParams +private constructor( + private val projectId: String?, + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + fun projectId(): Optional = Optional.ofNullable(projectId) + + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = body.dataRetentionDays() + + /** + * The project description. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun description(): Optional = body.description() + + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = body.modelDeveloper() + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelTypes(): Optional> = body.modelTypes() + + /** + * The project name. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun name(): Optional = body.name() + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun purpose(): Optional = body.purpose() + + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _dataRetentionDays(): JsonField = body._dataRetentionDays() + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _description(): JsonField = body._description() + + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _modelDeveloper(): JsonField = body._modelDeveloper() + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _modelTypes(): JsonField> = body._modelTypes() + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _name(): JsonField = body._name() + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _purpose(): JsonField = body._purpose() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): ProjectUpdateParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [ProjectUpdateParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ProjectUpdateParams]. */ + class Builder internal constructor() { + + private var projectId: String? = null + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(projectUpdateParams: ProjectUpdateParams) = apply { + projectId = projectUpdateParams.projectId + body = projectUpdateParams.body.toBuilder() + additionalHeaders = projectUpdateParams.additionalHeaders.toBuilder() + additionalQueryParams = projectUpdateParams.additionalQueryParams.toBuilder() + } + + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + + /** + * 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: + * - [dataRetentionDays] + * - [description] + * - [modelDeveloper] + * - [modelTypes] + * - [name] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = apply { + body.dataRetentionDays(dataRetentionDays) + } + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + body.dataRetentionDays(dataRetentionDays) + } + + /** The project description. */ + fun description(description: String?) = apply { body.description(description) } + + /** Alias for calling [Builder.description] with `description.orElse(null)`. */ + fun description(description: Optional) = description(description.getOrNull()) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun description(description: JsonField) = apply { body.description(description) } + + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = apply { body.modelDeveloper(modelDeveloper) } + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + body.modelDeveloper(modelDeveloper) + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = apply { body.modelTypes(modelTypes) } + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { body.modelTypes(modelTypes) } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { body.addModelType(modelType) } + + /** The project name. */ + fun name(name: String) = apply { body.name(name) } + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { body.name(name) } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = apply { body.purpose(purpose) } + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun purpose(purpose: JsonField) = apply { body.purpose(purpose) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [ProjectUpdateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ProjectUpdateParams = + ProjectUpdateParams( + projectId, + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + fun _pathParam(index: Int): String = + when (index) { + 0 -> projectId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val dataRetentionDays: JsonField, + private val description: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val name: JsonField, + private val purpose: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), + ) : this( + dataRetentionDays, + description, + modelDeveloper, + modelTypes, + name, + purpose, + mutableMapOf(), + ) + + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + + /** + * The project description. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun description(): Optional = description.getOptional("description") + + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * The project name. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("description") + @ExcludeMissing + fun _description(): JsonField = description + + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + + @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 [Body]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var dataRetentionDays: JsonField = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var name: JsonField = JsonMissing.of() + private var purpose: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + dataRetentionDays = body.dataRetentionDays + description = body.description + modelDeveloper = body.modelDeveloper + modelTypes = body.modelTypes.map { it.toMutableList() } + name = body.name + purpose = body.purpose + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + + /** The project description. */ + fun description(description: String?) = description(JsonField.ofNullable(description)) + + /** Alias for calling [Builder.description] with `description.orElse(null)`. */ + fun description(description: Optional) = description(description.getOrNull()) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun description(description: JsonField) = apply { + this.description = description + } + + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** The project name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Body = + Body( + dataRetentionDays, + description, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + name, + purpose, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Body = apply { + if (validated) { + return@apply + } + + dataRetentionDays() + description() + modelDeveloper() + modelTypes() + name() + purpose() + 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 (dataRetentionDays.asKnown().isPresent) 1 else 0) + + (if (description.asKnown().isPresent) 1 else 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (purpose.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + dataRetentionDays == other.dataRetentionDays && + description == other.description && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + name == other.name && + purpose == other.purpose && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + dataRetentionDays, + description, + modelDeveloper, + modelTypes, + name, + purpose, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{dataRetentionDays=$dataRetentionDays, description=$description, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, name=$name, purpose=$purpose, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ProjectUpdateParams && + projectId == other.projectId && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(projectId, body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "ProjectUpdateParams{projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponse.kt new file mode 100644 index 00000000..097d8c84 --- /dev/null +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponse.kt @@ -0,0 +1,2082 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.projects + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.openlayer.api.core.Enum +import com.openlayer.api.core.ExcludeMissing +import com.openlayer.api.core.JsonField +import com.openlayer.api.core.JsonMissing +import com.openlayer.api.core.JsonValue +import com.openlayer.api.core.checkKnown +import com.openlayer.api.core.checkRequired +import com.openlayer.api.core.toImmutable +import com.openlayer.api.errors.OpenlayerInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +class ProjectUpdateResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val creatorId: JsonField, + private val dateCreated: JsonField, + private val dateUpdated: JsonField, + private val developmentGoalCount: JsonField, + private val goalCount: JsonField, + private val inferencePipelineCount: JsonField, + private val links: JsonField, + private val monitoringGoalCount: JsonField, + private val name: JsonField, + private val source: JsonField, + private val taskType: JsonField, + private val versionCount: JsonField, + private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, + private val description: JsonField, + private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("creatorId") @ExcludeMissing creatorId: JsonField = JsonMissing.of(), + @JsonProperty("dateCreated") + @ExcludeMissing + dateCreated: JsonField = JsonMissing.of(), + @JsonProperty("dateUpdated") + @ExcludeMissing + dateUpdated: JsonField = JsonMissing.of(), + @JsonProperty("developmentGoalCount") + @ExcludeMissing + developmentGoalCount: JsonField = JsonMissing.of(), + @JsonProperty("goalCount") @ExcludeMissing goalCount: JsonField = JsonMissing.of(), + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + inferencePipelineCount: JsonField = JsonMissing.of(), + @JsonProperty("links") @ExcludeMissing links: JsonField = JsonMissing.of(), + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + monitoringGoalCount: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("source") @ExcludeMissing source: JsonField = JsonMissing.of(), + @JsonProperty("taskType") @ExcludeMissing taskType: JsonField = JsonMissing.of(), + @JsonProperty("versionCount") + @ExcludeMissing + versionCount: JsonField = JsonMissing.of(), + @JsonProperty("workspaceId") + @ExcludeMissing + workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of(), + @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), + ) : this( + id, + creatorId, + dateCreated, + dateUpdated, + developmentGoalCount, + goalCount, + inferencePipelineCount, + links, + monitoringGoalCount, + name, + source, + taskType, + versionCount, + workspaceId, + dataRetentionDays, + description, + gitRepo, + modelDeveloper, + modelTypes, + purpose, + mutableMapOf(), + ) + + /** + * The project id. + * + * @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 id(): String = id.getRequired("id") + + /** + * The project creator id. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun creatorId(): Optional = creatorId.getOptional("creatorId") + + /** + * The project creation date. + * + * @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 dateCreated(): OffsetDateTime = dateCreated.getRequired("dateCreated") + + /** + * The project last updated date. + * + * @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 dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + /** + * The number of tests in the development mode of the project. + * + * @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 developmentGoalCount(): Long = developmentGoalCount.getRequired("developmentGoalCount") + + /** + * The total number of tests in the project. + * + * @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 goalCount(): Long = goalCount.getRequired("goalCount") + + /** + * The number of inference pipelines in the project. + * + * @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 inferencePipelineCount(): Long = + inferencePipelineCount.getRequired("inferencePipelineCount") + + /** + * Links to the project. + * + * @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 links(): Links = links.getRequired("links") + + /** + * The number of tests in the monitoring mode of the project. + * + * @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 monitoringGoalCount(): Long = monitoringGoalCount.getRequired("monitoringGoalCount") + + /** + * The project name. + * + * @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 name(): String = name.getRequired("name") + + /** + * The source of the project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun source(): Optional = source.getOptional("source") + + /** + * The task type of the project. + * + * @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 taskType(): TaskType = taskType.getRequired("taskType") + + /** + * The number of versions (commits) in the project. + * + * @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 versionCount(): Long = versionCount.getRequired("versionCount") + + /** + * The workspace id. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + + /** + * The project description. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun description(): Optional = description.getOptional("description") + + /** + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [creatorId]. + * + * Unlike [creatorId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creatorId") @ExcludeMissing fun _creatorId(): JsonField = creatorId + + /** + * Returns the raw JSON value of [dateCreated]. + * + * Unlike [dateCreated], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("dateCreated") + @ExcludeMissing + fun _dateCreated(): JsonField = dateCreated + + /** + * Returns the raw JSON value of [dateUpdated]. + * + * Unlike [dateUpdated], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("dateUpdated") + @ExcludeMissing + fun _dateUpdated(): JsonField = dateUpdated + + /** + * Returns the raw JSON value of [developmentGoalCount]. + * + * Unlike [developmentGoalCount], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("developmentGoalCount") + @ExcludeMissing + fun _developmentGoalCount(): JsonField = developmentGoalCount + + /** + * Returns the raw JSON value of [goalCount]. + * + * Unlike [goalCount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("goalCount") @ExcludeMissing fun _goalCount(): JsonField = goalCount + + /** + * Returns the raw JSON value of [inferencePipelineCount]. + * + * Unlike [inferencePipelineCount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("inferencePipelineCount") + @ExcludeMissing + fun _inferencePipelineCount(): JsonField = inferencePipelineCount + + /** + * Returns the raw JSON value of [links]. + * + * Unlike [links], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("links") @ExcludeMissing fun _links(): JsonField = links + + /** + * Returns the raw JSON value of [monitoringGoalCount]. + * + * Unlike [monitoringGoalCount], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("monitoringGoalCount") + @ExcludeMissing + fun _monitoringGoalCount(): JsonField = monitoringGoalCount + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [source]. + * + * Unlike [source], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("source") @ExcludeMissing fun _source(): JsonField = source + + /** + * Returns the raw JSON value of [taskType]. + * + * Unlike [taskType], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("taskType") @ExcludeMissing fun _taskType(): JsonField = taskType + + /** + * Returns the raw JSON value of [versionCount]. + * + * Unlike [versionCount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("versionCount") + @ExcludeMissing + fun _versionCount(): JsonField = versionCount + + /** + * Returns the raw JSON value of [workspaceId]. + * + * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("workspaceId") @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description + + /** + * Returns the raw JSON value of [gitRepo]. + * + * Unlike [gitRepo], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + + @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 [ProjectUpdateResponse]. + * + * The following fields are required: + * ```java + * .id() + * .creatorId() + * .dateCreated() + * .dateUpdated() + * .developmentGoalCount() + * .goalCount() + * .inferencePipelineCount() + * .links() + * .monitoringGoalCount() + * .name() + * .source() + * .taskType() + * .versionCount() + * .workspaceId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ProjectUpdateResponse]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var creatorId: JsonField? = null + private var dateCreated: JsonField? = null + private var dateUpdated: JsonField? = null + private var developmentGoalCount: JsonField? = null + private var goalCount: JsonField? = null + private var inferencePipelineCount: JsonField? = null + private var links: JsonField? = null + private var monitoringGoalCount: JsonField? = null + private var name: JsonField? = null + private var source: JsonField? = null + private var taskType: JsonField? = null + private var versionCount: JsonField? = null + private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() + private var description: JsonField = JsonMissing.of() + private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(projectUpdateResponse: ProjectUpdateResponse) = apply { + id = projectUpdateResponse.id + creatorId = projectUpdateResponse.creatorId + dateCreated = projectUpdateResponse.dateCreated + dateUpdated = projectUpdateResponse.dateUpdated + developmentGoalCount = projectUpdateResponse.developmentGoalCount + goalCount = projectUpdateResponse.goalCount + inferencePipelineCount = projectUpdateResponse.inferencePipelineCount + links = projectUpdateResponse.links + monitoringGoalCount = projectUpdateResponse.monitoringGoalCount + name = projectUpdateResponse.name + source = projectUpdateResponse.source + taskType = projectUpdateResponse.taskType + versionCount = projectUpdateResponse.versionCount + workspaceId = projectUpdateResponse.workspaceId + dataRetentionDays = projectUpdateResponse.dataRetentionDays + description = projectUpdateResponse.description + gitRepo = projectUpdateResponse.gitRepo + modelDeveloper = projectUpdateResponse.modelDeveloper + modelTypes = projectUpdateResponse.modelTypes.map { it.toMutableList() } + purpose = projectUpdateResponse.purpose + additionalProperties = projectUpdateResponse.additionalProperties.toMutableMap() + } + + /** The project id. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** The project creator id. */ + fun creatorId(creatorId: String?) = creatorId(JsonField.ofNullable(creatorId)) + + /** Alias for calling [Builder.creatorId] with `creatorId.orElse(null)`. */ + fun creatorId(creatorId: Optional) = creatorId(creatorId.getOrNull()) + + /** + * Sets [Builder.creatorId] to an arbitrary JSON value. + * + * You should usually call [Builder.creatorId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creatorId(creatorId: JsonField) = apply { this.creatorId = creatorId } + + /** The project creation date. */ + fun dateCreated(dateCreated: OffsetDateTime) = dateCreated(JsonField.of(dateCreated)) + + /** + * Sets [Builder.dateCreated] to an arbitrary JSON value. + * + * You should usually call [Builder.dateCreated] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dateCreated(dateCreated: JsonField) = apply { + this.dateCreated = dateCreated + } + + /** The project last updated date. */ + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + /** + * Sets [Builder.dateUpdated] to an arbitrary JSON value. + * + * You should usually call [Builder.dateUpdated] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + /** The number of tests in the development mode of the project. */ + fun developmentGoalCount(developmentGoalCount: Long) = + developmentGoalCount(JsonField.of(developmentGoalCount)) + + /** + * Sets [Builder.developmentGoalCount] to an arbitrary JSON value. + * + * You should usually call [Builder.developmentGoalCount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun developmentGoalCount(developmentGoalCount: JsonField) = apply { + this.developmentGoalCount = developmentGoalCount + } + + /** The total number of tests in the project. */ + fun goalCount(goalCount: Long) = goalCount(JsonField.of(goalCount)) + + /** + * Sets [Builder.goalCount] to an arbitrary JSON value. + * + * You should usually call [Builder.goalCount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun goalCount(goalCount: JsonField) = apply { this.goalCount = goalCount } + + /** The number of inference pipelines in the project. */ + fun inferencePipelineCount(inferencePipelineCount: Long) = + inferencePipelineCount(JsonField.of(inferencePipelineCount)) + + /** + * Sets [Builder.inferencePipelineCount] to an arbitrary JSON value. + * + * You should usually call [Builder.inferencePipelineCount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun inferencePipelineCount(inferencePipelineCount: JsonField) = apply { + this.inferencePipelineCount = inferencePipelineCount + } + + /** Links to the project. */ + fun links(links: Links) = links(JsonField.of(links)) + + /** + * Sets [Builder.links] to an arbitrary JSON value. + * + * You should usually call [Builder.links] with a well-typed [Links] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun links(links: JsonField) = apply { this.links = links } + + /** The number of tests in the monitoring mode of the project. */ + fun monitoringGoalCount(monitoringGoalCount: Long) = + monitoringGoalCount(JsonField.of(monitoringGoalCount)) + + /** + * Sets [Builder.monitoringGoalCount] to an arbitrary JSON value. + * + * You should usually call [Builder.monitoringGoalCount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun monitoringGoalCount(monitoringGoalCount: JsonField) = apply { + this.monitoringGoalCount = monitoringGoalCount + } + + /** The project name. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** The source of the project. */ + fun source(source: Source?) = source(JsonField.ofNullable(source)) + + /** Alias for calling [Builder.source] with `source.orElse(null)`. */ + fun source(source: Optional) = source(source.getOrNull()) + + /** + * Sets [Builder.source] to an arbitrary JSON value. + * + * You should usually call [Builder.source] with a well-typed [Source] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun source(source: JsonField) = apply { this.source = source } + + /** The task type of the project. */ + fun taskType(taskType: TaskType) = taskType(JsonField.of(taskType)) + + /** + * Sets [Builder.taskType] to an arbitrary JSON value. + * + * You should usually call [Builder.taskType] with a well-typed [TaskType] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun taskType(taskType: JsonField) = apply { this.taskType = taskType } + + /** The number of versions (commits) in the project. */ + fun versionCount(versionCount: Long) = versionCount(JsonField.of(versionCount)) + + /** + * Sets [Builder.versionCount] to an arbitrary JSON value. + * + * You should usually call [Builder.versionCount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun versionCount(versionCount: JsonField) = apply { this.versionCount = versionCount } + + /** The workspace id. */ + fun workspaceId(workspaceId: String?) = workspaceId(JsonField.ofNullable(workspaceId)) + + /** Alias for calling [Builder.workspaceId] with `workspaceId.orElse(null)`. */ + fun workspaceId(workspaceId: Optional) = workspaceId(workspaceId.getOrNull()) + + /** + * Sets [Builder.workspaceId] to an arbitrary JSON value. + * + * You should usually call [Builder.workspaceId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId } + + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + + /** The project description. */ + fun description(description: String?) = description(JsonField.ofNullable(description)) + + /** Alias for calling [Builder.description] with `description.orElse(null)`. */ + fun description(description: Optional) = description(description.getOrNull()) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun description(description: JsonField) = apply { this.description = description } + + fun gitRepo(gitRepo: GitRepo?) = gitRepo(JsonField.ofNullable(gitRepo)) + + /** Alias for calling [Builder.gitRepo] with `gitRepo.orElse(null)`. */ + fun gitRepo(gitRepo: Optional) = gitRepo(gitRepo.getOrNull()) + + /** + * Sets [Builder.gitRepo] to an arbitrary JSON value. + * + * You should usually call [Builder.gitRepo] with a well-typed [GitRepo] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + + 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 [ProjectUpdateResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .creatorId() + * .dateCreated() + * .dateUpdated() + * .developmentGoalCount() + * .goalCount() + * .inferencePipelineCount() + * .links() + * .monitoringGoalCount() + * .name() + * .source() + * .taskType() + * .versionCount() + * .workspaceId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ProjectUpdateResponse = + ProjectUpdateResponse( + checkRequired("id", id), + checkRequired("creatorId", creatorId), + checkRequired("dateCreated", dateCreated), + checkRequired("dateUpdated", dateUpdated), + checkRequired("developmentGoalCount", developmentGoalCount), + checkRequired("goalCount", goalCount), + checkRequired("inferencePipelineCount", inferencePipelineCount), + checkRequired("links", links), + checkRequired("monitoringGoalCount", monitoringGoalCount), + checkRequired("name", name), + checkRequired("source", source), + checkRequired("taskType", taskType), + checkRequired("versionCount", versionCount), + checkRequired("workspaceId", workspaceId), + dataRetentionDays, + description, + gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): ProjectUpdateResponse = apply { + if (validated) { + return@apply + } + + id() + creatorId() + dateCreated() + dateUpdated() + developmentGoalCount() + goalCount() + inferencePipelineCount() + links().validate() + monitoringGoalCount() + name() + source().ifPresent { it.validate() } + taskType().validate() + versionCount() + workspaceId() + dataRetentionDays() + description() + gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() + 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 (id.asKnown().isPresent) 1 else 0) + + (if (creatorId.asKnown().isPresent) 1 else 0) + + (if (dateCreated.asKnown().isPresent) 1 else 0) + + (if (dateUpdated.asKnown().isPresent) 1 else 0) + + (if (developmentGoalCount.asKnown().isPresent) 1 else 0) + + (if (goalCount.asKnown().isPresent) 1 else 0) + + (if (inferencePipelineCount.asKnown().isPresent) 1 else 0) + + (links.asKnown().getOrNull()?.validity() ?: 0) + + (if (monitoringGoalCount.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (source.asKnown().getOrNull()?.validity() ?: 0) + + (taskType.asKnown().getOrNull()?.validity() ?: 0) + + (if (versionCount.asKnown().isPresent) 1 else 0) + + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + + (if (description.asKnown().isPresent) 1 else 0) + + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) + + /** Links to the project. */ + class Links + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val app: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("app") @ExcludeMissing app: JsonField = JsonMissing.of() + ) : this(app, mutableMapOf()) + + /** + * @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 app(): String = app.getRequired("app") + + /** + * Returns the raw JSON value of [app]. + * + * Unlike [app], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("app") @ExcludeMissing fun _app(): JsonField = app + + @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 [Links]. + * + * The following fields are required: + * ```java + * .app() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Links]. */ + class Builder internal constructor() { + + private var app: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(links: Links) = apply { + app = links.app + additionalProperties = links.additionalProperties.toMutableMap() + } + + fun app(app: String) = app(JsonField.of(app)) + + /** + * Sets [Builder.app] to an arbitrary JSON value. + * + * You should usually call [Builder.app] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun app(app: JsonField) = apply { this.app = app } + + 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 [Links]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .app() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Links = + Links(checkRequired("app", app), additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Links = apply { + if (validated) { + return@apply + } + + app() + 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 (app.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Links && + app == other.app && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(app, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Links{app=$app, additionalProperties=$additionalProperties}" + } + + /** The source of the project. */ + class Source @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 WEB = of("web") + + @JvmField val API = of("api") + + @JvmField val NULL = of("null") + + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) + } + + /** An enum containing [Source]'s known values. */ + enum class Known { + WEB, + API, + NULL, + } + + /** + * An enum containing [Source]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Source] 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 { + WEB, + API, + NULL, + /** An enum member indicating that [Source] 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) { + WEB -> Value.WEB + API -> Value.API + NULL -> Value.NULL + 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) { + WEB -> Known.WEB + API -> Known.API + NULL -> Known.NULL + else -> throw OpenlayerInvalidDataException("Unknown Source: $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 + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): Source = 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 Source && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** The task type of the project. */ + class TaskType @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 LLM_BASE = of("llm-base") + + @JvmField val TABULAR_CLASSIFICATION = of("tabular-classification") + + @JvmField val TABULAR_REGRESSION = of("tabular-regression") + + @JvmField val TEXT_CLASSIFICATION = of("text-classification") + + @JvmStatic fun of(value: String) = TaskType(JsonField.of(value)) + } + + /** An enum containing [TaskType]'s known values. */ + enum class Known { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + } + + /** + * An enum containing [TaskType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TaskType] 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 { + LLM_BASE, + TABULAR_CLASSIFICATION, + TABULAR_REGRESSION, + TEXT_CLASSIFICATION, + /** An enum member indicating that [TaskType] 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) { + LLM_BASE -> Value.LLM_BASE + TABULAR_CLASSIFICATION -> Value.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Value.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Value.TEXT_CLASSIFICATION + 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) { + LLM_BASE -> Known.LLM_BASE + TABULAR_CLASSIFICATION -> Known.TABULAR_CLASSIFICATION + TABULAR_REGRESSION -> Known.TABULAR_REGRESSION + TEXT_CLASSIFICATION -> Known.TEXT_CLASSIFICATION + else -> throw OpenlayerInvalidDataException("Unknown TaskType: $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 + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): TaskType = 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 TaskType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + class GitRepo + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val dateConnected: JsonField, + private val dateUpdated: JsonField, + private val gitAccountId: JsonField, + private val gitId: JsonField, + private val name: JsonField, + private val private_: JsonField, + private val projectId: JsonField, + private val slug: JsonField, + private val url: JsonField, + private val branch: JsonField, + private val rootDir: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("dateConnected") + @ExcludeMissing + dateConnected: JsonField = JsonMissing.of(), + @JsonProperty("dateUpdated") + @ExcludeMissing + dateUpdated: JsonField = JsonMissing.of(), + @JsonProperty("gitAccountId") + @ExcludeMissing + gitAccountId: JsonField = JsonMissing.of(), + @JsonProperty("gitId") @ExcludeMissing gitId: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("private") + @ExcludeMissing + private_: JsonField = JsonMissing.of(), + @JsonProperty("projectId") + @ExcludeMissing + projectId: JsonField = JsonMissing.of(), + @JsonProperty("slug") @ExcludeMissing slug: JsonField = JsonMissing.of(), + @JsonProperty("url") @ExcludeMissing url: JsonField = JsonMissing.of(), + @JsonProperty("branch") @ExcludeMissing branch: JsonField = JsonMissing.of(), + @JsonProperty("rootDir") @ExcludeMissing rootDir: JsonField = JsonMissing.of(), + ) : this( + id, + dateConnected, + dateUpdated, + gitAccountId, + gitId, + name, + private_, + projectId, + slug, + url, + branch, + rootDir, + mutableMapOf(), + ) + + /** + * @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 id(): String = id.getRequired("id") + + /** + * @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 dateConnected(): OffsetDateTime = dateConnected.getRequired("dateConnected") + + /** + * @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 dateUpdated(): OffsetDateTime = dateUpdated.getRequired("dateUpdated") + + /** + * @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 gitAccountId(): String = gitAccountId.getRequired("gitAccountId") + + /** + * @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 gitId(): Long = gitId.getRequired("gitId") + + /** + * @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 name(): String = name.getRequired("name") + + /** + * @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 private_(): Boolean = private_.getRequired("private") + + /** + * @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 projectId(): String = projectId.getRequired("projectId") + + /** + * @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 slug(): String = slug.getRequired("slug") + + /** + * @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 url(): String = url.getRequired("url") + + /** + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun branch(): Optional = branch.getOptional("branch") + + /** + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun rootDir(): Optional = rootDir.getOptional("rootDir") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [dateConnected]. + * + * Unlike [dateConnected], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dateConnected") + @ExcludeMissing + fun _dateConnected(): JsonField = dateConnected + + /** + * Returns the raw JSON value of [dateUpdated]. + * + * Unlike [dateUpdated], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("dateUpdated") + @ExcludeMissing + fun _dateUpdated(): JsonField = dateUpdated + + /** + * Returns the raw JSON value of [gitAccountId]. + * + * Unlike [gitAccountId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("gitAccountId") + @ExcludeMissing + fun _gitAccountId(): JsonField = gitAccountId + + /** + * Returns the raw JSON value of [gitId]. + * + * Unlike [gitId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("gitId") @ExcludeMissing fun _gitId(): JsonField = gitId + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [private_]. + * + * Unlike [private_], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("private") @ExcludeMissing fun _private_(): JsonField = private_ + + /** + * Returns the raw JSON value of [projectId]. + * + * Unlike [projectId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("projectId") @ExcludeMissing fun _projectId(): JsonField = projectId + + /** + * Returns the raw JSON value of [slug]. + * + * Unlike [slug], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("slug") @ExcludeMissing fun _slug(): JsonField = slug + + /** + * Returns the raw JSON value of [url]. + * + * Unlike [url], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("url") @ExcludeMissing fun _url(): JsonField = url + + /** + * Returns the raw JSON value of [branch]. + * + * Unlike [branch], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("branch") @ExcludeMissing fun _branch(): JsonField = branch + + /** + * Returns the raw JSON value of [rootDir]. + * + * Unlike [rootDir], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("rootDir") @ExcludeMissing fun _rootDir(): JsonField = rootDir + + @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 [GitRepo]. + * + * The following fields are required: + * ```java + * .id() + * .dateConnected() + * .dateUpdated() + * .gitAccountId() + * .gitId() + * .name() + * .private_() + * .projectId() + * .slug() + * .url() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [GitRepo]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var dateConnected: JsonField? = null + private var dateUpdated: JsonField? = null + private var gitAccountId: JsonField? = null + private var gitId: JsonField? = null + private var name: JsonField? = null + private var private_: JsonField? = null + private var projectId: JsonField? = null + private var slug: JsonField? = null + private var url: JsonField? = null + private var branch: JsonField = JsonMissing.of() + private var rootDir: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(gitRepo: GitRepo) = apply { + id = gitRepo.id + dateConnected = gitRepo.dateConnected + dateUpdated = gitRepo.dateUpdated + gitAccountId = gitRepo.gitAccountId + gitId = gitRepo.gitId + name = gitRepo.name + private_ = gitRepo.private_ + projectId = gitRepo.projectId + slug = gitRepo.slug + url = gitRepo.url + branch = gitRepo.branch + rootDir = gitRepo.rootDir + additionalProperties = gitRepo.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun id(id: JsonField) = apply { this.id = id } + + fun dateConnected(dateConnected: OffsetDateTime) = + dateConnected(JsonField.of(dateConnected)) + + /** + * Sets [Builder.dateConnected] to an arbitrary JSON value. + * + * You should usually call [Builder.dateConnected] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun dateConnected(dateConnected: JsonField) = apply { + this.dateConnected = dateConnected + } + + fun dateUpdated(dateUpdated: OffsetDateTime) = dateUpdated(JsonField.of(dateUpdated)) + + /** + * Sets [Builder.dateUpdated] to an arbitrary JSON value. + * + * You should usually call [Builder.dateUpdated] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun dateUpdated(dateUpdated: JsonField) = apply { + this.dateUpdated = dateUpdated + } + + fun gitAccountId(gitAccountId: String) = gitAccountId(JsonField.of(gitAccountId)) + + /** + * Sets [Builder.gitAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.gitAccountId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun gitAccountId(gitAccountId: JsonField) = apply { + this.gitAccountId = gitAccountId + } + + fun gitId(gitId: Long) = gitId(JsonField.of(gitId)) + + /** + * Sets [Builder.gitId] to an arbitrary JSON value. + * + * You should usually call [Builder.gitId] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun gitId(gitId: JsonField) = apply { this.gitId = gitId } + + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun private_(private_: Boolean) = private_(JsonField.of(private_)) + + /** + * Sets [Builder.private_] to an arbitrary JSON value. + * + * You should usually call [Builder.private_] with a well-typed [Boolean] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun private_(private_: JsonField) = apply { this.private_ = private_ } + + fun projectId(projectId: String) = projectId(JsonField.of(projectId)) + + /** + * Sets [Builder.projectId] to an arbitrary JSON value. + * + * You should usually call [Builder.projectId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun projectId(projectId: JsonField) = apply { this.projectId = projectId } + + fun slug(slug: String) = slug(JsonField.of(slug)) + + /** + * Sets [Builder.slug] to an arbitrary JSON value. + * + * You should usually call [Builder.slug] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun slug(slug: JsonField) = apply { this.slug = slug } + + fun url(url: String) = url(JsonField.of(url)) + + /** + * Sets [Builder.url] to an arbitrary JSON value. + * + * You should usually call [Builder.url] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun url(url: JsonField) = apply { this.url = url } + + fun branch(branch: String) = branch(JsonField.of(branch)) + + /** + * Sets [Builder.branch] to an arbitrary JSON value. + * + * You should usually call [Builder.branch] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun branch(branch: JsonField) = apply { this.branch = branch } + + fun rootDir(rootDir: String) = rootDir(JsonField.of(rootDir)) + + /** + * Sets [Builder.rootDir] to an arbitrary JSON value. + * + * You should usually call [Builder.rootDir] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun rootDir(rootDir: JsonField) = apply { this.rootDir = rootDir } + + 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 [GitRepo]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .dateConnected() + * .dateUpdated() + * .gitAccountId() + * .gitId() + * .name() + * .private_() + * .projectId() + * .slug() + * .url() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): GitRepo = + GitRepo( + checkRequired("id", id), + checkRequired("dateConnected", dateConnected), + checkRequired("dateUpdated", dateUpdated), + checkRequired("gitAccountId", gitAccountId), + checkRequired("gitId", gitId), + checkRequired("name", name), + checkRequired("private_", private_), + checkRequired("projectId", projectId), + checkRequired("slug", slug), + checkRequired("url", url), + branch, + rootDir, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws OpenlayerInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): GitRepo = apply { + if (validated) { + return@apply + } + + id() + dateConnected() + dateUpdated() + gitAccountId() + gitId() + name() + private_() + projectId() + slug() + url() + branch() + rootDir() + 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 (id.asKnown().isPresent) 1 else 0) + + (if (dateConnected.asKnown().isPresent) 1 else 0) + + (if (dateUpdated.asKnown().isPresent) 1 else 0) + + (if (gitAccountId.asKnown().isPresent) 1 else 0) + + (if (gitId.asKnown().isPresent) 1 else 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (if (private_.asKnown().isPresent) 1 else 0) + + (if (projectId.asKnown().isPresent) 1 else 0) + + (if (slug.asKnown().isPresent) 1 else 0) + + (if (url.asKnown().isPresent) 1 else 0) + + (if (branch.asKnown().isPresent) 1 else 0) + + (if (rootDir.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is GitRepo && + id == other.id && + dateConnected == other.dateConnected && + dateUpdated == other.dateUpdated && + gitAccountId == other.gitAccountId && + gitId == other.gitId && + name == other.name && + private_ == other.private_ && + projectId == other.projectId && + slug == other.slug && + url == other.url && + branch == other.branch && + rootDir == other.rootDir && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + dateConnected, + dateUpdated, + gitAccountId, + gitId, + name, + private_, + projectId, + slug, + url, + branch, + rootDir, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "GitRepo{id=$id, dateConnected=$dateConnected, dateUpdated=$dateUpdated, gitAccountId=$gitAccountId, gitId=$gitId, name=$name, private_=$private_, projectId=$projectId, slug=$slug, url=$url, branch=$branch, rootDir=$rootDir, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ProjectUpdateResponse && + id == other.id && + creatorId == other.creatorId && + dateCreated == other.dateCreated && + dateUpdated == other.dateUpdated && + developmentGoalCount == other.developmentGoalCount && + goalCount == other.goalCount && + inferencePipelineCount == other.inferencePipelineCount && + links == other.links && + monitoringGoalCount == other.monitoringGoalCount && + name == other.name && + source == other.source && + taskType == other.taskType && + versionCount == other.versionCount && + workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && + description == other.description && + gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + creatorId, + dateCreated, + dateUpdated, + developmentGoalCount, + goalCount, + inferencePipelineCount, + links, + monitoringGoalCount, + name, + source, + taskType, + versionCount, + workspaceId, + dataRetentionDays, + description, + gitRepo, + modelDeveloper, + modelTypes, + purpose, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ProjectUpdateResponse{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" +} 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 368a2300..67e82d3e 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 @@ -7866,8 +7866,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -7907,10 +7911,20 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -7926,8 +7940,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -8044,6 +8062,15 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -8058,6 +8085,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -8174,6 +8225,16 @@ private constructor( @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -8190,6 +8251,32 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -8245,8 +8332,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -8265,8 +8356,12 @@ private constructor( taskType = project.taskType versionCount = project.versionCount workspaceId = project.workspaceId + dataRetentionDays = project.dataRetentionDays description = project.description gitRepo = project.gitRepo + modelDeveloper = project.modelDeveloper + modelTypes = project.modelTypes.map { it.toMutableList() } + purpose = project.purpose additionalProperties = project.additionalProperties.toMutableMap() } @@ -8464,6 +8559,38 @@ private constructor( this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -8495,6 +8622,69 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -8555,8 +8745,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -8591,8 +8785,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -8626,8 +8824,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) /** Links to the project. */ class Links @@ -9734,8 +9936,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -9755,8 +9961,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -9764,7 +9974,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } class Workspace diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt index 0201f815..142d37f4 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponse.kt @@ -6836,8 +6836,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -6877,10 +6881,20 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") @ExcludeMissing purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -6896,8 +6910,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -7014,6 +7032,15 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is retained + * indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -7028,6 +7055,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -7144,6 +7195,16 @@ private constructor( @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -7160,6 +7221,32 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -7215,8 +7302,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -7235,8 +7326,12 @@ private constructor( taskType = project.taskType versionCount = project.versionCount workspaceId = project.workspaceId + dataRetentionDays = project.dataRetentionDays description = project.description gitRepo = project.gitRepo + modelDeveloper = project.modelDeveloper + modelTypes = project.modelTypes.map { it.toMutableList() } + purpose = project.purpose additionalProperties = project.additionalProperties.toMutableMap() } @@ -7434,6 +7529,38 @@ private constructor( this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -7465,6 +7592,69 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7525,8 +7715,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -7561,8 +7755,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -7596,8 +7794,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) /** Links to the project. */ class Links @@ -8701,8 +8903,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -8722,8 +8928,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -8731,7 +8941,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } class Workspace diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt index 56ddf9ad..6464f3ba 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponse.kt @@ -7146,8 +7146,12 @@ private constructor( private val taskType: JsonField, private val versionCount: JsonField, private val workspaceId: JsonField, + private val dataRetentionDays: JsonField, private val description: JsonField, private val gitRepo: JsonField, + private val modelDeveloper: JsonField, + private val modelTypes: JsonField>, + private val purpose: JsonField, private val additionalProperties: MutableMap, ) { @@ -7189,12 +7193,24 @@ private constructor( @JsonProperty("workspaceId") @ExcludeMissing workspaceId: JsonField = JsonMissing.of(), + @JsonProperty("dataRetentionDays") + @ExcludeMissing + dataRetentionDays: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), @JsonProperty("gitRepo") @ExcludeMissing gitRepo: JsonField = JsonMissing.of(), + @JsonProperty("modelDeveloper") + @ExcludeMissing + modelDeveloper: JsonField = JsonMissing.of(), + @JsonProperty("modelTypes") + @ExcludeMissing + modelTypes: JsonField> = JsonMissing.of(), + @JsonProperty("purpose") + @ExcludeMissing + purpose: JsonField = JsonMissing.of(), ) : this( id, creatorId, @@ -7210,8 +7226,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, mutableMapOf(), ) @@ -7340,6 +7360,16 @@ private constructor( */ fun workspaceId(): Optional = workspaceId.getOptional("workspaceId") + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun dataRetentionDays(): Optional = + dataRetentionDays.getOptional("dataRetentionDays") + /** * The project description. * @@ -7354,6 +7384,30 @@ private constructor( */ fun gitRepo(): Optional = gitRepo.getOptional("gitRepo") + /** + * Who developed the model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun modelDeveloper(): Optional = modelDeveloper.getOptional("modelDeveloper") + + /** + * The kinds of model used in this project. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun modelTypes(): Optional> = modelTypes.getOptional("modelTypes") + + /** + * What the system in this project is intended to do. + * + * @throws OpenlayerInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun purpose(): Optional = purpose.getOptional("purpose") + /** * Returns the raw JSON value of [id]. * @@ -7480,6 +7534,16 @@ private constructor( @ExcludeMissing fun _workspaceId(): JsonField = workspaceId + /** + * Returns the raw JSON value of [dataRetentionDays]. + * + * Unlike [dataRetentionDays], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("dataRetentionDays") + @ExcludeMissing + fun _dataRetentionDays(): JsonField = dataRetentionDays + /** * Returns the raw JSON value of [description]. * @@ -7497,6 +7561,33 @@ private constructor( */ @JsonProperty("gitRepo") @ExcludeMissing fun _gitRepo(): JsonField = gitRepo + /** + * Returns the raw JSON value of [modelDeveloper]. + * + * Unlike [modelDeveloper], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("modelDeveloper") + @ExcludeMissing + fun _modelDeveloper(): JsonField = modelDeveloper + + /** + * Returns the raw JSON value of [modelTypes]. + * + * Unlike [modelTypes], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("modelTypes") + @ExcludeMissing + fun _modelTypes(): JsonField> = modelTypes + + /** + * Returns the raw JSON value of [purpose]. + * + * Unlike [purpose], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("purpose") @ExcludeMissing fun _purpose(): JsonField = purpose + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -7552,8 +7643,12 @@ private constructor( private var taskType: JsonField? = null private var versionCount: JsonField? = null private var workspaceId: JsonField? = null + private var dataRetentionDays: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var gitRepo: JsonField = JsonMissing.of() + private var modelDeveloper: JsonField = JsonMissing.of() + private var modelTypes: JsonField>? = null + private var purpose: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -7572,8 +7667,12 @@ private constructor( taskType = project.taskType versionCount = project.versionCount workspaceId = project.workspaceId + dataRetentionDays = project.dataRetentionDays description = project.description gitRepo = project.gitRepo + modelDeveloper = project.modelDeveloper + modelTypes = project.modelTypes.map { it.toMutableList() } + purpose = project.purpose additionalProperties = project.additionalProperties.toMutableMap() } @@ -7775,6 +7874,39 @@ private constructor( this.workspaceId = workspaceId } + /** + * Number of days to retain monitoring data for this project. Null means data is + * retained indefinitely. + */ + fun dataRetentionDays(dataRetentionDays: Long?) = + dataRetentionDays(JsonField.ofNullable(dataRetentionDays)) + + /** + * Alias for [Builder.dataRetentionDays]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun dataRetentionDays(dataRetentionDays: Long) = + dataRetentionDays(dataRetentionDays as Long?) + + /** + * Alias for calling [Builder.dataRetentionDays] with + * `dataRetentionDays.orElse(null)`. + */ + fun dataRetentionDays(dataRetentionDays: Optional) = + dataRetentionDays(dataRetentionDays.getOrNull()) + + /** + * Sets [Builder.dataRetentionDays] to an arbitrary JSON value. + * + * You should usually call [Builder.dataRetentionDays] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun dataRetentionDays(dataRetentionDays: JsonField) = apply { + this.dataRetentionDays = dataRetentionDays + } + /** The project description. */ fun description(description: String?) = description(JsonField.ofNullable(description)) @@ -7808,6 +7940,73 @@ private constructor( */ fun gitRepo(gitRepo: JsonField) = apply { this.gitRepo = gitRepo } + /** Who developed the model used in this project. */ + fun modelDeveloper(modelDeveloper: String?) = + modelDeveloper(JsonField.ofNullable(modelDeveloper)) + + /** + * Alias for calling [Builder.modelDeveloper] with `modelDeveloper.orElse(null)`. + */ + fun modelDeveloper(modelDeveloper: Optional) = + modelDeveloper(modelDeveloper.getOrNull()) + + /** + * Sets [Builder.modelDeveloper] to an arbitrary JSON value. + * + * You should usually call [Builder.modelDeveloper] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun modelDeveloper(modelDeveloper: JsonField) = apply { + this.modelDeveloper = modelDeveloper + } + + /** The kinds of model used in this project. */ + fun modelTypes(modelTypes: List?) = + modelTypes(JsonField.ofNullable(modelTypes)) + + /** Alias for calling [Builder.modelTypes] with `modelTypes.orElse(null)`. */ + fun modelTypes(modelTypes: Optional>) = + modelTypes(modelTypes.getOrNull()) + + /** + * Sets [Builder.modelTypes] to an arbitrary JSON value. + * + * You should usually call [Builder.modelTypes] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun modelTypes(modelTypes: JsonField>) = apply { + this.modelTypes = modelTypes.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [modelTypes]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addModelType(modelType: String) = apply { + modelTypes = + (modelTypes ?: JsonField.of(mutableListOf())).also { + checkKnown("modelTypes", it).add(modelType) + } + } + + /** What the system in this project is intended to do. */ + fun purpose(purpose: String?) = purpose(JsonField.ofNullable(purpose)) + + /** Alias for calling [Builder.purpose] with `purpose.orElse(null)`. */ + fun purpose(purpose: Optional) = purpose(purpose.getOrNull()) + + /** + * Sets [Builder.purpose] to an arbitrary JSON value. + * + * You should usually call [Builder.purpose] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun purpose(purpose: JsonField) = apply { this.purpose = purpose } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7871,8 +8070,12 @@ private constructor( checkRequired("taskType", taskType), checkRequired("versionCount", versionCount), checkRequired("workspaceId", workspaceId), + dataRetentionDays, description, gitRepo, + modelDeveloper, + (modelTypes ?: JsonMissing.of()).map { it.toImmutable() }, + purpose, additionalProperties.toMutableMap(), ) } @@ -7908,8 +8111,12 @@ private constructor( taskType().validate() versionCount() workspaceId() + dataRetentionDays() description() gitRepo().ifPresent { it.validate() } + modelDeveloper() + modelTypes() + purpose() validated = true } @@ -7943,8 +8150,12 @@ private constructor( (taskType.asKnown().getOrNull()?.validity() ?: 0) + (if (versionCount.asKnown().isPresent) 1 else 0) + (if (workspaceId.asKnown().isPresent) 1 else 0) + + (if (dataRetentionDays.asKnown().isPresent) 1 else 0) + (if (description.asKnown().isPresent) 1 else 0) + - (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + (gitRepo.asKnown().getOrNull()?.validity() ?: 0) + + (if (modelDeveloper.asKnown().isPresent) 1 else 0) + + (modelTypes.asKnown().getOrNull()?.size ?: 0) + + (if (purpose.asKnown().isPresent) 1 else 0) /** Links to the project. */ class Links @@ -9068,8 +9279,12 @@ private constructor( taskType == other.taskType && versionCount == other.versionCount && workspaceId == other.workspaceId && + dataRetentionDays == other.dataRetentionDays && description == other.description && gitRepo == other.gitRepo && + modelDeveloper == other.modelDeveloper && + modelTypes == other.modelTypes && + purpose == other.purpose && additionalProperties == other.additionalProperties } @@ -9089,8 +9304,12 @@ private constructor( taskType, versionCount, workspaceId, + dataRetentionDays, description, gitRepo, + modelDeveloper, + modelTypes, + purpose, additionalProperties, ) } @@ -9098,7 +9317,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, description=$description, gitRepo=$gitRepo, additionalProperties=$additionalProperties}" + "Project{id=$id, creatorId=$creatorId, dateCreated=$dateCreated, dateUpdated=$dateUpdated, developmentGoalCount=$developmentGoalCount, goalCount=$goalCount, inferencePipelineCount=$inferencePipelineCount, links=$links, monitoringGoalCount=$monitoringGoalCount, name=$name, source=$source, taskType=$taskType, versionCount=$versionCount, workspaceId=$workspaceId, dataRetentionDays=$dataRetentionDays, description=$description, gitRepo=$gitRepo, modelDeveloper=$modelDeveloper, modelTypes=$modelTypes, purpose=$purpose, additionalProperties=$additionalProperties}" } class Workspace diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsync.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsync.kt index ade97e35..c3fb9451 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsync.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsync.kt @@ -11,6 +11,8 @@ import com.openlayer.api.models.projects.ProjectCreateResponse import com.openlayer.api.models.projects.ProjectDeleteParams import com.openlayer.api.models.projects.ProjectListParams import com.openlayer.api.models.projects.ProjectListResponse +import com.openlayer.api.models.projects.ProjectUpdateParams +import com.openlayer.api.models.projects.ProjectUpdateResponse import com.openlayer.api.services.async.projects.CommitServiceAsync import com.openlayer.api.services.async.projects.InferencePipelineServiceAsync import com.openlayer.api.services.async.projects.TestServiceAsync @@ -47,6 +49,41 @@ interface ProjectServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** Update a project's metadata. */ + fun update(projectId: String): CompletableFuture = + update(projectId, ProjectUpdateParams.none()) + + /** @see update */ + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + update(params.toBuilder().projectId(projectId).build(), requestOptions) + + /** @see update */ + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + ): CompletableFuture = update(projectId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see update */ + fun update(params: ProjectUpdateParams): CompletableFuture = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + projectId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + update(projectId, ProjectUpdateParams.none(), requestOptions) + /** List your workspace's projects. */ fun list(): CompletableFuture = list(ProjectListParams.none()) @@ -132,6 +169,47 @@ interface ProjectServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + /** + * Returns a raw HTTP response for `patch /projects/{projectId}`, but is otherwise the same + * as [ProjectServiceAsync.update]. + */ + fun update(projectId: String): CompletableFuture> = + update(projectId, ProjectUpdateParams.none()) + + /** @see update */ + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + update(params.toBuilder().projectId(projectId).build(), requestOptions) + + /** @see update */ + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + ): CompletableFuture> = + update(projectId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see update */ + fun update( + params: ProjectUpdateParams + ): CompletableFuture> = + update(params, RequestOptions.none()) + + /** @see update */ + fun update( + projectId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + update(projectId, ProjectUpdateParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /projects`, but is otherwise the same as * [ProjectServiceAsync.list]. diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncImpl.kt index 372e2f64..4eb7db4c 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncImpl.kt @@ -22,6 +22,8 @@ import com.openlayer.api.models.projects.ProjectCreateResponse import com.openlayer.api.models.projects.ProjectDeleteParams import com.openlayer.api.models.projects.ProjectListParams import com.openlayer.api.models.projects.ProjectListResponse +import com.openlayer.api.models.projects.ProjectUpdateParams +import com.openlayer.api.models.projects.ProjectUpdateResponse import com.openlayer.api.services.async.projects.CommitServiceAsync import com.openlayer.api.services.async.projects.CommitServiceAsyncImpl import com.openlayer.api.services.async.projects.InferencePipelineServiceAsync @@ -65,6 +67,13 @@ class ProjectServiceAsyncImpl internal constructor(private val clientOptions: Cl // post /projects withRawResponse().create(params, requestOptions).thenApply { it.parse() } + override fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // patch /projects/{projectId} + withRawResponse().update(params, requestOptions).thenApply { it.parse() } + override fun list( params: ProjectListParams, requestOptions: RequestOptions, @@ -142,6 +151,40 @@ class ProjectServiceAsyncImpl internal constructor(private val clientOptions: Cl } } + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("projectId", params.projectId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PATCH) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("projects", params._pathParam(0)) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectService.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectService.kt index 3897b856..693fd6fb 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectService.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectService.kt @@ -12,6 +12,8 @@ import com.openlayer.api.models.projects.ProjectCreateResponse import com.openlayer.api.models.projects.ProjectDeleteParams import com.openlayer.api.models.projects.ProjectListParams import com.openlayer.api.models.projects.ProjectListResponse +import com.openlayer.api.models.projects.ProjectUpdateParams +import com.openlayer.api.models.projects.ProjectUpdateResponse import com.openlayer.api.services.blocking.projects.CommitService import com.openlayer.api.services.blocking.projects.InferencePipelineService import com.openlayer.api.services.blocking.projects.TestService @@ -47,6 +49,38 @@ interface ProjectService { requestOptions: RequestOptions = RequestOptions.none(), ): ProjectCreateResponse + /** Update a project's metadata. */ + fun update(projectId: String): ProjectUpdateResponse = + update(projectId, ProjectUpdateParams.none()) + + /** @see update */ + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): ProjectUpdateResponse = + update(params.toBuilder().projectId(projectId).build(), requestOptions) + + /** @see update */ + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + ): ProjectUpdateResponse = update(projectId, params, RequestOptions.none()) + + /** @see update */ + fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): ProjectUpdateResponse + + /** @see update */ + fun update(params: ProjectUpdateParams): ProjectUpdateResponse = + update(params, RequestOptions.none()) + + /** @see update */ + fun update(projectId: String, requestOptions: RequestOptions): ProjectUpdateResponse = + update(projectId, ProjectUpdateParams.none(), requestOptions) + /** List your workspace's projects. */ fun list(): ProjectListResponse = list(ProjectListParams.none()) @@ -119,6 +153,50 @@ interface ProjectService { requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + /** + * Returns a raw HTTP response for `patch /projects/{projectId}`, but is otherwise the same + * as [ProjectService.update]. + */ + @MustBeClosed + fun update(projectId: String): HttpResponseFor = + update(projectId, ProjectUpdateParams.none()) + + /** @see update */ + @MustBeClosed + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + update(params.toBuilder().projectId(projectId).build(), requestOptions) + + /** @see update */ + @MustBeClosed + fun update( + projectId: String, + params: ProjectUpdateParams = ProjectUpdateParams.none(), + ): HttpResponseFor = update(projectId, params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see update */ + @MustBeClosed + fun update(params: ProjectUpdateParams): HttpResponseFor = + update(params, RequestOptions.none()) + + /** @see update */ + @MustBeClosed + fun update( + projectId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + update(projectId, ProjectUpdateParams.none(), requestOptions) + /** * Returns a raw HTTP response for `get /projects`, but is otherwise the same as * [ProjectService.list]. diff --git a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectServiceImpl.kt b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectServiceImpl.kt index 3a27528d..cd699ee8 100644 --- a/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectServiceImpl.kt +++ b/openlayer-java-core/src/main/kotlin/com/openlayer/api/services/blocking/ProjectServiceImpl.kt @@ -22,6 +22,8 @@ import com.openlayer.api.models.projects.ProjectCreateResponse import com.openlayer.api.models.projects.ProjectDeleteParams import com.openlayer.api.models.projects.ProjectListParams import com.openlayer.api.models.projects.ProjectListResponse +import com.openlayer.api.models.projects.ProjectUpdateParams +import com.openlayer.api.models.projects.ProjectUpdateResponse import com.openlayer.api.services.blocking.projects.CommitService import com.openlayer.api.services.blocking.projects.CommitServiceImpl import com.openlayer.api.services.blocking.projects.InferencePipelineService @@ -64,6 +66,13 @@ class ProjectServiceImpl internal constructor(private val clientOptions: ClientO // post /projects withRawResponse().create(params, requestOptions).parse() + override fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions, + ): ProjectUpdateResponse = + // patch /projects/{projectId} + withRawResponse().update(params, requestOptions).parse() + override fun list( params: ProjectListParams, requestOptions: RequestOptions, @@ -136,6 +145,37 @@ class ProjectServiceImpl internal constructor(private val clientOptions: ClientO } } + private val updateHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun update( + params: ProjectUpdateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("projectId", params.projectId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.PATCH) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("projects", params._pathParam(0)) + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { updateHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + private val listHandler: Handler = jsonHandler(clientOptions.jsonMapper) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponseTest.kt index 7328559c..825e3845 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineRetrieveResponseTest.kt @@ -87,6 +87,7 @@ internal class InferencePipelineRetrieveResponseTest { .taskType(InferencePipelineRetrieveResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineRetrieveResponse.Project.GitRepo.builder() @@ -104,6 +105,9 @@ internal class InferencePipelineRetrieveResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) @@ -224,6 +228,7 @@ internal class InferencePipelineRetrieveResponseTest { .taskType(InferencePipelineRetrieveResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineRetrieveResponse.Project.GitRepo.builder() @@ -241,6 +246,9 @@ internal class InferencePipelineRetrieveResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) assertThat(inferencePipelineRetrieveResponse.totalRecordsCount()).contains(1000L) @@ -352,6 +360,7 @@ internal class InferencePipelineRetrieveResponseTest { .taskType(InferencePipelineRetrieveResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineRetrieveResponse.Project.GitRepo.builder() @@ -369,6 +378,9 @@ internal class InferencePipelineRetrieveResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponseTest.kt index 58f7e077..6d309388 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/inferencepipelines/InferencePipelineUpdateResponseTest.kt @@ -87,6 +87,7 @@ internal class InferencePipelineUpdateResponseTest { .taskType(InferencePipelineUpdateResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineUpdateResponse.Project.GitRepo.builder() @@ -104,6 +105,9 @@ internal class InferencePipelineUpdateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) @@ -224,6 +228,7 @@ internal class InferencePipelineUpdateResponseTest { .taskType(InferencePipelineUpdateResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineUpdateResponse.Project.GitRepo.builder() @@ -241,6 +246,9 @@ internal class InferencePipelineUpdateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) assertThat(inferencePipelineUpdateResponse.totalRecordsCount()).contains(1000L) @@ -352,6 +360,7 @@ internal class InferencePipelineUpdateResponseTest { .taskType(InferencePipelineUpdateResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineUpdateResponse.Project.GitRepo.builder() @@ -369,6 +378,9 @@ internal class InferencePipelineUpdateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateParamsTest.kt index e9c15aa9..2f8d921c 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateParamsTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateParamsTest.kt @@ -3,6 +3,7 @@ package com.openlayer.api.models.projects import java.time.OffsetDateTime +import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -31,6 +32,7 @@ internal class ProjectCreateParamsTest { .taskType(ProjectCreateParams.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectCreateParams.GitRepo.builder() @@ -48,6 +50,9 @@ internal class ProjectCreateParamsTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() } @@ -75,6 +80,7 @@ internal class ProjectCreateParamsTest { .taskType(ProjectCreateParams.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectCreateParams.GitRepo.builder() @@ -92,6 +98,9 @@ internal class ProjectCreateParamsTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() val body = params._body() @@ -117,6 +126,7 @@ internal class ProjectCreateParamsTest { assertThat(body.taskType()).isEqualTo(ProjectCreateParams.TaskType.LLM_BASE) assertThat(body.versionCount()).isEqualTo(2L) assertThat(body.workspaceId()).contains("055fddb1-261f-4654-8598-f6347ee46a09") + assertThat(body.dataRetentionDays()).contains(30L) assertThat(body.description()).contains("My project description.") assertThat(body.gitRepo()) .contains( @@ -135,6 +145,9 @@ internal class ProjectCreateParamsTest { .rootDir("rootDir") .build() ) + assertThat(body.modelDeveloper()).contains("Acme AI") + assertThat(body.modelTypes().getOrNull()).containsExactly("llm") + assertThat(body.purpose()).contains("Answer customer billing questions.") } @Test diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateResponseTest.kt index 9eae557b..c619579d 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectCreateResponseTest.kt @@ -5,6 +5,7 @@ package com.openlayer.api.models.projects import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.openlayer.api.core.jsonMapper import java.time.OffsetDateTime +import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -34,6 +35,7 @@ internal class ProjectCreateResponseTest { .taskType(ProjectCreateResponse.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectCreateResponse.GitRepo.builder() @@ -51,6 +53,9 @@ internal class ProjectCreateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() assertThat(projectCreateResponse.id()).isEqualTo("3fa85f64-5717-4562-b3fc-2c963f66afa6") @@ -79,6 +84,7 @@ internal class ProjectCreateResponseTest { assertThat(projectCreateResponse.versionCount()).isEqualTo(2L) assertThat(projectCreateResponse.workspaceId()) .contains("055fddb1-261f-4654-8598-f6347ee46a09") + assertThat(projectCreateResponse.dataRetentionDays()).contains(30L) assertThat(projectCreateResponse.description()).contains("My project description.") assertThat(projectCreateResponse.gitRepo()) .contains( @@ -97,6 +103,9 @@ internal class ProjectCreateResponseTest { .rootDir("rootDir") .build() ) + assertThat(projectCreateResponse.modelDeveloper()).contains("Acme AI") + assertThat(projectCreateResponse.modelTypes().getOrNull()).containsExactly("llm") + assertThat(projectCreateResponse.purpose()).contains("Answer customer billing questions.") } @Test @@ -124,6 +133,7 @@ internal class ProjectCreateResponseTest { .taskType(ProjectCreateResponse.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectCreateResponse.GitRepo.builder() @@ -141,6 +151,9 @@ internal class ProjectCreateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() val roundtrippedProjectCreateResponse = diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectListResponseTest.kt index 5b68ccac..fb255700 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectListResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectListResponseTest.kt @@ -36,6 +36,7 @@ internal class ProjectListResponseTest { .taskType(ProjectListResponse.Item.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectListResponse.Item.GitRepo.builder() @@ -53,6 +54,9 @@ internal class ProjectListResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .build() @@ -80,6 +84,7 @@ internal class ProjectListResponseTest { .taskType(ProjectListResponse.Item.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectListResponse.Item.GitRepo.builder() @@ -97,6 +102,9 @@ internal class ProjectListResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) } @@ -128,6 +136,7 @@ internal class ProjectListResponseTest { .taskType(ProjectListResponse.Item.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectListResponse.Item.GitRepo.builder() @@ -145,6 +154,9 @@ internal class ProjectListResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .build() diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateParamsTest.kt new file mode 100644 index 00000000..70fd5cca --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateParamsTest.kt @@ -0,0 +1,64 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.projects + +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ProjectUpdateParamsTest { + + @Test + fun create() { + ProjectUpdateParams.builder() + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataRetentionDays(30L) + .description("My project description.") + .modelDeveloper("Acme AI") + .addModelType("llm") + .name("My Project") + .purpose("Answer customer billing questions.") + .build() + } + + @Test + fun pathParams() { + val params = + ProjectUpdateParams.builder().projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + + assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } + + @Test + fun body() { + val params = + ProjectUpdateParams.builder() + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataRetentionDays(30L) + .description("My project description.") + .modelDeveloper("Acme AI") + .addModelType("llm") + .name("My Project") + .purpose("Answer customer billing questions.") + .build() + + val body = params._body() + + assertThat(body.dataRetentionDays()).contains(30L) + assertThat(body.description()).contains("My project description.") + assertThat(body.modelDeveloper()).contains("Acme AI") + assertThat(body.modelTypes().getOrNull()).containsExactly("llm") + assertThat(body.name()).contains("My Project") + assertThat(body.purpose()).contains("Answer customer billing questions.") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + ProjectUpdateParams.builder().projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + + val body = params._body() + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponseTest.kt new file mode 100644 index 00000000..aad0719e --- /dev/null +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/ProjectUpdateResponseTest.kt @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.openlayer.api.models.projects + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.openlayer.api.core.jsonMapper +import java.time.OffsetDateTime +import kotlin.jvm.optionals.getOrNull +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class ProjectUpdateResponseTest { + + @Test + fun create() { + val projectUpdateResponse = + ProjectUpdateResponse.builder() + .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") + .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .developmentGoalCount(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectUpdateResponse.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectUpdateResponse.Source.WEB) + .taskType(ProjectUpdateResponse.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) + .description("My project description.") + .gitRepo( + ProjectUpdateResponse.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") + .build() + + assertThat(projectUpdateResponse.id()).isEqualTo("3fa85f64-5717-4562-b3fc-2c963f66afa6") + assertThat(projectUpdateResponse.creatorId()) + .contains("589ece63-49a2-41b4-98e1-10547761d4b0") + assertThat(projectUpdateResponse.dateCreated()) + .isEqualTo(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + assertThat(projectUpdateResponse.dateUpdated()) + .isEqualTo(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + assertThat(projectUpdateResponse.developmentGoalCount()).isEqualTo(5L) + assertThat(projectUpdateResponse.goalCount()).isEqualTo(10L) + assertThat(projectUpdateResponse.inferencePipelineCount()).isEqualTo(1L) + assertThat(projectUpdateResponse.links()) + .isEqualTo( + ProjectUpdateResponse.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + assertThat(projectUpdateResponse.monitoringGoalCount()).isEqualTo(5L) + assertThat(projectUpdateResponse.name()).isEqualTo("My Project") + assertThat(projectUpdateResponse.source()).contains(ProjectUpdateResponse.Source.WEB) + assertThat(projectUpdateResponse.taskType()) + .isEqualTo(ProjectUpdateResponse.TaskType.LLM_BASE) + assertThat(projectUpdateResponse.versionCount()).isEqualTo(2L) + assertThat(projectUpdateResponse.workspaceId()) + .contains("055fddb1-261f-4654-8598-f6347ee46a09") + assertThat(projectUpdateResponse.dataRetentionDays()).contains(30L) + assertThat(projectUpdateResponse.description()).contains("My project description.") + assertThat(projectUpdateResponse.gitRepo()) + .contains( + ProjectUpdateResponse.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + assertThat(projectUpdateResponse.modelDeveloper()).contains("Acme AI") + assertThat(projectUpdateResponse.modelTypes().getOrNull()).containsExactly("llm") + assertThat(projectUpdateResponse.purpose()).contains("Answer customer billing questions.") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val projectUpdateResponse = + ProjectUpdateResponse.builder() + .id("3fa85f64-5717-4562-b3fc-2c963f66afa6") + .creatorId("589ece63-49a2-41b4-98e1-10547761d4b0") + .dateCreated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .dateUpdated(OffsetDateTime.parse("2024-03-22T11:31:01.185Z")) + .developmentGoalCount(5L) + .goalCount(10L) + .inferencePipelineCount(1L) + .links( + ProjectUpdateResponse.Links.builder() + .app( + "https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6" + ) + .build() + ) + .monitoringGoalCount(5L) + .name("My Project") + .source(ProjectUpdateResponse.Source.WEB) + .taskType(ProjectUpdateResponse.TaskType.LLM_BASE) + .versionCount(2L) + .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) + .description("My project description.") + .gitRepo( + ProjectUpdateResponse.GitRepo.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dateConnected(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .dateUpdated(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .gitAccountId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .gitId(0L) + .name("name") + .private_(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .slug("slug") + .url("url") + .branch("branch") + .rootDir("rootDir") + .build() + ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") + .build() + + val roundtrippedProjectUpdateResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(projectUpdateResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedProjectUpdateResponse).isEqualTo(projectUpdateResponse) + } +} diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParamsTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParamsTest.kt index e0730396..75a77fdf 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParamsTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateParamsTest.kt @@ -83,6 +83,7 @@ internal class InferencePipelineCreateParamsTest { .taskType(InferencePipelineCreateParams.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateParams.Project.GitRepo.builder() @@ -100,6 +101,9 @@ internal class InferencePipelineCreateParamsTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) @@ -243,6 +247,7 @@ internal class InferencePipelineCreateParamsTest { .taskType(InferencePipelineCreateParams.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateParams.Project.GitRepo.builder() @@ -260,6 +265,9 @@ internal class InferencePipelineCreateParamsTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) @@ -374,6 +382,7 @@ internal class InferencePipelineCreateParamsTest { .taskType(InferencePipelineCreateParams.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateParams.Project.GitRepo.builder() @@ -391,6 +400,9 @@ internal class InferencePipelineCreateParamsTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) assertThat(body.totalRecordsCount()).contains(1000L) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponseTest.kt index 2e5ea548..37170daa 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineCreateResponseTest.kt @@ -87,6 +87,7 @@ internal class InferencePipelineCreateResponseTest { .taskType(InferencePipelineCreateResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateResponse.Project.GitRepo.builder() @@ -104,6 +105,9 @@ internal class InferencePipelineCreateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) @@ -224,6 +228,7 @@ internal class InferencePipelineCreateResponseTest { .taskType(InferencePipelineCreateResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateResponse.Project.GitRepo.builder() @@ -241,6 +246,9 @@ internal class InferencePipelineCreateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) assertThat(inferencePipelineCreateResponse.totalRecordsCount()).contains(1000L) @@ -352,6 +360,7 @@ internal class InferencePipelineCreateResponseTest { .taskType(InferencePipelineCreateResponse.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateResponse.Project.GitRepo.builder() @@ -369,6 +378,9 @@ internal class InferencePipelineCreateResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponseTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponseTest.kt index d616a978..1b6f0955 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponseTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/models/projects/inferencepipelines/InferencePipelineListResponseTest.kt @@ -96,6 +96,7 @@ internal class InferencePipelineListResponseTest { ) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineListResponse.Item.Project.GitRepo.builder() @@ -117,6 +118,9 @@ internal class InferencePipelineListResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) @@ -228,6 +232,7 @@ internal class InferencePipelineListResponseTest { .taskType(InferencePipelineListResponse.Item.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineListResponse.Item.Project.GitRepo.builder() @@ -245,6 +250,9 @@ internal class InferencePipelineListResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) @@ -365,6 +373,7 @@ internal class InferencePipelineListResponseTest { ) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineListResponse.Item.Project.GitRepo.builder() @@ -386,6 +395,9 @@ internal class InferencePipelineListResponseTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncTest.kt index 551a79dc..70fe6772 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/ProjectServiceAsyncTest.kt @@ -6,6 +6,7 @@ import com.openlayer.api.TestServerExtension import com.openlayer.api.client.okhttp.OpenlayerOkHttpClientAsync import com.openlayer.api.models.projects.ProjectCreateParams import com.openlayer.api.models.projects.ProjectListParams +import com.openlayer.api.models.projects.ProjectUpdateParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -45,6 +46,7 @@ internal class ProjectServiceAsyncTest { .taskType(ProjectCreateParams.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectCreateParams.GitRepo.builder() @@ -62,6 +64,35 @@ internal class ProjectServiceAsyncTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") + .build() + ) + + val project = projectFuture.get() + project.validate() + } + + @Test + fun update() { + val client = + OpenlayerOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val projectServiceAsync = client.projects() + + val projectFuture = + projectServiceAsync.update( + ProjectUpdateParams.builder() + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataRetentionDays(30L) + .description("My project description.") + .modelDeveloper("Acme AI") + .addModelType("llm") + .name("My Project") + .purpose("Answer customer billing questions.") .build() ) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncTest.kt index d34864d3..ea8e39bd 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/async/projects/InferencePipelineServiceAsyncTest.kt @@ -99,6 +99,7 @@ internal class InferencePipelineServiceAsyncTest { .taskType(InferencePipelineCreateParams.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateParams.Project.GitRepo.builder() @@ -116,6 +117,9 @@ internal class InferencePipelineServiceAsyncTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt index f5dd8a73..e5f4ea21 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/ProjectServiceTest.kt @@ -6,6 +6,7 @@ import com.openlayer.api.TestServerExtension import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient import com.openlayer.api.models.projects.ProjectCreateParams import com.openlayer.api.models.projects.ProjectListParams +import com.openlayer.api.models.projects.ProjectUpdateParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -45,6 +46,7 @@ internal class ProjectServiceTest { .taskType(ProjectCreateParams.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( ProjectCreateParams.GitRepo.builder() @@ -62,6 +64,34 @@ internal class ProjectServiceTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") + .build() + ) + + project.validate() + } + + @Test + fun update() { + val client = + OpenlayerOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val projectService = client.projects() + + val project = + projectService.update( + ProjectUpdateParams.builder() + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataRetentionDays(30L) + .description("My project description.") + .modelDeveloper("Acme AI") + .addModelType("llm") + .name("My Project") + .purpose("Answer customer billing questions.") .build() ) diff --git a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt index d30ce155..be17b058 100644 --- a/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt +++ b/openlayer-java-core/src/test/kotlin/com/openlayer/api/services/blocking/projects/InferencePipelineServiceTest.kt @@ -99,6 +99,7 @@ internal class InferencePipelineServiceTest { .taskType(InferencePipelineCreateParams.Project.TaskType.LLM_BASE) .versionCount(2L) .workspaceId("055fddb1-261f-4654-8598-f6347ee46a09") + .dataRetentionDays(30L) .description("My project description.") .gitRepo( InferencePipelineCreateParams.Project.GitRepo.builder() @@ -116,6 +117,9 @@ internal class InferencePipelineServiceTest { .rootDir("rootDir") .build() ) + .modelDeveloper("Acme AI") + .addModelType("llm") + .purpose("Answer customer billing questions.") .build() ) .totalRecordsCount(1000L) From 3dbd1bb7f506c7f75857455daccc40ef8954d76c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 13:36:17 +0000 Subject: [PATCH 3/3] release: 0.10.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8cfc016b..091cfb12 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.2" + ".": "0.10.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e2602fd..48cdc767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.10.0 (2026-08-03) + +Full Changelog: [v0.9.2...v0.10.0](https://github.com/openlayer-ai/openlayer-java/compare/v0.9.2...v0.10.0) + +### Features + +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([1c4e1bd](https://github.com/openlayer-ai/openlayer-java/commit/1c4e1bd16d71bd85a311e32d360ca072a90b51af)) + + +### Chores + +* **closes OPEN-11851:** expose update project endpoint ([df645bf](https://github.com/openlayer-ai/openlayer-java/commit/df645bfc1a5cbd004d80c3aae5104f4b0ab12531)) + ## 0.9.2 (2026-07-01) Full Changelog: [v0.9.1...v0.9.2](https://github.com/openlayer-ai/openlayer-java/compare/v0.9.1...v0.9.2) diff --git a/README.md b/README.md index a26cb4ee..d8bbe81e 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.9.2) -[![javadoc](https://javadoc.io/badge2/com.openlayer.api/openlayer-java/0.9.2/javadoc.svg)](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.9.2) +[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.10.0) +[![javadoc](https://javadoc.io/badge2/com.openlayer.api/openlayer-java/0.10.0/javadoc.svg)](https://javadoc.io/doc/com.openlayer.api/openlayer-java/0.10.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.9.2). +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.10.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.9.2") +implementation("com.openlayer.api:openlayer-java:0.10.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.openlayer.api:openlayer-java:0.9.2") com.openlayer.api openlayer-java - 0.9.2 + 0.10.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 13a6e05f..a8d0c0b5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.openlayer.api" - version = "0.9.2" // x-release-please-version + version = "0.10.0" // x-release-please-version } subprojects {