@@ -70,7 +70,9 @@ private constructor(
7070 @JsonProperty(" in_progress_at" )
7171 @ExcludeMissing
7272 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(),
7476 @JsonProperty(" output_file_id" )
7577 @ExcludeMissing
7678 private val outputFileId: JsonField <String > = JsonMissing .of(),
@@ -135,10 +137,13 @@ private constructor(
135137
136138 /* *
137139 * 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.
140145 */
141- @JsonProperty( " metadata " ) @ExcludeMissing fun _metadata (): JsonValue = metadata
146+ fun metadata (): Optional < Metadata > = Optional .ofNullable( metadata.getNullable( " metadata " ))
142147
143148 /* * The ID of the file containing the outputs of successfully executed requests. */
144149 fun outputFileId (): Optional <String > =
@@ -206,6 +211,16 @@ private constructor(
206211 @ExcludeMissing
207212 fun _inProgressAt (): JsonField <Long > = inProgressAt
208213
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+
209224 /* * The ID of the file containing the outputs of successfully executed requests. */
210225 @JsonProperty(" output_file_id" )
211226 @ExcludeMissing
@@ -248,6 +263,7 @@ private constructor(
248263 failedAt()
249264 finalizingAt()
250265 inProgressAt()
266+ metadata().ifPresent { it.validate() }
251267 outputFileId()
252268 requestCounts().ifPresent { it.validate() }
253269 validated = true
@@ -280,7 +296,7 @@ private constructor(
280296 private var failedAt: JsonField <Long > = JsonMissing .of()
281297 private var finalizingAt: JsonField <Long > = JsonMissing .of()
282298 private var inProgressAt: JsonField <Long > = JsonMissing .of()
283- private var metadata: JsonValue = JsonMissing .of()
299+ private var metadata: JsonField < Metadata > = JsonMissing .of()
284300 private var outputFileId: JsonField <String > = JsonMissing .of()
285301 private var requestCounts: JsonField <BatchRequestCounts > = JsonMissing .of()
286302 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
@@ -410,10 +426,33 @@ private constructor(
410426
411427 /* *
412428 * 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.
415454 */
416- fun metadata (metadata : JsonValue ) = apply { this .metadata = metadata }
455+ fun metadata (metadata : JsonField < Metadata > ) = apply { this .metadata = metadata }
417456
418457 /* * The ID of the file containing the outputs of successfully executed requests. */
419458 fun outputFileId (outputFileId : String ) = outputFileId(JsonField .of(outputFileId))
0 commit comments