@@ -91,17 +91,16 @@ private constructor(
9191
9292 fun body (body : Body ) = apply { this .body = body }
9393
94- /* * Alias for calling [body] with `Body.ofRunsUuidArray(runsUuidArray)`. */
95- fun bodyOfRunsUuidArray (runsUuidArray : List <String >) =
96- body(Body .ofRunsUuidArray(runsUuidArray))
94+ /* * Alias for calling [body] with `Body.ofStrings(strings)`. */
95+ fun bodyOfStrings (strings : List <String >) = body(Body .ofStrings(strings))
9796
9897 /* *
9998 * Alias for calling [body] with
100- * `Body.ofRunsAnnotationQueueRunAddSchemaArray(runsAnnotationQueueRunAddSchemaArray )`.
99+ * `Body.ofAnnotationQueueRunAddSchemas(annotationQueueRunAddSchemas )`.
101100 */
102- fun bodyOfRunsAnnotationQueueRunAddSchemaArray (
103- runsAnnotationQueueRunAddSchemaArray : List <Body .AnnotationQueueRunAddSchema >
104- ) = body(Body .ofRunsAnnotationQueueRunAddSchemaArray(runsAnnotationQueueRunAddSchemaArray ))
101+ fun bodyOfAnnotationQueueRunAddSchemas (
102+ annotationQueueRunAddSchemas : List <Body .AnnotationQueueRunAddSchema >
103+ ) = body(Body .ofAnnotationQueueRunAddSchemas(annotationQueueRunAddSchemas ))
105104
106105 fun additionalHeaders (additionalHeaders : Headers ) = apply {
107106 this .additionalHeaders.clear()
@@ -238,35 +237,32 @@ private constructor(
238237 @JsonSerialize(using = Body .Serializer ::class )
239238 class Body
240239 private constructor (
241- private val runsUuidArray : List <String >? = null ,
242- private val runsAnnotationQueueRunAddSchemaArray : List <AnnotationQueueRunAddSchema >? = null ,
240+ private val strings : List <String >? = null ,
241+ private val annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >? = null ,
243242 private val _json : JsonValue ? = null ,
244243 ) {
245244
246- fun runsUuidArray (): Optional <List <String >> = Optional .ofNullable(runsUuidArray )
245+ fun strings (): Optional <List <String >> = Optional .ofNullable(strings )
247246
248- fun runsAnnotationQueueRunAddSchemaArray (): Optional <List <AnnotationQueueRunAddSchema >> =
249- Optional .ofNullable(runsAnnotationQueueRunAddSchemaArray )
247+ fun annotationQueueRunAddSchemas (): Optional <List <AnnotationQueueRunAddSchema >> =
248+ Optional .ofNullable(annotationQueueRunAddSchemas )
250249
251- fun isRunsUuidArray (): Boolean = runsUuidArray != null
250+ fun isStrings (): Boolean = strings != null
252251
253- fun isRunsAnnotationQueueRunAddSchemaArray (): Boolean =
254- runsAnnotationQueueRunAddSchemaArray != null
252+ fun isAnnotationQueueRunAddSchemas (): Boolean = annotationQueueRunAddSchemas != null
255253
256- fun asRunsUuidArray (): List <String > = runsUuidArray .getOrThrow(" runsUuidArray " )
254+ fun asStrings (): List <String > = strings .getOrThrow(" strings " )
257255
258- fun asRunsAnnotationQueueRunAddSchemaArray (): List <AnnotationQueueRunAddSchema > =
259- runsAnnotationQueueRunAddSchemaArray .getOrThrow(" runsAnnotationQueueRunAddSchemaArray " )
256+ fun asAnnotationQueueRunAddSchemas (): List <AnnotationQueueRunAddSchema > =
257+ annotationQueueRunAddSchemas .getOrThrow(" annotationQueueRunAddSchemas " )
260258
261259 fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
262260
263261 fun <T > accept (visitor : Visitor <T >): T =
264262 when {
265- runsUuidArray != null -> visitor.visitRunsUuidArray(runsUuidArray)
266- runsAnnotationQueueRunAddSchemaArray != null ->
267- visitor.visitRunsAnnotationQueueRunAddSchemaArray(
268- runsAnnotationQueueRunAddSchemaArray
269- )
263+ strings != null -> visitor.visitStrings(strings)
264+ annotationQueueRunAddSchemas != null ->
265+ visitor.visitAnnotationQueueRunAddSchemas(annotationQueueRunAddSchemas)
270266 else -> visitor.unknown(_json )
271267 }
272268
@@ -279,12 +275,12 @@ private constructor(
279275
280276 accept(
281277 object : Visitor <Unit > {
282- override fun visitRunsUuidArray ( runsUuidArray : List <String >) {}
278+ override fun visitStrings ( strings : List <String >) {}
283279
284- override fun visitRunsAnnotationQueueRunAddSchemaArray (
285- runsAnnotationQueueRunAddSchemaArray : List <AnnotationQueueRunAddSchema >
280+ override fun visitAnnotationQueueRunAddSchemas (
281+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
286282 ) {
287- runsAnnotationQueueRunAddSchemaArray .forEach { it.validate() }
283+ annotationQueueRunAddSchemas .forEach { it.validate() }
288284 }
289285 }
290286 )
@@ -309,12 +305,11 @@ private constructor(
309305 internal fun validity (): Int =
310306 accept(
311307 object : Visitor <Int > {
312- override fun visitRunsUuidArray (runsUuidArray : List <String >) =
313- runsUuidArray.size
308+ override fun visitStrings (strings : List <String >) = strings.size
314309
315- override fun visitRunsAnnotationQueueRunAddSchemaArray (
316- runsAnnotationQueueRunAddSchemaArray : List <AnnotationQueueRunAddSchema >
317- ) = runsAnnotationQueueRunAddSchemaArray .sumOf { it.validity().toInt() }
310+ override fun visitAnnotationQueueRunAddSchemas (
311+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
312+ ) = annotationQueueRunAddSchemas .sumOf { it.validity().toInt() }
318313
319314 override fun unknown (json : JsonValue ? ) = 0
320315 }
@@ -326,45 +321,38 @@ private constructor(
326321 }
327322
328323 return other is Body &&
329- runsUuidArray == other.runsUuidArray &&
330- runsAnnotationQueueRunAddSchemaArray == other.runsAnnotationQueueRunAddSchemaArray
324+ strings == other.strings &&
325+ annotationQueueRunAddSchemas == other.annotationQueueRunAddSchemas
331326 }
332327
333- override fun hashCode (): Int =
334- Objects .hash(runsUuidArray, runsAnnotationQueueRunAddSchemaArray)
328+ override fun hashCode (): Int = Objects .hash(strings, annotationQueueRunAddSchemas)
335329
336330 override fun toString (): String =
337331 when {
338- runsUuidArray != null -> " Body{runsUuidArray= $runsUuidArray }"
339- runsAnnotationQueueRunAddSchemaArray != null ->
340- " Body{runsAnnotationQueueRunAddSchemaArray= $runsAnnotationQueueRunAddSchemaArray }"
332+ strings != null -> " Body{strings= $strings }"
333+ annotationQueueRunAddSchemas != null ->
334+ " Body{annotationQueueRunAddSchemas= $annotationQueueRunAddSchemas }"
341335 _json != null -> " Body{_unknown=$_json }"
342336 else -> throw IllegalStateException (" Invalid Body" )
343337 }
344338
345339 companion object {
346340
347- @JvmStatic
348- fun ofRunsUuidArray (runsUuidArray : List <String >) =
349- Body (runsUuidArray = runsUuidArray.toImmutable())
341+ @JvmStatic fun ofStrings (strings : List <String >) = Body (strings = strings.toImmutable())
350342
351343 @JvmStatic
352- fun ofRunsAnnotationQueueRunAddSchemaArray (
353- runsAnnotationQueueRunAddSchemaArray : List <AnnotationQueueRunAddSchema >
354- ) =
355- Body (
356- runsAnnotationQueueRunAddSchemaArray =
357- runsAnnotationQueueRunAddSchemaArray.toImmutable()
358- )
344+ fun ofAnnotationQueueRunAddSchemas (
345+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
346+ ) = Body (annotationQueueRunAddSchemas = annotationQueueRunAddSchemas.toImmutable())
359347 }
360348
361349 /* * An interface that defines how to map each variant of [Body] to a value of type [T]. */
362350 interface Visitor <out T > {
363351
364- fun visitRunsUuidArray ( runsUuidArray : List <String >): T
352+ fun visitStrings ( strings : List <String >): T
365353
366- fun visitRunsAnnotationQueueRunAddSchemaArray (
367- runsAnnotationQueueRunAddSchemaArray : List <AnnotationQueueRunAddSchema >
354+ fun visitAnnotationQueueRunAddSchemas (
355+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
368356 ): T
369357
370358 /* *
@@ -389,15 +377,13 @@ private constructor(
389377 val bestMatches =
390378 sequenceOf(
391379 tryDeserialize(node, jacksonTypeRef<List <String >>())?.let {
392- Body (runsUuidArray = it, _json = json)
380+ Body (strings = it, _json = json)
393381 },
394382 tryDeserialize(
395383 node,
396384 jacksonTypeRef<List <AnnotationQueueRunAddSchema >>(),
397385 )
398- ?.let {
399- Body (runsAnnotationQueueRunAddSchemaArray = it, _json = json)
400- },
386+ ?.let { Body (annotationQueueRunAddSchemas = it, _json = json) },
401387 )
402388 .filterNotNull()
403389 .allMaxBy { it.validity() }
@@ -423,9 +409,9 @@ private constructor(
423409 provider : SerializerProvider ,
424410 ) {
425411 when {
426- value.runsUuidArray != null -> generator.writeObject(value.runsUuidArray )
427- value.runsAnnotationQueueRunAddSchemaArray != null ->
428- generator.writeObject(value.runsAnnotationQueueRunAddSchemaArray )
412+ value.strings != null -> generator.writeObject(value.strings )
413+ value.annotationQueueRunAddSchemas != null ->
414+ generator.writeObject(value.annotationQueueRunAddSchemas )
429415 value._json != null -> generator.writeObject(value._json )
430416 else -> throw IllegalStateException (" Invalid Body" )
431417 }
0 commit comments