@@ -22,15 +22,15 @@ import kotlin.jvm.optionals.getOrNull
2222
2323class ManualAsyncJob
2424private constructor (
25- private val body: JsonField <List <JsonValue >>,
25+ private val body: JsonField <List <JsonValue ? >>,
2626 private val jobId: JsonField <String >,
2727 private val status: JsonField <Status >,
2828 private val additionalProperties: MutableMap <String , JsonValue >,
2929) {
3030
3131 @JsonCreator
3232 private constructor (
33- @JsonProperty(" body" ) @ExcludeMissing body: JsonField <List <JsonValue >> = JsonMissing .of(),
33+ @JsonProperty(" body" ) @ExcludeMissing body: JsonField <List <JsonValue ? >> = JsonMissing .of(),
3434 @JsonProperty(" job_id" ) @ExcludeMissing jobId: JsonField <String > = JsonMissing .of(),
3535 @JsonProperty(" status" ) @ExcludeMissing status: JsonField <Status > = JsonMissing .of(),
3636 ) : this (body, jobId, status, mutableMapOf ())
@@ -41,7 +41,7 @@ private constructor(
4141 * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
4242 * server responded with an unexpected value).
4343 */
44- fun body (): Optional <List <JsonValue >> = body.getOptional(" body" )
44+ fun body (): Optional <List <JsonValue ? >> = body.getOptional(" body" )
4545
4646 /* *
4747 * @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
@@ -60,7 +60,7 @@ private constructor(
6060 *
6161 * Unlike [body], this method doesn't throw if the JSON field has an unexpected type.
6262 */
63- @JsonProperty(" body" ) @ExcludeMissing fun _body (): JsonField <List <JsonValue >> = body
63+ @JsonProperty(" body" ) @ExcludeMissing fun _body (): JsonField <List <JsonValue ? >> = body
6464
6565 /* *
6666 * Returns the raw JSON value of [jobId].
@@ -106,7 +106,7 @@ private constructor(
106106 /* * A builder for [ManualAsyncJob]. */
107107 class Builder internal constructor() {
108108
109- private var body: JsonField <MutableList <JsonValue >>? = null
109+ private var body: JsonField <MutableList <JsonValue ? >>? = null
110110 private var jobId: JsonField <String >? = null
111111 private var status: JsonField <Status >? = null
112112 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
@@ -120,19 +120,19 @@ private constructor(
120120 }
121121
122122 /* * Specific information about the job, such as individual statuses for batch jobs. */
123- fun body (body : List <JsonValue >? ) = body(JsonField .ofNullable(body))
123+ fun body (body : List <JsonValue ? >? ) = body(JsonField .ofNullable(body))
124124
125125 /* * Alias for calling [Builder.body] with `body.orElse(null)`. */
126- fun body (body : Optional <List <JsonValue >>) = body(body.getOrNull())
126+ fun body (body : Optional <List <JsonValue ? >>) = body(body.getOrNull())
127127
128128 /* *
129129 * Sets [Builder.body] to an arbitrary JSON value.
130130 *
131- * You should usually call [Builder.body] with a well-typed `List<JsonValue>` value instead.
132- * This method is primarily for setting the field to an undocumented or not yet supported
133- * value.
131+ * You should usually call [Builder.body] with a well-typed `List<JsonValue? >` value
132+ * instead. This method is primarily for setting the field to an undocumented or not yet
133+ * supported value.
134134 */
135- fun body (body : JsonField <List <JsonValue >>) = apply {
135+ fun body (body : JsonField <List <JsonValue ? >>) = apply {
136136 this .body = body.map { it.toMutableList() }
137137 }
138138
@@ -238,7 +238,7 @@ private constructor(
238238 */
239239 @JvmSynthetic
240240 internal fun validity (): Int =
241- (body.asKnown().getOrNull()?.size ? : 0 ) +
241+ (body.asKnown().getOrNull()?.sumOf { ( if (it == null ) 0 else 1 ).toInt() } ? : 0 ) +
242242 (if (jobId.asKnown().isPresent) 1 else 0 ) +
243243 (status.asKnown().getOrNull()?.validity() ? : 0 )
244244
0 commit comments