Skip to content

Commit 738f846

Browse files
chore(internal): manual updates
1 parent 1b6bd2d commit 738f846

19 files changed

+1308
-98
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 88
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a473967d1766dc155994d932fbc4a5bcbd1c140a37c20d0a4065e1bf0640536d.yml
3-
openapi_spec_hash: 67cdc62b0d6c8b1de29b7dc54b265749
4-
config_hash: 7b53f96f897ca1b3407a5341a6f820db
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2d116cda53321baa3479e628512def723207a81eb1cdaebb542bd0555e563bda.yml
3+
openapi_spec_hash: 809d958fec261a32004a4b026b718793
4+
config_hash: 00b55237774c015fc35f58d2820759a9

openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/Transcription.kt

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ private constructor(
197197
* Alias for calling [usage] with the following:
198198
* ```java
199199
* Usage.Duration.builder()
200-
* .duration(duration)
200+
* .seconds(seconds)
201201
* .build()
202202
* ```
203203
*/
204-
fun durationUsage(duration: Double) =
205-
usage(Usage.Duration.builder().duration(duration).build())
204+
fun durationUsage(seconds: Double) =
205+
usage(Usage.Duration.builder().seconds(seconds).build())
206206

207207
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
208208
this.additionalProperties.clear()
@@ -1230,18 +1230,18 @@ private constructor(
12301230
/** Usage statistics for models billed by audio input duration. */
12311231
class Duration
12321232
private constructor(
1233-
private val duration: JsonField<Double>,
1233+
private val seconds: JsonField<Double>,
12341234
private val type: JsonValue,
12351235
private val additionalProperties: MutableMap<String, JsonValue>,
12361236
) {
12371237

12381238
@JsonCreator
12391239
private constructor(
1240-
@JsonProperty("duration")
1240+
@JsonProperty("seconds")
12411241
@ExcludeMissing
1242-
duration: JsonField<Double> = JsonMissing.of(),
1242+
seconds: JsonField<Double> = JsonMissing.of(),
12431243
@JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
1244-
) : this(duration, type, mutableMapOf())
1244+
) : this(seconds, type, mutableMapOf())
12451245

12461246
/**
12471247
* Duration of the input audio in seconds.
@@ -1250,7 +1250,7 @@ private constructor(
12501250
* unexpectedly missing or null (e.g. if the server responded with an unexpected
12511251
* value).
12521252
*/
1253-
fun duration(): Double = duration.getRequired("duration")
1253+
fun seconds(): Double = seconds.getRequired("seconds")
12541254

12551255
/**
12561256
* The type of the usage object. Always `duration` for this variant.
@@ -1266,12 +1266,11 @@ private constructor(
12661266
@JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
12671267

12681268
/**
1269-
* Returns the raw JSON value of [duration].
1269+
* Returns the raw JSON value of [seconds].
12701270
*
1271-
* Unlike [duration], this method doesn't throw if the JSON field has an unexpected
1272-
* type.
1271+
* Unlike [seconds], this method doesn't throw if the JSON field has an unexpected type.
12731272
*/
1274-
@JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField<Double> = duration
1273+
@JsonProperty("seconds") @ExcludeMissing fun _seconds(): JsonField<Double> = seconds
12751274

12761275
@JsonAnySetter
12771276
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -1292,7 +1291,7 @@ private constructor(
12921291
*
12931292
* The following fields are required:
12941293
* ```java
1295-
* .duration()
1294+
* .seconds()
12961295
* ```
12971296
*/
12981297
@JvmStatic fun builder() = Builder()
@@ -1301,28 +1300,28 @@ private constructor(
13011300
/** A builder for [Duration]. */
13021301
class Builder internal constructor() {
13031302

1304-
private var duration: JsonField<Double>? = null
1303+
private var seconds: JsonField<Double>? = null
13051304
private var type: JsonValue = JsonValue.from("duration")
13061305
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
13071306

13081307
@JvmSynthetic
13091308
internal fun from(duration: Duration) = apply {
1310-
this.duration = duration.duration
1309+
seconds = duration.seconds
13111310
type = duration.type
13121311
additionalProperties = duration.additionalProperties.toMutableMap()
13131312
}
13141313

13151314
/** Duration of the input audio in seconds. */
1316-
fun duration(duration: Double) = duration(JsonField.of(duration))
1315+
fun seconds(seconds: Double) = seconds(JsonField.of(seconds))
13171316

13181317
/**
1319-
* Sets [Builder.duration] to an arbitrary JSON value.
1318+
* Sets [Builder.seconds] to an arbitrary JSON value.
13201319
*
1321-
* You should usually call [Builder.duration] with a well-typed [Double] value
1320+
* You should usually call [Builder.seconds] with a well-typed [Double] value
13221321
* instead. This method is primarily for setting the field to an undocumented or not
13231322
* yet supported value.
13241323
*/
1325-
fun duration(duration: JsonField<Double>) = apply { this.duration = duration }
1324+
fun seconds(seconds: JsonField<Double>) = apply { this.seconds = seconds }
13261325

13271326
/**
13281327
* Sets the field to an arbitrary JSON value.
@@ -1367,14 +1366,14 @@ private constructor(
13671366
*
13681367
* The following fields are required:
13691368
* ```java
1370-
* .duration()
1369+
* .seconds()
13711370
* ```
13721371
*
13731372
* @throws IllegalStateException if any required field is unset.
13741373
*/
13751374
fun build(): Duration =
13761375
Duration(
1377-
checkRequired("duration", duration),
1376+
checkRequired("seconds", seconds),
13781377
type,
13791378
additionalProperties.toMutableMap(),
13801379
)
@@ -1387,7 +1386,7 @@ private constructor(
13871386
return@apply
13881387
}
13891388

1390-
duration()
1389+
seconds()
13911390
_type().let {
13921391
if (it != JsonValue.from("duration")) {
13931392
throw OpenAIInvalidDataException("'type' is invalid, received $it")
@@ -1412,25 +1411,25 @@ private constructor(
14121411
*/
14131412
@JvmSynthetic
14141413
internal fun validity(): Int =
1415-
(if (duration.asKnown().isPresent) 1 else 0) +
1414+
(if (seconds.asKnown().isPresent) 1 else 0) +
14161415
type.let { if (it == JsonValue.from("duration")) 1 else 0 }
14171416

14181417
override fun equals(other: Any?): Boolean {
14191418
if (this === other) {
14201419
return true
14211420
}
14221421

1423-
return /* spotless:off */ other is Duration && duration == other.duration && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */
1422+
return /* spotless:off */ other is Duration && seconds == other.seconds && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */
14241423
}
14251424

14261425
/* spotless:off */
1427-
private val hashCode: Int by lazy { Objects.hash(duration, type, additionalProperties) }
1426+
private val hashCode: Int by lazy { Objects.hash(seconds, type, additionalProperties) }
14281427
/* spotless:on */
14291428

14301429
override fun hashCode(): Int = hashCode
14311430

14321431
override fun toString() =
1433-
"Duration{duration=$duration, type=$type, additionalProperties=$additionalProperties}"
1432+
"Duration{seconds=$seconds, type=$type, additionalProperties=$additionalProperties}"
14341433
}
14351434
}
14361435

openai-java-core/src/main/kotlin/com/openai/models/audio/transcriptions/TranscriptionVerbose.kt

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -368,26 +368,24 @@ private constructor(
368368
/** Usage statistics for models billed by audio input duration. */
369369
class Usage
370370
private constructor(
371-
private val duration: JsonField<Double>,
371+
private val seconds: JsonField<Double>,
372372
private val type: JsonValue,
373373
private val additionalProperties: MutableMap<String, JsonValue>,
374374
) {
375375

376376
@JsonCreator
377377
private constructor(
378-
@JsonProperty("duration")
379-
@ExcludeMissing
380-
duration: JsonField<Double> = JsonMissing.of(),
378+
@JsonProperty("seconds") @ExcludeMissing seconds: JsonField<Double> = JsonMissing.of(),
381379
@JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
382-
) : this(duration, type, mutableMapOf())
380+
) : this(seconds, type, mutableMapOf())
383381

384382
/**
385383
* Duration of the input audio in seconds.
386384
*
387385
* @throws OpenAIInvalidDataException if the JSON field has an unexpected type or is
388386
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
389387
*/
390-
fun duration(): Double = duration.getRequired("duration")
388+
fun seconds(): Double = seconds.getRequired("seconds")
391389

392390
/**
393391
* The type of the usage object. Always `duration` for this variant.
@@ -403,11 +401,11 @@ private constructor(
403401
@JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
404402

405403
/**
406-
* Returns the raw JSON value of [duration].
404+
* Returns the raw JSON value of [seconds].
407405
*
408-
* Unlike [duration], this method doesn't throw if the JSON field has an unexpected type.
406+
* Unlike [seconds], this method doesn't throw if the JSON field has an unexpected type.
409407
*/
410-
@JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField<Double> = duration
408+
@JsonProperty("seconds") @ExcludeMissing fun _seconds(): JsonField<Double> = seconds
411409

412410
@JsonAnySetter
413411
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -428,7 +426,7 @@ private constructor(
428426
*
429427
* The following fields are required:
430428
* ```java
431-
* .duration()
429+
* .seconds()
432430
* ```
433431
*/
434432
@JvmStatic fun builder() = Builder()
@@ -437,28 +435,28 @@ private constructor(
437435
/** A builder for [Usage]. */
438436
class Builder internal constructor() {
439437

440-
private var duration: JsonField<Double>? = null
438+
private var seconds: JsonField<Double>? = null
441439
private var type: JsonValue = JsonValue.from("duration")
442440
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
443441

444442
@JvmSynthetic
445443
internal fun from(usage: Usage) = apply {
446-
duration = usage.duration
444+
seconds = usage.seconds
447445
type = usage.type
448446
additionalProperties = usage.additionalProperties.toMutableMap()
449447
}
450448

451449
/** Duration of the input audio in seconds. */
452-
fun duration(duration: Double) = duration(JsonField.of(duration))
450+
fun seconds(seconds: Double) = seconds(JsonField.of(seconds))
453451

454452
/**
455-
* Sets [Builder.duration] to an arbitrary JSON value.
453+
* Sets [Builder.seconds] to an arbitrary JSON value.
456454
*
457-
* You should usually call [Builder.duration] with a well-typed [Double] value instead.
455+
* You should usually call [Builder.seconds] with a well-typed [Double] value instead.
458456
* This method is primarily for setting the field to an undocumented or not yet
459457
* supported value.
460458
*/
461-
fun duration(duration: JsonField<Double>) = apply { this.duration = duration }
459+
fun seconds(seconds: JsonField<Double>) = apply { this.seconds = seconds }
462460

463461
/**
464462
* Sets the field to an arbitrary JSON value.
@@ -500,17 +498,13 @@ private constructor(
500498
*
501499
* The following fields are required:
502500
* ```java
503-
* .duration()
501+
* .seconds()
504502
* ```
505503
*
506504
* @throws IllegalStateException if any required field is unset.
507505
*/
508506
fun build(): Usage =
509-
Usage(
510-
checkRequired("duration", duration),
511-
type,
512-
additionalProperties.toMutableMap(),
513-
)
507+
Usage(checkRequired("seconds", seconds), type, additionalProperties.toMutableMap())
514508
}
515509

516510
private var validated: Boolean = false
@@ -520,7 +514,7 @@ private constructor(
520514
return@apply
521515
}
522516

523-
duration()
517+
seconds()
524518
_type().let {
525519
if (it != JsonValue.from("duration")) {
526520
throw OpenAIInvalidDataException("'type' is invalid, received $it")
@@ -545,25 +539,25 @@ private constructor(
545539
*/
546540
@JvmSynthetic
547541
internal fun validity(): Int =
548-
(if (duration.asKnown().isPresent) 1 else 0) +
542+
(if (seconds.asKnown().isPresent) 1 else 0) +
549543
type.let { if (it == JsonValue.from("duration")) 1 else 0 }
550544

551545
override fun equals(other: Any?): Boolean {
552546
if (this === other) {
553547
return true
554548
}
555549

556-
return /* spotless:off */ other is Usage && duration == other.duration && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */
550+
return /* spotless:off */ other is Usage && seconds == other.seconds && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */
557551
}
558552

559553
/* spotless:off */
560-
private val hashCode: Int by lazy { Objects.hash(duration, type, additionalProperties) }
554+
private val hashCode: Int by lazy { Objects.hash(seconds, type, additionalProperties) }
561555
/* spotless:on */
562556

563557
override fun hashCode(): Int = hashCode
564558

565559
override fun toString() =
566-
"Usage{duration=$duration, type=$type, additionalProperties=$additionalProperties}"
560+
"Usage{seconds=$seconds, type=$type, additionalProperties=$additionalProperties}"
567561
}
568562

569563
override fun equals(other: Any?): Boolean {

0 commit comments

Comments
 (0)