@@ -197,12 +197,12 @@ private constructor(
197
197
* Alias for calling [usage] with the following:
198
198
* ```java
199
199
* Usage.Duration.builder()
200
- * .duration(duration )
200
+ * .seconds(seconds )
201
201
* .build()
202
202
* ```
203
203
*/
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())
206
206
207
207
fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
208
208
this .additionalProperties.clear()
@@ -1230,18 +1230,18 @@ private constructor(
1230
1230
/* * Usage statistics for models billed by audio input duration. */
1231
1231
class Duration
1232
1232
private constructor (
1233
- private val duration : JsonField <Double >,
1233
+ private val seconds : JsonField <Double >,
1234
1234
private val type: JsonValue ,
1235
1235
private val additionalProperties: MutableMap <String , JsonValue >,
1236
1236
) {
1237
1237
1238
1238
@JsonCreator
1239
1239
private constructor (
1240
- @JsonProperty(" duration " )
1240
+ @JsonProperty(" seconds " )
1241
1241
@ExcludeMissing
1242
- duration : JsonField <Double > = JsonMissing .of(),
1242
+ seconds : JsonField <Double > = JsonMissing .of(),
1243
1243
@JsonProperty(" type" ) @ExcludeMissing type: JsonValue = JsonMissing .of(),
1244
- ) : this (duration , type, mutableMapOf ())
1244
+ ) : this (seconds , type, mutableMapOf ())
1245
1245
1246
1246
/* *
1247
1247
* Duration of the input audio in seconds.
@@ -1250,7 +1250,7 @@ private constructor(
1250
1250
* unexpectedly missing or null (e.g. if the server responded with an unexpected
1251
1251
* value).
1252
1252
*/
1253
- fun duration (): Double = duration .getRequired(" duration " )
1253
+ fun seconds (): Double = seconds .getRequired(" seconds " )
1254
1254
1255
1255
/* *
1256
1256
* The type of the usage object. Always `duration` for this variant.
@@ -1266,12 +1266,11 @@ private constructor(
1266
1266
@JsonProperty(" type" ) @ExcludeMissing fun _type (): JsonValue = type
1267
1267
1268
1268
/* *
1269
- * Returns the raw JSON value of [duration ].
1269
+ * Returns the raw JSON value of [seconds ].
1270
1270
*
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.
1273
1272
*/
1274
- @JsonProperty(" duration " ) @ExcludeMissing fun _duration (): JsonField <Double > = duration
1273
+ @JsonProperty(" seconds " ) @ExcludeMissing fun _seconds (): JsonField <Double > = seconds
1275
1274
1276
1275
@JsonAnySetter
1277
1276
private fun putAdditionalProperty (key : String , value : JsonValue ) {
@@ -1292,7 +1291,7 @@ private constructor(
1292
1291
*
1293
1292
* The following fields are required:
1294
1293
* ```java
1295
- * .duration ()
1294
+ * .seconds ()
1296
1295
* ```
1297
1296
*/
1298
1297
@JvmStatic fun builder () = Builder ()
@@ -1301,28 +1300,28 @@ private constructor(
1301
1300
/* * A builder for [Duration]. */
1302
1301
class Builder internal constructor() {
1303
1302
1304
- private var duration : JsonField <Double >? = null
1303
+ private var seconds : JsonField <Double >? = null
1305
1304
private var type: JsonValue = JsonValue .from(" duration" )
1306
1305
private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
1307
1306
1308
1307
@JvmSynthetic
1309
1308
internal fun from (duration : Duration ) = apply {
1310
- this .duration = duration.duration
1309
+ seconds = duration.seconds
1311
1310
type = duration.type
1312
1311
additionalProperties = duration.additionalProperties.toMutableMap()
1313
1312
}
1314
1313
1315
1314
/* * 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 ))
1317
1316
1318
1317
/* *
1319
- * Sets [Builder.duration ] to an arbitrary JSON value.
1318
+ * Sets [Builder.seconds ] to an arbitrary JSON value.
1320
1319
*
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
1322
1321
* instead. This method is primarily for setting the field to an undocumented or not
1323
1322
* yet supported value.
1324
1323
*/
1325
- fun duration ( duration : JsonField <Double >) = apply { this .duration = duration }
1324
+ fun seconds ( seconds : JsonField <Double >) = apply { this .seconds = seconds }
1326
1325
1327
1326
/* *
1328
1327
* Sets the field to an arbitrary JSON value.
@@ -1367,14 +1366,14 @@ private constructor(
1367
1366
*
1368
1367
* The following fields are required:
1369
1368
* ```java
1370
- * .duration ()
1369
+ * .seconds ()
1371
1370
* ```
1372
1371
*
1373
1372
* @throws IllegalStateException if any required field is unset.
1374
1373
*/
1375
1374
fun build (): Duration =
1376
1375
Duration (
1377
- checkRequired(" duration " , duration ),
1376
+ checkRequired(" seconds " , seconds ),
1378
1377
type,
1379
1378
additionalProperties.toMutableMap(),
1380
1379
)
@@ -1387,7 +1386,7 @@ private constructor(
1387
1386
return @apply
1388
1387
}
1389
1388
1390
- duration ()
1389
+ seconds ()
1391
1390
_type ().let {
1392
1391
if (it != JsonValue .from(" duration" )) {
1393
1392
throw OpenAIInvalidDataException (" 'type' is invalid, received $it " )
@@ -1412,25 +1411,25 @@ private constructor(
1412
1411
*/
1413
1412
@JvmSynthetic
1414
1413
internal fun validity (): Int =
1415
- (if (duration .asKnown().isPresent) 1 else 0 ) +
1414
+ (if (seconds .asKnown().isPresent) 1 else 0 ) +
1416
1415
type.let { if (it == JsonValue .from(" duration" )) 1 else 0 }
1417
1416
1418
1417
override fun equals (other : Any? ): Boolean {
1419
1418
if (this == = other) {
1420
1419
return true
1421
1420
}
1422
1421
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 */
1424
1423
}
1425
1424
1426
1425
/* 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) }
1428
1427
/* spotless:on */
1429
1428
1430
1429
override fun hashCode (): Int = hashCode
1431
1430
1432
1431
override fun toString () =
1433
- " Duration{duration= $duration , type=$type , additionalProperties=$additionalProperties }"
1432
+ " Duration{seconds= $seconds , type=$type , additionalProperties=$additionalProperties }"
1434
1433
}
1435
1434
}
1436
1435
0 commit comments