@@ -63,6 +63,26 @@ public interface AsyncProjectService {
63
63
*/
64
64
Mono <ExperimentalGroupCreationResponse > create (ExperimentalGroupCreationRequest request );
65
65
66
+
67
+ /**
68
+ * Requests the creation of an experiment and returns a reactive
69
+ * {@link Mono<ExperimentCreationResponse>}.
70
+ * <p>
71
+ * <b>Exceptions</b>
72
+ * <p>
73
+ * Exceptions are wrapped as {@link Mono#error(Throwable)} and are one of the types described in
74
+ * the throw section below.
75
+ *
76
+ * @param request the request containing information to create the experiment
77
+ * @return a {@link Mono<ExperimentCreationResponse>} object publishing a
78
+ * {@link ExperimentCreationResponse} on success.
79
+ * @throws UnknownRequestException if an unknown request has been used in the service call
80
+ * @throws RequestFailedException if the request was not successfully executed
81
+ * @throws AccessDeniedException if the user has insufficient rights
82
+ * @since 1.10.0
83
+ */
84
+ Mono <ExperimentCreationResponse > create (ExperimentCreationRequest request );
85
+
66
86
/**
67
87
* Submits an experimental group update request and returns a reactive
68
88
* {@link Mono<ExperimentalGroupUpdateResponse>}.
@@ -571,9 +591,9 @@ sealed interface ValidationRequestBody permits MeasurementRegistrationInformatio
571
591
*
572
592
* @since 1.9.0
573
593
*/
574
- sealed interface CacheableRequest permits ExperimentalGroupCreationRequest ,
575
- ExperimentalGroupDeletionRequest , ExperimentalGroupUpdateRequest , ExperimentUpdateRequest ,
576
- ProjectUpdateRequest , ValidationRequest {
594
+ sealed interface CacheableRequest permits ExperimentCreationRequest , ExperimentUpdateRequest ,
595
+ ExperimentalGroupCreationRequest , ExperimentalGroupDeletionRequest ,
596
+ ExperimentalGroupUpdateRequest , ProjectUpdateRequest , ValidationRequest {
577
597
578
598
/**
579
599
* Returns an ID that is unique to the request.
@@ -958,6 +978,69 @@ public String toString() {
958
978
}
959
979
}
960
980
981
+ /**
982
+ * A service request to create an experiment
983
+ *
984
+ * @param projectId the project in which to create the experiment
985
+ * @param experimentDescription the minimal required information for the experiment
986
+ * @param requestId the unique id of this request. If none exists use
987
+ * {@link ExperimentCreationRequest#ExperimentCreationRequest(String,
988
+ * ExperimentDescription)} for construction.
989
+ * @since 1.10.0
990
+ */
991
+ record ExperimentCreationRequest (String projectId , ExperimentDescription experimentDescription ,
992
+ String requestId ) implements CacheableRequest {
993
+
994
+ /**
995
+ * A service request to create an experiment
996
+ *
997
+ * @param projectId the project in which to create the experiment
998
+ * @param experimentDescription the minimal required information for the experiment
999
+ * @param requestId the unique id of this request. If none exists use
1000
+ * {@link
1001
+ * ExperimentCreationRequest#ExperimentCreationRequest(String,
1002
+ * ExperimentDescription)} for construction.
1003
+ * @since 1.10.0
1004
+ */
1005
+ public ExperimentCreationRequest {
1006
+ requireNonNull (projectId );
1007
+ requireNonNull (requestId );
1008
+ }
1009
+
1010
+ /**
1011
+ * A service request to create an experiment. Generates a request id and assinges it to this
1012
+ * request.
1013
+ *
1014
+ * @param projectId the project in which to create the experiment
1015
+ * @param experimentDescription the minimal required information for the experiment
1016
+ * @since 1.10.0
1017
+ */
1018
+ public ExperimentCreationRequest (String projectId ,
1019
+ ExperimentDescription experimentDescription ) {
1020
+ this (projectId , experimentDescription , UUID .randomUUID ().toString ());
1021
+ }
1022
+ }
1023
+
1024
+ /**
1025
+ * A service response for experiment creation.
1026
+ *
1027
+ * @param projectId the project in which the experiment was created
1028
+ * @param experimentId the identifier of the created experiment
1029
+ * @param experimentDescription information about the experiment
1030
+ * @param requestId the identifier of the original request
1031
+ * @since 1.10.0
1032
+ */
1033
+ record ExperimentCreationResponse (String projectId , String experimentId ,
1034
+ ExperimentDescription experimentDescription ,
1035
+ String requestId ) {
1036
+
1037
+ public ExperimentCreationResponse {
1038
+ requireNonNull (projectId );
1039
+ requireNonNull (requestId );
1040
+ }
1041
+ }
1042
+
1043
+
961
1044
/**
962
1045
* A service request to update an experiment
963
1046
*
0 commit comments