@@ -70,7 +70,9 @@ private constructor(
70
70
@JsonProperty(" in_progress_at" )
71
71
@ExcludeMissing
72
72
private val inProgressAt: JsonField <Long > = JsonMissing .of(),
73
- @JsonProperty(" metadata" ) @ExcludeMissing private val metadata: JsonValue = JsonMissing .of(),
73
+ @JsonProperty(" metadata" )
74
+ @ExcludeMissing
75
+ private val metadata: JsonField <Metadata > = JsonMissing .of(),
74
76
@JsonProperty(" output_file_id" )
75
77
@ExcludeMissing
76
78
private val outputFileId: JsonField <String > = JsonMissing .of(),
@@ -135,10 +137,13 @@ private constructor(
135
137
136
138
/* *
137
139
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
138
- * additional information about the object in a structured format. Keys can be a maximum of 64
139
- * characters long and values can be a maximum of 512 characters long.
140
+ * additional information about the object in a structured format, and querying for objects via
141
+ * API or the dashboard.
142
+ *
143
+ * Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
144
+ * length of 512 characters.
140
145
*/
141
- @JsonProperty( " metadata " ) @ExcludeMissing fun _metadata (): JsonValue = metadata
146
+ fun metadata (): Optional < Metadata > = Optional .ofNullable( metadata.getNullable( " metadata " ))
142
147
143
148
/* * The ID of the file containing the outputs of successfully executed requests. */
144
149
fun outputFileId (): Optional <String > =
@@ -206,6 +211,16 @@ private constructor(
206
211
@ExcludeMissing
207
212
fun _inProgressAt (): JsonField <Long > = inProgressAt
208
213
214
+ /* *
215
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful for storing
216
+ * additional information about the object in a structured format, and querying for objects via
217
+ * API or the dashboard.
218
+ *
219
+ * Keys are strings with a maximum length of 64 characters. Values are strings with a maximum
220
+ * length of 512 characters.
221
+ */
222
+ @JsonProperty(" metadata" ) @ExcludeMissing fun _metadata (): JsonField <Metadata > = metadata
223
+
209
224
/* * The ID of the file containing the outputs of successfully executed requests. */
210
225
@JsonProperty(" output_file_id" )
211
226
@ExcludeMissing
@@ -248,6 +263,7 @@ private constructor(
248
263
failedAt()
249
264
finalizingAt()
250
265
inProgressAt()
266
+ metadata().ifPresent { it.validate() }
251
267
outputFileId()
252
268
requestCounts().ifPresent { it.validate() }
253
269
validated = true
@@ -280,7 +296,7 @@ private constructor(
280
296
private var failedAt: JsonField <Long > = JsonMissing .of()
281
297
private var finalizingAt: JsonField <Long > = JsonMissing .of()
282
298
private var inProgressAt: JsonField <Long > = JsonMissing .of()
283
- private var metadata: JsonValue = JsonMissing .of()
299
+ private var metadata: JsonField < Metadata > = JsonMissing .of()
284
300
private var outputFileId: JsonField <String > = JsonMissing .of()
285
301
private var requestCounts: JsonField <BatchRequestCounts > = JsonMissing .of()
286
302
private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
@@ -410,10 +426,33 @@ private constructor(
410
426
411
427
/* *
412
428
* Set of 16 key-value pairs that can be attached to an object. This can be useful for
413
- * storing additional information about the object in a structured format. Keys can be a
414
- * maximum of 64 characters long and values can be a maximum of 512 characters long.
429
+ * storing additional information about the object in a structured format, and querying for
430
+ * objects via API or the dashboard.
431
+ *
432
+ * Keys are strings with a maximum length of 64 characters. Values are strings with a
433
+ * maximum length of 512 characters.
434
+ */
435
+ fun metadata (metadata : Metadata ? ) = metadata(JsonField .ofNullable(metadata))
436
+
437
+ /* *
438
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful for
439
+ * storing additional information about the object in a structured format, and querying for
440
+ * objects via API or the dashboard.
441
+ *
442
+ * Keys are strings with a maximum length of 64 characters. Values are strings with a
443
+ * maximum length of 512 characters.
444
+ */
445
+ fun metadata (metadata : Optional <Metadata >) = metadata(metadata.orElse(null ))
446
+
447
+ /* *
448
+ * Set of 16 key-value pairs that can be attached to an object. This can be useful for
449
+ * storing additional information about the object in a structured format, and querying for
450
+ * objects via API or the dashboard.
451
+ *
452
+ * Keys are strings with a maximum length of 64 characters. Values are strings with a
453
+ * maximum length of 512 characters.
415
454
*/
416
- fun metadata (metadata : JsonValue ) = apply { this .metadata = metadata }
455
+ fun metadata (metadata : JsonField < Metadata > ) = apply { this .metadata = metadata }
417
456
418
457
/* * The ID of the file containing the outputs of successfully executed requests. */
419
458
fun outputFileId (outputFileId : String ) = outputFileId(JsonField .of(outputFileId))
0 commit comments