@@ -91,12 +91,16 @@ private constructor(
9191
9292 fun body (body : Body ) = apply { this .body = body }
9393
94- /* * Alias for calling [body] with `Body.ofRunIdList(runIdList )`. */
95- fun bodyOfRunIdList ( runIdList : List <String >) = body(Body .ofRunIdList(runIdList ))
94+ /* * Alias for calling [body] with `Body.ofStrings(strings )`. */
95+ fun bodyOfStrings ( strings : List <String >) = body(Body .ofStrings(strings ))
9696
97- /* * Alias for calling [body] with `Body.ofRunAddObjects(runAddObjects)`. */
98- fun bodyOfRunAddObjects (runAddObjects : List <Body .AnnotationQueueRunAddSchema >) =
99- body(Body .ofRunAddObjects(runAddObjects))
97+ /* *
98+ * Alias for calling [body] with
99+ * `Body.ofAnnotationQueueRunAddSchemas(annotationQueueRunAddSchemas)`.
100+ */
101+ fun bodyOfAnnotationQueueRunAddSchemas (
102+ annotationQueueRunAddSchemas : List <Body .AnnotationQueueRunAddSchema >
103+ ) = body(Body .ofAnnotationQueueRunAddSchemas(annotationQueueRunAddSchemas))
100104
101105 fun additionalHeaders (additionalHeaders : Headers ) = apply {
102106 this .additionalHeaders.clear()
@@ -233,31 +237,32 @@ private constructor(
233237 @JsonSerialize(using = Body .Serializer ::class )
234238 class Body
235239 private constructor (
236- private val runIdList : List <String >? = null ,
237- private val runAddObjects : List <AnnotationQueueRunAddSchema >? = null ,
240+ private val strings : List <String >? = null ,
241+ private val annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >? = null ,
238242 private val _json : JsonValue ? = null ,
239243 ) {
240244
241- fun runIdList (): Optional <List <String >> = Optional .ofNullable(runIdList )
245+ fun strings (): Optional <List <String >> = Optional .ofNullable(strings )
242246
243- fun runAddObjects (): Optional <List <AnnotationQueueRunAddSchema >> =
244- Optional .ofNullable(runAddObjects )
247+ fun annotationQueueRunAddSchemas (): Optional <List <AnnotationQueueRunAddSchema >> =
248+ Optional .ofNullable(annotationQueueRunAddSchemas )
245249
246- fun isRunIdList (): Boolean = runIdList != null
250+ fun isStrings (): Boolean = strings != null
247251
248- fun isRunAddObjects (): Boolean = runAddObjects != null
252+ fun isAnnotationQueueRunAddSchemas (): Boolean = annotationQueueRunAddSchemas != null
249253
250- fun asRunIdList (): List <String > = runIdList .getOrThrow(" runIdList " )
254+ fun asStrings (): List <String > = strings .getOrThrow(" strings " )
251255
252- fun asRunAddObjects (): List <AnnotationQueueRunAddSchema > =
253- runAddObjects .getOrThrow(" runAddObjects " )
256+ fun asAnnotationQueueRunAddSchemas (): List <AnnotationQueueRunAddSchema > =
257+ annotationQueueRunAddSchemas .getOrThrow(" annotationQueueRunAddSchemas " )
254258
255259 fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
256260
257261 fun <T > accept (visitor : Visitor <T >): T =
258262 when {
259- runIdList != null -> visitor.visitRunIdList(runIdList)
260- runAddObjects != null -> visitor.visitRunAddObjects(runAddObjects)
263+ strings != null -> visitor.visitStrings(strings)
264+ annotationQueueRunAddSchemas != null ->
265+ visitor.visitAnnotationQueueRunAddSchemas(annotationQueueRunAddSchemas)
261266 else -> visitor.unknown(_json )
262267 }
263268
@@ -270,12 +275,12 @@ private constructor(
270275
271276 accept(
272277 object : Visitor <Unit > {
273- override fun visitRunIdList ( runIdList : List <String >) {}
278+ override fun visitStrings ( strings : List <String >) {}
274279
275- override fun visitRunAddObjects (
276- runAddObjects : List <AnnotationQueueRunAddSchema >
280+ override fun visitAnnotationQueueRunAddSchemas (
281+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
277282 ) {
278- runAddObjects .forEach { it.validate() }
283+ annotationQueueRunAddSchemas .forEach { it.validate() }
279284 }
280285 }
281286 )
@@ -300,11 +305,11 @@ private constructor(
300305 internal fun validity (): Int =
301306 accept(
302307 object : Visitor <Int > {
303- override fun visitRunIdList ( runIdList : List <String >) = runIdList .size
308+ override fun visitStrings ( strings : List <String >) = strings .size
304309
305- override fun visitRunAddObjects (
306- runAddObjects : List <AnnotationQueueRunAddSchema >
307- ) = runAddObjects .sumOf { it.validity().toInt() }
310+ override fun visitAnnotationQueueRunAddSchemas (
311+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
312+ ) = annotationQueueRunAddSchemas .sumOf { it.validity().toInt() }
308313
309314 override fun unknown (json : JsonValue ? ) = 0
310315 }
@@ -316,36 +321,39 @@ private constructor(
316321 }
317322
318323 return other is Body &&
319- runIdList == other.runIdList &&
320- runAddObjects == other.runAddObjects
324+ strings == other.strings &&
325+ annotationQueueRunAddSchemas == other.annotationQueueRunAddSchemas
321326 }
322327
323- override fun hashCode (): Int = Objects .hash(runIdList, runAddObjects )
328+ override fun hashCode (): Int = Objects .hash(strings, annotationQueueRunAddSchemas )
324329
325330 override fun toString (): String =
326331 when {
327- runIdList != null -> " Body{runIdList=$runIdList }"
328- runAddObjects != null -> " Body{runAddObjects=$runAddObjects }"
332+ strings != null -> " Body{strings=$strings }"
333+ annotationQueueRunAddSchemas != null ->
334+ " Body{annotationQueueRunAddSchemas=$annotationQueueRunAddSchemas }"
329335 _json != null -> " Body{_unknown=$_json }"
330336 else -> throw IllegalStateException (" Invalid Body" )
331337 }
332338
333339 companion object {
334340
335- @JvmStatic
336- fun ofRunIdList (runIdList : List <String >) = Body (runIdList = runIdList.toImmutable())
341+ @JvmStatic fun ofStrings (strings : List <String >) = Body (strings = strings.toImmutable())
337342
338343 @JvmStatic
339- fun ofRunAddObjects (runAddObjects : List <AnnotationQueueRunAddSchema >) =
340- Body (runAddObjects = runAddObjects.toImmutable())
344+ fun ofAnnotationQueueRunAddSchemas (
345+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
346+ ) = Body (annotationQueueRunAddSchemas = annotationQueueRunAddSchemas.toImmutable())
341347 }
342348
343349 /* * An interface that defines how to map each variant of [Body] to a value of type [T]. */
344350 interface Visitor <out T > {
345351
346- fun visitRunIdList ( runIdList : List <String >): T
352+ fun visitStrings ( strings : List <String >): T
347353
348- fun visitRunAddObjects (runAddObjects : List <AnnotationQueueRunAddSchema >): T
354+ fun visitAnnotationQueueRunAddSchemas (
355+ annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
356+ ): T
349357
350358 /* *
351359 * Maps an unknown variant of [Body] to a value of type [T].
@@ -369,13 +377,13 @@ private constructor(
369377 val bestMatches =
370378 sequenceOf(
371379 tryDeserialize(node, jacksonTypeRef<List <String >>())?.let {
372- Body (runIdList = it, _json = json)
380+ Body (strings = it, _json = json)
373381 },
374382 tryDeserialize(
375383 node,
376384 jacksonTypeRef<List <AnnotationQueueRunAddSchema >>(),
377385 )
378- ?.let { Body (runAddObjects = it, _json = json) },
386+ ?.let { Body (annotationQueueRunAddSchemas = it, _json = json) },
379387 )
380388 .filterNotNull()
381389 .allMaxBy { it.validity() }
@@ -401,8 +409,9 @@ private constructor(
401409 provider : SerializerProvider ,
402410 ) {
403411 when {
404- value.runIdList != null -> generator.writeObject(value.runIdList)
405- value.runAddObjects != null -> generator.writeObject(value.runAddObjects)
412+ value.strings != null -> generator.writeObject(value.strings)
413+ value.annotationQueueRunAddSchemas != null ->
414+ generator.writeObject(value.annotationQueueRunAddSchemas)
406415 value._json != null -> generator.writeObject(value._json )
407416 else -> throw IllegalStateException (" Invalid Body" )
408417 }
0 commit comments