@@ -91,16 +91,12 @@ private constructor(
9191
9292 fun body (body : Body ) = apply { this .body = body }
9393
94- /* * Alias for calling [body] with `Body.ofStrings(strings )`. */
95- fun bodyOfStrings ( strings : List <String >) = body(Body .ofStrings(strings ))
94+ /* * Alias for calling [body] with `Body.ofRunIdList(runIdList )`. */
95+ fun bodyOfRunIdList ( runIdList : List <String >) = body(Body .ofRunIdList(runIdList ))
9696
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))
97+ /* * Alias for calling [body] with `Body.ofRunAddObjects(runAddObjects)`. */
98+ fun bodyOfRunAddObjects (runAddObjects : List <Body .AnnotationQueueRunAddSchema >) =
99+ body(Body .ofRunAddObjects(runAddObjects))
104100
105101 fun additionalHeaders (additionalHeaders : Headers ) = apply {
106102 this .additionalHeaders.clear()
@@ -237,32 +233,31 @@ private constructor(
237233 @JsonSerialize(using = Body .Serializer ::class )
238234 class Body
239235 private constructor (
240- private val strings : List <String >? = null ,
241- private val annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >? = null ,
236+ private val runIdList : List <String >? = null ,
237+ private val runAddObjects : List <AnnotationQueueRunAddSchema >? = null ,
242238 private val _json : JsonValue ? = null ,
243239 ) {
244240
245- fun strings (): Optional <List <String >> = Optional .ofNullable(strings )
241+ fun runIdList (): Optional <List <String >> = Optional .ofNullable(runIdList )
246242
247- fun annotationQueueRunAddSchemas (): Optional <List <AnnotationQueueRunAddSchema >> =
248- Optional .ofNullable(annotationQueueRunAddSchemas )
243+ fun runAddObjects (): Optional <List <AnnotationQueueRunAddSchema >> =
244+ Optional .ofNullable(runAddObjects )
249245
250- fun isStrings (): Boolean = strings != null
246+ fun isRunIdList (): Boolean = runIdList != null
251247
252- fun isAnnotationQueueRunAddSchemas (): Boolean = annotationQueueRunAddSchemas != null
248+ fun isRunAddObjects (): Boolean = runAddObjects != null
253249
254- fun asStrings (): List <String > = strings .getOrThrow(" strings " )
250+ fun asRunIdList (): List <String > = runIdList .getOrThrow(" runIdList " )
255251
256- fun asAnnotationQueueRunAddSchemas (): List <AnnotationQueueRunAddSchema > =
257- annotationQueueRunAddSchemas .getOrThrow(" annotationQueueRunAddSchemas " )
252+ fun asRunAddObjects (): List <AnnotationQueueRunAddSchema > =
253+ runAddObjects .getOrThrow(" runAddObjects " )
258254
259255 fun _json (): Optional <JsonValue > = Optional .ofNullable(_json )
260256
261257 fun <T > accept (visitor : Visitor <T >): T =
262258 when {
263- strings != null -> visitor.visitStrings(strings)
264- annotationQueueRunAddSchemas != null ->
265- visitor.visitAnnotationQueueRunAddSchemas(annotationQueueRunAddSchemas)
259+ runIdList != null -> visitor.visitRunIdList(runIdList)
260+ runAddObjects != null -> visitor.visitRunAddObjects(runAddObjects)
266261 else -> visitor.unknown(_json )
267262 }
268263
@@ -275,12 +270,12 @@ private constructor(
275270
276271 accept(
277272 object : Visitor <Unit > {
278- override fun visitStrings ( strings : List <String >) {}
273+ override fun visitRunIdList ( runIdList : List <String >) {}
279274
280- override fun visitAnnotationQueueRunAddSchemas (
281- annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
275+ override fun visitRunAddObjects (
276+ runAddObjects : List <AnnotationQueueRunAddSchema >
282277 ) {
283- annotationQueueRunAddSchemas .forEach { it.validate() }
278+ runAddObjects .forEach { it.validate() }
284279 }
285280 }
286281 )
@@ -305,11 +300,11 @@ private constructor(
305300 internal fun validity (): Int =
306301 accept(
307302 object : Visitor <Int > {
308- override fun visitStrings ( strings : List <String >) = strings .size
303+ override fun visitRunIdList ( runIdList : List <String >) = runIdList .size
309304
310- override fun visitAnnotationQueueRunAddSchemas (
311- annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
312- ) = annotationQueueRunAddSchemas .sumOf { it.validity().toInt() }
305+ override fun visitRunAddObjects (
306+ runAddObjects : List <AnnotationQueueRunAddSchema >
307+ ) = runAddObjects .sumOf { it.validity().toInt() }
313308
314309 override fun unknown (json : JsonValue ? ) = 0
315310 }
@@ -321,39 +316,36 @@ private constructor(
321316 }
322317
323318 return other is Body &&
324- strings == other.strings &&
325- annotationQueueRunAddSchemas == other.annotationQueueRunAddSchemas
319+ runIdList == other.runIdList &&
320+ runAddObjects == other.runAddObjects
326321 }
327322
328- override fun hashCode (): Int = Objects .hash(strings, annotationQueueRunAddSchemas )
323+ override fun hashCode (): Int = Objects .hash(runIdList, runAddObjects )
329324
330325 override fun toString (): String =
331326 when {
332- strings != null -> " Body{strings=$strings }"
333- annotationQueueRunAddSchemas != null ->
334- " Body{annotationQueueRunAddSchemas=$annotationQueueRunAddSchemas }"
327+ runIdList != null -> " Body{runIdList=$runIdList }"
328+ runAddObjects != null -> " Body{runAddObjects=$runAddObjects }"
335329 _json != null -> " Body{_unknown=$_json }"
336330 else -> throw IllegalStateException (" Invalid Body" )
337331 }
338332
339333 companion object {
340334
341- @JvmStatic fun ofStrings (strings : List <String >) = Body (strings = strings.toImmutable())
335+ @JvmStatic
336+ fun ofRunIdList (runIdList : List <String >) = Body (runIdList = runIdList.toImmutable())
342337
343338 @JvmStatic
344- fun ofAnnotationQueueRunAddSchemas (
345- annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
346- ) = Body (annotationQueueRunAddSchemas = annotationQueueRunAddSchemas.toImmutable())
339+ fun ofRunAddObjects (runAddObjects : List <AnnotationQueueRunAddSchema >) =
340+ Body (runAddObjects = runAddObjects.toImmutable())
347341 }
348342
349343 /* * An interface that defines how to map each variant of [Body] to a value of type [T]. */
350344 interface Visitor <out T > {
351345
352- fun visitStrings ( strings : List <String >): T
346+ fun visitRunIdList ( runIdList : List <String >): T
353347
354- fun visitAnnotationQueueRunAddSchemas (
355- annotationQueueRunAddSchemas : List <AnnotationQueueRunAddSchema >
356- ): T
348+ fun visitRunAddObjects (runAddObjects : List <AnnotationQueueRunAddSchema >): T
357349
358350 /* *
359351 * Maps an unknown variant of [Body] to a value of type [T].
@@ -377,13 +369,13 @@ private constructor(
377369 val bestMatches =
378370 sequenceOf(
379371 tryDeserialize(node, jacksonTypeRef<List <String >>())?.let {
380- Body (strings = it, _json = json)
372+ Body (runIdList = it, _json = json)
381373 },
382374 tryDeserialize(
383375 node,
384376 jacksonTypeRef<List <AnnotationQueueRunAddSchema >>(),
385377 )
386- ?.let { Body (annotationQueueRunAddSchemas = it, _json = json) },
378+ ?.let { Body (runAddObjects = it, _json = json) },
387379 )
388380 .filterNotNull()
389381 .allMaxBy { it.validity() }
@@ -409,9 +401,8 @@ private constructor(
409401 provider : SerializerProvider ,
410402 ) {
411403 when {
412- value.strings != null -> generator.writeObject(value.strings)
413- value.annotationQueueRunAddSchemas != null ->
414- generator.writeObject(value.annotationQueueRunAddSchemas)
404+ value.runIdList != null -> generator.writeObject(value.runIdList)
405+ value.runAddObjects != null -> generator.writeObject(value.runAddObjects)
415406 value._json != null -> generator.writeObject(value._json )
416407 else -> throw IllegalStateException (" Invalid Body" )
417408 }
0 commit comments