diff --git a/.castiron.stats.yml b/.castiron.stats.yml index fe145a2d4..4f42d0696 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: 9ddc7bd7-7dde-4ca0-9796-b799d1856183 -openapi_spec_hash: 92700e1a33a4f6174a01b46648c8186a -openapi_transformed_spec_hash: e37bbe0f04caa6093f1cb5d65d23ad03 -config_hash: beab4f058e80bab30085bb6c8467b65f -codegen_sha: eb5e25357e53704e2f933c553955a272266a1c04 -codegen_hash: eba4178634b1f9b13d20cce4648c21f0009e610a7434e11e4b363c03f7058563 -public_codegen_sha: f2bbcb54a3442935e643fd86befd04a969fbcb60 +generation_id: fd65dd19-7eac-493f-9f90-c62db36ea447 +openapi_spec_hash: b2c62b342b04685226037c980f2b5a7a +openapi_transformed_spec_hash: ba44bf31326f01a1d886b7510dd9da8a +config_hash: 1e11a5becf7bc1c2e9e07b8654872dc4 +codegen_sha: 65429161dddc59cf304fa034eb8caccb05c4b1e6 +codegen_hash: 9302c8bf58629b0afe926ed88c80b2f20beb9a2555afe1febb68867f72ade4ea +public_codegen_sha: d9c7f61c82c73280993dd32b5a1ef3d2c0c8d490 diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index c12baba61..164fe8c28 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -9552,7 +9552,8 @@ paths: "line_item": null, "project_id": null, "api_key_id": null, - "quantity": null + "quantity": null, + "quantity_unit": null } ] } @@ -31011,6 +31012,21 @@ components: - type: number description: When `group_by=line_item`, this field provides the quantity of the grouped costs result. - type: 'null' + quantity_unit: + description: The unit of the `quantity` value. If no single supported unit applies to the result, this field is `null`. + anyOf: + - type: string + - type: string + enum: + - tokens + - 1000_tokens + - duration_seconds + - duration_minutes + - duration_hours + - gibibyte_hours + - images + - characters + - type: 'null' required: - object x-oaiMeta: @@ -31022,9 +31038,10 @@ components: "value": 0.06, "currency": "usd" }, - "line_item": "Image models", + "line_item": "input_tokens", "project_id": "proj_abc", - "quantity": 10000 + "quantity": 10000, + "quantity_unit": "tokens" } CreateAssistantRequest: type: object @@ -42278,6 +42295,9 @@ components: - type: string - type: 'null' description: The external key associated with the project. + residency: + $ref: '#/components/schemas/PublicProjectResidency' + description: The residency configuration for the project. required: - id - object @@ -42473,7 +42493,15 @@ components: anyOf: - type: string - type: 'null' - description: Create the project with the specified data residency region. Your organization must have access to Data residency functionality in order to use. See [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) to review the functionality and limitations of setting this field. + deprecated: true + description: |- + Create the project with the specified data residency region. Your organization must have access to Data residency functionality in order to use. See [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) to review the functionality and limitations of setting this field. + Deprecated: use `residency` instead. Do not provide both `geography` and `residency`. + residency: + anyOf: + - $ref: '#/components/schemas/PublicProjectResidency' + - type: 'null' + description: Create the project with the specified residency configuration. Your organization must have access to the requested residency configuration in order to use it. See [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) to review the functionality and limitations of setting this field. external_key_id: anyOf: - type: string @@ -43170,7 +43198,10 @@ components: anyOf: - type: string - type: 'null' - description: Geography for the project. + deprecated: true + description: |- + Geography for the project. + Deprecated: use `residency` when creating a project to configure data residency. This field is retained for backward compatibility. ProjectUser: type: object description: Represents an individual user in a project. @@ -64729,6 +64760,21 @@ components: - input_tokens_details title: Image generation usage description: For `gpt-image-1` only, the token usage information for the image generation. + PublicProjectResidency: + type: string + enum: + - GLOBAL + - US_STORAGE_PROCESSING + - EU_STORAGE_PROCESSING + - JP_STORAGE + - KR_STORAGE + - CA_STORAGE + - SG_STORAGE + - IN_STORAGE + - AU_STORAGE + - GB_STORAGE + - AE_STORAGE + - AE_STORAGE_PROCESSING SpecificProgrammaticToolCallingParam: properties: type: diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/Project.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/Project.kt index d2f37f884..d85ff21a7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/Project.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/Project.kt @@ -27,6 +27,7 @@ private constructor( private val archivedAt: JsonField, private val externalKeyId: JsonField, private val name: JsonField, + private val residency: JsonField, private val status: JsonField, private val additionalProperties: MutableMap, ) { @@ -41,8 +42,21 @@ private constructor( @ExcludeMissing externalKeyId: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("residency") + @ExcludeMissing + residency: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), - ) : this(id, createdAt, object_, archivedAt, externalKeyId, name, status, mutableMapOf()) + ) : this( + id, + createdAt, + object_, + archivedAt, + externalKeyId, + name, + residency, + status, + mutableMapOf(), + ) /** * The identifier, which can be referenced in API endpoints @@ -97,6 +111,14 @@ private constructor( */ fun name(): Optional = name.getOptional("name") + /** + * The residency configuration for the project. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun residency(): Optional = residency.getOptional("residency") + /** * `active` or `archived` * @@ -142,6 +164,15 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [residency]. + * + * Unlike [residency], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("residency") + @ExcludeMissing + fun _residency(): JsonField = residency + /** * Returns the raw JSON value of [status]. * @@ -184,6 +215,7 @@ private constructor( private var archivedAt: JsonField = JsonMissing.of() private var externalKeyId: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var residency: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -195,6 +227,7 @@ private constructor( archivedAt = project.archivedAt externalKeyId = project.externalKeyId name = project.name + residency = project.residency status = project.status additionalProperties = project.additionalProperties.toMutableMap() } @@ -289,6 +322,18 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + /** The residency configuration for the project. */ + fun residency(residency: ProjectResidency) = residency(JsonField.of(residency)) + + /** + * Sets [Builder.residency] to an arbitrary JSON value. + * + * You should usually call [Builder.residency] with a well-typed [ProjectResidency] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun residency(residency: JsonField) = apply { this.residency = residency } + /** `active` or `archived` */ fun status(status: String?) = status(JsonField.ofNullable(status)) @@ -343,6 +388,7 @@ private constructor( archivedAt, externalKeyId, name, + residency, status, additionalProperties.toMutableMap(), ) @@ -373,6 +419,7 @@ private constructor( archivedAt() externalKeyId() name() + residency().ifPresent { it.validate() } status() validated = true } @@ -398,6 +445,7 @@ private constructor( (if (archivedAt.asKnown().isPresent) 1 else 0) + (if (externalKeyId.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + + (residency.asKnown().getOrNull()?.validity() ?: 0) + (if (status.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -412,6 +460,7 @@ private constructor( archivedAt == other.archivedAt && externalKeyId == other.externalKeyId && name == other.name && + residency == other.residency && status == other.status && additionalProperties == other.additionalProperties } @@ -424,6 +473,7 @@ private constructor( archivedAt, externalKeyId, name, + residency, status, additionalProperties, ) @@ -432,5 +482,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Project{id=$id, createdAt=$createdAt, object_=$object_, archivedAt=$archivedAt, externalKeyId=$externalKeyId, name=$name, status=$status, additionalProperties=$additionalProperties}" + "Project{id=$id, createdAt=$createdAt, object_=$object_, archivedAt=$archivedAt, externalKeyId=$externalKeyId, name=$name, residency=$residency, status=$status, additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParams.kt index 272e7b5ec..ac265aa91 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParams.kt @@ -51,12 +51,24 @@ private constructor( * Create the project with the specified data residency region. Your organization must have * access to Data residency functionality in order to use. See * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) + * to review the functionality and limitations of setting this field. Deprecated: use + * `residency` instead. Do not provide both `geography` and `residency`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + @Deprecated("deprecated") fun geography(): Optional = body.geography() + + /** + * Create the project with the specified residency configuration. Your organization must have + * access to the requested residency configuration in order to use it. See + * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) * to review the functionality and limitations of setting this field. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun geography(): Optional = body.geography() + fun residency(): Optional = body.residency() /** * Returns the raw JSON value of [name]. @@ -77,7 +89,14 @@ private constructor( * * Unlike [geography], this method doesn't throw if the JSON field has an unexpected type. */ - fun _geography(): JsonField = body._geography() + @Deprecated("deprecated") fun _geography(): JsonField = body._geography() + + /** + * Returns the raw JSON value of [residency]. + * + * Unlike [residency], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _residency(): JsonField = body._residency() fun _additionalBodyProperties(): Map = body._additionalProperties() @@ -124,6 +143,7 @@ private constructor( * - [name] * - [externalKeyId] * - [geography] + * - [residency] */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -160,11 +180,14 @@ private constructor( * Create the project with the specified data residency region. Your organization must have * access to Data residency functionality in order to use. See * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) - * to review the functionality and limitations of setting this field. + * to review the functionality and limitations of setting this field. Deprecated: use + * `residency` instead. Do not provide both `geography` and `residency`. */ + @Deprecated("deprecated") fun geography(geography: String?) = apply { body.geography(geography) } /** Alias for calling [Builder.geography] with `geography.orElse(null)`. */ + @Deprecated("deprecated") fun geography(geography: Optional) = geography(geography.getOrNull()) /** @@ -174,8 +197,29 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet supported * value. */ + @Deprecated("deprecated") fun geography(geography: JsonField) = apply { body.geography(geography) } + /** + * Create the project with the specified residency configuration. Your organization must + * have access to the requested residency configuration in order to use it. See + * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) + * to review the functionality and limitations of setting this field. + */ + fun residency(residency: ProjectResidency?) = apply { body.residency(residency) } + + /** Alias for calling [Builder.residency] with `residency.orElse(null)`. */ + fun residency(residency: Optional) = residency(residency.getOrNull()) + + /** + * Sets [Builder.residency] to an arbitrary JSON value. + * + * You should usually call [Builder.residency] with a well-typed [ProjectResidency] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun residency(residency: JsonField) = apply { body.residency(residency) } + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) } @@ -325,6 +369,7 @@ private constructor( private val name: JsonField, private val externalKeyId: JsonField, private val geography: JsonField, + private val residency: JsonField, private val additionalProperties: MutableMap, ) { @@ -337,7 +382,10 @@ private constructor( @JsonProperty("geography") @ExcludeMissing geography: JsonField = JsonMissing.of(), - ) : this(name, externalKeyId, geography, mutableMapOf()) + @JsonProperty("residency") + @ExcludeMissing + residency: JsonField = JsonMissing.of(), + ) : this(name, externalKeyId, geography, residency, mutableMapOf()) /** * The friendly name of the project, this name appears in reports. @@ -359,13 +407,26 @@ private constructor( * Create the project with the specified data residency region. Your organization must have * access to Data residency functionality in order to use. See * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) - * to review the functionality and limitations of setting this field. + * to review the functionality and limitations of setting this field. Deprecated: use + * `residency` instead. Do not provide both `geography` and `residency`. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ + @Deprecated("deprecated") fun geography(): Optional = geography.getOptional("geography") + /** + * Create the project with the specified residency configuration. Your organization must + * have access to the requested residency configuration in order to use it. See + * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) + * to review the functionality and limitations of setting this field. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun residency(): Optional = residency.getOptional("residency") + /** * Returns the raw JSON value of [name]. * @@ -388,7 +449,19 @@ private constructor( * * Unlike [geography], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("geography") @ExcludeMissing fun _geography(): JsonField = geography + @Deprecated("deprecated") + @JsonProperty("geography") + @ExcludeMissing + fun _geography(): JsonField = geography + + /** + * Returns the raw JSON value of [residency]. + * + * Unlike [residency], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("residency") + @ExcludeMissing + fun _residency(): JsonField = residency @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -421,6 +494,7 @@ private constructor( private var name: JsonField? = null private var externalKeyId: JsonField = JsonMissing.of() private var geography: JsonField = JsonMissing.of() + private var residency: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -428,6 +502,7 @@ private constructor( name = body.name externalKeyId = body.externalKeyId geography = body.geography + residency = body.residency additionalProperties = body.additionalProperties.toMutableMap() } @@ -466,11 +541,14 @@ private constructor( * Create the project with the specified data residency region. Your organization must * have access to Data residency functionality in order to use. See * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) - * to review the functionality and limitations of setting this field. + * to review the functionality and limitations of setting this field. Deprecated: use + * `residency` instead. Do not provide both `geography` and `residency`. */ + @Deprecated("deprecated") fun geography(geography: String?) = geography(JsonField.ofNullable(geography)) /** Alias for calling [Builder.geography] with `geography.orElse(null)`. */ + @Deprecated("deprecated") fun geography(geography: Optional) = geography(geography.getOrNull()) /** @@ -480,8 +558,31 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet * supported value. */ + @Deprecated("deprecated") fun geography(geography: JsonField) = apply { this.geography = geography } + /** + * Create the project with the specified residency configuration. Your organization must + * have access to the requested residency configuration in order to use it. See + * [data residency controls](https://platform.openai.com/docs/guides/your-data#data-residency-controls) + * to review the functionality and limitations of setting this field. + */ + fun residency(residency: ProjectResidency?) = residency(JsonField.ofNullable(residency)) + + /** Alias for calling [Builder.residency] with `residency.orElse(null)`. */ + fun residency(residency: Optional) = residency(residency.getOrNull()) + + /** + * Sets [Builder.residency] to an arbitrary JSON value. + * + * You should usually call [Builder.residency] with a well-typed [ProjectResidency] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun residency(residency: JsonField) = apply { + this.residency = residency + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -518,6 +619,7 @@ private constructor( checkRequired("name", name), externalKeyId, geography, + residency, additionalProperties.toMutableMap(), ) } @@ -541,6 +643,7 @@ private constructor( name() externalKeyId() geography() + residency().ifPresent { it.validate() } validated = true } @@ -562,7 +665,8 @@ private constructor( internal fun validity(): Int = (if (name.asKnown().isPresent) 1 else 0) + (if (externalKeyId.asKnown().isPresent) 1 else 0) + - (if (geography.asKnown().isPresent) 1 else 0) + (if (geography.asKnown().isPresent) 1 else 0) + + (residency.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -573,17 +677,18 @@ private constructor( name == other.name && externalKeyId == other.externalKeyId && geography == other.geography && + residency == other.residency && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(name, externalKeyId, geography, additionalProperties) + Objects.hash(name, externalKeyId, geography, residency, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{name=$name, externalKeyId=$externalKeyId, geography=$geography, additionalProperties=$additionalProperties}" + "Body{name=$name, externalKeyId=$externalKeyId, geography=$geography, residency=$residency, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectResidency.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectResidency.kt new file mode 100644 index 000000000..a2091970d --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectResidency.kt @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +package com.openai.models.admin.organization.projects + +import com.fasterxml.jackson.annotation.JsonCreator +import com.openai.core.Enum +import com.openai.core.JsonField +import com.openai.errors.OpenAIInvalidDataException + +class ProjectResidency @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 GLOBAL = of("GLOBAL") + + @JvmField val US_STORAGE_PROCESSING = of("US_STORAGE_PROCESSING") + + @JvmField val EU_STORAGE_PROCESSING = of("EU_STORAGE_PROCESSING") + + @JvmField val JP_STORAGE = of("JP_STORAGE") + + @JvmField val KR_STORAGE = of("KR_STORAGE") + + @JvmField val CA_STORAGE = of("CA_STORAGE") + + @JvmField val SG_STORAGE = of("SG_STORAGE") + + @JvmField val IN_STORAGE = of("IN_STORAGE") + + @JvmField val AU_STORAGE = of("AU_STORAGE") + + @JvmField val GB_STORAGE = of("GB_STORAGE") + + @JvmField val AE_STORAGE = of("AE_STORAGE") + + @JvmField val AE_STORAGE_PROCESSING = of("AE_STORAGE_PROCESSING") + + @JvmStatic fun of(value: String) = ProjectResidency(JsonField.of(value)) + } + + /** An enum containing [ProjectResidency]'s known values. */ + enum class Known { + GLOBAL, + US_STORAGE_PROCESSING, + EU_STORAGE_PROCESSING, + JP_STORAGE, + KR_STORAGE, + CA_STORAGE, + SG_STORAGE, + IN_STORAGE, + AU_STORAGE, + GB_STORAGE, + AE_STORAGE, + AE_STORAGE_PROCESSING, + } + + /** + * An enum containing [ProjectResidency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ProjectResidency] 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 { + GLOBAL, + US_STORAGE_PROCESSING, + EU_STORAGE_PROCESSING, + JP_STORAGE, + KR_STORAGE, + CA_STORAGE, + SG_STORAGE, + IN_STORAGE, + AU_STORAGE, + GB_STORAGE, + AE_STORAGE, + AE_STORAGE_PROCESSING, + /** + * An enum member indicating that [ProjectResidency] 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) { + GLOBAL -> Value.GLOBAL + US_STORAGE_PROCESSING -> Value.US_STORAGE_PROCESSING + EU_STORAGE_PROCESSING -> Value.EU_STORAGE_PROCESSING + JP_STORAGE -> Value.JP_STORAGE + KR_STORAGE -> Value.KR_STORAGE + CA_STORAGE -> Value.CA_STORAGE + SG_STORAGE -> Value.SG_STORAGE + IN_STORAGE -> Value.IN_STORAGE + AU_STORAGE -> Value.AU_STORAGE + GB_STORAGE -> Value.GB_STORAGE + AE_STORAGE -> Value.AE_STORAGE + AE_STORAGE_PROCESSING -> Value.AE_STORAGE_PROCESSING + 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 OpenAIInvalidDataException if this class instance's value is a not a known member. + */ + fun known(): Known = + when (this) { + GLOBAL -> Known.GLOBAL + US_STORAGE_PROCESSING -> Known.US_STORAGE_PROCESSING + EU_STORAGE_PROCESSING -> Known.EU_STORAGE_PROCESSING + JP_STORAGE -> Known.JP_STORAGE + KR_STORAGE -> Known.KR_STORAGE + CA_STORAGE -> Known.CA_STORAGE + SG_STORAGE -> Known.SG_STORAGE + IN_STORAGE -> Known.IN_STORAGE + AU_STORAGE -> Known.AU_STORAGE + GB_STORAGE -> Known.GB_STORAGE + AE_STORAGE -> Known.AE_STORAGE + AE_STORAGE_PROCESSING -> Known.AE_STORAGE_PROCESSING + else -> throw OpenAIInvalidDataException("Unknown ProjectResidency: $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 OpenAIInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OpenAIInvalidDataException("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 OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): ProjectResidency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + 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 ProjectResidency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectUpdateParams.kt index c1c7cbbad..eaacff107 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/projects/ProjectUpdateParams.kt @@ -39,12 +39,13 @@ private constructor( fun externalKeyId(): Optional = body.externalKeyId() /** - * Geography for the project. + * Geography for the project. Deprecated: use `residency` when creating a project to configure + * data residency. This field is retained for backward compatibility. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun geography(): Optional = body.geography() + @Deprecated("deprecated") fun geography(): Optional = body.geography() /** * The updated name of the project, this name appears in reports. @@ -66,7 +67,7 @@ private constructor( * * Unlike [geography], this method doesn't throw if the JSON field has an unexpected type. */ - fun _geography(): JsonField = body._geography() + @Deprecated("deprecated") fun _geography(): JsonField = body._geography() /** * Returns the raw JSON value of [name]. @@ -143,10 +144,15 @@ private constructor( body.externalKeyId(externalKeyId) } - /** Geography for the project. */ + /** + * Geography for the project. Deprecated: use `residency` when creating a project to + * configure data residency. This field is retained for backward compatibility. + */ + @Deprecated("deprecated") fun geography(geography: String?) = apply { body.geography(geography) } /** Alias for calling [Builder.geography] with `geography.orElse(null)`. */ + @Deprecated("deprecated") fun geography(geography: Optional) = geography(geography.getOrNull()) /** @@ -156,6 +162,7 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet supported * value. */ + @Deprecated("deprecated") fun geography(geography: JsonField) = apply { body.geography(geography) } /** The updated name of the project, this name appears in reports. */ @@ -344,11 +351,13 @@ private constructor( fun externalKeyId(): Optional = externalKeyId.getOptional("external_key_id") /** - * Geography for the project. + * Geography for the project. Deprecated: use `residency` when creating a project to + * configure data residency. This field is retained for backward compatibility. * * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ + @Deprecated("deprecated") fun geography(): Optional = geography.getOptional("geography") /** @@ -374,7 +383,10 @@ private constructor( * * Unlike [geography], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("geography") @ExcludeMissing fun _geography(): JsonField = geography + @Deprecated("deprecated") + @JsonProperty("geography") + @ExcludeMissing + fun _geography(): JsonField = geography /** * Returns the raw JSON value of [name]. @@ -436,10 +448,15 @@ private constructor( this.externalKeyId = externalKeyId } - /** Geography for the project. */ + /** + * Geography for the project. Deprecated: use `residency` when creating a project to + * configure data residency. This field is retained for backward compatibility. + */ + @Deprecated("deprecated") fun geography(geography: String?) = geography(JsonField.ofNullable(geography)) /** Alias for calling [Builder.geography] with `geography.orElse(null)`. */ + @Deprecated("deprecated") fun geography(geography: Optional) = geography(geography.getOrNull()) /** @@ -449,6 +466,7 @@ private constructor( * This method is primarily for setting the field to an undocumented or not yet * supported value. */ + @Deprecated("deprecated") fun geography(geography: JsonField) = apply { this.geography = geography } /** The updated name of the project, this name appears in reports. */ diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/CostQuantityUnit.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/CostQuantityUnit.kt new file mode 100644 index 000000000..2788ccc26 --- /dev/null +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/CostQuantityUnit.kt @@ -0,0 +1,181 @@ +// File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +package com.openai.models.admin.organization.usage + +import com.fasterxml.jackson.annotation.JsonCreator +import com.openai.core.Enum +import com.openai.core.JsonField +import com.openai.errors.OpenAIInvalidDataException + +/** + * The unit of the `quantity` value. If no single supported unit applies to the result, this field + * is `null`. + */ +class CostQuantityUnit @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 TOKENS = of("tokens") + + @JvmField val _1000_TOKENS = of("1000_tokens") + + @JvmField val DURATION_SECONDS = of("duration_seconds") + + @JvmField val DURATION_MINUTES = of("duration_minutes") + + @JvmField val DURATION_HOURS = of("duration_hours") + + @JvmField val GIBIBYTE_HOURS = of("gibibyte_hours") + + @JvmField val IMAGES = of("images") + + @JvmField val CHARACTERS = of("characters") + + @JvmStatic fun of(value: String) = CostQuantityUnit(JsonField.of(value)) + } + + /** An enum containing [CostQuantityUnit]'s known values. */ + enum class Known { + TOKENS, + _1000_TOKENS, + DURATION_SECONDS, + DURATION_MINUTES, + DURATION_HOURS, + GIBIBYTE_HOURS, + IMAGES, + CHARACTERS, + } + + /** + * An enum containing [CostQuantityUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [CostQuantityUnit] 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 { + TOKENS, + _1000_TOKENS, + DURATION_SECONDS, + DURATION_MINUTES, + DURATION_HOURS, + GIBIBYTE_HOURS, + IMAGES, + CHARACTERS, + /** + * An enum member indicating that [CostQuantityUnit] 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) { + TOKENS -> Value.TOKENS + _1000_TOKENS -> Value._1000_TOKENS + DURATION_SECONDS -> Value.DURATION_SECONDS + DURATION_MINUTES -> Value.DURATION_MINUTES + DURATION_HOURS -> Value.DURATION_HOURS + GIBIBYTE_HOURS -> Value.GIBIBYTE_HOURS + IMAGES -> Value.IMAGES + CHARACTERS -> Value.CHARACTERS + 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 OpenAIInvalidDataException if this class instance's value is a not a known member. + */ + fun known(): Known = + when (this) { + TOKENS -> Known.TOKENS + _1000_TOKENS -> Known._1000_TOKENS + DURATION_SECONDS -> Known.DURATION_SECONDS + DURATION_MINUTES -> Known.DURATION_MINUTES + DURATION_HOURS -> Known.DURATION_HOURS + GIBIBYTE_HOURS -> Known.GIBIBYTE_HOURS + IMAGES -> Known.IMAGES + CHARACTERS -> Known.CHARACTERS + else -> throw OpenAIInvalidDataException("Unknown CostQuantityUnit: $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 OpenAIInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { OpenAIInvalidDataException("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 OpenAIInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): CostQuantityUnit = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: OpenAIInvalidDataException) { + 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 CostQuantityUnit && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() +} diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt index c376aa1c3..8eed6d1d6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioSpeechesResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt index c0a6004ac..efc846308 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageAudioTranscriptionsResponse.kt @@ -6703,6 +6703,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6724,7 +6725,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6781,6 +6794,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6829,6 +6852,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6859,6 +6892,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6869,6 +6903,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6980,6 +7015,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7015,6 +7083,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7046,6 +7115,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7072,7 +7142,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7291,6 +7362,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7302,6 +7374,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7309,7 +7382,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt index 985b67e11..a978873c9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCodeInterpreterSessionsResponse.kt @@ -6704,6 +6704,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6725,7 +6726,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6782,6 +6795,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6830,6 +6853,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6860,6 +6893,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6870,6 +6904,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6981,6 +7016,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7016,6 +7084,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7047,6 +7116,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7073,7 +7143,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7292,6 +7363,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7303,6 +7375,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7310,7 +7383,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt index 7e696fba9..bceae6d4b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCompletionsResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt index 7ba1479c7..82d37ec0e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageCostsResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt index 2ae64b5f6..4ac36afdc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageEmbeddingsResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt index bc937dbb0..187a49808 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageFileSearchCallsResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt index a58c15ee0..42806a422 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageImagesResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt index 5ddbd8166..45549f2eb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageModerationsResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt index 335d3a1b4..940c8fe50 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageVectorStoresResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt index 6939686e6..7e7c0bd55 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/admin/organization/usage/UsageWebSearchCallsResponse.kt @@ -6700,6 +6700,7 @@ private constructor( private val lineItem: JsonField, private val projectId: JsonField, private val quantity: JsonField, + private val quantityUnit: JsonField, private val additionalProperties: MutableMap, ) { @@ -6721,7 +6722,19 @@ private constructor( @JsonProperty("quantity") @ExcludeMissing quantity: JsonField = JsonMissing.of(), - ) : this(object_, amount, apiKeyId, lineItem, projectId, quantity, mutableMapOf()) + @JsonProperty("quantity_unit") + @ExcludeMissing + quantityUnit: JsonField = JsonMissing.of(), + ) : this( + object_, + amount, + apiKeyId, + lineItem, + projectId, + quantity, + quantityUnit, + mutableMapOf(), + ) /** * Expected to always return the following: @@ -6778,6 +6791,16 @@ private constructor( */ fun quantity(): Optional = quantity.getOptional("quantity") + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + * + * @throws OpenAIInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun quantityUnit(): Optional = + quantityUnit.getOptional("quantity_unit") + /** * Returns the raw JSON value of [amount]. * @@ -6826,6 +6849,16 @@ private constructor( @ExcludeMissing fun _quantity(): JsonField = quantity + /** + * Returns the raw JSON value of [quantityUnit]. + * + * Unlike [quantityUnit], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("quantity_unit") + @ExcludeMissing + fun _quantityUnit(): JsonField = quantityUnit + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6856,6 +6889,7 @@ private constructor( private var lineItem: JsonField = JsonMissing.of() private var projectId: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() + private var quantityUnit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6866,6 +6900,7 @@ private constructor( lineItem = organizationCostsResult.lineItem projectId = organizationCostsResult.projectId quantity = organizationCostsResult.quantity + quantityUnit = organizationCostsResult.quantityUnit additionalProperties = organizationCostsResult.additionalProperties.toMutableMap() } @@ -6977,6 +7012,39 @@ private constructor( */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } + /** + * The unit of the `quantity` value. If no single supported unit applies to the + * result, this field is `null`. + */ + fun quantityUnit(quantityUnit: CostQuantityUnit?) = + quantityUnit(JsonField.ofNullable(quantityUnit)) + + /** + * Alias for calling [Builder.quantityUnit] with `quantityUnit.orElse(null)`. + */ + fun quantityUnit(quantityUnit: Optional) = + quantityUnit(quantityUnit.getOrNull()) + + /** + * Sets [Builder.quantityUnit] to an arbitrary JSON value. + * + * You should usually call [Builder.quantityUnit] with a well-typed + * [CostQuantityUnit] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun quantityUnit(quantityUnit: JsonField) = apply { + this.quantityUnit = quantityUnit + } + + /** + * Sets [quantityUnit] to an arbitrary [String]. + * + * You should usually call [quantityUnit] with a well-typed [CostQuantityUnit] + * constant instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun quantityUnit(value: String) = quantityUnit(CostQuantityUnit.of(value)) + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7012,6 +7080,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties.toMutableMap(), ) } @@ -7043,6 +7112,7 @@ private constructor( lineItem() projectId() quantity() + quantityUnit() validated = true } @@ -7069,7 +7139,8 @@ private constructor( (if (apiKeyId.asKnown().isPresent) 1 else 0) + (if (lineItem.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + - (if (quantity.asKnown().isPresent) 1 else 0) + (if (quantity.asKnown().isPresent) 1 else 0) + + (if (quantityUnit.asKnown().isPresent) 1 else 0) /** The monetary value in its associated currency. */ class Amount @@ -7288,6 +7359,7 @@ private constructor( lineItem == other.lineItem && projectId == other.projectId && quantity == other.quantity && + quantityUnit == other.quantityUnit && additionalProperties == other.additionalProperties } @@ -7299,6 +7371,7 @@ private constructor( lineItem, projectId, quantity, + quantityUnit, additionalProperties, ) } @@ -7306,7 +7379,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, additionalProperties=$additionalProperties}" + "OrganizationCostsResult{object_=$object_, amount=$amount, apiKeyId=$apiKeyId, lineItem=$lineItem, projectId=$projectId, quantity=$quantity, quantityUnit=$quantityUnit, additionalProperties=$additionalProperties}" } } diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParamsTest.kt index 573cd8a0a..09e1d3a86 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectCreateParamsTest.kt @@ -13,6 +13,7 @@ internal class ProjectCreateParamsTest { .name("name") .externalKeyId("external_key_id") .geography("geography") + .residency(ProjectResidency.GLOBAL) .build() } @@ -23,6 +24,7 @@ internal class ProjectCreateParamsTest { .name("name") .externalKeyId("external_key_id") .geography("geography") + .residency(ProjectResidency.GLOBAL) .build() val body = params._body() @@ -30,6 +32,7 @@ internal class ProjectCreateParamsTest { assertThat(body.name()).isEqualTo("name") assertThat(body.externalKeyId()).contains("external_key_id") assertThat(body.geography()).contains("geography") + assertThat(body.residency()).contains(ProjectResidency.GLOBAL) } @Test diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectListPageResponseTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectListPageResponseTest.kt index c001f2fd5..05272eb4b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectListPageResponseTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectListPageResponseTest.kt @@ -20,6 +20,7 @@ internal class ProjectListPageResponseTest { .archivedAt(0L) .externalKeyId("external_key_id") .name("name") + .residency(ProjectResidency.GLOBAL) .status("status") .build() ) @@ -36,6 +37,7 @@ internal class ProjectListPageResponseTest { .archivedAt(0L) .externalKeyId("external_key_id") .name("name") + .residency(ProjectResidency.GLOBAL) .status("status") .build() ) @@ -56,6 +58,7 @@ internal class ProjectListPageResponseTest { .archivedAt(0L) .externalKeyId("external_key_id") .name("name") + .residency(ProjectResidency.GLOBAL) .status("status") .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectTest.kt index 7471c8080..9746fb734 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/admin/organization/projects/ProjectTest.kt @@ -18,6 +18,7 @@ internal class ProjectTest { .archivedAt(0L) .externalKeyId("external_key_id") .name("name") + .residency(ProjectResidency.GLOBAL) .status("status") .build() @@ -26,6 +27,7 @@ internal class ProjectTest { assertThat(project.archivedAt()).contains(0L) assertThat(project.externalKeyId()).contains("external_key_id") assertThat(project.name()).contains("name") + assertThat(project.residency()).contains(ProjectResidency.GLOBAL) assertThat(project.status()).contains("status") } @@ -39,6 +41,7 @@ internal class ProjectTest { .archivedAt(0L) .externalKeyId("external_key_id") .name("name") + .residency(ProjectResidency.GLOBAL) .status("status") .build() diff --git a/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/ProjectServiceAsyncTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/ProjectServiceAsyncTest.kt index d5f05a281..00c64507a 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/ProjectServiceAsyncTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/async/admin/organization/ProjectServiceAsyncTest.kt @@ -5,6 +5,7 @@ package com.openai.services.async.admin.organization import com.openai.TestServerExtension import com.openai.client.okhttp.OpenAIOkHttpClientAsync import com.openai.models.admin.organization.projects.ProjectCreateParams +import com.openai.models.admin.organization.projects.ProjectResidency import com.openai.models.admin.organization.projects.ProjectUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -28,6 +29,7 @@ internal class ProjectServiceAsyncTest { .name("name") .externalKeyId("external_key_id") .geography("geography") + .residency(ProjectResidency.GLOBAL) .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/ProjectServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/ProjectServiceTest.kt index b902ad968..437180b5b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/ProjectServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/admin/organization/ProjectServiceTest.kt @@ -5,6 +5,7 @@ package com.openai.services.blocking.admin.organization import com.openai.TestServerExtension import com.openai.client.okhttp.OpenAIOkHttpClient import com.openai.models.admin.organization.projects.ProjectCreateParams +import com.openai.models.admin.organization.projects.ProjectResidency import com.openai.models.admin.organization.projects.ProjectUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -28,6 +29,7 @@ internal class ProjectServiceTest { .name("name") .externalKeyId("external_key_id") .geography("geography") + .residency(ProjectResidency.GLOBAL) .build() )