selectors) {
return this;
}
- /**
- * Get the startOnCreation property: A boolean value that indicates if experiment should be started on creation or
- * not.
- *
- * @return the startOnCreation value.
- */
- public Boolean startOnCreation() {
- return this.startOnCreation;
- }
-
- /**
- * Set the startOnCreation property: A boolean value that indicates if experiment should be started on creation or
- * not.
- *
- * @param startOnCreation the startOnCreation value to set.
- * @return the ExperimentProperties object itself.
- */
- public ExperimentProperties withStartOnCreation(Boolean startOnCreation) {
- this.startOnCreation = startOnCreation;
- return this;
- }
-
/**
* Validates the instance.
*
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java
deleted file mode 100644
index 03dc806d31cd5..0000000000000
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.chaos.fluent.models;
-
-import com.azure.core.annotation.Immutable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/** Model that represents the result of a start Experiment operation. */
-@Immutable
-public final class ExperimentStartOperationResultInner {
- /*
- * String of the Experiment name.
- */
- @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
- private String name;
-
- /*
- * URL to retrieve the Experiment status.
- */
- @JsonProperty(value = "statusUrl", access = JsonProperty.Access.WRITE_ONLY)
- private String statusUrl;
-
- /** Creates an instance of ExperimentStartOperationResultInner class. */
- public ExperimentStartOperationResultInner() {
- }
-
- /**
- * Get the name property: String of the Experiment name.
- *
- * @return the name value.
- */
- public String name() {
- return this.name;
- }
-
- /**
- * Get the statusUrl property: URL to retrieve the Experiment status.
- *
- * @return the statusUrl value.
- */
- public String statusUrl() {
- return this.statusUrl;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- }
-}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusProperties.java
deleted file mode 100644
index cef7dca7b1fbb..0000000000000
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusProperties.java
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.chaos.fluent.models;
-
-import com.azure.core.annotation.Immutable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.time.OffsetDateTime;
-
-/** Model that represents the Experiment status properties model. */
-@Immutable
-public final class ExperimentStatusProperties {
- /*
- * String that represents the status of a Experiment.
- */
- @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
- private String status;
-
- /*
- * String that represents the created date time of a Experiment.
- */
- @JsonProperty(value = "createdDateUtc", access = JsonProperty.Access.WRITE_ONLY)
- private OffsetDateTime createdDateUtc;
-
- /*
- * String that represents the end date time of a Experiment.
- */
- @JsonProperty(value = "endDateUtc", access = JsonProperty.Access.WRITE_ONLY)
- private OffsetDateTime endDateUtc;
-
- /** Creates an instance of ExperimentStatusProperties class. */
- public ExperimentStatusProperties() {
- }
-
- /**
- * Get the status property: String that represents the status of a Experiment.
- *
- * @return the status value.
- */
- public String status() {
- return this.status;
- }
-
- /**
- * Get the createdDateUtc property: String that represents the created date time of a Experiment.
- *
- * @return the createdDateUtc value.
- */
- public OffsetDateTime createdDateUtc() {
- return this.createdDateUtc;
- }
-
- /**
- * Get the endDateUtc property: String that represents the end date time of a Experiment.
- *
- * @return the endDateUtc value.
- */
- public OffsetDateTime endDateUtc() {
- return this.endDateUtc;
- }
-
- /**
- * Validates the instance.
- *
- * @throws IllegalArgumentException thrown if the instance is not valid.
- */
- public void validate() {
- }
-}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java
new file mode 100644
index 0000000000000..3468d9ffca75f
--- /dev/null
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java
@@ -0,0 +1,187 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.chaos.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.exception.ManagementError;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The status of operation. */
+@Fluent
+public final class OperationStatusInner {
+ /*
+ * The operation Id.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /*
+ * The operation name.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * The start time of the operation.
+ */
+ @JsonProperty(value = "startTime")
+ private String startTime;
+
+ /*
+ * The end time of the operation.
+ */
+ @JsonProperty(value = "endTime")
+ private String endTime;
+
+ /*
+ * The status of the operation.
+ */
+ @JsonProperty(value = "status")
+ private String status;
+
+ /*
+ * Error response
+ *
+ * The error detail of the operation if any.
+ */
+ @JsonProperty(value = "error")
+ private ManagementError error;
+
+ /** Creates an instance of OperationStatusInner class. */
+ public OperationStatusInner() {
+ }
+
+ /**
+ * Get the id property: The operation Id.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set the id property: The operation Id.
+ *
+ * @param id the id value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get the name property: The operation name.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: The operation name.
+ *
+ * @param name the name value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the startTime property: The start time of the operation.
+ *
+ * @return the startTime value.
+ */
+ public String startTime() {
+ return this.startTime;
+ }
+
+ /**
+ * Set the startTime property: The start time of the operation.
+ *
+ * @param startTime the startTime value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withStartTime(String startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ /**
+ * Get the endTime property: The end time of the operation.
+ *
+ * @return the endTime value.
+ */
+ public String endTime() {
+ return this.endTime;
+ }
+
+ /**
+ * Set the endTime property: The end time of the operation.
+ *
+ * @param endTime the endTime value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withEndTime(String endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ /**
+ * Get the status property: The status of the operation.
+ *
+ * @return the status value.
+ */
+ public String status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status property: The status of the operation.
+ *
+ * @param status the status value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withStatus(String status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the error property: Error response
+ *
+ * The error detail of the operation if any.
+ *
+ * @return the error value.
+ */
+ public ManagementError error() {
+ return this.error;
+ }
+
+ /**
+ * Set the error property: Error response
+ *
+ *
The error detail of the operation if any.
+ *
+ * @param error the error value to set.
+ * @return the OperationStatusInner object itself.
+ */
+ public OperationStatusInner withError(ManagementError error) {
+ this.error = error;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java
index ed74ff20611a7..866e2f6186acd 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java
@@ -137,7 +137,7 @@ public ChaosManagementClientImpl buildClient() {
localSerializerAdapter,
localDefaultPollInterval,
localEnvironment,
- subscriptionId,
+ this.subscriptionId,
localEndpoint);
return client;
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java
index c07707c92a9db..cffdad3b65792 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java
@@ -26,6 +26,7 @@
import com.azure.resourcemanager.chaos.fluent.CapabilityTypesClient;
import com.azure.resourcemanager.chaos.fluent.ChaosManagementClient;
import com.azure.resourcemanager.chaos.fluent.ExperimentsClient;
+import com.azure.resourcemanager.chaos.fluent.OperationStatusesClient;
import com.azure.resourcemanager.chaos.fluent.OperationsClient;
import com.azure.resourcemanager.chaos.fluent.TargetTypesClient;
import com.azure.resourcemanager.chaos.fluent.TargetsClient;
@@ -149,6 +150,18 @@ public ExperimentsClient getExperiments() {
return this.experiments;
}
+ /** The OperationStatusesClient object to access its operations. */
+ private final OperationStatusesClient operationStatuses;
+
+ /**
+ * Gets the OperationStatusesClient object to access its operations.
+ *
+ * @return the OperationStatusesClient object.
+ */
+ public OperationStatusesClient getOperationStatuses() {
+ return this.operationStatuses;
+ }
+
/** The OperationsClient object to access its operations. */
private final OperationsClient operations;
@@ -207,10 +220,11 @@ public TargetsClient getTargets() {
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
- this.apiVersion = "2023-04-15-preview";
+ this.apiVersion = "2023-11-01";
this.capabilities = new CapabilitiesClientImpl(this);
this.capabilityTypes = new CapabilityTypesClientImpl(this);
this.experiments = new ExperimentsClientImpl(this);
+ this.operationStatuses = new OperationStatusesClientImpl(this);
this.operations = new OperationsClientImpl(this);
this.targetTypes = new TargetTypesClientImpl(this);
this.targets = new TargetsClientImpl(this);
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java
deleted file mode 100644
index ab9f6c580516b..0000000000000
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.chaos.implementation;
-
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner;
-import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult;
-
-public final class ExperimentCancelOperationResultImpl implements ExperimentCancelOperationResult {
- private ExperimentCancelOperationResultInner innerObject;
-
- private final com.azure.resourcemanager.chaos.ChaosManager serviceManager;
-
- ExperimentCancelOperationResultImpl(
- ExperimentCancelOperationResultInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- }
-
- public String name() {
- return this.innerModel().name();
- }
-
- public String statusUrl() {
- return this.innerModel().statusUrl();
- }
-
- public ExperimentCancelOperationResultInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.chaos.ChaosManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java
index abb9d17a9c4b1..9e53868c14023 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java
@@ -32,36 +32,28 @@ public String name() {
return this.innerModel().name();
}
- public String experimentId() {
- return this.innerModel().experimentId();
- }
-
- public String status() {
- return this.innerModel().status();
- }
-
public String failureReason() {
return this.innerModel().failureReason();
}
- public OffsetDateTime createdDateTime() {
- return this.innerModel().createdDateTime();
+ public OffsetDateTime lastActionAt() {
+ return this.innerModel().lastActionAt();
}
- public OffsetDateTime lastActionDateTime() {
- return this.innerModel().lastActionDateTime();
+ public ExperimentExecutionDetailsPropertiesRunInformation runInformation() {
+ return this.innerModel().runInformation();
}
- public OffsetDateTime startDateTime() {
- return this.innerModel().startDateTime();
+ public String status() {
+ return this.innerModel().status();
}
- public OffsetDateTime stopDateTime() {
- return this.innerModel().stopDateTime();
+ public OffsetDateTime startedAt() {
+ return this.innerModel().startedAt();
}
- public ExperimentExecutionDetailsPropertiesRunInformation runInformation() {
- return this.innerModel().runInformation();
+ public OffsetDateTime stoppedAt() {
+ return this.innerModel().stoppedAt();
}
public ExperimentExecutionDetailsInner innerModel() {
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStatusImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionImpl.java
similarity index 58%
rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStatusImpl.java
rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionImpl.java
index 491789a838555..6b494ead16fa5 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStatusImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionImpl.java
@@ -4,17 +4,17 @@
package com.azure.resourcemanager.chaos.implementation;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner;
-import com.azure.resourcemanager.chaos.models.ExperimentStatus;
+import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionInner;
+import com.azure.resourcemanager.chaos.models.ExperimentExecution;
import java.time.OffsetDateTime;
-public final class ExperimentStatusImpl implements ExperimentStatus {
- private ExperimentStatusInner innerObject;
+public final class ExperimentExecutionImpl implements ExperimentExecution {
+ private ExperimentExecutionInner innerObject;
private final com.azure.resourcemanager.chaos.ChaosManager serviceManager;
- ExperimentStatusImpl(
- ExperimentStatusInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
+ ExperimentExecutionImpl(
+ ExperimentExecutionInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -35,15 +35,15 @@ public String status() {
return this.innerModel().status();
}
- public OffsetDateTime createdDateUtc() {
- return this.innerModel().createdDateUtc();
+ public OffsetDateTime startedAt() {
+ return this.innerModel().startedAt();
}
- public OffsetDateTime endDateUtc() {
- return this.innerModel().endDateUtc();
+ public OffsetDateTime stoppedAt() {
+ return this.innerModel().stoppedAt();
}
- public ExperimentStatusInner innerModel() {
+ public ExperimentExecutionInner innerModel() {
return this.innerObject;
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java
index d48f0bfa66a59..25a5f5d055e05 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java
@@ -4,15 +4,13 @@
package com.azure.resourcemanager.chaos.implementation;
-import com.azure.core.http.rest.Response;
import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner;
import com.azure.resourcemanager.chaos.models.Experiment;
-import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult;
-import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult;
import com.azure.resourcemanager.chaos.models.ExperimentUpdate;
+import com.azure.resourcemanager.chaos.models.ProvisioningState;
import com.azure.resourcemanager.chaos.models.ResourceIdentity;
import com.azure.resourcemanager.chaos.models.Selector;
import com.azure.resourcemanager.chaos.models.Step;
@@ -58,6 +56,10 @@ public ResourceIdentity identity() {
return this.innerModel().identity();
}
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
public List steps() {
List inner = this.innerModel().steps();
if (inner != null) {
@@ -76,10 +78,6 @@ public List selectors() {
}
}
- public Boolean startOnCreation() {
- return this.innerModel().startOnCreation();
- }
-
public Region region() {
return Region.fromName(this.regionName());
}
@@ -116,8 +114,7 @@ public Experiment create() {
serviceManager
.serviceClient()
.getExperiments()
- .createOrUpdateWithResponse(resourceGroupName, experimentName, this.innerModel(), Context.NONE)
- .getValue();
+ .createOrUpdate(resourceGroupName, experimentName, this.innerModel(), Context.NONE);
return this;
}
@@ -126,8 +123,7 @@ public Experiment create(Context context) {
serviceManager
.serviceClient()
.getExperiments()
- .createOrUpdateWithResponse(resourceGroupName, experimentName, this.innerModel(), context)
- .getValue();
+ .createOrUpdate(resourceGroupName, experimentName, this.innerModel(), context);
return this;
}
@@ -147,8 +143,7 @@ public Experiment apply() {
serviceManager
.serviceClient()
.getExperiments()
- .updateWithResponse(resourceGroupName, experimentName, updateExperiment, Context.NONE)
- .getValue();
+ .update(resourceGroupName, experimentName, updateExperiment, Context.NONE);
return this;
}
@@ -157,8 +152,7 @@ public Experiment apply(Context context) {
serviceManager
.serviceClient()
.getExperiments()
- .updateWithResponse(resourceGroupName, experimentName, updateExperiment, context)
- .getValue();
+ .update(resourceGroupName, experimentName, updateExperiment, context);
return this;
}
@@ -189,20 +183,20 @@ public Experiment refresh(Context context) {
return this;
}
- public Response cancelWithResponse(Context context) {
- return serviceManager.experiments().cancelWithResponse(resourceGroupName, experimentName, context);
+ public void cancel() {
+ serviceManager.experiments().cancel(resourceGroupName, experimentName);
}
- public ExperimentCancelOperationResult cancel() {
- return serviceManager.experiments().cancel(resourceGroupName, experimentName);
+ public void cancel(Context context) {
+ serviceManager.experiments().cancel(resourceGroupName, experimentName, context);
}
- public Response startWithResponse(Context context) {
- return serviceManager.experiments().startWithResponse(resourceGroupName, experimentName, context);
+ public void start() {
+ serviceManager.experiments().start(resourceGroupName, experimentName);
}
- public ExperimentStartOperationResult start() {
- return serviceManager.experiments().start(resourceGroupName, experimentName);
+ public void start(Context context) {
+ serviceManager.experiments().start(resourceGroupName, experimentName, context);
}
public ExperimentImpl withRegion(Region location) {
@@ -240,11 +234,6 @@ public ExperimentImpl withIdentity(ResourceIdentity identity) {
}
}
- public ExperimentImpl withStartOnCreation(Boolean startOnCreation) {
- this.innerModel().withStartOnCreation(startOnCreation);
- return this;
- }
-
private boolean isInCreateMode() {
return this.innerModel().id() == null;
}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java
deleted file mode 100644
index 8fa3ca1fcc2c6..0000000000000
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.resourcemanager.chaos.implementation;
-
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner;
-import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult;
-
-public final class ExperimentStartOperationResultImpl implements ExperimentStartOperationResult {
- private ExperimentStartOperationResultInner innerObject;
-
- private final com.azure.resourcemanager.chaos.ChaosManager serviceManager;
-
- ExperimentStartOperationResultImpl(
- ExperimentStartOperationResultInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) {
- this.innerObject = innerObject;
- this.serviceManager = serviceManager;
- }
-
- public String name() {
- return this.innerModel().name();
- }
-
- public String statusUrl() {
- return this.innerModel().statusUrl();
- }
-
- public ExperimentStartOperationResultInner innerModel() {
- return this.innerObject;
- }
-
- private com.azure.resourcemanager.chaos.ChaosManager manager() {
- return this.serviceManager;
- }
-}
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java
index dcf3d6a39bc9f..467c951c9313c 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java
@@ -28,18 +28,20 @@
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.chaos.fluent.ExperimentsClient;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner;
+import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner;
-import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsListResult;
+import com.azure.resourcemanager.chaos.models.ExperimentExecutionListResult;
import com.azure.resourcemanager.chaos.models.ExperimentListResult;
-import com.azure.resourcemanager.chaos.models.ExperimentStatusListResult;
import com.azure.resourcemanager.chaos.models.ExperimentUpdate;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in ExperimentsClient. */
@@ -98,9 +100,9 @@ Mono> listByResourceGroup(
@Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}")
- @ExpectedResponses({200, 204})
+ @ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> delete(
+ Mono>> delete(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -126,9 +128,9 @@ Mono> getByResourceGroup(
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}")
- @ExpectedResponses({200})
+ @ExpectedResponses({200, 201})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> createOrUpdate(
+ Mono>> createOrUpdate(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -141,9 +143,9 @@ Mono> createOrUpdate(
@Headers({"Content-Type: application/json"})
@Patch(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}")
- @ExpectedResponses({200})
+ @ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> update(
+ Mono>> update(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -158,7 +160,7 @@ Mono> update(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> cancel(
+ Mono>> cancel(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -172,21 +174,7 @@ Mono> cancel(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> start(
- @HostParam("$host") String endpoint,
- @QueryParam("api-version") String apiVersion,
- @PathParam("subscriptionId") String subscriptionId,
- @PathParam("resourceGroupName") String resourceGroupName,
- @PathParam("experimentName") String experimentName,
- @HeaderParam("Accept") String accept,
- Context context);
-
- @Headers({"Content-Type: application/json"})
- @Get(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/statuses")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listAllStatuses(
+ Mono>> start(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@@ -197,45 +185,45 @@ Mono> listAllStatuses(
@Headers({"Content-Type: application/json"})
@Get(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/statuses/{statusId}")
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> getStatus(
+ Mono> listAllExecutions(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("experimentName") String experimentName,
- @PathParam("statusId") String statusId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executionDetails")
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listExecutionDetails(
+ Mono> getExecution(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("experimentName") String experimentName,
+ @PathParam("executionId") String executionId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
- @Get(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executionDetails/{executionDetailsId}")
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executions/{executionId}/getExecutionDetails")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> getExecutionDetails(
+ Mono> executionDetails(
@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("experimentName") String experimentName,
- @PathParam("executionDetailsId") String executionDetailsId,
+ @PathParam("executionId") String executionId,
@HeaderParam("Accept") String accept,
Context context);
@@ -263,17 +251,7 @@ Mono> listNext(
@Get("{nextLink}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listAllStatusesNext(
- @PathParam(value = "nextLink", encoded = true) String nextLink,
- @HostParam("$host") String endpoint,
- @HeaderParam("Accept") String accept,
- Context context);
-
- @Headers({"Content-Type: application/json"})
- @Get("{nextLink}")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(ManagementException.class)
- Mono> listExecutionDetailsNext(
+ Mono> listAllExecutionsNext(
@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept,
@@ -682,7 +660,7 @@ public PagedIterable listByResourceGroup(
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> deleteWithResponseAsync(String resourceGroupName, String experimentName) {
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -730,7 +708,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> deleteWithResponseAsync(
+ private Mono>> deleteWithResponseAsync(
String resourceGroupName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -764,6 +742,78 @@ private Mono> deleteWithResponseAsync(
context);
}
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String experimentName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String experimentName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName) {
+ return this.beginDeleteAsync(resourceGroupName, experimentName).getSyncPoller();
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String experimentName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, experimentName, context).getSyncPoller();
+ }
+
/**
* Delete a Experiment resource.
*
@@ -776,7 +826,9 @@ private Mono> deleteWithResponseAsync(
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String experimentName) {
- return deleteWithResponseAsync(resourceGroupName, experimentName).flatMap(ignored -> Mono.empty());
+ return beginDeleteAsync(resourceGroupName, experimentName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -788,11 +840,13 @@ private Mono deleteAsync(String resourceGroupName, String experimentName)
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link Response}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response deleteWithResponse(String resourceGroupName, String experimentName, Context context) {
- return deleteWithResponseAsync(resourceGroupName, experimentName, context).block();
+ private Mono deleteAsync(String resourceGroupName, String experimentName, Context context) {
+ return beginDeleteAsync(resourceGroupName, experimentName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -806,7 +860,22 @@ public Response deleteWithResponse(String resourceGroupName, String experi
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String experimentName) {
- deleteWithResponse(resourceGroupName, experimentName, Context.NONE);
+ deleteAsync(resourceGroupName, experimentName).block();
+ }
+
+ /**
+ * Delete a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String experimentName, Context context) {
+ deleteAsync(resourceGroupName, experimentName, context).block();
}
/**
@@ -964,7 +1033,7 @@ public ExperimentInner getByResourceGroup(String resourceGroupName, String exper
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> createOrUpdateWithResponseAsync(
+ private Mono>> createOrUpdateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1021,7 +1090,7 @@ private Mono> createOrUpdateWithResponseAsync(
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> createOrUpdateWithResponseAsync(
+ private Mono>> createOrUpdateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1061,6 +1130,91 @@ private Mono> createOrUpdateWithResponseAsync(
context);
}
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentInner experiment) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ExperimentInner.class,
+ ExperimentInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context);
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginCreateOrUpdate(
+ String resourceGroupName, String experimentName, ExperimentInner experiment) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment).getSyncPoller();
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginCreateOrUpdate(
+ String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment, context).getSyncPoller();
+ }
+
/**
* Create or update a Experiment resource.
*
@@ -1075,8 +1229,9 @@ private Mono> createOrUpdateWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment) {
- return createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ return beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1089,12 +1244,14 @@ private Mono createOrUpdateAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a Experiment resource along with {@link Response}.
+ * @return model that represents a Experiment resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response createOrUpdateWithResponse(
+ private Mono createOrUpdateAsync(
String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
- return createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment, context).block();
+ return beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1110,7 +1267,25 @@ public Response createOrUpdateWithResponse(
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner experiment) {
- return createOrUpdateWithResponse(resourceGroupName, experimentName, experiment, Context.NONE).getValue();
+ return createOrUpdateAsync(resourceGroupName, experimentName, experiment).block();
+ }
+
+ /**
+ * Create or update a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Experiment resource to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ExperimentInner createOrUpdate(
+ String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) {
+ return createOrUpdateAsync(resourceGroupName, experimentName, experiment, context).block();
}
/**
@@ -1126,7 +1301,7 @@ public ExperimentInner createOrUpdate(String resourceGroupName, String experimen
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> updateWithResponseAsync(
+ private Mono>> updateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1183,7 +1358,7 @@ private Mono> updateWithResponseAsync(
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> updateWithResponseAsync(
+ private Mono>> updateWithResponseAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1223,6 +1398,90 @@ private Mono> updateWithResponseAsync(
context);
}
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, experimentName, experiment);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ExperimentInner.class,
+ ExperimentInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ExperimentInner> beginUpdateAsync(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, experimentName, experiment, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context);
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginUpdate(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
+ return this.beginUpdateAsync(resourceGroupName, experimentName, experiment).getSyncPoller();
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ExperimentInner> beginUpdate(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, experimentName, experiment, context).getSyncPoller();
+ }
+
/**
* The operation to update an experiment.
*
@@ -1237,8 +1496,9 @@ private Mono> updateWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
- return updateWithResponseAsync(resourceGroupName, experimentName, experiment)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ return beginUpdateAsync(resourceGroupName, experimentName, experiment)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1251,12 +1511,14 @@ private Mono updateAsync(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a Experiment resource along with {@link Response}.
+ * @return model that represents a Experiment resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response updateWithResponse(
+ private Mono updateAsync(
String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
- return updateWithResponseAsync(resourceGroupName, experimentName, experiment, context).block();
+ return beginUpdateAsync(resourceGroupName, experimentName, experiment, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
@@ -1272,7 +1534,25 @@ public Response updateWithResponse(
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate experiment) {
- return updateWithResponse(resourceGroupName, experimentName, experiment, Context.NONE).getValue();
+ return updateAsync(resourceGroupName, experimentName, experiment).block();
+ }
+
+ /**
+ * The operation to update an experiment.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param experiment Parameters supplied to the Update experiment operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return model that represents a Experiment resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ExperimentInner update(
+ String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) {
+ return updateAsync(resourceGroupName, experimentName, experiment, context).block();
}
/**
@@ -1283,12 +1563,10 @@ public ExperimentInner update(String resourceGroupName, String experimentName, E
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> cancelWithResponseAsync(
- String resourceGroupName, String experimentName) {
+ private Mono>> cancelWithResponseAsync(String resourceGroupName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1333,11 +1611,10 @@ private Mono> cancelWithResponseA
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> cancelWithResponseAsync(
+ private Mono>> cancelWithResponseAsync(
String resourceGroupName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1379,13 +1656,15 @@ private Mono> cancelWithResponseA
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation on successful completion of {@link
- * Mono}.
+ * @return the {@link PollerFlux} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono cancelAsync(String resourceGroupName, String experimentName) {
- return cancelWithResponseAsync(resourceGroupName, experimentName)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String experimentName) {
+ Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
}
/**
@@ -1397,12 +1676,16 @@ private Mono cancelAsync(String resourceGr
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation along with {@link Response}.
+ * @return the {@link PollerFlux} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response cancelWithResponse(
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginCancelAsync(
String resourceGroupName, String experimentName, Context context) {
- return cancelWithResponseAsync(resourceGroupName, experimentName, context).block();
+ context = this.client.mergeContext(context);
+ Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
}
/**
@@ -1413,172 +1696,106 @@ public Response cancelWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a cancel Experiment operation.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- public ExperimentCancelOperationResultInner cancel(String resourceGroupName, String experimentName) {
- return cancelWithResponse(resourceGroupName, experimentName, Context.NONE).getValue();
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName) {
+ return this.beginCancelAsync(resourceGroupName, experimentName).getSyncPoller();
}
/**
- * Start a Experiment resource.
+ * Cancel a running Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> startWithResponseAsync(
- String resourceGroupName, String experimentName) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (experimentName == null) {
- return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(
- context ->
- service
- .start(
- this.client.getEndpoint(),
- this.client.getApiVersion(),
- this.client.getSubscriptionId(),
- resourceGroupName,
- experimentName,
- accept,
- context))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginCancel(
+ String resourceGroupName, String experimentName, Context context) {
+ return this.beginCancelAsync(resourceGroupName, experimentName, context).getSyncPoller();
}
/**
- * Start a Experiment resource.
+ * Cancel a running Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> startWithResponseAsync(
- String resourceGroupName, String experimentName, Context context) {
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- if (this.client.getSubscriptionId() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getSubscriptionId() is required and cannot be null."));
- }
- if (resourceGroupName == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
- }
- if (experimentName == null) {
- return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .start(
- this.client.getEndpoint(),
- this.client.getApiVersion(),
- this.client.getSubscriptionId(),
- resourceGroupName,
- experimentName,
- accept,
- context);
+ private Mono cancelAsync(String resourceGroupName, String experimentName) {
+ return beginCancelAsync(resourceGroupName, experimentName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
- * Start a Experiment resource.
+ * Cancel a running Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation on successful completion of {@link
- * Mono}.
+ * @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono startAsync(String resourceGroupName, String experimentName) {
- return startWithResponseAsync(resourceGroupName, experimentName)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ private Mono cancelAsync(String resourceGroupName, String experimentName, Context context) {
+ return beginCancelAsync(resourceGroupName, experimentName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
- * Start a Experiment resource.
+ * Cancel a running Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response startWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- return startWithResponseAsync(resourceGroupName, experimentName, context).block();
+ public void cancel(String resourceGroupName, String experimentName) {
+ cancelAsync(resourceGroupName, experimentName).block();
}
/**
- * Start a Experiment resource.
+ * Cancel a running Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents the result of a start Experiment operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public ExperimentStartOperationResultInner start(String resourceGroupName, String experimentName) {
- return startWithResponse(resourceGroupName, experimentName, Context.NONE).getValue();
+ public void cancel(String resourceGroupName, String experimentName, Context context) {
+ cancelAsync(resourceGroupName, experimentName, context).block();
}
/**
- * Get a list of statuses of a Experiment resource.
+ * Start a Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of statuses of a Experiment resource along with {@link PagedResponse} on successful completion of
- * {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listAllStatusesSinglePageAsync(
- String resourceGroupName, String experimentName) {
+ private Mono>> startWithResponseAsync(String resourceGroupName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1603,7 +1820,7 @@ private Mono> listAllStatusesSinglePageAsyn
.withContext(
context ->
service
- .listAllStatuses(
+ .start(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
@@ -1611,20 +1828,11 @@ private Mono> listAllStatusesSinglePageAsyn
experimentName,
accept,
context))
- .>map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
- * Get a list of statuses of a Experiment resource.
+ * Start a Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
@@ -1632,11 +1840,10 @@ private Mono> listAllStatusesSinglePageAsyn
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of statuses of a Experiment resource along with {@link PagedResponse} on successful completion of
- * {@link Mono}.
+ * @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listAllStatusesSinglePageAsync(
+ private Mono>> startWithResponseAsync(
String resourceGroupName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
@@ -1660,44 +1867,37 @@ private Mono> listAllStatusesSinglePageAsyn
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
- .listAllStatuses(
+ .start(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
resourceGroupName,
experimentName,
accept,
- context)
- .map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null));
+ context);
}
/**
- * Get a list of statuses of a Experiment resource.
+ * Start a Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of statuses of a Experiment resource as paginated response with {@link PagedFlux}.
+ * @return the {@link PollerFlux} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAllStatusesAsync(String resourceGroupName, String experimentName) {
- return new PagedFlux<>(
- () -> listAllStatusesSinglePageAsync(resourceGroupName, experimentName),
- nextLink -> listAllStatusesNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginStartAsync(String resourceGroupName, String experimentName) {
+ Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
}
/**
- * Get a list of statuses of a Experiment resource.
+ * Start a Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
@@ -1705,33 +1905,35 @@ private PagedFlux listAllStatusesAsync(String resourceGro
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of statuses of a Experiment resource as paginated response with {@link PagedFlux}.
+ * @return the {@link PollerFlux} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listAllStatusesAsync(
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginStartAsync(
String resourceGroupName, String experimentName, Context context) {
- return new PagedFlux<>(
- () -> listAllStatusesSinglePageAsync(resourceGroupName, experimentName, context),
- nextLink -> listAllStatusesNextSinglePageAsync(nextLink, context));
+ context = this.client.mergeContext(context);
+ Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
}
/**
- * Get a list of statuses of a Experiment resource.
+ * Start a Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of statuses of a Experiment resource as paginated response with {@link PagedIterable}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listAllStatuses(String resourceGroupName, String experimentName) {
- return new PagedIterable<>(listAllStatusesAsync(resourceGroupName, experimentName));
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginStart(String resourceGroupName, String experimentName) {
+ return this.beginStartAsync(resourceGroupName, experimentName).getSyncPoller();
}
/**
- * Get a list of statuses of a Experiment resource.
+ * Start a Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
@@ -1739,28 +1941,90 @@ public PagedIterable listAllStatuses(String resourceGroup
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of statuses of a Experiment resource as paginated response with {@link PagedIterable}.
+ * @return the {@link SyncPoller} for polling of long-running operation.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listAllStatuses(
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginStart(
String resourceGroupName, String experimentName, Context context) {
- return new PagedIterable<>(listAllStatusesAsync(resourceGroupName, experimentName, context));
+ return this.beginStartAsync(resourceGroupName, experimentName, context).getSyncPoller();
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono startAsync(String resourceGroupName, String experimentName) {
+ return beginStartAsync(resourceGroupName, experimentName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono startAsync(String resourceGroupName, String experimentName, Context context) {
+ return beginStartAsync(resourceGroupName, experimentName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
}
/**
- * Get a status of a Experiment resource.
+ * Start a Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param statusId GUID that represents a Experiment status.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a status of a Experiment resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getStatusWithResponseAsync(
- String resourceGroupName, String experimentName, String statusId) {
+ public void start(String resourceGroupName, String experimentName) {
+ startAsync(resourceGroupName, experimentName).block();
+ }
+
+ /**
+ * Start a Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void start(String resourceGroupName, String experimentName, Context context) {
+ startAsync(resourceGroupName, experimentName, context).block();
+ }
+
+ /**
+ * Get a list of executions of an Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of executions of an Experiment resource along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAllExecutionsSinglePageAsync(
+ String resourceGroupName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1780,41 +2044,46 @@ private Mono> getStatusWithResponseAsync(
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
- if (statusId == null) {
- return Mono.error(new IllegalArgumentException("Parameter statusId is required and cannot be null."));
- }
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
- .getStatus(
+ .listAllExecutions(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
resourceGroupName,
experimentName,
- statusId,
accept,
context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
- * Get a status of a Experiment resource.
+ * Get a list of executions of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param statusId GUID that represents a Experiment status.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a status of a Experiment resource along with {@link Response} on successful completion of {@link Mono}.
+ * @return a list of executions of an Experiment resource along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getStatusWithResponseAsync(
- String resourceGroupName, String experimentName, String statusId, Context context) {
+ private Mono> listAllExecutionsSinglePageAsync(
+ String resourceGroupName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1834,89 +2103,112 @@ private Mono> getStatusWithResponseAsync(
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
- if (statusId == null) {
- return Mono.error(new IllegalArgumentException("Parameter statusId is required and cannot be null."));
- }
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
- .getStatus(
+ .listAllExecutions(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
resourceGroupName,
experimentName,
- statusId,
accept,
- context);
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
}
/**
- * Get a status of a Experiment resource.
+ * Get a list of executions of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param statusId GUID that represents a Experiment status.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a status of a Experiment resource on successful completion of {@link Mono}.
+ * @return a list of executions of an Experiment resource as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono getStatusAsync(
- String resourceGroupName, String experimentName, String statusId) {
- return getStatusWithResponseAsync(resourceGroupName, experimentName, statusId)
- .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAllExecutionsAsync(
+ String resourceGroupName, String experimentName) {
+ return new PagedFlux<>(
+ () -> listAllExecutionsSinglePageAsync(resourceGroupName, experimentName),
+ nextLink -> listAllExecutionsNextSinglePageAsync(nextLink));
}
/**
- * Get a status of a Experiment resource.
+ * Get a list of executions of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param statusId GUID that represents a Experiment status.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a status of a Experiment resource along with {@link Response}.
+ * @return a list of executions of an Experiment resource as paginated response with {@link PagedFlux}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response getStatusWithResponse(
- String resourceGroupName, String experimentName, String statusId, Context context) {
- return getStatusWithResponseAsync(resourceGroupName, experimentName, statusId, context).block();
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAllExecutionsAsync(
+ String resourceGroupName, String experimentName, Context context) {
+ return new PagedFlux<>(
+ () -> listAllExecutionsSinglePageAsync(resourceGroupName, experimentName, context),
+ nextLink -> listAllExecutionsNextSinglePageAsync(nextLink, context));
}
/**
- * Get a status of a Experiment resource.
+ * Get a list of executions of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param statusId GUID that represents a Experiment status.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a status of a Experiment resource.
+ * @return a list of executions of an Experiment resource as paginated response with {@link PagedIterable}.
*/
- @ServiceMethod(returns = ReturnType.SINGLE)
- public ExperimentStatusInner getStatus(String resourceGroupName, String experimentName, String statusId) {
- return getStatusWithResponse(resourceGroupName, experimentName, statusId, Context.NONE).getValue();
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAllExecutions(String resourceGroupName, String experimentName) {
+ return new PagedIterable<>(listAllExecutionsAsync(resourceGroupName, experimentName));
}
/**
- * Get a list of execution details of a Experiment resource.
+ * Get a list of executions of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of execution details of a Experiment resource along with {@link PagedResponse} on successful
- * completion of {@link Mono}.
+ * @return a list of executions of an Experiment resource as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAllExecutions(
+ String resourceGroupName, String experimentName, Context context) {
+ return new PagedIterable<>(listAllExecutionsAsync(resourceGroupName, experimentName, context));
+ }
+
+ /**
+ * Get an execution of an Experiment resource.
+ *
+ * @param resourceGroupName String that represents an Azure resource group.
+ * @param experimentName String that represents a Experiment resource name.
+ * @param executionId GUID that represents a Experiment execution detail.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an execution of an Experiment resource along with {@link Response} on successful completion of {@link
+ * Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listExecutionDetailsSinglePageAsync(
- String resourceGroupName, String experimentName) {
+ private Mono> getExecutionWithResponseAsync(
+ String resourceGroupName, String experimentName, String executionId) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1936,46 +2228,42 @@ private Mono> listExecutionDetail
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
+ if (executionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter executionId is required and cannot be null."));
+ }
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
- .listExecutionDetails(
+ .getExecution(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
resourceGroupName,
experimentName,
+ executionId,
accept,
context))
- .>map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
- * Get a list of execution details of a Experiment resource.
+ * Get an execution of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param executionId GUID that represents a Experiment execution detail.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of execution details of a Experiment resource along with {@link PagedResponse} on successful
- * completion of {@link Mono}.
+ * @return an execution of an Experiment resource along with {@link Response} on successful completion of {@link
+ * Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listExecutionDetailsSinglePageAsync(
- String resourceGroupName, String experimentName, Context context) {
+ private Mono> getExecutionWithResponseAsync(
+ String resourceGroupName, String experimentName, String executionId, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -1995,113 +2283,90 @@ private Mono> listExecutionDetail
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
+ if (executionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter executionId is required and cannot be null."));
+ }
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
- .listExecutionDetails(
+ .getExecution(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
resourceGroupName,
experimentName,
+ executionId,
accept,
- context)
- .map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null));
+ context);
}
/**
- * Get a list of execution details of a Experiment resource.
+ * Get an execution of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param executionId GUID that represents a Experiment execution detail.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of execution details of a Experiment resource as paginated response with {@link PagedFlux}.
+ * @return an execution of an Experiment resource on successful completion of {@link Mono}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listExecutionDetailsAsync(
- String resourceGroupName, String experimentName) {
- return new PagedFlux<>(
- () -> listExecutionDetailsSinglePageAsync(resourceGroupName, experimentName),
- nextLink -> listExecutionDetailsNextSinglePageAsync(nextLink));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getExecutionAsync(
+ String resourceGroupName, String experimentName, String executionId) {
+ return getExecutionWithResponseAsync(resourceGroupName, experimentName, executionId)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
- * Get a list of execution details of a Experiment resource.
+ * Get an execution of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
+ * @param executionId GUID that represents a Experiment execution detail.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of execution details of a Experiment resource as paginated response with {@link PagedFlux}.
- */
- @ServiceMethod(returns = ReturnType.COLLECTION)
- private PagedFlux listExecutionDetailsAsync(
- String resourceGroupName, String experimentName, Context context) {
- return new PagedFlux<>(
- () -> listExecutionDetailsSinglePageAsync(resourceGroupName, experimentName, context),
- nextLink -> listExecutionDetailsNextSinglePageAsync(nextLink, context));
- }
-
- /**
- * Get a list of execution details of a Experiment resource.
- *
- * @param resourceGroupName String that represents an Azure resource group.
- * @param experimentName String that represents a Experiment resource name.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of execution details of a Experiment resource as paginated response with {@link PagedIterable}.
+ * @return an execution of an Experiment resource along with {@link Response}.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listExecutionDetails(
- String resourceGroupName, String experimentName) {
- return new PagedIterable<>(listExecutionDetailsAsync(resourceGroupName, experimentName));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getExecutionWithResponse(
+ String resourceGroupName, String experimentName, String executionId, Context context) {
+ return getExecutionWithResponseAsync(resourceGroupName, experimentName, executionId, context).block();
}
/**
- * Get a list of execution details of a Experiment resource.
+ * Get an execution of an Experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param context The context to associate with this operation.
+ * @param executionId GUID that represents a Experiment execution detail.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a list of execution details of a Experiment resource as paginated response with {@link PagedIterable}.
+ * @return an execution of an Experiment resource.
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listExecutionDetails(
- String resourceGroupName, String experimentName, Context context) {
- return new PagedIterable<>(listExecutionDetailsAsync(resourceGroupName, experimentName, context));
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ExperimentExecutionInner getExecution(String resourceGroupName, String experimentName, String executionId) {
+ return getExecutionWithResponse(resourceGroupName, experimentName, executionId, Context.NONE).getValue();
}
/**
- * Get an execution detail of a Experiment resource.
+ * Execution details of an experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param executionDetailsId GUID that represents a Experiment execution detail.
+ * @param executionId GUID that represents a Experiment execution detail.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an execution detail of a Experiment resource along with {@link Response} on successful completion of
- * {@link Mono}.
+ * @return model that represents the execution details of an Experiment along with {@link Response} on successful
+ * completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getExecutionDetailsWithResponseAsync(
- String resourceGroupName, String experimentName, String executionDetailsId) {
+ private Mono> executionDetailsWithResponseAsync(
+ String resourceGroupName, String experimentName, String executionId) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -2121,43 +2386,42 @@ private Mono> getExecutionDetailsWithR
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
- if (executionDetailsId == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter executionDetailsId is required and cannot be null."));
+ if (executionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter executionId is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
- .getExecutionDetails(
+ .executionDetails(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
resourceGroupName,
experimentName,
- executionDetailsId,
+ executionId,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
- * Get an execution detail of a Experiment resource.
+ * Execution details of an experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param executionDetailsId GUID that represents a Experiment execution detail.
+ * @param executionId GUID that represents a Experiment execution detail.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an execution detail of a Experiment resource along with {@link Response} on successful completion of
- * {@link Mono}.
+ * @return model that represents the execution details of an Experiment along with {@link Response} on successful
+ * completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> getExecutionDetailsWithResponseAsync(
- String resourceGroupName, String experimentName, String executionDetailsId, Context context) {
+ private Mono> executionDetailsWithResponseAsync(
+ String resourceGroupName, String experimentName, String executionId, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
@@ -2177,77 +2441,74 @@ private Mono> getExecutionDetailsWithR
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
- if (executionDetailsId == null) {
- return Mono
- .error(new IllegalArgumentException("Parameter executionDetailsId is required and cannot be null."));
+ if (executionId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter executionId is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
- .getExecutionDetails(
+ .executionDetails(
this.client.getEndpoint(),
this.client.getApiVersion(),
this.client.getSubscriptionId(),
resourceGroupName,
experimentName,
- executionDetailsId,
+ executionId,
accept,
context);
}
/**
- * Get an execution detail of a Experiment resource.
+ * Execution details of an experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param executionDetailsId GUID that represents a Experiment execution detail.
+ * @param executionId GUID that represents a Experiment execution detail.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an execution detail of a Experiment resource on successful completion of {@link Mono}.
+ * @return model that represents the execution details of an Experiment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono getExecutionDetailsAsync(
- String resourceGroupName, String experimentName, String executionDetailsId) {
- return getExecutionDetailsWithResponseAsync(resourceGroupName, experimentName, executionDetailsId)
+ private Mono executionDetailsAsync(
+ String resourceGroupName, String experimentName, String executionId) {
+ return executionDetailsWithResponseAsync(resourceGroupName, experimentName, executionId)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
- * Get an execution detail of a Experiment resource.
+ * Execution details of an experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param executionDetailsId GUID that represents a Experiment execution detail.
+ * @param executionId GUID that represents a Experiment execution detail.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an execution detail of a Experiment resource along with {@link Response}.
+ * @return model that represents the execution details of an Experiment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getExecutionDetailsWithResponse(
- String resourceGroupName, String experimentName, String executionDetailsId, Context context) {
- return getExecutionDetailsWithResponseAsync(resourceGroupName, experimentName, executionDetailsId, context)
- .block();
+ public Response executionDetailsWithResponse(
+ String resourceGroupName, String experimentName, String executionId, Context context) {
+ return executionDetailsWithResponseAsync(resourceGroupName, experimentName, executionId, context).block();
}
/**
- * Get an execution detail of a Experiment resource.
+ * Execution details of an experiment resource.
*
* @param resourceGroupName String that represents an Azure resource group.
* @param experimentName String that represents a Experiment resource name.
- * @param executionDetailsId GUID that represents a Experiment execution detail.
+ * @param executionId GUID that represents a Experiment execution detail.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return an execution detail of a Experiment resource.
+ * @return model that represents the execution details of an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public ExperimentExecutionDetailsInner getExecutionDetails(
- String resourceGroupName, String experimentName, String executionDetailsId) {
- return getExecutionDetailsWithResponse(resourceGroupName, experimentName, executionDetailsId, Context.NONE)
- .getValue();
+ public ExperimentExecutionDetailsInner executionDetails(
+ String resourceGroupName, String experimentName, String executionId) {
+ return executionDetailsWithResponse(resourceGroupName, experimentName, executionId, Context.NONE).getValue();
}
/**
@@ -2408,88 +2669,11 @@ private Mono> listNextSinglePageAsync(String next
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a list of Experiment statuses and a link for pagination along with {@link
- * PagedResponse} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listAllStatusesNextSinglePageAsync(String nextLink) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- return FluxUtil
- .withContext(context -> service.listAllStatusesNext(nextLink, this.client.getEndpoint(), accept, context))
- .>map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null))
- .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
- }
-
- /**
- * Get the next page of items.
- *
- * @param nextLink The URL to get the next list of items
- * The nextLink parameter.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a list of Experiment statuses and a link for pagination along with {@link
- * PagedResponse} on successful completion of {@link Mono}.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listAllStatusesNextSinglePageAsync(
- String nextLink, Context context) {
- if (nextLink == null) {
- return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
- }
- if (this.client.getEndpoint() == null) {
- return Mono
- .error(
- new IllegalArgumentException(
- "Parameter this.client.getEndpoint() is required and cannot be null."));
- }
- final String accept = "application/json";
- context = this.client.mergeContext(context);
- return service
- .listAllStatusesNext(nextLink, this.client.getEndpoint(), accept, context)
- .map(
- res ->
- new PagedResponseBase<>(
- res.getRequest(),
- res.getStatusCode(),
- res.getHeaders(),
- res.getValue().value(),
- res.getValue().nextLink(),
- null));
- }
-
- /**
- * Get the next page of items.
- *
- * @param nextLink The URL to get the next list of items
- * The nextLink parameter.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws ManagementException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a list of Experiment execution details and a link for pagination along with {@link
+ * @return model that represents a list of Experiment executions and a link for pagination along with {@link
* PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listExecutionDetailsNextSinglePageAsync(
- String nextLink) {
+ private Mono> listAllExecutionsNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
@@ -2501,9 +2685,8 @@ private Mono> listExecutionDetail
}
final String accept = "application/json";
return FluxUtil
- .withContext(
- context -> service.listExecutionDetailsNext(nextLink, this.client.getEndpoint(), accept, context))
- .>map(
+ .withContext(context -> service.listAllExecutionsNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
@@ -2524,11 +2707,11 @@ private Mono> listExecutionDetail
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return model that represents a list of Experiment execution details and a link for pagination along with {@link
+ * @return model that represents a list of Experiment executions and a link for pagination along with {@link
* PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- private Mono> listExecutionDetailsNextSinglePageAsync(
+ private Mono> listAllExecutionsNextSinglePageAsync(
String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
@@ -2542,7 +2725,7 @@ private Mono> listExecutionDetail
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
- .listExecutionDetailsNext(nextLink, this.client.getEndpoint(), accept, context)
+ .listAllExecutionsNext(nextLink, this.client.getEndpoint(), accept, context)
.map(
res ->
new PagedResponseBase<>(
diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java
index 66d80202a470f..cc81637e23b15 100644
--- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java
+++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java
@@ -10,16 +10,12 @@
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.chaos.fluent.ExperimentsClient;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner;
+import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionInner;
import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner;
-import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner;
import com.azure.resourcemanager.chaos.models.Experiment;
-import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult;
+import com.azure.resourcemanager.chaos.models.ExperimentExecution;
import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetails;
-import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult;
-import com.azure.resourcemanager.chaos.models.ExperimentStatus;
import com.azure.resourcemanager.chaos.models.Experiments;
public final class ExperimentsImpl implements Experiments {
@@ -56,15 +52,14 @@ public PagedIterable listByResourceGroup(
return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager()));
}
- public Response deleteByResourceGroupWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- return this.serviceClient().deleteWithResponse(resourceGroupName, experimentName, context);
- }
-
public void deleteByResourceGroup(String resourceGroupName, String experimentName) {
this.serviceClient().delete(resourceGroupName, experimentName);
}
+ public void delete(String resourceGroupName, String experimentName, Context context) {
+ this.serviceClient().delete(resourceGroupName, experimentName, context);
+ }
+
public Response getByResourceGroupWithResponse(
String resourceGroupName, String experimentName, Context context) {
Response inner =
@@ -89,111 +84,64 @@ public Experiment getByResourceGroup(String resourceGroupName, String experiment
}
}
- public Response cancelWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- Response inner =
- this.serviceClient().cancelWithResponse(resourceGroupName, experimentName, context);
- if (inner != null) {
- return new SimpleResponse<>(
- inner.getRequest(),
- inner.getStatusCode(),
- inner.getHeaders(),
- new ExperimentCancelOperationResultImpl(inner.getValue(), this.manager()));
- } else {
- return null;
- }
+ public void cancel(String resourceGroupName, String experimentName) {
+ this.serviceClient().cancel(resourceGroupName, experimentName);
}
- public ExperimentCancelOperationResult cancel(String resourceGroupName, String experimentName) {
- ExperimentCancelOperationResultInner inner = this.serviceClient().cancel(resourceGroupName, experimentName);
- if (inner != null) {
- return new ExperimentCancelOperationResultImpl(inner, this.manager());
- } else {
- return null;
- }
+ public void cancel(String resourceGroupName, String experimentName, Context context) {
+ this.serviceClient().cancel(resourceGroupName, experimentName, context);
}
- public Response startWithResponse(
- String resourceGroupName, String experimentName, Context context) {
- Response inner =
- this.serviceClient().startWithResponse(resourceGroupName, experimentName, context);
- if (inner != null) {
- return new SimpleResponse<>(
- inner.getRequest(),
- inner.getStatusCode(),
- inner.getHeaders(),
- new ExperimentStartOperationResultImpl(inner.getValue(), this.manager()));
- } else {
- return null;
- }
+ public void start(String resourceGroupName, String experimentName) {
+ this.serviceClient().start(resourceGroupName, experimentName);
}
- public ExperimentStartOperationResult start(String resourceGroupName, String experimentName) {
- ExperimentStartOperationResultInner inner = this.serviceClient().start(resourceGroupName, experimentName);
- if (inner != null) {
- return new ExperimentStartOperationResultImpl(inner, this.manager());
- } else {
- return null;
- }
+ public void start(String resourceGroupName, String experimentName, Context context) {
+ this.serviceClient().start(resourceGroupName, experimentName, context);
}
- public PagedIterable listAllStatuses(String resourceGroupName, String experimentName) {
- PagedIterable