35
35
public interface AsyncProjectService {
36
36
37
37
/**
38
- * Submits a project update request and returns a reactive {@link Mono< ProjectUpdateResponse >}
38
+ * Submits a project update request and returns a reactive {@link Mono<ProjectUpdateResponse>}
39
39
* object immediately.
40
40
* <p>
41
41
* The method implementation must be non-blocking.
@@ -65,7 +65,7 @@ public interface AsyncProjectService {
65
65
66
66
/**
67
67
* Submits an experiment update request and returns a reactive
68
- * {@link Mono< ExperimentUpdateResponse >} object immediately.
68
+ * {@link Mono<ExperimentUpdateResponse>} object immediately.
69
69
* <p>
70
70
* The method is non-blocking.
71
71
* <p>
@@ -92,7 +92,7 @@ public interface AsyncProjectService {
92
92
Mono <ExperimentUpdateResponse > update (ExperimentUpdateRequest request );
93
93
94
94
/**
95
- * Submits a project creation request and returns a {@link Mono< ProjectCreationResponse >}
95
+ * Submits a project creation request and returns a {@link Mono<ProjectCreationResponse>}
96
96
* immediately.
97
97
* <p>
98
98
* This implementation must be non-blocking.
@@ -244,8 +244,9 @@ sealed interface ProjectUpdateResponseBody permits FundingInformation, ProjectCo
244
244
245
245
}
246
246
247
- sealed interface ExperimentUpdateRequestBody permits ConfoundingVariables , ExperimentDescription ,
248
- ExperimentalGroups , ExperimentalVariables {
247
+ sealed interface ExperimentUpdateRequestBody permits ConfoundingVariableAdditions ,
248
+ ConfoundingVariableDeletions , ConfoundingVariableUpdates , ExperimentDescription ,
249
+ ExperimentalGroups , ExperimentalVariableAdditions , ExperimentalVariableDeletions {
249
250
250
251
}
251
252
@@ -331,11 +332,54 @@ record FundingInformation(String grant, String grantId) implements ProjectUpdate
331
332
* @param unit the unit of the experimental variable. Can be null if no unit is set
332
333
* @since 1.9.0
333
334
*/
334
- record ExperimentalVariable (String name , Set <String > levels , @ Nullable String unit ) {
335
+ record ExperimentalVariable (Long id , String name , Set <String > levels , @ Nullable String unit ) {
335
336
336
337
public ExperimentalVariable {
337
338
levels = Set .copyOf (levels );
338
339
}
340
+
341
+ @ Override
342
+ public Set <String > levels () {
343
+ return Set .copyOf (levels );
344
+ }
345
+ }
346
+
347
+ /**
348
+ * Information about variables that should be created
349
+ *
350
+ * @param experimentalVariables
351
+ * @since 1.9.2
352
+ */
353
+ record ExperimentalVariableAdditions (List <ExperimentalVariable > experimentalVariables ) implements
354
+ ExperimentUpdateRequestBody {
355
+
356
+ public ExperimentalVariableAdditions {
357
+ experimentalVariables = List .copyOf (experimentalVariables );
358
+ }
359
+
360
+ @ Override
361
+ public List <ExperimentalVariable > experimentalVariables () {
362
+ return List .copyOf (experimentalVariables );
363
+ }
364
+ }
365
+
366
+
367
+ /**
368
+ * Information about variables that should be deleted
369
+ *
370
+ * @param experimentalVariables
371
+ */
372
+ record ExperimentalVariableDeletions (List <ExperimentalVariable > experimentalVariables ) implements
373
+ ExperimentUpdateRequestBody {
374
+
375
+ public ExperimentalVariableDeletions {
376
+ experimentalVariables = List .copyOf (experimentalVariables );
377
+ }
378
+
379
+ @ Override
380
+ public List <ExperimentalVariable > experimentalVariables () {
381
+ return List .copyOf (experimentalVariables );
382
+ }
339
383
}
340
384
341
385
/**
@@ -345,22 +389,29 @@ record ExperimentalVariable(String name, Set<String> levels, @Nullable String un
345
389
* @since 1.9.0
346
390
*/
347
391
record ExperimentalVariables (List <ExperimentalVariable > experimentalVariables ) implements
348
- ExperimentUpdateRequestBody , ExperimentUpdateResponseBody {
392
+ ExperimentUpdateResponseBody {
393
+
349
394
350
395
public ExperimentalVariables {
351
396
experimentalVariables = List .copyOf (experimentalVariables );
352
397
}
398
+
399
+ @ Override
400
+ public List <ExperimentalVariable > experimentalVariables () {
401
+ return List .copyOf (experimentalVariables );
402
+ }
353
403
}
354
404
355
405
/**
356
406
* A level of an experimental variable
357
407
*
408
+ * @param variableId the identifier of the variable
358
409
* @param variableName the name of the variable
359
410
* @param levelValue the value of the level
360
411
* @param unit the unit for the value of the level. Can be null if no unit is set
361
412
* @since 1.9.0
362
413
*/
363
- record VariableLevel (String variableName , String levelValue , @ Nullable String unit ) {
414
+ record VariableLevel (Long variableId , String variableName , String levelValue , @ Nullable String unit ) {
364
415
365
416
}
366
417
@@ -421,17 +472,81 @@ record ExperimentDescription(String experimentName, Set<String> species, Set<Str
421
472
}
422
473
423
474
/**
424
- * A list of confounding variable information. Can be used in
475
+ * A list of confounding variable information for variable addition. Can be used in
476
+ * {@link #update(ExperimentUpdateRequest)}
477
+ *
478
+ * @param confoundingVariables the variable information
479
+ */
480
+ record ConfoundingVariableAdditions (
481
+ List <ConfoundingVariableInformation > confoundingVariables ) implements
482
+ ExperimentUpdateRequestBody {
483
+
484
+ public ConfoundingVariableAdditions {
485
+ confoundingVariables = List .copyOf (confoundingVariables );
486
+ }
487
+
488
+ @ Override
489
+ public List <ConfoundingVariableInformation > confoundingVariables () {
490
+ return List .copyOf (confoundingVariables );
491
+ }
492
+ }
493
+
494
+ /**
495
+ * A list of confounding variable information for variable update. Can be used in
496
+ * {@link #update(ExperimentUpdateRequest)}
497
+ *
498
+ * @param confoundingVariables the variable information
499
+ */
500
+ record ConfoundingVariableDeletions (
501
+ List <ConfoundingVariableInformation > confoundingVariables ) implements
502
+ ExperimentUpdateRequestBody {
503
+
504
+ public ConfoundingVariableDeletions {
505
+ confoundingVariables = List .copyOf (confoundingVariables );
506
+ }
507
+
508
+ @ Override
509
+ public List <ConfoundingVariableInformation > confoundingVariables () {
510
+ return List .copyOf (confoundingVariables );
511
+ }
512
+ }
513
+
514
+ /**
515
+ * A list of confounding variable information for variable deletion. Can be used in
425
516
* {@link #update(ExperimentUpdateRequest)}
426
517
*
427
518
* @param confoundingVariables the variable information
428
519
*/
520
+ record ConfoundingVariableUpdates (
521
+ List <ConfoundingVariableInformation > confoundingVariables ) implements
522
+ ExperimentUpdateRequestBody {
523
+
524
+ public ConfoundingVariableUpdates {
525
+ confoundingVariables = List .copyOf (confoundingVariables );
526
+ }
527
+
528
+ @ Override
529
+ public List <ConfoundingVariableInformation > confoundingVariables () {
530
+ return List .copyOf (confoundingVariables );
531
+ }
532
+ }
533
+
534
+ /**
535
+ * A list of confounding variable information.
536
+ *
537
+ * @param confoundingVariables the variable information
538
+ */
429
539
record ConfoundingVariables (List <ConfoundingVariableInformation > confoundingVariables ) implements
430
- ExperimentUpdateRequestBody , ExperimentUpdateResponseBody {
540
+ ExperimentUpdateResponseBody {
431
541
432
542
public ConfoundingVariables {
433
543
confoundingVariables = List .copyOf (confoundingVariables );
434
544
}
545
+
546
+ @ Override
547
+ public List <ConfoundingVariableInformation > confoundingVariables () {
548
+ return List .copyOf (confoundingVariables );
549
+ }
435
550
}
436
551
437
552
0 commit comments