From d25e39140a8b777b1d5a02df3dcb3dd265e93ae6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 30 Apr 2025 10:06:28 +0000 Subject: [PATCH] CodeGen from PR 32585 in Azure/azure-rest-api-specs Merge 21400ebcbf3f9a92063d5a629c05636024d9af0c into f5671c70c93b5b6ec9734be971bfe2c8e3ad52c9 --- .../azure-developer-loadtesting/CHANGELOG.md | 267 +- .../azure-developer-loadtesting/README.md | 291 +- .../azure-developer-loadtesting/assets.json | 7 +- .../checkstyle-suppressions.xml | 8 - .../azure-developer-loadtesting/pom.xml | 11 +- .../spotbugs-exclude.xml | 16 - .../LoadTestAdministrationAsyncClient.java | 2505 +++++++-- .../LoadTestAdministrationClient.java | 2303 +++++++-- .../LoadTestAdministrationClientBuilder.java | 50 +- .../loadtesting/LoadTestRunAsyncClient.java | 2460 +++++++-- .../loadtesting/LoadTestRunClient.java | 2298 ++++++--- .../loadtesting/LoadTestRunClientBuilder.java | 50 +- .../LoadTestingServiceVersion.java | 38 +- .../developer/loadtesting/PollingUtils.java | 111 - .../implementation/JsonMergePatchHelper.java | 529 ++ .../LoadTestAdministrationClientImpl.java | 4458 ++++++++++++++++ .../LoadTestAdministrationsImpl.java | 2509 --------- ...nsImpl.java => LoadTestRunClientImpl.java} | 4538 ++++++++++------- .../implementation/LoadTestingClientImpl.java | 142 - .../models/CloneTestRequest1.java | 151 + .../implementation/models/package-info.java | 11 + .../implementation/package-info.java | 9 +- .../loadtesting/models/AggregationType.java | 123 + .../models/ArtifactsContainerInfo.java | 104 + .../loadtesting/models/AutoStopCriteria.java | 276 + .../loadtesting/models/CertificateType.java | 51 + .../loadtesting/models/CreatedByType.java | 69 + .../loadtesting/models/DailyRecurrence.java | 163 + .../loadtesting/models/DimensionFilter.java | 125 + .../loadtesting/models/DimensionValue.java | 99 + .../loadtesting/models/ErrorDetails.java | 79 + .../models/FileValidationStatus.java | 75 + .../loadtesting/models/Frequency.java | 81 + ...nFlexConsumptionResourceConfiguration.java | 183 + ...nsumptionTargetResourceConfigurations.java | 157 + .../loadtesting/models/HourlyRecurrence.java | 163 + .../loadtesting/models/LoadTest.java | 984 ++++ .../models/LoadTestConfiguration.java | 326 ++ .../loadtesting/models/LoadTestKind.java | 63 + .../loadtesting/models/LoadTestRun.java | 1029 ++++ .../models/LoadTestingAppComponent.java | 321 ++ .../models/LoadTestingFileType.java | 81 + .../LoadTestingManagedIdentityType.java | 57 + .../models/MetricAvailability.java | 82 + .../loadtesting/models/MetricDefinition.java | 226 + .../loadtesting/models/MetricDefinitions.java | 84 + .../loadtesting/models/MetricNamespace.java | 99 + .../loadtesting/models/MetricNamespaces.java | 84 + .../loadtesting/models/MetricUnit.java | 93 + .../loadtesting/models/MetricValue.java | 104 + .../loadtesting/models/MetricsFilters.java | 103 + .../models/MonthlyRecurrenceByDates.java | 212 + .../models/MonthlyRecurrenceByWeekDays.java | 249 + .../models/NameAndDescription.java | 99 + .../models/NotificationEventType.java | 69 + .../loadtesting/models/NotificationRule.java | 364 ++ .../models/NotificationScopeType.java | 51 + .../loadtesting/models/OperationKind.java | 51 + .../loadtesting/models/OperationState.java | 75 + .../loadtesting/models/OperationStatus.java | 149 + .../models/OptionalLoadTestConfiguration.java | 355 ++ .../loadtesting/models/PassFailAction.java | 57 + .../models/PassFailAggregationFunction.java | 135 + .../loadtesting/models/PassFailCriteria.java | 207 + .../loadtesting/models/PassFailMetric.java | 386 ++ .../loadtesting/models/PassFailResult.java | 63 + .../models/PassFailServerMetric.java | 415 ++ .../models/PassFailTestResult.java | 63 + .../loadtesting/models/PfMetrics.java | 75 + .../models/RecommendationCategory.java | 57 + .../loadtesting/models/Recurrence.java | 217 + .../loadtesting/models/RecurrenceEnd.java | 190 + .../loadtesting/models/RecurrenceStatus.java | 109 + .../models/RecurrenceWithCron.java | 165 + .../models/RegionalConfiguration.java | 194 + .../loadtesting/models/RequestDataLevel.java | 57 + .../loadtesting/models/ResourceKind.java | 51 + .../loadtesting/models/ResourceMetric.java | 401 ++ .../models/ScheduleTestsTrigger.java | 337 ++ .../loadtesting/models/SecretType.java | 57 + .../loadtesting/models/StateDetails.java | 80 + .../models/TargetResourceConfigurations.java | 151 + .../loadtesting/models/TestAppComponents.java | 257 + .../loadtesting/models/TestCertificate.java | 220 + .../loadtesting/models/TestFileInfo.java | 173 + .../models/TestInputArtifacts.java | 176 + .../loadtesting/models/TestProfile.java | 411 ++ .../loadtesting/models/TestProfileRun.java | 499 ++ .../models/TestProfileRunRecommendation.java | 111 + .../models/TestProfileRunStatus.java | 87 + .../models/TestRunAppComponents.java | 257 + .../loadtesting/models/TestRunArtifacts.java | 98 + .../loadtesting/models/TestRunDetail.java | 128 + .../models/TestRunEndedEventCondition.java | 192 + .../TestRunEndedNotificationEventFilter.java | 146 + .../loadtesting/models/TestRunFileInfo.java | 173 + .../models/TestRunInputArtifacts.java | 177 + .../models/TestRunOutputArtifacts.java | 137 + .../TestRunServerMetricsConfiguration.java | 255 + ...TestRunStartedNotificationEventFilter.java | 102 + .../loadtesting/models/TestRunStatistics.java | 422 ++ .../loadtesting/models/TestRunStatus.java | 141 + .../loadtesting/models/TestSecret.java | 181 + .../TestServerMetricsConfiguration.java | 256 + .../models/TestsNotificationEventFilter.java | 158 + .../models/TestsNotificationRule.java | 263 + .../loadtesting/models/TimeGrain.java | 75 + .../loadtesting/models/TimeSeriesElement.java | 104 + .../developer/loadtesting/models/Trigger.java | 425 ++ ...iggerCompletedNotificationEventFilter.java | 102 + ...riggerDisabledNotificationEventFilter.java | 102 + .../loadtesting/models/TriggerState.java | 69 + .../loadtesting/models/TriggerType.java | 51 + .../loadtesting/models/WeekDays.java | 87 + .../loadtesting/models/WeeklyRecurrence.java | 209 + .../loadtesting/models/package-info.java | 11 + .../developer/loadtesting/package-info.java | 9 +- .../src/main/java/module-info.java | 7 +- ...eloper-loadtesting_apiview_properties.json | 267 + .../src/samples/README.md | 59 - .../developer/loadtesting/HelloWorld.java | 240 - .../developer/loadtesting/ListOperations.java | 122 - .../loadtesting/ListOperationsAsync.java | 123 - .../loadtesting/LongRunningOperations.java | 149 - .../LongRunningOperationsAsync.java | 122 - .../developer/loadtesting/ReadmeSamples.java | 222 +- .../LoadTestAdministrationAsyncTests.java | 296 -- .../LoadTestAdministrationTests.java | 276 - .../loadtesting/LoadTestRunAsyncTests.java | 327 -- .../loadtesting/LoadTestRunTests.java | 304 -- .../LoadTestingClientTestBase.java | 254 - .../src/test/resources/additional-data.csv | 2 - .../src/test/resources/sample-JMX-file.jmx | 86 - .../swagger/autorest.md | 58 - .../tsp-location.yaml | 4 + 135 files changed, 32799 insertions(+), 9770 deletions(-) delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/checkstyle-suppressions.xml delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/PollingUtils.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/JsonMergePatchHelper.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java rename sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/{LoadTestRunsImpl.java => LoadTestRunClientImpl.java} (60%) delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/CloneTestRequest1.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AggregationType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ArtifactsContainerInfo.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AutoStopCriteria.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CertificateType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CreatedByType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DailyRecurrence.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionFilter.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionValue.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ErrorDetails.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FileValidationStatus.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Frequency.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionResourceConfiguration.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionTargetResourceConfigurations.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/HourlyRecurrence.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTest.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestConfiguration.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestKind.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestRun.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingAppComponent.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingFileType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingManagedIdentityType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricAvailability.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinition.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinitions.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespace.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespaces.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricUnit.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricValue.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricsFilters.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByDates.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByWeekDays.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NameAndDescription.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationEventType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationRule.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationScopeType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationKind.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationState.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationStatus.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OptionalLoadTestConfiguration.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAction.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAggregationFunction.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailCriteria.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailMetric.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailResult.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailServerMetric.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailTestResult.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PfMetrics.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecommendationCategory.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Recurrence.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceEnd.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceStatus.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceWithCron.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RegionalConfiguration.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RequestDataLevel.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceKind.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceMetric.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ScheduleTestsTrigger.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/SecretType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/StateDetails.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TargetResourceConfigurations.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestAppComponents.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestCertificate.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestFileInfo.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestInputArtifacts.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfile.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRun.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunRecommendation.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunStatus.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunAppComponents.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunArtifacts.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunDetail.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedEventCondition.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedNotificationEventFilter.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunFileInfo.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunInputArtifacts.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunOutputArtifacts.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunServerMetricsConfiguration.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStartedNotificationEventFilter.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatistics.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatus.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestSecret.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestServerMetricsConfiguration.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationEventFilter.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationRule.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeGrain.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeSeriesElement.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Trigger.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerCompletedNotificationEventFilter.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerDisabledNotificationEventFilter.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerState.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerType.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeekDays.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeeklyRecurrence.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/package-info.java create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/resources/META-INF/azure-developer-loadtesting_apiview_properties.json delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/samples/README.md delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncTests.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationTests.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunAsyncTests.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunTests.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/test/resources/additional-data.csv delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx delete mode 100644 sdk/loadtesting/azure-developer-loadtesting/swagger/autorest.md create mode 100644 sdk/loadtesting/azure-developer-loadtesting/tsp-location.yaml diff --git a/sdk/loadtesting/azure-developer-loadtesting/CHANGELOG.md b/sdk/loadtesting/azure-developer-loadtesting/CHANGELOG.md index 4a038c8ff6f7..47b2491edd32 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/CHANGELOG.md +++ b/sdk/loadtesting/azure-developer-loadtesting/CHANGELOG.md @@ -1,274 +1,13 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (Unreleased) -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.22 (2025-03-24) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.55.2` to version `1.55.3`. -- Upgraded `azure-core-http-netty` from `1.15.10` to version `1.15.11`. - - -## 1.0.21 (2025-02-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.54.1` to version `1.55.2`. -- Upgraded `azure-core-http-netty` from `1.15.7` to version `1.15.10`. - -## 1.0.20 (2025-01-20) - -### Other Changes - -- Add NOT_VALIDATED to the list of terminal states for the file validation poller. - - -## 1.0.19 (2024-12-04) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.53.0` to version `1.54.1`. -- Upgraded `azure-core-http-netty` from `1.15.5` to version `1.15.7`. - - -## 1.0.18 (2024-10-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.4` to version `1.15.5`. -- Upgraded `azure-core` from `1.52.0` to version `1.53.0`. - - -## 1.0.17 (2024-09-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.51.0` to version `1.52.0`. -- Upgraded `azure-core-http-netty` from `1.15.3` to version `1.15.4`. - - -## 1.0.16 (2024-08-24) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.2` to version `1.15.3`. -- Upgraded `azure-core` from `1.50.0` to version `1.51.0`. - - -## 1.0.15 (2024-07-26) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.1` to version `1.15.2`. -- Upgraded `azure-core` from `1.49.1` to version `1.50.0`. - - -## 1.0.14 (2024-06-27) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.15.0` to version `1.15.1`. -- Upgraded `azure-core` from `1.49.0` to version `1.49.1`. - - -## 1.0.13 (2024-05-28) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.48.0` to version `1.49.0`. -- Upgraded `azure-core-http-netty` from `1.14.2` to version `1.15.0`. - - -## 1.0.12 (2024-04-23) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.47.0` to version `1.48.0`. -- Upgraded `azure-core-http-netty` from `1.14.1` to version `1.14.2`. - - -## 1.0.11 (2024-03-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.46.0` to version `1.47.0`. -- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - - -## 1.0.10 (2024-02-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.11` to version `1.14.0`. -- Upgraded `azure-core` from `1.45.1` to version `1.46.0`. - - -## 1.0.9 (2023-12-04) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core-http-netty` from `1.13.10` to version `1.13.11`. -- Upgraded `azure-core` from `1.45.0` to version `1.45.1`. - - -## 1.0.8 (2023-11-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.44.1` to version `1.45.0`. -- Upgraded `azure-core-http-netty` from `1.13.9` to version `1.13.10`. - - -## 1.0.7 (2023-10-20) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.43.0` to version `1.44.1`. -- Upgraded `azure-core-http-netty` from `1.13.7` to version `1.13.9`. - - -## 1.0.6 (2023-09-22) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.42.0` to version `1.43.0`. -- Upgraded `azure-core-http-netty` from `1.13.6` to version `1.13.7`. - - -## 1.0.5 (2023-08-18) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.41.0` to version `1.42.0`. -- Upgraded `azure-core-http-netty` from `1.13.5` to version `1.13.6`. - -## 1.0.4 (2023-07-25) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.40.0` to version `1.41.0`. -- Upgraded `azure-core-http-netty` from `1.13.4` to version `1.13.5`. - -## 1.0.3 (2023-06-21) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.39.0` to version `1.40.0`. -- Upgraded `azure-core-http-netty` from `1.13.3` to version `1.13.4`. - -## 1.0.2 (2023-05-22) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.38.0` to version `1.39.0`. -- Upgraded `azure-core-http-netty` from `1.13.2` to version `1.13.3`. - -## 1.0.1 (2023-04-24) - -### Other Changes - -#### Dependency Updates - -- Upgraded `azure-core` from `1.37.0` to version `1.38.0`. -- Upgraded `azure-core-http-netty` from `1.13.1` to version `1.13.2`. - -## 1.0.0 (2023-03-07) - -- First stable release of Azure Load Testing client library for Java - -### Breaking Changes - -- Reintroduce two client builders - `LoadTestAdministrationClientBuilder` and `LoadTestRunClientBuilder` -- Rename `metricname` parameter to `metricName` in `LoadTestRunClient.listMetrics` -- Rename `LoadTestRunClient.listMetricDefinitionsWithResponse` to `LoadTestRunClient.getMetricDefinitionsWithResponse` -- Rename `LoadTestRunClient.listMetricNamespacesWithResponse` to `LoadTestRunClient.getMetricNamespacesWithResponse` - -### Other Changes - -- Updated samples and test cases - -## 1.0.0-beta.2 (2023-01-22) - -- Second preview release of Azure Load Testing client library for Java. +- Azure Load Testing client library for Java. This package contains Microsoft Azure Load Testing client library. ### Features Added -- Added sync and async versions of `LoadTestRunClient.listMetricNamespacesWithResponse` -- Added sync and async versions of `LoadTestRunClient.listMetricDefinitionsWithResponse` -- Added sync and async versions of `LoadTestRunClient.listMetrics` -- Added sync and async versions of `LoadTestRunClient.listMetricDimensionValues` -- Added sync and async versions of `LoadTestRunClient.createOrUpdateAppComponentWithResponse` -- Added sync and async versions of `LoadTestRunClient.getAppComponentsWithResponse` -- Added sync and async versions of `LoadTestRunClient.createOrUpdateServerMetricsConfigWithResponse` -- Added sync and async versions of `LoadTestRunClient.getServerMetricsConfigWithResponse` -- Added sync and async versions of `LoadTestAdministrationClient.beginUploadTestFile` and `LoadTestRunClient.beginTestRun` Long-Running operation - ### Breaking Changes -- There is a single builder which builds `LoadTestAdministration` and `LoadTestRun` clients, rather than a client which provides them via accessor methods previously -- Added metric namespaces and metric dimensions -- File upload now uses `application/octet-stream` instead of `multipart/form-data` -- File upload now uses file name as primary identifier instead of `fileId` -- Removed sync and async versions of `LoadTestAdministrationClient.ListSupportedResourceType` -- Removed sync and async versions of `LoadTestAdministrationClient.DeleteAppComponent` and `LoadTestAdministrationClient.DeleteAppComponentByName` -- Removed sync and async versions of `LoadTestAdministrationClient.DeleteServerMetrics` and `LoadTestAdministrationClient.DeleteServerMetricsByName` -- Removed sync and async versions of `TestRunClient.GetTestRunClientMetrics` and `TestRunClient.GetTestRunClientMetricsFilters` -- Removed sync and async versions of `TestRunClient.GetServerDefaultMetrics` +### Bugs Fixed ### Other Changes - -- README updated -- Added samples and test cases - -## 1.0.0-beta.1 (2022-10-22) - -- Initial preview release of Azure Load Testing client library for Java with single top-level `LoadTesting` client, and `LoadTestAdministration` and `TestRun` subclients. diff --git a/sdk/loadtesting/azure-developer-loadtesting/README.md b/sdk/loadtesting/azure-developer-loadtesting/README.md index 8db9930aba19..b8cc49195ef4 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/README.md +++ b/sdk/loadtesting/azure-developer-loadtesting/README.md @@ -1,16 +1,15 @@ # Azure Load Testing client library for Java -Azure Load Testing provides client library in Java to the user by which they can interact natively with Azure Load Testing service. Azure Load Testing is a fully managed load-testing service that enables you to generate high-scale load. The service simulates traffic for your applications, regardless of where they're hosted. Developers, testers, and quality assurance (QA) engineers can use it to optimize application performance, scalability, or capacity +Azure Load Testing client library for Java. -This package contains Microsoft Azure Developer LoadTesting client library. +This package contains Microsoft Azure Load Testing client library. ## Documentation Various documentation is available to help you get started -- [Source code][source_code] -- [API reference documentation][api_reference_doc] -- [Product Documentation][product_documentation] +- [API reference documentation][docs] +- [Product documentation][product_documentation] ## Getting started @@ -18,7 +17,6 @@ Various documentation is available to help you get started - [Java Development Kit (JDK)][jdk] with version 8 or above - [Azure Subscription][azure_subscription] -- Azure Load Testing resource ### Adding the package to your product @@ -27,7 +25,7 @@ Various documentation is available to help you get started com.azure azure-developer-loadtesting - 1.1.0-beta.1 + 1.0.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -36,282 +34,32 @@ Various documentation is available to help you get started [Azure Identity][azure_identity] package provides the default implementation for authenticating the client. -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. - -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. - -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. - -With above configuration, `azure` client can be authenticated by following code: - -```java java-readme-sample-auth -// ensure the user, service principal or managed identity used has Loadtesting Contributor role for the resource -TokenCredential credential = new DefaultAzureCredentialBuilder().build(); -// create client using DefaultAzureCredential -LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); -LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); - -RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); -adminClient.listTests(reqOpts); - -reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); -testRunClient.listTestRuns(reqOpts); -``` - ## Key concepts -The following components make up the Azure Load Testing service. The Azure Load Test client library for Java allows you to interact with each of these components through the use of clients. There are two top-level clients which are the main entry points for the library - -- `LoadTestingClient` - -- `LoadTestingAsyncClient` - -The two clients have similar methods in them except the methods in the async client are async as well. - -The top-level clients have two sub-clients - -- `LoadTestAdministration` - -- `TestRun` - -These sub-clients are used for managing and using different components of the service. - -### Load Test Administration Client - -The `LoadTestAdministration` sub-clients is used to administer and configure the load tests, app components and metrics. - -#### Test - -A test specifies the test script, and configuration settings for running a load test. You can create one or more tests in an Azure Load Testing resource. - -#### App Component - -When you run a load test for an Azure-hosted application, you can monitor resource metrics for the different Azure application components (server-side metrics). While the load test runs, and after completion of the test, you can monitor and analyze the resource metrics in the Azure Load Testing dashboard. - -#### Metrics - -During a load test, Azure Load Testing collects metrics about the test execution. There are two types of metrics: - -1. Client-side metrics give you details reported by the test engine. These metrics include the number of virtual users, the request response time, the number of failed requests, or the number of requests per second. - -2. Server-side metrics are available for Azure-hosted applications and provide information about your Azure application components. Metrics can be for the number of database reads, the type of HTTP responses, or container resource consumption. - -### Test Run Client - -The `TestRun` sub-clients is used to start and stop test runs corresponding to a load test. A test run represents one execution of a load test. It collects the logs associated with running the Apache JMeter script, the load test YAML configuration, the list of app components to monitor, and the results of the test. - -### Data-Plane Endpoint - -Data-plane of Azure Load Testing resources is addressable using the following URL format: - -`00000000-0000-0000-0000-000000000000.aaa.cnt-prod.loadtesting.azure.com` - -The first GUID `00000000-0000-0000-0000-000000000000` is the unique identifier used for accessing the Azure Load Testing resource. This is followed by `aaa` which is the Azure region of the resource. - -The data-plane endpoint is obtained from Control Plane APIs. - -**Example:** `1234abcd-12ab-12ab-12ab-123456abcdef.eus.cnt-prod.loadtesting.azure.com` - -In the above example, `eus` represents the Azure region `East US`. - ## Examples -### Creating a Load Test - -```java java-readme-sample-createTest -LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - -// construct Test object using nested String:Object Maps -Map testMap = new HashMap<>(); -testMap.put("displayName", "Sample Display Name"); -testMap.put("description", "Sample Description"); - -// loadTestConfig describes the number of test engines to generate load -Map loadTestConfigMap = new HashMap<>(); -loadTestConfigMap.put("engineInstances", 1); -testMap.put("loadTestConfiguration", loadTestConfigMap); - -// environmentVariables are plain-text data passed to test engines -Map envVarMap = new HashMap<>(); -envVarMap.put("a", "b"); -envVarMap.put("x", "y"); -testMap.put("environmentVariables", envVarMap); - -// secrets are secure data sent using Azure Key Vault -Map secretMap = new HashMap<>(); -Map sampleSecretMap = new HashMap<>(); -sampleSecretMap.put("value", "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827"); -sampleSecretMap.put("type", "AKV_SECRET_URI"); -secretMap.put("sampleSecret", sampleSecretMap); -testMap.put("secrets", secretMap); - -// passFailCriteria define the conditions to conclude the test as success -Map passFailMap = new HashMap<>(); -Map passFailMetrics = new HashMap<>(); -Map samplePassFailMetric = new HashMap<>(); -samplePassFailMetric.put("clientmetric", "response_time_ms"); -samplePassFailMetric.put("aggregate", "percentage"); -samplePassFailMetric.put("condition", ">"); -samplePassFailMetric.put("value", "20"); -samplePassFailMetric.put("action", "continue"); -passFailMetrics.put("fefd759d-7fe8-4f83-8b6d-aeebe0f491fe", samplePassFailMetric); -passFailMap.put("passFailMetrics", passFailMetrics); -testMap.put("passFailCriteria", passFailMap); - -// convert the object Map to JSON BinaryData -BinaryData test = BinaryData.fromObject(testMap); - -// receive response with BinaryData content -Response testOutResponse = adminClient.createOrUpdateTestWithResponse("test12345", test, null); -System.out.println(testOutResponse.getValue().toString()); +```java com.azure.developer.loadtesting.readme ``` -### Uploading .jmx file to a Load Test - -```java java-readme-sample-uploadTestFile -LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - -// extract file contents to BinaryData -BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - -// receive response with BinaryData content -PollResponse fileUrlOut = adminClient.beginUploadTestFile("test12345", "sample-file.jmx", fileData, null) - .waitForCompletion(Duration.ofMinutes(2)); -System.out.println(fileUrlOut.getValue().toString()); -``` +### Service API versions -### Running a Load Test +The client library targets the latest service API version by default. +The service client builder accepts an optional service API version parameter to specify which API version to communicate. -```java java-readme-sample-runTest -LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); +#### Select a service API version -// construct Test Run object using nested String:Object Maps -Map testRunMap = new HashMap<>(); -testRunMap.put("testId", "test12345"); -testRunMap.put("displayName", "SDK-Created-TestRun"); +You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder. +This ensures that the client can communicate with services using the specified API version. -// convert the object Map to JSON BinaryData -BinaryData testRun = BinaryData.fromObject(testRunMap); +When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version. +If there are significant differences, API calls may fail due to incompatibility. -// start test with poller -SyncPoller poller = testRunClient.beginTestRun("testrun12345", testRun, null); -Duration pollInterval = Duration.ofSeconds(5); -poller = poller.setPollInterval(pollInterval); - -// wait for test to reach terminal state -Map jsonTree = null; -String testStatus; -PollResponse pollResponse = poller.poll(); -while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // wait and check test status every 5 seconds - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); -} - -poller.waitForCompletion(); -BinaryData testRunBinary = poller.getFinalResult(); - -try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); -} catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition -} - -String startDateTime = jsonTree.get("startDateTime").toString(); -String endDateTime = jsonTree.get("endDateTime").toString(); -OffsetDateTime startOffsetDateTime = OffsetDateTime.parse(startDateTime); -OffsetDateTime endOffsetDateTime = OffsetDateTime.parse(endDateTime); - -// get list of all metric namespaces and pick the first one -Response metricNamespacesOut = testRunClient.getMetricNamespacesWithResponse("testrun12345", null); -String metricNamespace = null; -// parse JSON and read first value -try (JsonReader jsonReader = JsonProviders.createReader(metricNamespacesOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - Map namespaceMap = (Map) metricNamespaces.get(0); - metricNamespace = namespaceMap.get("name").toString(); -} catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition -} - -// get list of all metric definitions and pick the first one -Response metricDefinitionsOut = testRunClient.getMetricDefinitionsWithResponse("testrun12345", metricNamespace, null); -String metricName = null; -// parse JSON and read first value -try (JsonReader jsonReader = JsonProviders.createReader(metricDefinitionsOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - Map definitionMap = (Map) metricDefinitions.get(0); - Map nameMap = (Map) definitionMap.get("name"); - metricName = nameMap.get("value").toString(); -} catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition -} - -// fetch client metrics using metric namespace and metric name -PagedIterable clientMetricsOut = testRunClient.listMetrics("testrun12345", metricName, metricNamespace, startDateTime + '/' + endDateTime, null); -clientMetricsOut.forEach((clientMetric) -> { - System.out.println(clientMetric.toString()); -}); -``` +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. ## Troubleshooting -Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and expedite -their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help -locate the root issue. View the [logging][logging] wiki for guidance about enabling logging. - ## Next steps -Azure Loading Testing Java SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered. -See [Azure Load Testing samples][sample_code]. - ## Contributing For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). @@ -323,11 +71,8 @@ For details on contributing to this repository, see the [contributing guide](htt 1. Create new Pull Request -[source_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src -[sample_code]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples -[api_reference_doc]: https://learn.microsoft.com/rest/api/loadtesting/ -[product_documentation]: https://azure.microsoft.com/services/load-testing/ -[jdk]: https://learn.microsoft.com/java/azure/jdk/ +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-in-Azure-SDK diff --git a/sdk/loadtesting/azure-developer-loadtesting/assets.json b/sdk/loadtesting/azure-developer-loadtesting/assets.json index 034976ee2d23..6288a0d45343 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/assets.json +++ b/sdk/loadtesting/azure-developer-loadtesting/assets.json @@ -1,6 +1 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "java", - "TagPrefix": "java/loadtesting/azure-developer-loadtesting", - "Tag": "java/loadtesting/azure-developer-loadtesting_c9288cb1d7" -} +{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/loadtesting/azure-developer-loadtesting","Tag":""} \ No newline at end of file diff --git a/sdk/loadtesting/azure-developer-loadtesting/checkstyle-suppressions.xml b/sdk/loadtesting/azure-developer-loadtesting/checkstyle-suppressions.xml deleted file mode 100644 index ff9216216935..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/checkstyle-suppressions.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/sdk/loadtesting/azure-developer-loadtesting/pom.xml b/sdk/loadtesting/azure-developer-loadtesting/pom.xml index b5db2819e194..a92776be6f2c 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/pom.xml +++ b/sdk/loadtesting/azure-developer-loadtesting/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -9,7 +14,7 @@ com.azure azure-developer-loadtesting - 1.1.0-beta.1 + 1.0.0-beta.1 jar Microsoft Azure SDK for Load Testing @@ -38,10 +43,6 @@ UTF-8 - - checkstyle-suppressions.xml - false - spotbugs-exclude.xml diff --git a/sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml b/sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml deleted file mode 100644 index 36fd7768cc86..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/spotbugs-exclude.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java index 7a6f4d47dc96..5b3b6841321f 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -12,174 +13,53 @@ import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; -import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; -import java.time.Duration; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.developer.loadtesting.implementation.LoadTestAdministrationClientImpl; +import com.azure.developer.loadtesting.implementation.models.CloneTestRequest1; +import com.azure.developer.loadtesting.models.LoadTest; +import com.azure.developer.loadtesting.models.LoadTestingFileType; +import com.azure.developer.loadtesting.models.NotificationRule; +import com.azure.developer.loadtesting.models.OperationStatus; +import com.azure.developer.loadtesting.models.TestAppComponents; +import com.azure.developer.loadtesting.models.TestFileInfo; +import com.azure.developer.loadtesting.models.TestProfile; +import com.azure.developer.loadtesting.models.TestServerMetricsConfiguration; +import com.azure.developer.loadtesting.models.Trigger; +import com.azure.developer.loadtesting.models.TriggerState; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** - * Initializes a new instance of the asynchronous LoadTestingClient type. + * Initializes a new instance of the asynchronous LoadTestAdministrationClient type. */ @ServiceClient(builder = LoadTestAdministrationClientBuilder.class, isAsync = true) public final class LoadTestAdministrationAsyncClient { - - private static final ClientLogger LOGGER = new ClientLogger(LoadTestAdministrationAsyncClient.class); - @Generated - private final LoadTestAdministrationsImpl serviceClient; + private final LoadTestAdministrationClientImpl serviceClient; /** * Initializes an instance of LoadTestAdministrationAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated - LoadTestAdministrationAsyncClient(LoadTestAdministrationsImpl serviceClient) { + LoadTestAdministrationAsyncClient(LoadTestAdministrationClientImpl serviceClient) { this.serviceClient = serviceClient; } /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(testId, body, requestOptions); - } - - /** - * Uploads file and polls the validation status of the uploaded file. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param fileUploadRequestOptions The options to configure the file upload HTTP request before HTTP client sends - * it. - * @throws ResourceNotFoundException when a test with {@code testId} doesn't exist. - * @return A {@link PollerFlux} to poll on and retrieve the file info with validation status. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginUploadTestFile(String testId, String fileName, BinaryData body, - RequestOptions fileUploadRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (fileUploadRequestOptions != null) { - defaultRequestOptions.setContext(fileUploadRequestOptions.getContext()); - } - return new PollerFlux<>(Duration.ofSeconds(2), - (context) -> uploadTestFileWithResponse(testId, fileName, body, fileUploadRequestOptions) - .flatMap(FluxUtil::toMono) - .flatMap(fileBinaryData -> PollingUtils - .getPollResponseMono(() -> PollingUtils.getValidationStatus(fileBinaryData))) - .flatMap(fileValidationPollResp -> Mono.just(fileValidationPollResp.getValue())), - (context) -> getTestFileWithResponse(testId, fileName, defaultRequestOptions).flatMap(FluxUtil::toMono) - .flatMap(fileBinaryData -> PollingUtils - .getPollResponseMono(() -> PollingUtils.getValidationStatus(fileBinaryData))), - (activationResponse, context) -> Mono - .error(LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported"))), - (context) -> getTestFileWithResponse(testId, fileName, defaultRequestOptions).flatMap(FluxUtil::toMono)); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestFiles(String testId, RequestOptions requestOptions) { - return this.serviceClient.listTestFilesAsync(testId, requestOptions); - } - - /** - * Create a new test or update an existing test. + * Create a new test or update an existing test by providing the test Id. *

Request Body Schema

* *
@@ -189,7 +69,7 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -198,6 +78,25 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -219,16 +118,25 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
+     *     baselineTestRunId: String (Optional)
      *     inputArtifacts (Optional): {
      *         configFileInfo (Optional): {
+     *             fileName: String (Required)
      *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *             expireDateTime: OffsetDateTime (Optional)
      *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *             validationFailureDetails: String (Optional)
@@ -236,16 +144,25 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *         additionalFileInfo (Optional): [
      *             (recursive schema, see above)
      *         ]
      *     }
-     *     testId: String (Optional)
+     *     testId: String (Required)
      *     description: String (Optional)
      *     displayName: String (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
      *     keyvaultReferenceIdentityType: String (Optional)
      *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -263,7 +180,7 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -272,6 +189,25 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -293,16 +229,25 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
+     *     baselineTestRunId: String (Optional)
      *     inputArtifacts (Optional): {
      *         configFileInfo (Optional): {
+     *             fileName: String (Required)
      *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *             expireDateTime: OffsetDateTime (Optional)
      *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *             validationFailureDetails: String (Optional)
@@ -310,16 +255,25 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *         additionalFileInfo (Optional): [
      *             (recursive schema, see above)
      *         ]
      *     }
-     *     testId: String (Optional)
+     *     testId: String (Required)
      *     description: String (Optional)
      *     displayName: String (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
      *     keyvaultReferenceIdentityType: String (Optional)
      *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -327,10 +281,10 @@ public PagedFlux listTestFiles(String testId, RequestOptions request
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Load test model. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -346,91 +300,122 @@ public Mono> createOrUpdateTestWithResponse(String testId, } /** - * Delete a test by its name. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * Add an app component to a test. + * + * Add an app component to a test by providing the resource Id, name and type. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return test app components along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.deleteTestWithResponseAsync(testId, requestOptions); + public Mono> createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(testId, body, requestOptions); } /** - * Get load test details by test name. - *

Response Body Schema

+ * Configure server metrics for a test. + *

Request Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
      *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
      *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
      *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -438,41 +423,112 @@ public Mono> deleteTestWithResponse(String testId, RequestOptions
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name along with {@link Response} on successful completion of {@link Mono}. + * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getTestWithResponseAsync(testId, requestOptions); + public Mono> createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(testId, body, requestOptions); } /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get associated app component (collection of azure resources) for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return associated app component (collection of azure resources) for the given test along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.getAppComponentsWithResponseAsync(testId, requestOptions); + } + + /** + * List server metrics configuration for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.getServerMetricsConfigWithResponseAsync(testId, requestOptions); + } + + /** + * Get load test details by test Id. *

Response Body Schema

* *
@@ -482,7 +538,7 @@ public Mono> getTestWithResponse(String testId, RequestOpti
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -491,6 +547,25 @@ public Mono> getTestWithResponse(String testId, RequestOpti
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -512,16 +587,25 @@ public Mono> getTestWithResponse(String testId, RequestOpti
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
+     *     baselineTestRunId: String (Optional)
      *     inputArtifacts (Optional): {
      *         configFileInfo (Optional): {
+     *             fileName: String (Required)
      *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *             expireDateTime: OffsetDateTime (Optional)
      *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *             validationFailureDetails: String (Optional)
@@ -529,16 +613,25 @@ public Mono> getTestWithResponse(String testId, RequestOpti
      *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *         additionalFileInfo (Optional): [
      *             (recursive schema, see above)
      *         ]
      *     }
-     *     testId: String (Optional)
+     *     testId: String (Required)
      *     description: String (Optional)
      *     displayName: String (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
      *     keyvaultReferenceIdentityType: String (Optional)
      *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -546,187 +639,212 @@ public Mono> getTestWithResponse(String testId, RequestOpti
      * }
      * }
      * 
- * + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated - * response with {@link PagedFlux}. + * @return load test details by test Id along with {@link Response} on successful completion of {@link Mono}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTests(RequestOptions requestOptions) { - return this.serviceClient.listTestsAsync(requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.getTestWithResponseAsync(testId, requestOptions); } /** - * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the - * given test will be overwritten. File should be provided in the request body as application/octet-stream. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", "ADDITIONAL_ARTIFACTS".
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * - *

-     * {@code
-     * BinaryData
-     * }
-     * 
- * - *

- * Response Body Schema - * + * Get all the files that are associated with a test. + *

Response Body Schema

+ * *
      * {@code
      * {
+     *     fileName: String (Required)
      *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *     expireDateTime: OffsetDateTime (Optional)
      *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response} on successful completion of {@link Mono}. + * @return all the files that are associated with a test along with {@link Response} on successful completion of + * {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> uploadTestFileWithResponse(String testId, String fileName, BinaryData body, + public Mono> getTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { - return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileName, body, requestOptions); + return this.serviceClient.getTestFileWithResponseAsync(testId, fileName, requestOptions); } /** - * Get test file by the file name. + * Get all test files. *

Response Body Schema

* *
      * {@code
      * {
+     *     fileName: String (Required)
      *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *     expireDateTime: OffsetDateTime (Optional)
      *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestFileWithResponse(String testId, String fileName, - RequestOptions requestOptions) { - return this.serviceClient.getTestFileWithResponseAsync(testId, fileName, requestOptions); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return all test files as paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTestFileWithResponse(String testId, String fileName, - RequestOptions requestOptions) { - return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileName, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestFiles(String testId, RequestOptions requestOptions) { + return this.serviceClient.listTestFilesAsync(testId, requestOptions); } /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

+ * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
      *         }
      *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
      *         }
      *     }
-     *     testId: String (Optional)
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -734,43 +852,213 @@ public Mono> deleteTestFileWithResponse(String testId, String fil
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body App Component model. + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test app component along with {@link Response} on successful completion of {@link Mono}. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTests(RequestOptions requestOptions) { + return this.serviceClient.listTestsAsync(requestOptions); + } + + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", + * "ADDITIONAL_ARTIFACTS", "ZIPPED_ARTIFACTS", "URL_TEST_CONFIG", "TEST_SCRIPT".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file info along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, + Mono> uploadTestFileWithResponse(String testId, String fileName, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponseAsync(testId, body, requestOptions); + return this.serviceClient.uploadTestFileWithResponseAsync(testId, fileName, body, requestOptions); } /** - * Get associated app component (collection of azure resources) for the given test. + * Delete file by the file name for a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestFileWithResponse(String testId, String fileName, + RequestOptions requestOptions) { + return this.serviceClient.deleteTestFileWithResponseAsync(testId, fileName, requestOptions); + } + + /** + * Delete a test by its test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestWithResponse(String testId, RequestOptions requestOptions) { + return this.serviceClient.deleteTestWithResponseAsync(testId, requestOptions); + } + + /** + * Create a new test profile or update an existing test profile. + * + * Create a new test profile or update an existing test profile by providing the test profile Id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
      *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test Profile Model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTestProfileWithResponse(String testProfileId, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateTestProfileWithResponseAsync(testProfileId, body, requestOptions); + } + + /** + * Delete a test profile. + * + * Delete a test profile by its test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestProfileWithResponse(String testProfileId, RequestOptions requestOptions) { + return this.serviceClient.deleteTestProfileWithResponseAsync(testProfileId, requestOptions); + } + + /** + * Get load test profile details. + * + * Get load test profile details by test profile Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
      *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -778,42 +1066,57 @@ public Mono> createOrUpdateAppComponentsWithResponse(String
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response} - * on successful completion of {@link Mono}. + * @return load test profile details. + * + * Get load test profile details by test profile Id along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentsWithResponseAsync(testId, requestOptions); + public Mono> getTestProfileWithResponse(String testProfileId, RequestOptions requestOptions) { + return this.serviceClient.getTestProfileWithResponseAsync(testProfileId, requestOptions); } /** - * List server metrics configuration for the given test. + * List test profiles. + * + * Get all test profiles for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter test profiles.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter test profiles.
testProfileIdsList<String>NoComma separated list of IDs of the test + * profiles to filter. In the form of "," separated string.
testIdsList<String>NoComma separated list IDs of the tests which should + * be associated with the test profiles to fetch. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
      *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
      *     }
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
@@ -822,19 +1125,1387 @@ public Mono> getAppComponentsWithResponse(String testId, Re
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. + * @return paged collection of TestProfile items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfiles(RequestOptions requestOptions) { + return this.serviceClient.listTestProfilesAsync(requestOptions); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsConfigWithResponseAsync(testId, requestOptions); + public Mono> createOrUpdateTriggerWithResponse(String triggerId, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateTriggerWithResponseAsync(triggerId, body, requestOptions); + } + + /** + * Resource delete operation template. + * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTriggerWithResponse(String triggerId, RequestOptions requestOptions) { + return this.serviceClient.deleteTriggerWithResponseAsync(triggerId, requestOptions); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTriggerWithResponse(String triggerId, RequestOptions requestOptions) { + return this.serviceClient.getTriggerWithResponseAsync(triggerId, requestOptions); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on triggers associated with the provided test + * ids.
statesStringNoFilter triggers based on a comma separated list of states. + * Allowed values: "Active", "Paused", "Completed", "Disabled".
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter triggers.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter triggers.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Trigger items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTriggers(RequestOptions requestOptions) { + return this.serviceClient.listTriggersAsync(requestOptions); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateNotificationRuleWithResponse(String notificationRuleId, + BinaryData body, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateNotificationRuleWithResponseAsync(notificationRuleId, body, + requestOptions); + } + + /** + * Resource delete operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteNotificationRuleWithResponse(String notificationRuleId, + RequestOptions requestOptions) { + return this.serviceClient.deleteNotificationRuleWithResponseAsync(notificationRuleId, requestOptions); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getNotificationRuleWithResponse(String notificationRuleId, + RequestOptions requestOptions) { + return this.serviceClient.getNotificationRuleWithResponseAsync(notificationRuleId, requestOptions); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on notification rules associated with the provided + * test ids.
scopesStringNoSearch based on notification rules for the provided + * scopes.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter notification rules.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter notification rules.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of NotificationRule items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNotificationRules(RequestOptions requestOptions) { + return this.serviceClient.listNotificationRulesAsync(requestOptions); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     newTestId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param cloneTestRequest1 The cloneTestRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCloneTest(String testId, BinaryData cloneTestRequest1, + RequestOptions requestOptions) { + return this.serviceClient.beginCloneTestAsync(testId, cloneTestRequest1, requestOptions); + } + + /** + * Get the status of a long running operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     kind: String(CloneTest) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     id: String (Required)
+     * }
+     * }
+     * 
+ * + * @param operationId The unique ID of the operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a long running operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationStatusWithResponse(String operationId, + RequestOptions requestOptions) { + return this.serviceClient.getOperationStatusWithResponseAsync(operationId, requestOptions); + } + + /** + * Create a new test or update an existing test by providing the test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateTest(String testId, LoadTest body) { + // Generated convenience method for createOrUpdateTestWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLoadTestAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getLoadTestAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestWithResponse(testId, bodyInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LoadTest.class)); + } + + /** + * Add an app component to a test. + * + * Add an app component to a test by providing the resource Id, name and type. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test app components on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAppComponents(String testId, TestAppComponents body) { + // Generated convenience method for createOrUpdateAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestAppComponentsAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestAppComponentsAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateAppComponentsWithResponse(testId, bodyInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestAppComponents.class)); + } + + /** + * Configure server metrics for a test. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test server metrics configuration on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateServerMetricsConfig(String testId, + TestServerMetricsConfiguration body) { + // Generated convenience method for createOrUpdateServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateServerMetricsConfigWithResponse(testId, bodyInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestServerMetricsConfiguration.class)); + } + + /** + * Get associated app component (collection of azure resources) for the given test. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated app component (collection of azure resources) for the given test on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAppComponents(String testId) { + // Generated convenience method for getAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAppComponentsWithResponse(testId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestAppComponents.class)); + } + + /** + * List server metrics configuration for the given test. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test server metrics configuration on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getServerMetricsConfig(String testId) { + // Generated convenience method for getServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getServerMetricsConfigWithResponse(testId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestServerMetricsConfiguration.class)); + } + + /** + * Get load test details by test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test details by test Id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTest(String testId) { + // Generated convenience method for getTestWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestWithResponse(testId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LoadTest.class)); + } + + /** + * Get all the files that are associated with a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the files that are associated with a test on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestFile(String testId, String fileName) { + // Generated convenience method for getTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestFileWithResponse(testId, fileName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestFileInfo.class)); + } + + /** + * Get all test files. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all test files as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestFiles(String testId) { + // Generated convenience method for listTestFiles + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTestFiles(testId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TestFileInfo.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * @param orderBy Sort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime. + * @param search Prefix based, case sensitive search on searchable fields - displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login. + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * tests. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter tests. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTests(String orderBy, String search, OffsetDateTime lastModifiedStartTime, + OffsetDateTime lastModifiedEndTime) { + // Generated convenience method for listTests + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (lastModifiedStartTime != null) { + requestOptions.addQueryParam("lastModifiedStartTime", String.valueOf(lastModifiedStartTime), false); + } + if (lastModifiedEndTime != null) { + requestOptions.addQueryParam("lastModifiedEndTime", String.valueOf(lastModifiedEndTime), false); + } + PagedFlux pagedFluxResponse = listTests(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(LoadTest.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTests() { + // Generated convenience method for listTests + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTests(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(LoadTest.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @param fileType File type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test file info on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono uploadTestFile(String testId, String fileName, BinaryData body, LoadTestingFileType fileType) { + // Generated convenience method for uploadTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (fileType != null) { + requestOptions.addQueryParam("fileType", fileType.toString(), false); + } + return uploadTestFileWithResponse(testId, fileName, body, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestFileInfo.class)); + } + + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test file info on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono uploadTestFile(String testId, String fileName, BinaryData body) { + // Generated convenience method for uploadTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return uploadTestFileWithResponse(testId, fileName, body, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestFileInfo.class)); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTestFile(String testId, String fileName) { + // Generated convenience method for deleteTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTestFileWithResponse(testId, fileName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Delete a test by its test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTest(String testId) { + // Generated convenience method for deleteTestWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTestWithResponse(testId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create a new test profile or update an existing test profile. + * + * Create a new test profile or update an existing test profile by providing the test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test Profile Model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateTestProfile(String testProfileId, TestProfile body) { + // Generated convenience method for createOrUpdateTestProfileWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestProfileAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestProfileAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestProfileWithResponse(testProfileId, bodyInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestProfile.class)); + } + + /** + * Delete a test profile. + * + * Delete a test profile by its test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTestProfile(String testProfileId) { + // Generated convenience method for deleteTestProfileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTestProfileWithResponse(testProfileId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get load test profile details. + * + * Get load test profile details by test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test profile details. + * + * Get load test profile details by test profile Id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestProfile(String testProfileId) { + // Generated convenience method for getTestProfileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestProfileWithResponse(testProfileId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestProfile.class)); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + * + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * test profiles. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter test + * profiles. + * @param testProfileIds Comma separated list of IDs of the test profiles to filter. + * @param testIds Comma separated list IDs of the tests which should be associated with the test profiles to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfile items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfiles(OffsetDateTime lastModifiedStartTime, + OffsetDateTime lastModifiedEndTime, List testProfileIds, List testIds) { + // Generated convenience method for listTestProfiles + RequestOptions requestOptions = new RequestOptions(); + if (lastModifiedStartTime != null) { + requestOptions.addQueryParam("lastModifiedStartTime", String.valueOf(lastModifiedStartTime), false); + } + if (lastModifiedEndTime != null) { + requestOptions.addQueryParam("lastModifiedEndTime", String.valueOf(lastModifiedEndTime), false); + } + if (testProfileIds != null) { + requestOptions.addQueryParam("testProfileIds", + testProfileIds.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + if (testIds != null) { + requestOptions.addQueryParam("testIds", + testIds.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + PagedFlux pagedFluxResponse = listTestProfiles(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TestProfile.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfile items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfiles() { + // Generated convenience method for listTestProfiles + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTestProfiles(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TestProfile.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Create or update operation template. + * + * @param triggerId The unique identifier of the trigger. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateTrigger(String triggerId, Trigger body) { + // Generated convenience method for createOrUpdateTriggerWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTriggerAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTriggerAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTriggerWithResponse(triggerId, bodyInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Trigger.class)); + } + + /** + * Resource delete operation template. + * + * @param triggerId The unique identifier of the trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTrigger(String triggerId) { + // Generated convenience method for deleteTriggerWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTriggerWithResponse(triggerId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Resource read operation template. + * + * @param triggerId The unique identifier of the trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTrigger(String triggerId) { + // Generated convenience method for getTriggerWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTriggerWithResponse(triggerId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Trigger.class)); + } + + /** + * Resource list operation template. + * + * @param testIds Search based on triggers associated with the provided test ids. + * @param states Filter triggers based on a comma separated list of states. + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * triggers. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter + * triggers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Trigger items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTriggers(String testIds, TriggerState states, OffsetDateTime lastModifiedStartTime, + OffsetDateTime lastModifiedEndTime) { + // Generated convenience method for listTriggers + RequestOptions requestOptions = new RequestOptions(); + if (testIds != null) { + requestOptions.addQueryParam("testIds", testIds, false); + } + if (states != null) { + requestOptions.addQueryParam("states", states.toString(), false); + } + if (lastModifiedStartTime != null) { + requestOptions.addQueryParam("lastModifiedStartTime", String.valueOf(lastModifiedStartTime), false); + } + if (lastModifiedEndTime != null) { + requestOptions.addQueryParam("lastModifiedEndTime", String.valueOf(lastModifiedEndTime), false); + } + PagedFlux pagedFluxResponse = listTriggers(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Trigger.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Resource list operation template. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Trigger items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTriggers() { + // Generated convenience method for listTriggers + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTriggers(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Trigger.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Create or update operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification rule model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateNotificationRule(String notificationRuleId, NotificationRule body) { + // Generated convenience method for createOrUpdateNotificationRuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getNotificationRuleAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getNotificationRuleAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateNotificationRuleWithResponse(notificationRuleId, bodyInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(NotificationRule.class)); + } + + /** + * Resource delete operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteNotificationRule(String notificationRuleId) { + // Generated convenience method for deleteNotificationRuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteNotificationRuleWithResponse(notificationRuleId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Resource read operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification rule model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNotificationRule(String notificationRuleId) { + // Generated convenience method for getNotificationRuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNotificationRuleWithResponse(notificationRuleId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(NotificationRule.class)); + } + + /** + * Resource list operation template. + * + * @param testIds Search based on notification rules associated with the provided test ids. + * @param scopes Search based on notification rules for the provided scopes. + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * notification rules. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter + * notification rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of NotificationRule items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNotificationRules(String testIds, String scopes, + OffsetDateTime lastModifiedStartTime, OffsetDateTime lastModifiedEndTime) { + // Generated convenience method for listNotificationRules + RequestOptions requestOptions = new RequestOptions(); + if (testIds != null) { + requestOptions.addQueryParam("testIds", testIds, false); + } + if (scopes != null) { + requestOptions.addQueryParam("scopes", scopes, false); + } + if (lastModifiedStartTime != null) { + requestOptions.addQueryParam("lastModifiedStartTime", String.valueOf(lastModifiedStartTime), false); + } + if (lastModifiedEndTime != null) { + requestOptions.addQueryParam("lastModifiedEndTime", String.valueOf(lastModifiedEndTime), false); + } + PagedFlux pagedFluxResponse = listNotificationRules(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(NotificationRule.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Resource list operation template. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of NotificationRule items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNotificationRules() { + // Generated convenience method for listNotificationRules + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listNotificationRules(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(NotificationRule.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param newTestId Unique identifier for the new test that will be created. + * @param displayName Display Name override for the newly created test. + * @param description Description override for the newly created test. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCloneTest(String testId, String newTestId, String displayName, + String description) { + // Generated convenience method for beginCloneTestWithModel + RequestOptions requestOptions = new RequestOptions(); + CloneTestRequest1 cloneTestRequest1Obj + = new CloneTestRequest1(newTestId).setDisplayName(displayName).setDescription(description); + BinaryData cloneTestRequest1 = BinaryData.fromObject(cloneTestRequest1Obj); + return serviceClient.beginCloneTestWithModelAsync(testId, cloneTestRequest1, requestOptions); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param newTestId Unique identifier for the new test that will be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCloneTest(String testId, String newTestId) { + // Generated convenience method for beginCloneTestWithModel + RequestOptions requestOptions = new RequestOptions(); + CloneTestRequest1 cloneTestRequest1Obj = new CloneTestRequest1(newTestId); + BinaryData cloneTestRequest1 = BinaryData.fromObject(cloneTestRequest1Obj); + return serviceClient.beginCloneTestWithModelAsync(testId, cloneTestRequest1, requestOptions); + } + + /** + * Get the status of a long running operation. + * + * @param operationId The unique ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a long running operation on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOperationStatus(String operationId) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationStatusWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OperationStatus.class)); } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java index 55fdab103fbd..bb6ff0ddeb30 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -15,165 +16,41 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.SyncPoller; -import com.azure.developer.loadtesting.implementation.LoadTestAdministrationsImpl; -import java.time.Duration; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.developer.loadtesting.models.LoadTest; +import com.azure.developer.loadtesting.models.LoadTestingFileType; +import com.azure.developer.loadtesting.models.NotificationRule; +import com.azure.developer.loadtesting.models.OperationStatus; +import com.azure.developer.loadtesting.models.TestAppComponents; +import com.azure.developer.loadtesting.models.TestFileInfo; +import com.azure.developer.loadtesting.models.TestProfile; +import com.azure.developer.loadtesting.models.TestServerMetricsConfiguration; +import com.azure.developer.loadtesting.models.Trigger; +import com.azure.developer.loadtesting.models.TriggerState; +import java.time.OffsetDateTime; +import java.util.List; /** - * Initializes a new instance of the synchronous LoadTestingClient type. + * Initializes a new instance of the synchronous LoadTestAdministrationClient type. */ @ServiceClient(builder = LoadTestAdministrationClientBuilder.class) public final class LoadTestAdministrationClient { - - private static final ClientLogger LOGGER = new ClientLogger(LoadTestAdministrationClient.class); - @Generated - private final LoadTestAdministrationsImpl serviceClient; + private final LoadTestAdministrationAsyncClient client; /** * Initializes an instance of LoadTestAdministrationClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - LoadTestAdministrationClient(LoadTestAdministrationsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponse(testId, body, requestOptions); - } - - /** - * Uploads file and polls the validation status of the uploaded file. - * - * @param testId Unique name for load test, must be a valid URL character ^[a-z0-9_-]*$. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param fileUploadRequestOptions The options to configure the file upload HTTP request before HTTP client sends - * it. - * @throws ResourceNotFoundException when a test with {@code testId} doesn't exist. - * @return A {@link SyncPoller} to poll on and retrieve the file info with validation status. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginUploadTestFile(String testId, String fileName, BinaryData body, - RequestOptions fileUploadRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (fileUploadRequestOptions != null) { - defaultRequestOptions.setContext(fileUploadRequestOptions.getContext()); - } - return SyncPoller.createPoller(Duration.ofSeconds(2), - (context) -> PollingUtils.getValidationStatus( - uploadTestFileWithResponse(testId, fileName, body, fileUploadRequestOptions).getValue()), - (context) -> PollingUtils - .getValidationStatus(getTestFileWithResponse(testId, fileName, defaultRequestOptions).getValue()), - (activationResponse, context) -> { - throw LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported")); - }, (context) -> getTestFileWithResponse(testId, fileName, defaultRequestOptions).getValue()); - } - - /** - * Get all test files. - *

Response Body Schema

* - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files as paginated response with {@link PagedIterable}. + * @param client the async client. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTestFiles(String testId, RequestOptions requestOptions) { - return this.serviceClient.listTestFiles(testId, requestOptions); + LoadTestAdministrationClient(LoadTestAdministrationAsyncClient client) { + this.client = client; } /** - * Create a new test or update an existing test. + * Create a new test or update an existing test by providing the test Id. *

Request Body Schema

* *
@@ -183,7 +60,7 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -192,6 +69,25 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -213,16 +109,25 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
+     *     baselineTestRunId: String (Optional)
      *     inputArtifacts (Optional): {
      *         configFileInfo (Optional): {
+     *             fileName: String (Required)
      *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *             expireDateTime: OffsetDateTime (Optional)
      *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *             validationFailureDetails: String (Optional)
@@ -230,16 +135,25 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *         additionalFileInfo (Optional): [
      *             (recursive schema, see above)
      *         ]
      *     }
-     *     testId: String (Optional)
+     *     testId: String (Required)
      *     description: String (Optional)
      *     displayName: String (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
      *     keyvaultReferenceIdentityType: String (Optional)
      *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -257,7 +171,7 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -266,6 +180,25 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -287,16 +220,25 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
+     *     baselineTestRunId: String (Optional)
      *     inputArtifacts (Optional): {
      *         configFileInfo (Optional): {
+     *             fileName: String (Required)
      *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *             expireDateTime: OffsetDateTime (Optional)
      *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *             validationFailureDetails: String (Optional)
@@ -304,16 +246,25 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *         additionalFileInfo (Optional): [
      *             (recursive schema, see above)
      *         ]
      *     }
-     *     testId: String (Optional)
+     *     testId: String (Required)
      *     description: String (Optional)
      *     displayName: String (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
      *     keyvaultReferenceIdentityType: String (Optional)
      *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -321,10 +272,10 @@ public PagedIterable listTestFiles(String testId, RequestOptions req
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Load test model. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -336,95 +287,126 @@ public PagedIterable listTestFiles(String testId, RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateTestWithResponse(String testId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateTestWithResponse(testId, body, requestOptions); + return this.client.createOrUpdateTestWithResponse(testId, body, requestOptions).block(); } /** - * Delete a test by its name. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * Add an app component to a test. + * + * Add an app component to a test by providing the resource Id, name and type. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return test app components along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.deleteTestWithResponse(testId, requestOptions); + public Response createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, + RequestOptions requestOptions) { + return this.client.createOrUpdateAppComponentsWithResponse(testId, body, requestOptions).block(); } /** - * Get load test details by test name. - *

Response Body Schema

+ * Configure server metrics for a test. + *

Request Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
      *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
      *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
      *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -432,41 +414,111 @@ public Response deleteTestWithResponse(String testId, RequestOptions reque
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name along with {@link Response}. + * @return test server metrics configuration along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getTestWithResponse(testId, requestOptions); + public Response createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, + RequestOptions requestOptions) { + return this.client.createOrUpdateServerMetricsConfigWithResponse(testId, body, requestOptions).block(); } /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get associated app component (collection of azure resources) for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return associated app component (collection of azure resources) for the given test along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { + return this.client.getAppComponentsWithResponse(testId, requestOptions).block(); + } + + /** + * List server metrics configuration for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test server metrics configuration along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { + return this.client.getServerMetricsConfigWithResponse(testId, requestOptions).block(); + } + + /** + * Get load test details by test Id. *

Response Body Schema

* *
@@ -476,7 +528,7 @@ public Response getTestWithResponse(String testId, RequestOptions re
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -485,6 +537,25 @@ public Response getTestWithResponse(String testId, RequestOptions re
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -506,16 +577,25 @@ public Response getTestWithResponse(String testId, RequestOptions re
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
+     *     baselineTestRunId: String (Optional)
      *     inputArtifacts (Optional): {
      *         configFileInfo (Optional): {
+     *             fileName: String (Required)
      *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *             expireDateTime: OffsetDateTime (Optional)
      *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *             validationFailureDetails: String (Optional)
@@ -523,16 +603,25 @@ public Response getTestWithResponse(String testId, RequestOptions re
      *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *         additionalFileInfo (Optional): [
      *             (recursive schema, see above)
      *         ]
      *     }
-     *     testId: String (Optional)
+     *     testId: String (Required)
      *     description: String (Optional)
      *     displayName: String (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
      *     keyvaultReferenceIdentityType: String (Optional)
      *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -540,185 +629,210 @@ public Response getTestWithResponse(String testId, RequestOptions re
      * }
      * }
      * 
- * + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated - * response with {@link PagedIterable}. + * @return load test details by test Id along with {@link Response}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTests(RequestOptions requestOptions) { - return this.serviceClient.listTests(requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestWithResponse(String testId, RequestOptions requestOptions) { + return this.client.getTestWithResponse(testId, requestOptions).block(); } /** - * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the - * given test will be overwritten. File should be provided in the request body as application/octet-stream. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", "ADDITIONAL_ARTIFACTS".
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * - *

-     * {@code
-     * BinaryData
-     * }
-     * 
- * - *

- * Response Body Schema - * + * Get all the files that are associated with a test. + *

Response Body Schema

+ * *
      * {@code
      * {
+     *     fileName: String (Required)
      *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *     expireDateTime: OffsetDateTime (Optional)
      *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response}. + * @return all the files that are associated with a test along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response uploadTestFileWithResponse(String testId, String fileName, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.uploadTestFileWithResponse(testId, fileName, body, requestOptions); + public Response getTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { + return this.client.getTestFileWithResponse(testId, fileName, requestOptions).block(); } /** - * Get test file by the file name. + * Get all test files. *

Response Body Schema

* *
      * {@code
      * {
+     *     fileName: String (Required)
      *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *     expireDateTime: OffsetDateTime (Optional)
      *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { - return this.serviceClient.getTestFileWithResponse(testId, fileName, requestOptions); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return all test files as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { - return this.serviceClient.deleteTestFileWithResponse(testId, fileName, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTestFiles(testId, requestOptions)); } /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

+ * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
      *         }
      *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
      *         }
      *     }
-     *     testId: String (Optional)
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -726,43 +840,150 @@ public Response deleteTestFileWithResponse(String testId, String fileName,
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body App Component model. + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test app component along with {@link Response}. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponse(testId, body, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTests(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTests(requestOptions)); } /** - * Get associated app component (collection of azure resources) for the given test. - *

Response Body Schema

+ * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", + * "ADDITIONAL_ARTIFACTS", "ZIPPED_ARTIFACTS", "URL_TEST_CONFIG", "TEST_SCRIPT".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

* *
      * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
+     * BinaryData
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file info along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response uploadTestFileWithResponse(String testId, String fileName, BinaryData body, + RequestOptions requestOptions) { + return this.client.uploadTestFileWithResponse(testId, fileName, body, requestOptions).block(); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { + return this.client.deleteTestFileWithResponse(testId, fileName, requestOptions).block(); + } + + /** + * Delete a test by its test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestWithResponse(String testId, RequestOptions requestOptions) { + return this.client.deleteTestWithResponse(testId, requestOptions).block(); + } + + /** + * Create a new test profile or update an existing test profile. + * + * Create a new test profile or update an existing test profile by providing the test profile Id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
      *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
      *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -770,41 +991,60 @@ public Response createOrUpdateAppComponentsWithResponse(String testI
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response}. + * @return test Profile Model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentsWithResponse(testId, requestOptions); + public Response createOrUpdateTestProfileWithResponse(String testProfileId, BinaryData body, + RequestOptions requestOptions) { + return this.client.createOrUpdateTestProfileWithResponse(testProfileId, body, requestOptions).block(); } /** - * List server metrics configuration for the given test. + * Delete a test profile. + * + * Delete a test profile by its test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestProfileWithResponse(String testProfileId, RequestOptions requestOptions) { + return this.client.deleteTestProfileWithResponse(testProfileId, requestOptions).block(); + } + + /** + * Get load test profile details. + * + * Get load test profile details by test profile Id. *

Response Body Schema

* *
      * {@code
      * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
      *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
      *     }
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
@@ -813,19 +1053,1248 @@ public Response getAppComponentsWithResponse(String testId, RequestO
      * }
      * }
      * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response}. + * @return load test profile details. + * + * Get load test profile details by test profile Id along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsConfigWithResponse(testId, requestOptions); + public Response getTestProfileWithResponse(String testProfileId, RequestOptions requestOptions) { + return this.client.getTestProfileWithResponse(testProfileId, requestOptions).block(); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter test profiles.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter test profiles.
testProfileIdsList<String>NoComma separated list of IDs of the test + * profiles to filter. In the form of "," separated string.
testIdsList<String>NoComma separated list IDs of the tests which should + * be associated with the test profiles to fetch. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfile items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfiles(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTestProfiles(requestOptions)); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateTriggerWithResponse(String triggerId, BinaryData body, + RequestOptions requestOptions) { + return this.client.createOrUpdateTriggerWithResponse(triggerId, body, requestOptions).block(); + } + + /** + * Resource delete operation template. + * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTriggerWithResponse(String triggerId, RequestOptions requestOptions) { + return this.client.deleteTriggerWithResponse(triggerId, requestOptions).block(); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTriggerWithResponse(String triggerId, RequestOptions requestOptions) { + return this.client.getTriggerWithResponse(triggerId, requestOptions).block(); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on triggers associated with the provided test + * ids.
statesStringNoFilter triggers based on a comma separated list of states. + * Allowed values: "Active", "Paused", "Completed", "Disabled".
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter triggers.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter triggers.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Trigger items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTriggers(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTriggers(requestOptions)); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateNotificationRuleWithResponse(String notificationRuleId, BinaryData body, + RequestOptions requestOptions) { + return this.client.createOrUpdateNotificationRuleWithResponse(notificationRuleId, body, requestOptions).block(); + } + + /** + * Resource delete operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteNotificationRuleWithResponse(String notificationRuleId, RequestOptions requestOptions) { + return this.client.deleteNotificationRuleWithResponse(notificationRuleId, requestOptions).block(); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNotificationRuleWithResponse(String notificationRuleId, + RequestOptions requestOptions) { + return this.client.getNotificationRuleWithResponse(notificationRuleId, requestOptions).block(); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on notification rules associated with the provided + * test ids.
scopesStringNoSearch based on notification rules for the provided + * scopes.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter notification rules.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter notification rules.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of NotificationRule items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNotificationRules(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listNotificationRules(requestOptions)); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     newTestId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param cloneTestRequest1 The cloneTestRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCloneTest(String testId, BinaryData cloneTestRequest1, + RequestOptions requestOptions) { + return this.client.beginCloneTest(testId, cloneTestRequest1, requestOptions).getSyncPoller(); + } + + /** + * Get the status of a long running operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     kind: String(CloneTest) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     id: String (Required)
+     * }
+     * }
+     * 
+ * + * @param operationId The unique ID of the operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a long running operation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { + return this.client.getOperationStatusWithResponse(operationId, requestOptions).block(); + } + + /** + * Create a new test or update an existing test by providing the test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadTest createOrUpdateTest(String testId, LoadTest body) { + // Generated convenience method for createOrUpdateTestWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLoadTestAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getLoadTestAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestWithResponse(testId, bodyInBinaryData, requestOptions).getValue() + .toObject(LoadTest.class); + } + + /** + * Add an app component to a test. + * + * Add an app component to a test by providing the resource Id, name and type. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test app components. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestAppComponents createOrUpdateAppComponents(String testId, TestAppComponents body) { + // Generated convenience method for createOrUpdateAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestAppComponentsAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestAppComponentsAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateAppComponentsWithResponse(testId, bodyInBinaryData, requestOptions).getValue() + .toObject(TestAppComponents.class); + } + + /** + * Configure server metrics for a test. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test server metrics configuration. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestServerMetricsConfiguration createOrUpdateServerMetricsConfig(String testId, + TestServerMetricsConfiguration body) { + // Generated convenience method for createOrUpdateServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateServerMetricsConfigWithResponse(testId, bodyInBinaryData, requestOptions).getValue() + .toObject(TestServerMetricsConfiguration.class); + } + + /** + * Get associated app component (collection of azure resources) for the given test. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated app component (collection of azure resources) for the given test. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestAppComponents getAppComponents(String testId) { + // Generated convenience method for getAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAppComponentsWithResponse(testId, requestOptions).getValue().toObject(TestAppComponents.class); + } + + /** + * List server metrics configuration for the given test. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test server metrics configuration. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestServerMetricsConfiguration getServerMetricsConfig(String testId) { + // Generated convenience method for getServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getServerMetricsConfigWithResponse(testId, requestOptions).getValue() + .toObject(TestServerMetricsConfiguration.class); + } + + /** + * Get load test details by test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test details by test Id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadTest getTest(String testId) { + // Generated convenience method for getTestWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestWithResponse(testId, requestOptions).getValue().toObject(LoadTest.class); + } + + /** + * Get all the files that are associated with a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the files that are associated with a test. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestFileInfo getTestFile(String testId, String fileName) { + // Generated convenience method for getTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestFileWithResponse(testId, fileName, requestOptions).getValue().toObject(TestFileInfo.class); + } + + /** + * Get all test files. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all test files as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestFiles(String testId) { + // Generated convenience method for listTestFiles + return new PagedIterable<>(client.listTestFiles(testId)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * @param orderBy Sort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime. + * @param search Prefix based, case sensitive search on searchable fields - displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login. + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * tests. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter tests. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTests(String orderBy, String search, OffsetDateTime lastModifiedStartTime, + OffsetDateTime lastModifiedEndTime) { + // Generated convenience method for listTests + return new PagedIterable<>(client.listTests(orderBy, search, lastModifiedStartTime, lastModifiedEndTime)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTests() { + // Generated convenience method for listTests + return new PagedIterable<>(client.listTests()); + } + + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @param fileType File type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test file info. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + TestFileInfo uploadTestFile(String testId, String fileName, BinaryData body, LoadTestingFileType fileType) { + // Generated convenience method for uploadTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (fileType != null) { + requestOptions.addQueryParam("fileType", fileType.toString(), false); + } + return uploadTestFileWithResponse(testId, fileName, body, requestOptions).getValue() + .toObject(TestFileInfo.class); + } + + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test file info. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + TestFileInfo uploadTestFile(String testId, String fileName, BinaryData body) { + // Generated convenience method for uploadTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return uploadTestFileWithResponse(testId, fileName, body, requestOptions).getValue() + .toObject(TestFileInfo.class); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTestFile(String testId, String fileName) { + // Generated convenience method for deleteTestFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTestFileWithResponse(testId, fileName, requestOptions).getValue(); + } + + /** + * Delete a test by its test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTest(String testId) { + // Generated convenience method for deleteTestWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTestWithResponse(testId, requestOptions).getValue(); + } + + /** + * Create a new test profile or update an existing test profile. + * + * Create a new test profile or update an existing test profile by providing the test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test Profile Model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestProfile createOrUpdateTestProfile(String testProfileId, TestProfile body) { + // Generated convenience method for createOrUpdateTestProfileWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestProfileAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestProfileAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestProfileWithResponse(testProfileId, bodyInBinaryData, requestOptions).getValue() + .toObject(TestProfile.class); + } + + /** + * Delete a test profile. + * + * Delete a test profile by its test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTestProfile(String testProfileId) { + // Generated convenience method for deleteTestProfileWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTestProfileWithResponse(testProfileId, requestOptions).getValue(); + } + + /** + * Get load test profile details. + * + * Get load test profile details by test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test profile details. + * + * Get load test profile details by test profile Id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestProfile getTestProfile(String testProfileId) { + // Generated convenience method for getTestProfileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestProfileWithResponse(testProfileId, requestOptions).getValue().toObject(TestProfile.class); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + * + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * test profiles. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter test + * profiles. + * @param testProfileIds Comma separated list of IDs of the test profiles to filter. + * @param testIds Comma separated list IDs of the tests which should be associated with the test profiles to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfile items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfiles(OffsetDateTime lastModifiedStartTime, + OffsetDateTime lastModifiedEndTime, List testProfileIds, List testIds) { + // Generated convenience method for listTestProfiles + return new PagedIterable<>( + client.listTestProfiles(lastModifiedStartTime, lastModifiedEndTime, testProfileIds, testIds)); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfile items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfiles() { + // Generated convenience method for listTestProfiles + return new PagedIterable<>(client.listTestProfiles()); + } + + /** + * Create or update operation template. + * + * @param triggerId The unique identifier of the trigger. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Trigger createOrUpdateTrigger(String triggerId, Trigger body) { + // Generated convenience method for createOrUpdateTriggerWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTriggerAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTriggerAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTriggerWithResponse(triggerId, bodyInBinaryData, requestOptions).getValue() + .toObject(Trigger.class); + } + + /** + * Resource delete operation template. + * + * @param triggerId The unique identifier of the trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTrigger(String triggerId) { + // Generated convenience method for deleteTriggerWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTriggerWithResponse(triggerId, requestOptions).getValue(); + } + + /** + * Resource read operation template. + * + * @param triggerId The unique identifier of the trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Trigger getTrigger(String triggerId) { + // Generated convenience method for getTriggerWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTriggerWithResponse(triggerId, requestOptions).getValue().toObject(Trigger.class); + } + + /** + * Resource list operation template. + * + * @param testIds Search based on triggers associated with the provided test ids. + * @param states Filter triggers based on a comma separated list of states. + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * triggers. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter + * triggers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Trigger items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTriggers(String testIds, TriggerState states, + OffsetDateTime lastModifiedStartTime, OffsetDateTime lastModifiedEndTime) { + // Generated convenience method for listTriggers + return new PagedIterable<>(client.listTriggers(testIds, states, lastModifiedStartTime, lastModifiedEndTime)); + } + + /** + * Resource list operation template. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Trigger items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTriggers() { + // Generated convenience method for listTriggers + return new PagedIterable<>(client.listTriggers()); + } + + /** + * Create or update operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification rule model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public NotificationRule createOrUpdateNotificationRule(String notificationRuleId, NotificationRule body) { + // Generated convenience method for createOrUpdateNotificationRuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getNotificationRuleAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getNotificationRuleAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateNotificationRuleWithResponse(notificationRuleId, bodyInBinaryData, requestOptions) + .getValue() + .toObject(NotificationRule.class); + } + + /** + * Resource delete operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteNotificationRule(String notificationRuleId) { + // Generated convenience method for deleteNotificationRuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteNotificationRuleWithResponse(notificationRuleId, requestOptions).getValue(); + } + + /** + * Resource read operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return notification rule model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public NotificationRule getNotificationRule(String notificationRuleId) { + // Generated convenience method for getNotificationRuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getNotificationRuleWithResponse(notificationRuleId, requestOptions).getValue() + .toObject(NotificationRule.class); + } + + /** + * Resource list operation template. + * + * @param testIds Search based on notification rules associated with the provided test ids. + * @param scopes Search based on notification rules for the provided scopes. + * @param lastModifiedStartTime Start DateTime(RFC 3339 literal format) of the last updated time range to filter + * notification rules. + * @param lastModifiedEndTime End DateTime(RFC 3339 literal format) of the last updated time range to filter + * notification rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of NotificationRule items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNotificationRules(String testIds, String scopes, + OffsetDateTime lastModifiedStartTime, OffsetDateTime lastModifiedEndTime) { + // Generated convenience method for listNotificationRules + return new PagedIterable<>( + client.listNotificationRules(testIds, scopes, lastModifiedStartTime, lastModifiedEndTime)); + } + + /** + * Resource list operation template. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of NotificationRule items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNotificationRules() { + // Generated convenience method for listNotificationRules + return new PagedIterable<>(client.listNotificationRules()); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param newTestId Unique identifier for the new test that will be created. + * @param displayName Display Name override for the newly created test. + * @param description Description override for the newly created test. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCloneTest(String testId, String newTestId, String displayName, + String description) { + // Generated convenience method for beginCloneTestWithModel + return client.beginCloneTest(testId, newTestId, displayName, description).getSyncPoller(); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param newTestId Unique identifier for the new test that will be created. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCloneTest(String testId, String newTestId) { + // Generated convenience method for beginCloneTestWithModel + return client.beginCloneTest(testId, newTestId).getSyncPoller(); + } + + /** + * Get the status of a long running operation. + * + * @param operationId The unique ID of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a long running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatus getOperationStatus(String operationId) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationStatusWithResponse(operationId, requestOptions).getValue().toObject(OperationStatus.class); } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java index 03c74af38b25..12dd46f6138a 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -33,7 +34,7 @@ import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; +import com.azure.developer.loadtesting.implementation.LoadTestAdministrationClientImpl; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,7 +47,6 @@ public final class LoadTestAdministrationClientBuilder implements HttpTrait, ConfigurationTrait, TokenCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; @@ -56,6 +56,10 @@ public final class LoadTestAdministrationClientBuilder @Generated private static final String[] DEFAULT_SCOPES = new String[] { "https://cnt-prod.loadtesting.azure.com/.default" }; + @Generated + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + @Generated private final List pipelinePolicies; @@ -217,7 +221,7 @@ public LoadTestAdministrationClientBuilder endpoint(String endpoint) { /** * Sets Service version. - * + * * @param serviceVersion the serviceVersion value. * @return the LoadTestAdministrationClientBuilder. */ @@ -235,7 +239,7 @@ public LoadTestAdministrationClientBuilder serviceVersion(LoadTestingServiceVers /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the LoadTestAdministrationClientBuilder. */ @@ -246,21 +250,28 @@ public LoadTestAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) } /** - * Builds an instance of LoadTestingClientImpl with the provided parameters. - * - * @return an instance of LoadTestingClientImpl. + * Builds an instance of LoadTestAdministrationClientImpl with the provided parameters. + * + * @return an instance of LoadTestAdministrationClientImpl. */ @Generated - private LoadTestingClientImpl buildInnerClient() { + private LoadTestAdministrationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); LoadTestingServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); - LoadTestingClientImpl client = new LoadTestingClientImpl(localPipeline, + LoadTestAdministrationClientImpl client = new LoadTestAdministrationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration @@ -301,34 +312,23 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of LoadTestAdministrationAsyncClient class. - * + * * @return an instance of LoadTestAdministrationAsyncClient. */ @Generated public LoadTestAdministrationAsyncClient buildAsyncClient() { - return new LoadTestAdministrationAsyncClient(buildInnerClient().getLoadTestAdministrations()); + return new LoadTestAdministrationAsyncClient(buildInnerClient()); } /** * Builds an instance of LoadTestAdministrationClient class. - * + * * @return an instance of LoadTestAdministrationClient. */ @Generated public LoadTestAdministrationClient buildClient() { - return new LoadTestAdministrationClient(buildInnerClient().getLoadTestAdministrations()); + return new LoadTestAdministrationClient(new LoadTestAdministrationAsyncClient(buildInnerClient())); } - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - private static final ClientLogger LOGGER = new ClientLogger(LoadTestAdministrationClientBuilder.class); - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunAsyncClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunAsyncClient.java index bfafcd59881b..e683b95fb3c3 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunAsyncClient.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunAsyncClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -11,56 +12,214 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.developer.loadtesting.implementation.LoadTestRunsImpl; -import java.time.Duration; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.developer.loadtesting.implementation.LoadTestRunClientImpl; +import com.azure.developer.loadtesting.models.LoadTestRun; +import com.azure.developer.loadtesting.models.MetricDefinitions; +import com.azure.developer.loadtesting.models.MetricNamespaces; +import com.azure.developer.loadtesting.models.MetricsFilters; +import com.azure.developer.loadtesting.models.TestProfileRun; +import com.azure.developer.loadtesting.models.TestRunAppComponents; +import com.azure.developer.loadtesting.models.TestRunFileInfo; +import com.azure.developer.loadtesting.models.TestRunServerMetricsConfiguration; +import com.azure.developer.loadtesting.models.TimeGrain; +import com.azure.developer.loadtesting.models.TimeSeriesElement; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** - * Initializes a new instance of the asynchronous LoadTestingClient type. + * Initializes a new instance of the asynchronous LoadTestRunClient type. */ @ServiceClient(builder = LoadTestRunClientBuilder.class, isAsync = true) public final class LoadTestRunAsyncClient { - @Generated - private final LoadTestRunsImpl serviceClient; + private final LoadTestRunClientImpl serviceClient; /** * Initializes an instance of LoadTestRunAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated - LoadTestRunAsyncClient(LoadTestRunsImpl serviceClient) { + LoadTestRunAsyncClient(LoadTestRunClientImpl serviceClient) { this.serviceClient = serviceClient; } /** - * Configure server metrics for a test run. + * Create and start a new test run with the given test run Id. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this + * is provided, the + * test will run with the JMX file, configuration and app components from the + * existing test run. You can override the configuration values for new test run + * in the request body.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -74,19 +233,152 @@ public final class LoadTestRunAsyncClient {
      * 
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -94,66 +386,38 @@ public final class LoadTestRunAsyncClient {
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric configuration model. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response} on successful completion of - * {@link Mono}. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, + Mono> createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(testRunId, body, requestOptions); - } - - /** - * Starts a test run and polls the status of the test run. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. - * @param testRunRequestOptions The options to configure the file upload HTTP request before HTTP client sends it. - * @throws ResourceNotFoundException when a test with {@code testRunId} doesn't exist. - * @return A {@link PollerFlux} to poll on and retrieve the test run - * status(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE). - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginTestRun(String testRunId, BinaryData body, - RequestOptions testRunRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (testRunRequestOptions != null) { - defaultRequestOptions.setContext(testRunRequestOptions.getContext()); - } - return new PollerFlux<>(Duration.ofSeconds(5), - (context) -> createOrUpdateTestRunWithResponse(testRunId, body, testRunRequestOptions) - .flatMap(FluxUtil::toMono), - (context) -> getTestRunWithResponse(testRunId, defaultRequestOptions).flatMap(FluxUtil::toMono) - .flatMap(testRunBinary -> PollingUtils - .getPollResponseMono(() -> PollingUtils.getTestRunStatus(testRunBinary))), - (activationResponse, context) -> stopTestRunWithResponse(testRunId, defaultRequestOptions) - .flatMap(FluxUtil::toMono), - (context) -> getTestRunWithResponse(testRunId, defaultRequestOptions).flatMap(FluxUtil::toMono)); + return this.serviceClient.createOrUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); } /** - * Associate an app component (collection of azure resources) to a test run. + * Add an app component to a test run. + * + * Add an app component to a test run by providing the resource Id, name and type. *

Request Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
      *             displayName: String (Optional)
      *             resourceGroup: String (Optional)
      *             subscriptionId: String (Optional)
@@ -174,11 +438,11 @@ public PollerFlux beginTestRun(String testRunId, BinaryD
      * 
      * {@code
      * {
-     *     components (Required): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
      *             displayName: String (Optional)
      *             resourceGroup: String (Optional)
      *             subscriptionId: String (Optional)
@@ -193,9 +457,9 @@ public PollerFlux beginTestRun(String testRunId, BinaryD
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param body App Component model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -212,156 +476,110 @@ public Mono> createOrUpdateAppComponentsWithResponse(String } /** - * List the metric values for a load test run. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * + * Configure server metrics for a test run. + *

Request Body Schema

+ * *
      * {@code
      * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
-     *     ]
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
- * - *

- * Response Body Schema - * + * + *

Response Body Schema

+ * *
      * {@code
      * {
-     *     value (Optional): [
-     *          (Optional){
-     *             data (Optional): [
-     *                  (Optional){
-     *                     timestamp: String (Optional)
-     *                     value: Double (Optional)
-     *                 }
-     *             ]
-     *             dimensionValues (Optional): [
-     *                  (Optional){
-     *                     name: String (Optional)
-     *                     value: String (Optional)
-     *                 }
-     *             ]
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response to a metrics query as paginated response with {@link PagedFlux}. + * @return test run server metrics configuration along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetrics(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - if (requestOptions == null) { - requestOptions = new RequestOptions(); - } - // Content-Type header required even though body can be null - requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "application/json"); - return this.serviceClient.listMetricsAsync(testRunId, metricName, metricNamespace, timespan, requestOptions); + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateServerMetricsConfigWithResponseAsync(testRunId, body, requestOptions); } /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

+ * Delete an existing load test run. * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. + * Delete an existing load test run by providing the testRunId. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedFlux}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricDimensionValues(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - return this.serviceClient.listMetricDimensionValuesAsync(testRunId, name, metricName, metricNamespace, timespan, - requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.deleteTestRunWithResponseAsync(testRunId, requestOptions); } /** - * Get associated app component (collection of azure resources) for the given test run. + * Get associated app component (collection of azure resources) for the given test + * run. *

Response Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
      *             displayName: String (Optional)
      *             resourceGroup: String (Optional)
      *             subscriptionId: String (Optional)
@@ -376,16 +594,16 @@ public PagedFlux listMetricDimensionValues(String testRunId, String
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response} on successful completion of {@link Mono}. + * @return associated app component (collection of azure resources) for the given test + * run along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -394,7 +612,7 @@ public Mono> getAppComponentsWithResponse(String testRunId, } /** - * List server metrics configuration for the given test run. + * Get associated server metrics configuration for the given test run. *

Response Body Schema

* *
@@ -404,13 +622,13 @@ public Mono> getAppComponentsWithResponse(String testRunId,
      *     metrics (Optional): {
      *         String (Required): {
      *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
      *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
      *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             resourceType: String (Optional, Required on create)
      *         }
      *     }
      *     createdDateTime: OffsetDateTime (Optional)
@@ -420,16 +638,16 @@ public Mono> getAppComponentsWithResponse(String testRunId,
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response} on successful completion of - * {@link Mono}. + * @return associated server metrics configuration for the given test run along with {@link Response} on successful + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -439,42 +657,18 @@ public Mono> getServerMetricsConfigWithResponse(String test } /** - * Create and start a new test run with the given name. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this is provided, the test will run with the JMX file, - * configuration and app components from the existing test run. You can override the configuration values for new - * test run in the request body.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * + * Get test run details by test run Id. + *

Response Body Schema

+ * *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
-     *             String (Optional): {
+     *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -483,9 +677,28 @@ public Mono> getServerMetricsConfigWithResponse(String test
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
-     *         String (Optional): {
+     *         String (Required): {
      *             value: String (Optional)
      *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
      *         }
@@ -496,7 +709,7 @@ public Mono> getServerMetricsConfigWithResponse(String test
      *         name: String (Optional)
      *     }
      *     environmentVariables (Optional): {
-     *         String: String (Optional)
+     *         String: String (Required)
      *     }
      *     errorDetails (Optional): [
      *          (Optional){
@@ -504,7 +717,7 @@ public Mono> getServerMetricsConfigWithResponse(String test
      *         }
      *     ]
      *     testRunStatistics (Optional): {
-     *         String (Optional): {
+     *         String (Required): {
      *             transaction: String (Optional)
      *             sampleCount: Double (Optional)
      *             errorCount: Double (Optional)
@@ -516,28 +729,45 @@ public Mono> getServerMetricsConfigWithResponse(String test
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -545,6 +775,7 @@ public Mono> getServerMetricsConfigWithResponse(String test
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -552,11 +783,15 @@ public Mono> getServerMetricsConfigWithResponse(String test
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -566,7 +801,14 @@ public Mono> getServerMetricsConfigWithResponse(String test
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -574,331 +816,280 @@ public Mono> getServerMetricsConfigWithResponse(String test
      * }
      * }
      * 
- * - *

- * Response Body Schema - * + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by test run Id along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getTestRunWithResponseAsync(testRunId, requestOptions); + } + + /** + * Get test run file by file name. + *

Response Body Schema

+ * *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Name of the file. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, + public Mono> getTestRunFileWithResponse(String testRunId, String fileName, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateTestRunWithResponseAsync(testRunId, body, requestOptions); + return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileName, requestOptions); } /** - * Get test run details by name. + * List the dimension values for the given metric dimension name. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: + * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
+     * String
+     * }
+     * 
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return metrics dimension values as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetricDimensionValues(String testRunId, String name, String metricname, + String metricNamespace, String timespan, RequestOptions requestOptions) { + return this.serviceClient.listMetricDimensionValuesAsync(testRunId, name, metricname, metricNamespace, timespan, + requestOptions); + } + + /** + * List the metric definitions for a load test run. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             dimensions (Optional): [
+     *                  (Optional){
+     *                     description: String (Optional)
+     *                     name: String (Optional)
+     *                 }
+     *             ]
+     *             description: String (Optional)
+     *             name: String (Optional)
+     *             namespace: String (Optional)
+     *             primaryAggregationType: String(Average/Count/None/Total/Percentile75/Percentile90/Percentile95/Percentile96/Percentile97/Percentile98/Percentile99/Percentile999/Percentile9999) (Optional)
+     *             supportedAggregationTypes (Optional): [
+     *                 String (Optional)
+     *             ]
+     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
+     *             metricAvailabilities (Optional): [
+     *                  (Optional){
+     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
+     *                 }
      *             ]
      *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
+     *     ]
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricNamespace Metric namespace to query metric definitions for. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name along with {@link Response} on successful completion of {@link Mono}. + * @return represents collection of metric definitions along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunWithResponseAsync(testRunId, requestOptions); + public Mono> getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, + RequestOptions requestOptions) { + return this.serviceClient.getMetricDefinitionsWithResponseAsync(testRunId, metricNamespace, requestOptions); } /** - * Delete a test run by its name. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * List the metric namespaces for a load test run. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             description: String (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return represents collection of metric namespaces along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.deleteTestRunWithResponseAsync(testRunId, requestOptions); + public Mono> getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { + return this.serviceClient.getMetricNamespacesWithResponseAsync(testRunId, requestOptions); } /** - * Get test run file by file name. + * List the metric values for a load test run. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: + * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     filters (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             values (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
+     *     data (Optional): [
+     *          (Optional){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: Double (Optional)
+     *         }
+     *     ]
+     *     dimensionValues (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             value: String (Optional)
+     *         }
+     *     ]
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + * @return the response to a metrics query as paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunFileWithResponse(String testRunId, String fileName, - RequestOptions requestOptions) { - return this.serviceClient.getTestRunFileWithResponseAsync(testRunId, fileName, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetrics(String testRunId, String metricname, String metricNamespace, + String timespan, RequestOptions requestOptions) { + return this.serviceClient.listMetricsAsync(testRunId, metricname, metricNamespace, timespan, requestOptions); } /** - * Get all test runs with given filters. + * Get all test runs for the given filters. *

Query Parameters

* * * * + * executedDateTime + * asc. Supported fields - executedDateTime * + * description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500. * - * - * * * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of + *
executionFromOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run + *
executionToOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of test-run * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
createdByTypesList<String>NoComma separated list of type of entities + * that have created the test run. In the form of "," separated string.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -906,11 +1097,12 @@ public Mono> getTestRunFileWithResponse(String testRunId, S *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -919,6 +1111,25 @@ public Mono> getTestRunFileWithResponse(String testRunId, S
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -952,28 +1163,45 @@ public Mono> getTestRunFileWithResponse(String testRunId, S
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -981,6 +1209,7 @@ public Mono> getTestRunFileWithResponse(String testRunId, S
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -988,11 +1217,15 @@ public Mono> getTestRunFileWithResponse(String testRunId, S
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -1002,7 +1235,14 @@ public Mono> getTestRunFileWithResponse(String testRunId, S
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1010,13 +1250,13 @@ public Mono> getTestRunFileWithResponse(String testRunId, S
      * }
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedFlux}. + * @return all test runs for the given filters as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -1025,17 +1265,18 @@ public PagedFlux listTestRuns(RequestOptions requestOptions) { } /** - * Stop test run by name. + * Stop test run by test run Id. *

Response Body Schema

* *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -1044,6 +1285,25 @@ public PagedFlux listTestRuns(RequestOptions requestOptions) {
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -1077,28 +1337,45 @@ public PagedFlux listTestRuns(RequestOptions requestOptions) {
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -1106,6 +1383,7 @@ public PagedFlux listTestRuns(RequestOptions requestOptions) {
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -1113,11 +1391,15 @@ public PagedFlux listTestRuns(RequestOptions requestOptions) {
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -1127,7 +1409,14 @@ public PagedFlux listTestRuns(RequestOptions requestOptions) {
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1135,9 +1424,9 @@ public PagedFlux listTestRuns(RequestOptions requestOptions) {
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1152,87 +1441,1164 @@ public Mono> stopTestRunWithResponse(String testRunId, Requ } /** - * List the metric namespaces for a load test run. - *

Response Body Schema

+ * Create and start a new test profile run. + * + * Create and start a new test profile run with the given test profile run Id. + *

Request Body Schema

* *
      * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
      *         }
      *     ]
-     * }
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response} on successful completion of - * {@link Mono}. + * @return test Profile Run model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getMetricNamespacesWithResponseAsync(testRunId, requestOptions); + Mono> createOrUpdateTestProfileRunWithResponse(String testProfileRunId, BinaryData body, + RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateTestProfileRunWithResponseAsync(testProfileRunId, body, requestOptions); } /** - * List the metric definitions for a load test run. + * Delete an existing load test profile run. + * + * Delete an existing load test profile run by providing the test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestProfileRunWithResponse(String testProfileRunId, + RequestOptions requestOptions) { + return this.serviceClient.deleteTestProfileRunWithResponseAsync(testProfileRunId, requestOptions); + } + + /** + * Get test profile run details. + * + * Get test profile run details by test profile run Id. *

Response Body Schema

* *
      * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             dimensions (Optional): [
-     *                  (Optional){
-     *                     description: String (Optional)
-     *                     name: String (Optional)
-     *                 }
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
      *             ]
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *             namespace: String (Optional)
-     *             primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional)
-     *             supportedAggregationTypes (Optional): [
+     *         }
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test profile run details. + * + * Get test profile run details by test profile run Id along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestProfileRunWithResponse(String testProfileRunId, + RequestOptions requestOptions) { + return this.serviceClient.getTestProfileRunWithResponseAsync(testProfileRunId, requestOptions); + } + + /** + * List test profile runs. + * + * Get all test profile runs for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
minStartDateTimeOffsetDateTimeNoMinimum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
maxStartDateTimeOffsetDateTimeNoMaximum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
minEndDateTimeOffsetDateTimeNoMinimum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
maxEndDateTimeOffsetDateTimeNoMaximum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
createdDateStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * the created time range to filter test profile runs.
createdDateEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of the + * created time range to filter test profile runs.
testProfileRunIdsList<String>NoComma separated list of IDs of the test + * profile runs to filter. In the form of "," separated string.
testProfileIdsList<String>NoComma separated IDs of the test profiles + * which should be associated with the test profile runs to fetch. In the form of "," separated string.
statusesList<String>NoComma separated list of Statuses of the test + * profile runs to filter. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
      *                 String (Optional)
      *             ]
-     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
-     *             metricAvailabilities (Optional): [
-     *                  (Optional){
-     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
-     *                 }
+     *         }
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfileRuns(RequestOptions requestOptions) { + return this.serviceClient.listTestProfileRunsAsync(requestOptions); + } + + /** + * Stop test profile run. + * + * Stop test profile run for the given test profile run Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
      *             ]
      *         }
      *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricNamespace Metric namespace to query metric definitions for. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric definitions along with {@link Response} on successful completion of - * {@link Mono}. + * @return test Profile Run model along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, + public Mono> stopTestProfileRunWithResponse(String testProfileRunId, RequestOptions requestOptions) { - return this.serviceClient.getMetricDefinitionsWithResponseAsync(testRunId, metricNamespace, requestOptions); + return this.serviceClient.stopTestProfileRunWithResponseAsync(testProfileRunId, requestOptions); + } + + /** + * Create and start a new test run with the given test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. + * @param oldTestRunId Existing test run identifier that should be rerun, if this is provided, the + * test will run with the JMX file, configuration and app components from the + * existing test run. You can override the configuration values for new test run + * in the request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test run model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateTestRun(String testRunId, LoadTestRun body, String oldTestRunId) { + // Generated convenience method for createOrUpdateTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (oldTestRunId != null) { + requestOptions.addQueryParam("oldTestRunId", oldTestRunId, false); + } + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestRunWithResponse(testRunId, bodyInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LoadTestRun.class)); + } + + /** + * Create and start a new test run with the given test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test run model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateTestRun(String testRunId, LoadTestRun body) { + // Generated convenience method for createOrUpdateTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestRunWithResponse(testRunId, bodyInBinaryData, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LoadTestRun.class)); + } + + /** + * Add an app component to a test run. + * + * Add an app component to a test run by providing the resource Id, name and type. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run app component on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAppComponents(String testRunId, TestRunAppComponents body) { + // Generated convenience method for createOrUpdateAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestRunAppComponentsAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestRunAppComponentsAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateAppComponentsWithResponse(testRunId, bodyInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestRunAppComponents.class)); + } + + /** + * Configure server metrics for a test run. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run server metrics configuration on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateServerMetricsConfig(String testRunId, + TestRunServerMetricsConfiguration body) { + // Generated convenience method for createOrUpdateServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestRunServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestRunServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateServerMetricsConfigWithResponse(testRunId, bodyInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestRunServerMetricsConfiguration.class)); + } + + /** + * Delete an existing load test run. + * + * Delete an existing load test run by providing the testRunId. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTestRun(String testRunId) { + // Generated convenience method for deleteTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTestRunWithResponse(testRunId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get associated app component (collection of azure resources) for the given test + * run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated app component (collection of azure resources) for the given test + * run on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAppComponents(String testRunId) { + // Generated convenience method for getAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAppComponentsWithResponse(testRunId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestRunAppComponents.class)); + } + + /** + * Get associated server metrics configuration for the given test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated server metrics configuration for the given test run on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getServerMetricsConfig(String testRunId) { + // Generated convenience method for getServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getServerMetricsConfigWithResponse(testRunId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestRunServerMetricsConfiguration.class)); + } + + /** + * Get test run details by test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run details by test run Id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestRun(String testRunId) { + // Generated convenience method for getTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestRunWithResponse(testRunId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LoadTestRun.class)); + } + + /** + * Get test run file by file name. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Name of the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run file by file name on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestRunFile(String testRunId, String fileName) { + // Generated convenience method for getTestRunFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestRunFileWithResponse(testRunId, fileName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestRunFileInfo.class)); + } + + /** + * List the dimension values for the given metric dimension name. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metrics dimension values as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetricDimensionValues(String testRunId, String name, String metricname, + String metricNamespace, String timespan, TimeGrain interval) { + // Generated convenience method for listMetricDimensionValues + RequestOptions requestOptions = new RequestOptions(); + if (interval != null) { + requestOptions.addQueryParam("interval", interval.toString(), false); + } + PagedFlux pagedFluxResponse + = listMetricDimensionValues(testRunId, name, metricname, metricNamespace, timespan, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List the dimension values for the given metric dimension name. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metrics dimension values as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetricDimensionValues(String testRunId, String name, String metricname, + String metricNamespace, String timespan) { + // Generated convenience method for listMetricDimensionValues + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse + = listMetricDimensionValues(testRunId, name, metricname, metricNamespace, timespan, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List the metric definitions for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricNamespace Metric namespace to query metric definitions for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMetricDefinitions(String testRunId, String metricNamespace) { + // Generated convenience method for getMetricDefinitionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMetricDefinitionsWithResponse(testRunId, metricNamespace, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MetricDefinitions.class)); + } + + /** + * List the metric namespaces for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric namespaces on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMetricNamespaces(String testRunId) { + // Generated convenience method for getMetricNamespacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMetricNamespacesWithResponse(testRunId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MetricNamespaces.class)); + } + + /** + * List the metric values for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param aggregation The aggregation. + * @param interval The interval (i.e. timegrain) of the query. + * @param body Metric dimension filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetrics(String testRunId, String metricname, String metricNamespace, + String timespan, String aggregation, TimeGrain interval, MetricsFilters body) { + // Generated convenience method for listMetrics + RequestOptions requestOptions = new RequestOptions(); + if (aggregation != null) { + requestOptions.addQueryParam("aggregation", aggregation, false); + } + if (interval != null) { + requestOptions.addQueryParam("interval", interval.toString(), false); + } + if (body != null) { + requestOptions.setBody(BinaryData.fromObject(body)); + } + PagedFlux pagedFluxResponse + = listMetrics(testRunId, metricname, metricNamespace, timespan, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TimeSeriesElement.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List the metric values for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetrics(String testRunId, String metricname, String metricNamespace, + String timespan) { + // Generated convenience method for listMetrics + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse + = listMetrics(testRunId, metricname, metricNamespace, timespan, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TimeSeriesElement.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get all test runs for the given filters. + * + * @param orderBy Sort on the supported fields in (field asc/desc) format. eg: executedDateTime + * asc. Supported fields - executedDateTime. + * @param search Prefix based, case sensitive search on searchable fields - description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500. + * @param testId Unique name of an existing load test. + * @param executionFrom Start DateTime(RFC 3339 literal format) of test-run execution time filter range. + * @param executionTo End DateTime(RFC 3339 literal format) of test-run execution time filter range. + * @param status Comma separated list of test run status. + * @param createdByTypes Comma separated list of type of entities that have created the test run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all test runs for the given filters as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRuns(String orderBy, String search, String testId, + OffsetDateTime executionFrom, OffsetDateTime executionTo, String status, List createdByTypes) { + // Generated convenience method for listTestRuns + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (testId != null) { + requestOptions.addQueryParam("testId", testId, false); + } + if (executionFrom != null) { + requestOptions.addQueryParam("executionFrom", String.valueOf(executionFrom), false); + } + if (executionTo != null) { + requestOptions.addQueryParam("executionTo", String.valueOf(executionTo), false); + } + if (status != null) { + requestOptions.addQueryParam("status", status, false); + } + if (createdByTypes != null) { + requestOptions.addQueryParam("createdByTypes", + createdByTypes.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + PagedFlux pagedFluxResponse = listTestRuns(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(LoadTestRun.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get all test runs for the given filters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all test runs for the given filters as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRuns() { + // Generated convenience method for listTestRuns + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTestRuns(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(LoadTestRun.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Stop test run by test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test run model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopTestRun(String testRunId) { + // Generated convenience method for stopTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopTestRunWithResponse(testRunId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LoadTestRun.class)); + } + + /** + * Create and start a new test profile run. + * + * Create and start a new test profile run with the given test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test Profile Run model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateTestProfileRun(String testProfileRunId, TestProfileRun body) { + // Generated convenience method for createOrUpdateTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestProfileRunAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestProfileRunAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestProfileRunWithResponse(testProfileRunId, bodyInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestProfileRun.class)); + } + + /** + * Delete an existing load test profile run. + * + * Delete an existing load test profile run by providing the test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteTestProfileRun(String testProfileRunId) { + // Generated convenience method for deleteTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteTestProfileRunWithResponse(testProfileRunId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get test profile run details. + * + * Get test profile run details by test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test profile run details. + * + * Get test profile run details by test profile run Id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTestProfileRun(String testProfileRunId) { + // Generated convenience method for getTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestProfileRunWithResponse(testProfileRunId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestProfileRun.class)); + } + + /** + * List test profile runs. + * + * Get all test profile runs for the given filters. + * + * @param minStartDateTime Minimum Start DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param maxStartDateTime Maximum Start DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param minEndDateTime Minimum End DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param maxEndDateTime Maximum End DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param createdDateStartTime Start DateTime(RFC 3339 literal format) of the created time range to filter test + * profile runs. + * @param createdDateEndTime End DateTime(RFC 3339 literal format) of the created time range to filter test profile + * runs. + * @param testProfileRunIds Comma separated list of IDs of the test profile runs to filter. + * @param testProfileIds Comma separated IDs of the test profiles which should be associated with the test profile + * runs to fetch. + * @param statuses Comma separated list of Statuses of the test profile runs to filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfileRuns(OffsetDateTime minStartDateTime, + OffsetDateTime maxStartDateTime, OffsetDateTime minEndDateTime, OffsetDateTime maxEndDateTime, + OffsetDateTime createdDateStartTime, OffsetDateTime createdDateEndTime, List testProfileRunIds, + List testProfileIds, List statuses) { + // Generated convenience method for listTestProfileRuns + RequestOptions requestOptions = new RequestOptions(); + if (minStartDateTime != null) { + requestOptions.addQueryParam("minStartDateTime", String.valueOf(minStartDateTime), false); + } + if (maxStartDateTime != null) { + requestOptions.addQueryParam("maxStartDateTime", String.valueOf(maxStartDateTime), false); + } + if (minEndDateTime != null) { + requestOptions.addQueryParam("minEndDateTime", String.valueOf(minEndDateTime), false); + } + if (maxEndDateTime != null) { + requestOptions.addQueryParam("maxEndDateTime", String.valueOf(maxEndDateTime), false); + } + if (createdDateStartTime != null) { + requestOptions.addQueryParam("createdDateStartTime", String.valueOf(createdDateStartTime), false); + } + if (createdDateEndTime != null) { + requestOptions.addQueryParam("createdDateEndTime", String.valueOf(createdDateEndTime), false); + } + if (testProfileRunIds != null) { + requestOptions.addQueryParam("testProfileRunIds", + testProfileRunIds.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + if (testProfileIds != null) { + requestOptions.addQueryParam("testProfileIds", + testProfileIds.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + if (statuses != null) { + requestOptions.addQueryParam("statuses", + statuses.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + PagedFlux pagedFluxResponse = listTestProfileRuns(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TestProfileRun.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List test profile runs. + * + * Get all test profile runs for the given filters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfileRuns() { + // Generated convenience method for listTestProfileRuns + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listTestProfileRuns(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(TestProfileRun.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Stop test profile run. + * + * Stop test profile run for the given test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test Profile Run model on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopTestProfileRun(String testProfileRunId) { + // Generated convenience method for stopTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopTestProfileRunWithResponse(testProfileRunId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TestProfileRun.class)); } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClient.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClient.java index 64358eff94b3..08b3fac978ce 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClient.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClient.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -11,54 +12,206 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.SyncPoller; -import com.azure.developer.loadtesting.implementation.LoadTestRunsImpl; -import java.time.Duration; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.developer.loadtesting.models.LoadTestRun; +import com.azure.developer.loadtesting.models.MetricDefinitions; +import com.azure.developer.loadtesting.models.MetricNamespaces; +import com.azure.developer.loadtesting.models.MetricsFilters; +import com.azure.developer.loadtesting.models.TestProfileRun; +import com.azure.developer.loadtesting.models.TestRunAppComponents; +import com.azure.developer.loadtesting.models.TestRunFileInfo; +import com.azure.developer.loadtesting.models.TestRunServerMetricsConfiguration; +import com.azure.developer.loadtesting.models.TimeGrain; +import com.azure.developer.loadtesting.models.TimeSeriesElement; +import java.time.OffsetDateTime; +import java.util.List; /** - * Initializes a new instance of the synchronous LoadTestingClient type. + * Initializes a new instance of the synchronous LoadTestRunClient type. */ @ServiceClient(builder = LoadTestRunClientBuilder.class) public final class LoadTestRunClient { - @Generated - private final LoadTestRunsImpl serviceClient; + private final LoadTestRunAsyncClient client; /** * Initializes an instance of LoadTestRunClient class. - * - * @param serviceClient the service client implementation. + * + * @param client the async client. */ @Generated - LoadTestRunClient(LoadTestRunsImpl serviceClient) { - this.serviceClient = serviceClient; + LoadTestRunClient(LoadTestRunAsyncClient client) { + this.client = client; } /** - * Configure server metrics for a test run. + * Create and start a new test run with the given test run Id. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this + * is provided, the + * test will run with the JMX file, configuration and app components from the + * existing test run. You can override the configuration values for new test run + * in the request body.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

* *
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -72,19 +225,152 @@ public final class LoadTestRunClient {
      * 
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -92,63 +378,38 @@ public final class LoadTestRunClient {
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric configuration model. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response}. + * @return load test run model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, + Response createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateServerMetricsConfigWithResponse(testRunId, body, requestOptions); - } - - /** - * Starts a test run and polls the status of the test run. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. - * @param testRunRequestOptions The options to configure the file upload HTTP request before HTTP client sends it. - * @throws ResourceNotFoundException when a test with {@code testRunId} doesn't exist. - * @return A {@link SyncPoller} to poll on and retrieve the test run - * status(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE). - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginTestRun(String testRunId, BinaryData body, - RequestOptions testRunRequestOptions) { - RequestOptions defaultRequestOptions = new RequestOptions(); - if (testRunRequestOptions != null) { - defaultRequestOptions.setContext(testRunRequestOptions.getContext()); - } - return SyncPoller.createPoller(Duration.ofSeconds(5), - (context) -> PollingUtils - .getTestRunStatus(createOrUpdateTestRunWithResponse(testRunId, body, testRunRequestOptions).getValue()), - (context) -> PollingUtils - .getTestRunStatus(getTestRunWithResponse(testRunId, defaultRequestOptions).getValue()), - (activationResponse, context) -> stopTestRunWithResponse(testRunId, defaultRequestOptions).getValue(), - (context) -> getTestRunWithResponse(testRunId, defaultRequestOptions).getValue()); + return this.client.createOrUpdateTestRunWithResponse(testRunId, body, requestOptions).block(); } /** - * Associate an app component (collection of azure resources) to a test run. + * Add an app component to a test run. + * + * Add an app component to a test run by providing the resource Id, name and type. *

Request Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
      *             displayName: String (Optional)
      *             resourceGroup: String (Optional)
      *             subscriptionId: String (Optional)
@@ -169,11 +430,11 @@ public SyncPoller beginTestRun(String testRunId, BinaryD
      * 
      * {@code
      * {
-     *     components (Required): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
      *             displayName: String (Optional)
      *             resourceGroup: String (Optional)
      *             subscriptionId: String (Optional)
@@ -188,9 +449,9 @@ public SyncPoller beginTestRun(String testRunId, BinaryD
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param body App Component model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -203,173 +464,113 @@ public SyncPoller beginTestRun(String testRunId, BinaryD @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateAppComponentsWithResponse(String testRunId, BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateAppComponentsWithResponse(testRunId, body, requestOptions); + return this.client.createOrUpdateAppComponentsWithResponse(testRunId, body, requestOptions).block(); } /** - * List the metric values for a load test run. - *

- * Query Parameters - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

- * Header Parameters - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

- * Request Body Schema - *

- * + * Configure server metrics for a test run. + *

Request Body Schema

+ * *
      * {@code
      * {
-     *     filters (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
-     *     ]
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
- * - *

- * Response Body Schema - *

- * + * + *

Response Body Schema

+ * *
      * {@code
      * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
-     *     ]
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response to a metrics query as paginated response with {@link PagedIterable}. + * @return test run server metrics configuration along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - if (requestOptions == null) { - requestOptions = new RequestOptions(); - } - // Content-Type header required even though body can be null - requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "application/json"); - return this.serviceClient.listMetrics(testRunId, metricName, metricNamespace, timespan, requestOptions); + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, + RequestOptions requestOptions) { + return this.client.createOrUpdateServerMetricsConfigWithResponse(testRunId, body, requestOptions).block(); } /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

+ * Delete an existing load test run. * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. + * Delete an existing load test run by providing the testRunId. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - return this.serviceClient.listMetricDimensionValues(testRunId, name, metricName, metricNamespace, timespan, - requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.deleteTestRunWithResponse(testRunId, requestOptions).block(); } /** - * Get associated app component (collection of azure resources) for the given test run. + * Get associated app component (collection of azure resources) for the given test + * run. *

Response Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
      *             displayName: String (Optional)
      *             resourceGroup: String (Optional)
      *             subscriptionId: String (Optional)
@@ -384,25 +585,25 @@ public PagedIterable listMetricDimensionValues(String testRunId, Str
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response}. + * @return associated app component (collection of azure resources) for the given test + * run along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getAppComponentsWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getAppComponentsWithResponse(testRunId, requestOptions); + return this.client.getAppComponentsWithResponse(testRunId, requestOptions).block(); } /** - * List server metrics configuration for the given test run. + * Get associated server metrics configuration for the given test run. *

Response Body Schema

* *
@@ -412,13 +613,13 @@ public Response getAppComponentsWithResponse(String testRunId, Reque
      *     metrics (Optional): {
      *         String (Required): {
      *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
      *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
      *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             resourceType: String (Optional, Required on create)
      *         }
      *     }
      *     createdDateTime: OffsetDateTime (Optional)
@@ -428,59 +629,35 @@ public Response getAppComponentsWithResponse(String testRunId, Reque
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response}. + * @return associated server metrics configuration for the given test run along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getServerMetricsConfigWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getServerMetricsConfigWithResponse(testRunId, requestOptions); + return this.client.getServerMetricsConfigWithResponse(testRunId, requestOptions).block(); } /** - * Create and start a new test run with the given name. - * - *

- * Query Parameters - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this is provided, the test will run with the JMX file, - * configuration and app components from the existing test run. You can override the configuration values for new - * test run in the request body.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

- * Request Body Schema - * + * Get test run details by test run Id. + *

Response Body Schema

+ * *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
-     *             String (Optional): {
+     *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -489,9 +666,28 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
-     *         String (Optional): {
+     *         String (Required): {
      *             value: String (Optional)
      *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
      *         }
@@ -502,7 +698,7 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      *         name: String (Optional)
      *     }
      *     environmentVariables (Optional): {
-     *         String: String (Optional)
+     *         String: String (Required)
      *     }
      *     errorDetails (Optional): [
      *          (Optional){
@@ -510,7 +706,7 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      *         }
      *     ]
      *     testRunStatistics (Optional): {
-     *         String (Optional): {
+     *         String (Required): {
      *             transaction: String (Optional)
      *             sampleCount: Double (Optional)
      *             errorCount: Double (Optional)
@@ -522,28 +718,45 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -551,6 +764,7 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -558,11 +772,15 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -572,7 +790,14 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -580,331 +805,279 @@ public Response getServerMetricsConfigWithResponse(String testRunId,
      * }
      * }
      * 
- * - *

- * Response Body Schema - * + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test run details by test run Id along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.getTestRunWithResponse(testRunId, requestOptions).block(); + } + + /** + * Get test run file by file name. + *

Response Body Schema

+ * *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Optional): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Optional): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Optional): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Name of the file. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response}. + * @return test run file by file name along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, + public Response getTestRunFileWithResponse(String testRunId, String fileName, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateTestRunWithResponse(testRunId, body, requestOptions); + return this.client.getTestRunFileWithResponse(testRunId, fileName, requestOptions).block(); } /** - * Get test run details by name. + * List the dimension values for the given metric dimension name. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: + * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
+     * String
+     * }
+     * 
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return metrics dimension values as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricname, + String metricNamespace, String timespan, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listMetricDimensionValues(testRunId, name, metricname, metricNamespace, + timespan, requestOptions)); + } + + /** + * List the metric definitions for a load test run. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             dimensions (Optional): [
+     *                  (Optional){
+     *                     description: String (Optional)
+     *                     name: String (Optional)
+     *                 }
+     *             ]
+     *             description: String (Optional)
+     *             name: String (Optional)
+     *             namespace: String (Optional)
+     *             primaryAggregationType: String(Average/Count/None/Total/Percentile75/Percentile90/Percentile95/Percentile96/Percentile97/Percentile98/Percentile99/Percentile999/Percentile9999) (Optional)
+     *             supportedAggregationTypes (Optional): [
+     *                 String (Optional)
+     *             ]
+     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
+     *             metricAvailabilities (Optional): [
+     *                  (Optional){
+     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
+     *                 }
      *             ]
      *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
+     *     ]
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricNamespace Metric namespace to query metric definitions for. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name along with {@link Response}. + * @return represents collection of metric definitions along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getTestRunWithResponse(testRunId, requestOptions); + public Response getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, + RequestOptions requestOptions) { + return this.client.getMetricDefinitionsWithResponse(testRunId, metricNamespace, requestOptions).block(); } /** - * Delete a test run by its name. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * List the metric namespaces for a load test run. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     value (Required): [
+     *          (Required){
+     *             description: String (Optional)
+     *             name: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return represents collection of metric namespaces along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.deleteTestRunWithResponse(testRunId, requestOptions); + public Response getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { + return this.client.getMetricNamespacesWithResponse(testRunId, requestOptions).block(); } /** - * Get test run file by file name. + * List the metric values for a load test run. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: + * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/json".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     filters (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             values (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
+     *     data (Optional): [
+     *          (Optional){
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: Double (Optional)
+     *         }
+     *     ]
+     *     dimensionValues (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             value: String (Optional)
+     *         }
+     *     ]
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response}. + * @return the response to a metrics query as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunFileWithResponse(String testRunId, String fileName, - RequestOptions requestOptions) { - return this.serviceClient.getTestRunFileWithResponse(testRunId, fileName, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMetrics(String testRunId, String metricname, String metricNamespace, + String timespan, RequestOptions requestOptions) { + return new PagedIterable<>( + this.client.listMetrics(testRunId, metricname, metricNamespace, timespan, requestOptions)); } /** - * Get all test runs with given filters. + * Get all test runs for the given filters. *

Query Parameters

* * * * + * executedDateTime + * asc. Supported fields - executedDateTime * + * description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500. * - * - * * * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of + *
executionFromOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run + *
executionToOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of test-run * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
createdByTypesList<String>NoComma separated list of type of entities + * that have created the test run. In the form of "," separated string.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -912,11 +1085,12 @@ public Response getTestRunFileWithResponse(String testRunId, String *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -925,6 +1099,25 @@ public Response getTestRunFileWithResponse(String testRunId, String
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -958,28 +1151,45 @@ public Response getTestRunFileWithResponse(String testRunId, String
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -987,6 +1197,7 @@ public Response getTestRunFileWithResponse(String testRunId, String
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -994,11 +1205,15 @@ public Response getTestRunFileWithResponse(String testRunId, String
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -1008,7 +1223,14 @@ public Response getTestRunFileWithResponse(String testRunId, String
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1016,32 +1238,33 @@ public Response getTestRunFileWithResponse(String testRunId, String
      * }
      * }
      * 
- * + * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedIterable}. + * @return all test runs for the given filters as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listTestRuns(RequestOptions requestOptions) { - return this.serviceClient.listTestRuns(requestOptions); + return new PagedIterable<>(this.client.listTestRuns(requestOptions)); } /** - * Stop test run by name. + * Stop test run by test run Id. *

Response Body Schema

* *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -1050,6 +1273,25 @@ public PagedIterable listTestRuns(RequestOptions requestOptions) {
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -1083,28 +1325,45 @@ public PagedIterable listTestRuns(RequestOptions requestOptions) {
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -1112,6 +1371,7 @@ public PagedIterable listTestRuns(RequestOptions requestOptions) {
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -1119,11 +1379,15 @@ public PagedIterable listTestRuns(RequestOptions requestOptions) {
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -1133,7 +1397,14 @@ public PagedIterable listTestRuns(RequestOptions requestOptions) {
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1141,9 +1412,9 @@ public PagedIterable listTestRuns(RequestOptions requestOptions) {
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1154,89 +1425,976 @@ public PagedIterable listTestRuns(RequestOptions requestOptions) { @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.stopTestRunWithResponse(testRunId, requestOptions); + return this.client.stopTestRunWithResponse(testRunId, requestOptions).block(); } /** - * List the metric namespaces for a load test run. - *

Response Body Schema

+ * Create and start a new test profile run. + * + * Create and start a new test profile run with the given test profile run Id. + *

Request Body Schema

* *
      * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
      *         }
      *     ]
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response}. - */ + * startDateTime: OffsetDateTime (Optional) + * endDateTime: OffsetDateTime (Optional) + * durationInSeconds: Long (Optional) + * testRunDetails (Optional): { + * String (Required): { + * status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required) + * configurationId: String (Required) + * properties (Required): { + * String: String (Required) + * } + * } + * } + * recommendations (Optional): [ + * (Optional){ + * category: String(ThroughputOptimized/CostOptimized) (Required) + * configurations (Optional): [ + * String (Optional) + * ] + * } + * ] + * createdDateTime: OffsetDateTime (Optional) + * createdBy: String (Optional) + * lastModifiedDateTime: OffsetDateTime (Optional) + * lastModifiedBy: String (Optional) + * } + * } + *
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test Profile Run model along with {@link Response}. + */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { - return this.serviceClient.getMetricNamespacesWithResponse(testRunId, requestOptions); + Response createOrUpdateTestProfileRunWithResponse(String testProfileRunId, BinaryData body, + RequestOptions requestOptions) { + return this.client.createOrUpdateTestProfileRunWithResponse(testProfileRunId, body, requestOptions).block(); } /** - * List the metric definitions for a load test run. + * Delete an existing load test profile run. + * + * Delete an existing load test profile run by providing the test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestProfileRunWithResponse(String testProfileRunId, RequestOptions requestOptions) { + return this.client.deleteTestProfileRunWithResponse(testProfileRunId, requestOptions).block(); + } + + /** + * Get test profile run details. + * + * Get test profile run details by test profile run Id. *

Response Body Schema

* *
      * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             dimensions (Optional): [
-     *                  (Optional){
-     *                     description: String (Optional)
-     *                     name: String (Optional)
-     *                 }
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
      *             ]
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *             namespace: String (Optional)
-     *             primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional)
-     *             supportedAggregationTypes (Optional): [
+     *         }
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test profile run details. + * + * Get test profile run details by test profile run Id along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestProfileRunWithResponse(String testProfileRunId, RequestOptions requestOptions) { + return this.client.getTestProfileRunWithResponse(testProfileRunId, requestOptions).block(); + } + + /** + * List test profile runs. + * + * Get all test profile runs for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
minStartDateTimeOffsetDateTimeNoMinimum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
maxStartDateTimeOffsetDateTimeNoMaximum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
minEndDateTimeOffsetDateTimeNoMinimum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
maxEndDateTimeOffsetDateTimeNoMaximum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
createdDateStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * the created time range to filter test profile runs.
createdDateEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of the + * created time range to filter test profile runs.
testProfileRunIdsList<String>NoComma separated list of IDs of the test + * profile runs to filter. In the form of "," separated string.
testProfileIdsList<String>NoComma separated IDs of the test profiles + * which should be associated with the test profile runs to fetch. In the form of "," separated string.
statusesList<String>NoComma separated list of Statuses of the test + * profile runs to filter. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
      *                 String (Optional)
      *             ]
-     *             unit: String(NotSpecified/Percent/Count/Seconds/Milliseconds/Bytes/BytesPerSecond/CountPerSecond) (Optional)
-     *             metricAvailabilities (Optional): [
-     *                  (Optional){
-     *                     timeGrain: String(PT5S/PT10S/PT1M/PT5M/PT1H) (Optional)
-     *                 }
+     *         }
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfileRuns(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listTestProfileRuns(requestOptions)); + } + + /** + * Stop test profile run. + * + * Stop test profile run for the given test profile run Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
      *             ]
      *         }
      *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricNamespace Metric namespace to query metric definitions for. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric definitions along with {@link Response}. + * @return test Profile Run model along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, - RequestOptions requestOptions) { - return this.serviceClient.getMetricDefinitionsWithResponse(testRunId, metricNamespace, requestOptions); + public Response stopTestProfileRunWithResponse(String testProfileRunId, RequestOptions requestOptions) { + return this.client.stopTestProfileRunWithResponse(testProfileRunId, requestOptions).block(); + } + + /** + * Create and start a new test run with the given test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. + * @param oldTestRunId Existing test run identifier that should be rerun, if this is provided, the + * test will run with the JMX file, configuration and app components from the + * existing test run. You can override the configuration values for new test run + * in the request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test run model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + LoadTestRun createOrUpdateTestRun(String testRunId, LoadTestRun body, String oldTestRunId) { + // Generated convenience method for createOrUpdateTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (oldTestRunId != null) { + requestOptions.addQueryParam("oldTestRunId", oldTestRunId, false); + } + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestRunWithResponse(testRunId, bodyInBinaryData, requestOptions).getValue() + .toObject(LoadTestRun.class); + } + + /** + * Create and start a new test run with the given test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test run model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + LoadTestRun createOrUpdateTestRun(String testRunId, LoadTestRun body) { + // Generated convenience method for createOrUpdateTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getLoadTestRunAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestRunWithResponse(testRunId, bodyInBinaryData, requestOptions).getValue() + .toObject(LoadTestRun.class); + } + + /** + * Add an app component to a test run. + * + * Add an app component to a test run by providing the resource Id, name and type. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run app component. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestRunAppComponents createOrUpdateAppComponents(String testRunId, TestRunAppComponents body) { + // Generated convenience method for createOrUpdateAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestRunAppComponentsAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestRunAppComponentsAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateAppComponentsWithResponse(testRunId, bodyInBinaryData, requestOptions).getValue() + .toObject(TestRunAppComponents.class); + } + + /** + * Configure server metrics for a test run. + * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run server metrics configuration. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestRunServerMetricsConfiguration createOrUpdateServerMetricsConfig(String testRunId, + TestRunServerMetricsConfiguration body) { + // Generated convenience method for createOrUpdateServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestRunServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestRunServerMetricsConfigurationAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateServerMetricsConfigWithResponse(testRunId, bodyInBinaryData, requestOptions).getValue() + .toObject(TestRunServerMetricsConfiguration.class); + } + + /** + * Delete an existing load test run. + * + * Delete an existing load test run by providing the testRunId. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTestRun(String testRunId) { + // Generated convenience method for deleteTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTestRunWithResponse(testRunId, requestOptions).getValue(); + } + + /** + * Get associated app component (collection of azure resources) for the given test + * run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated app component (collection of azure resources) for the given test + * run. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestRunAppComponents getAppComponents(String testRunId) { + // Generated convenience method for getAppComponentsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getAppComponentsWithResponse(testRunId, requestOptions).getValue().toObject(TestRunAppComponents.class); + } + + /** + * Get associated server metrics configuration for the given test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return associated server metrics configuration for the given test run. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestRunServerMetricsConfiguration getServerMetricsConfig(String testRunId) { + // Generated convenience method for getServerMetricsConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getServerMetricsConfigWithResponse(testRunId, requestOptions).getValue() + .toObject(TestRunServerMetricsConfiguration.class); + } + + /** + * Get test run details by test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run details by test run Id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadTestRun getTestRun(String testRunId) { + // Generated convenience method for getTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestRunWithResponse(testRunId, requestOptions).getValue().toObject(LoadTestRun.class); + } + + /** + * Get test run file by file name. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Name of the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test run file by file name. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestRunFileInfo getTestRunFile(String testRunId, String fileName) { + // Generated convenience method for getTestRunFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestRunFileWithResponse(testRunId, fileName, requestOptions).getValue() + .toObject(TestRunFileInfo.class); + } + + /** + * List the dimension values for the given metric dimension name. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metrics dimension values as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricname, + String metricNamespace, String timespan, TimeGrain interval) { + // Generated convenience method for listMetricDimensionValues + return new PagedIterable<>( + client.listMetricDimensionValues(testRunId, name, metricname, metricNamespace, timespan, interval)); + } + + /** + * List the dimension values for the given metric dimension name. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return metrics dimension values as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricname, + String metricNamespace, String timespan) { + // Generated convenience method for listMetricDimensionValues + return new PagedIterable<>( + client.listMetricDimensionValues(testRunId, name, metricname, metricNamespace, timespan)); + } + + /** + * List the metric definitions for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricNamespace Metric namespace to query metric definitions for. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MetricDefinitions getMetricDefinitions(String testRunId, String metricNamespace) { + // Generated convenience method for getMetricDefinitionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMetricDefinitionsWithResponse(testRunId, metricNamespace, requestOptions).getValue() + .toObject(MetricDefinitions.class); + } + + /** + * List the metric namespaces for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric namespaces. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MetricNamespaces getMetricNamespaces(String testRunId) { + // Generated convenience method for getMetricNamespacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMetricNamespacesWithResponse(testRunId, requestOptions).getValue().toObject(MetricNamespaces.class); + } + + /** + * List the metric values for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param aggregation The aggregation. + * @param interval The interval (i.e. timegrain) of the query. + * @param body Metric dimension filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMetrics(String testRunId, String metricname, String metricNamespace, + String timespan, String aggregation, TimeGrain interval, MetricsFilters body) { + // Generated convenience method for listMetrics + return new PagedIterable<>( + client.listMetrics(testRunId, metricname, metricNamespace, timespan, aggregation, interval, body)); + } + + /** + * List the metric values for a load test run. + * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMetrics(String testRunId, String metricname, String metricNamespace, + String timespan) { + // Generated convenience method for listMetrics + return new PagedIterable<>(client.listMetrics(testRunId, metricname, metricNamespace, timespan)); + } + + /** + * Get all test runs for the given filters. + * + * @param orderBy Sort on the supported fields in (field asc/desc) format. eg: executedDateTime + * asc. Supported fields - executedDateTime. + * @param search Prefix based, case sensitive search on searchable fields - description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500. + * @param testId Unique name of an existing load test. + * @param executionFrom Start DateTime(RFC 3339 literal format) of test-run execution time filter range. + * @param executionTo End DateTime(RFC 3339 literal format) of test-run execution time filter range. + * @param status Comma separated list of test run status. + * @param createdByTypes Comma separated list of type of entities that have created the test run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all test runs for the given filters as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestRuns(String orderBy, String search, String testId, + OffsetDateTime executionFrom, OffsetDateTime executionTo, String status, List createdByTypes) { + // Generated convenience method for listTestRuns + return new PagedIterable<>( + client.listTestRuns(orderBy, search, testId, executionFrom, executionTo, status, createdByTypes)); + } + + /** + * Get all test runs for the given filters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all test runs for the given filters as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestRuns() { + // Generated convenience method for listTestRuns + return new PagedIterable<>(client.listTestRuns()); + } + + /** + * Stop test run by test run Id. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return load test run model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LoadTestRun stopTestRun(String testRunId) { + // Generated convenience method for stopTestRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopTestRunWithResponse(testRunId, requestOptions).getValue().toObject(LoadTestRun.class); + } + + /** + * Create and start a new test profile run. + * + * Create and start a new test profile run with the given test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test Profile Run model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + TestProfileRun createOrUpdateTestProfileRun(String testProfileRunId, TestProfileRun body) { + // Generated convenience method for createOrUpdateTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getTestProfileRunAccessor().prepareModelForJsonMergePatch(body, true); + BinaryData bodyInBinaryData = BinaryData.fromObject(body); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + bodyInBinaryData.getLength(); + JsonMergePatchHelper.getTestProfileRunAccessor().prepareModelForJsonMergePatch(body, false); + return createOrUpdateTestProfileRunWithResponse(testProfileRunId, bodyInBinaryData, requestOptions).getValue() + .toObject(TestProfileRun.class); + } + + /** + * Delete an existing load test profile run. + * + * Delete an existing load test profile run by providing the test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteTestProfileRun(String testProfileRunId) { + // Generated convenience method for deleteTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteTestProfileRunWithResponse(testProfileRunId, requestOptions).getValue(); + } + + /** + * Get test profile run details. + * + * Get test profile run details by test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test profile run details. + * + * Get test profile run details by test profile run Id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestProfileRun getTestProfileRun(String testProfileRunId) { + // Generated convenience method for getTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getTestProfileRunWithResponse(testProfileRunId, requestOptions).getValue() + .toObject(TestProfileRun.class); + } + + /** + * List test profile runs. + * + * Get all test profile runs for the given filters. + * + * @param minStartDateTime Minimum Start DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param maxStartDateTime Maximum Start DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param minEndDateTime Minimum End DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param maxEndDateTime Maximum End DateTime(RFC 3339 literal format) of the test profile runs to filter on. + * @param createdDateStartTime Start DateTime(RFC 3339 literal format) of the created time range to filter test + * profile runs. + * @param createdDateEndTime End DateTime(RFC 3339 literal format) of the created time range to filter test profile + * runs. + * @param testProfileRunIds Comma separated list of IDs of the test profile runs to filter. + * @param testProfileIds Comma separated IDs of the test profiles which should be associated with the test profile + * runs to fetch. + * @param statuses Comma separated list of Statuses of the test profile runs to filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfileRuns(OffsetDateTime minStartDateTime, + OffsetDateTime maxStartDateTime, OffsetDateTime minEndDateTime, OffsetDateTime maxEndDateTime, + OffsetDateTime createdDateStartTime, OffsetDateTime createdDateEndTime, List testProfileRunIds, + List testProfileIds, List statuses) { + // Generated convenience method for listTestProfileRuns + return new PagedIterable<>(client.listTestProfileRuns(minStartDateTime, maxStartDateTime, minEndDateTime, + maxEndDateTime, createdDateStartTime, createdDateEndTime, testProfileRunIds, testProfileIds, statuses)); + } + + /** + * List test profile runs. + * + * Get all test profile runs for the given filters. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfileRuns() { + // Generated convenience method for listTestProfileRuns + return new PagedIterable<>(client.listTestProfileRuns()); + } + + /** + * Stop test profile run. + * + * Stop test profile run for the given test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test Profile Run model. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public TestProfileRun stopTestProfileRun(String testProfileRunId) { + // Generated convenience method for stopTestProfileRunWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopTestProfileRunWithResponse(testProfileRunId, requestOptions).getValue() + .toObject(TestProfileRun.class); } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java index 8eef8080f17f..4ffa426eed9e 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.developer.loadtesting; import com.azure.core.annotation.Generated; @@ -33,7 +34,7 @@ import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.developer.loadtesting.implementation.LoadTestingClientImpl; +import com.azure.developer.loadtesting.implementation.LoadTestRunClientImpl; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,7 +47,6 @@ public final class LoadTestRunClientBuilder implements HttpTrait, ConfigurationTrait, TokenCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; @@ -56,6 +56,10 @@ public final class LoadTestRunClientBuilder @Generated private static final String[] DEFAULT_SCOPES = new String[] { "https://cnt-prod.loadtesting.azure.com/.default" }; + @Generated + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-developer-loadtesting.properties"); + @Generated private final List pipelinePolicies; @@ -217,7 +221,7 @@ public LoadTestRunClientBuilder endpoint(String endpoint) { /** * Sets Service version. - * + * * @param serviceVersion the serviceVersion value. * @return the LoadTestRunClientBuilder. */ @@ -235,7 +239,7 @@ public LoadTestRunClientBuilder serviceVersion(LoadTestingServiceVersion service /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the LoadTestRunClientBuilder. */ @@ -246,21 +250,28 @@ public LoadTestRunClientBuilder retryPolicy(RetryPolicy retryPolicy) { } /** - * Builds an instance of LoadTestingClientImpl with the provided parameters. - * - * @return an instance of LoadTestingClientImpl. + * Builds an instance of LoadTestRunClientImpl with the provided parameters. + * + * @return an instance of LoadTestRunClientImpl. */ @Generated - private LoadTestingClientImpl buildInnerClient() { + private LoadTestRunClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); LoadTestingServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); - LoadTestingClientImpl client = new LoadTestingClientImpl(localPipeline, + LoadTestRunClientImpl client = new LoadTestRunClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration @@ -301,34 +312,23 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of LoadTestRunAsyncClient class. - * + * * @return an instance of LoadTestRunAsyncClient. */ @Generated public LoadTestRunAsyncClient buildAsyncClient() { - return new LoadTestRunAsyncClient(buildInnerClient().getLoadTestRuns()); + return new LoadTestRunAsyncClient(buildInnerClient()); } /** * Builds an instance of LoadTestRunClient class. - * + * * @return an instance of LoadTestRunClient. */ @Generated public LoadTestRunClient buildClient() { - return new LoadTestRunClient(buildInnerClient().getLoadTestRuns()); + return new LoadTestRunClient(new LoadTestRunAsyncClient(buildInnerClient())); } - @Generated - private static final Map PROPERTIES - = CoreUtils.getProperties("azure-developer-loadtesting.properties"); - private static final ClientLogger LOGGER = new ClientLogger(LoadTestRunClientBuilder.class); - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java index 277cd8cc2f90..d6d0b575ffdf 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java @@ -1,19 +1,49 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.developer.loadtesting; import com.azure.core.util.ServiceVersion; /** - * Service version of LoadTestingClient. + * Service version of Load TestingClient. */ public enum LoadTestingServiceVersion implements ServiceVersion { /** * Enum value 2022-11-01. */ - V2022_11_01("2022-11-01"); + V2022_11_01("2022-11-01"), + + /** + * Enum value 2023-04-01-preview. + */ + V2023_04_01_PREVIEW("2023-04-01-preview"), + + /** + * Enum value 2024-03-01-preview. + */ + V2024_03_01_PREVIEW("2024-03-01-preview"), + + /** + * Enum value 2024-05-01-preview. + */ + V2024_05_01_PREVIEW("2024-05-01-preview"), + + /** + * Enum value 2024-07-01-preview. + */ + V2024_07_01_PREVIEW("2024-07-01-preview"), + + /** + * Enum value 2024-12-01-preview. + */ + V2024_12_01_PREVIEW("2024-12-01-preview"), + + /** + * Enum value 2025-03-01-preview. + */ + V2025_03_01_PREVIEW("2025-03-01-preview"); private final String version; @@ -35,6 +65,6 @@ public String getVersion() { * @return The latest {@link LoadTestingServiceVersion}. */ public static LoadTestingServiceVersion getLatest() { - return V2022_11_01; + return V2025_03_01_PREVIEW; } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/PollingUtils.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/PollingUtils.java deleted file mode 100644 index 39ab7f76248d..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/PollingUtils.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.developer.loadtesting; - -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import reactor.core.publisher.Mono; - -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.Callable; - -final class PollingUtils { - static Mono> getPollResponseMono(Callable> pollOperation) { - try { - return Mono.just(pollOperation.call()); - } catch (Exception e) { - return Mono.error(e); - } - } - - static PollResponse getValidationStatus(BinaryData fileBinary) throws RuntimeException { - String validationStatus, fileType; - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - validationStatus = jsonTree.get("validationStatus").toString(); - } catch (IOException e) { - throw new RuntimeException("Encountered exception while retrieving validation status", e); - } - - LongRunningOperationStatus lroStatus; - - switch (validationStatus) { - case "VALIDATION_NOT_REQUIRED": - case "VALIDATION_SUCCESS": - lroStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - - break; - - case "VALIDATION_FAILURE": - lroStatus = LongRunningOperationStatus.FAILED; - - break; - - case "VALIDATION_INITIATED": - lroStatus = LongRunningOperationStatus.IN_PROGRESS; - - break; - - case "NOT_VALIDATED": - lroStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - - break; - - default: - lroStatus = LongRunningOperationStatus.NOT_STARTED; - - break; - } - - return new PollResponse<>(lroStatus, fileBinary); - } - - static PollResponse getTestRunStatus(BinaryData testRunBinary) throws RuntimeException { - String status; - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - status = jsonTree.get("status").toString(); - } catch (IOException e) { - throw new RuntimeException("Encountered exception while retrieving test run status", e); - } - - LongRunningOperationStatus lroStatus; - - switch (status) { - case "NOTSTARTED": - lroStatus = LongRunningOperationStatus.NOT_STARTED; - - break; - - case "DONE": - lroStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - - break; - - case "FAILED": - lroStatus = LongRunningOperationStatus.FAILED; - - break; - - case "CANCELLED": - lroStatus = LongRunningOperationStatus.USER_CANCELLED; - - break; - - default: - lroStatus = LongRunningOperationStatus.IN_PROGRESS; - - break; - } - - return new PollResponse<>(lroStatus, testRunBinary); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/JsonMergePatchHelper.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/JsonMergePatchHelper.java new file mode 100644 index 000000000000..3fcbe12cdb7f --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/JsonMergePatchHelper.java @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.developer.loadtesting.models.AutoStopCriteria; +import com.azure.developer.loadtesting.models.FunctionFlexConsumptionResourceConfiguration; +import com.azure.developer.loadtesting.models.LoadTest; +import com.azure.developer.loadtesting.models.LoadTestConfiguration; +import com.azure.developer.loadtesting.models.LoadTestRun; +import com.azure.developer.loadtesting.models.LoadTestingAppComponent; +import com.azure.developer.loadtesting.models.NotificationRule; +import com.azure.developer.loadtesting.models.OptionalLoadTestConfiguration; +import com.azure.developer.loadtesting.models.PassFailCriteria; +import com.azure.developer.loadtesting.models.PassFailMetric; +import com.azure.developer.loadtesting.models.PassFailServerMetric; +import com.azure.developer.loadtesting.models.Recurrence; +import com.azure.developer.loadtesting.models.RecurrenceEnd; +import com.azure.developer.loadtesting.models.RegionalConfiguration; +import com.azure.developer.loadtesting.models.ResourceMetric; +import com.azure.developer.loadtesting.models.StateDetails; +import com.azure.developer.loadtesting.models.TargetResourceConfigurations; +import com.azure.developer.loadtesting.models.TestAppComponents; +import com.azure.developer.loadtesting.models.TestCertificate; +import com.azure.developer.loadtesting.models.TestProfile; +import com.azure.developer.loadtesting.models.TestProfileRun; +import com.azure.developer.loadtesting.models.TestRunAppComponents; +import com.azure.developer.loadtesting.models.TestRunEndedEventCondition; +import com.azure.developer.loadtesting.models.TestRunServerMetricsConfiguration; +import com.azure.developer.loadtesting.models.TestSecret; +import com.azure.developer.loadtesting.models.TestServerMetricsConfiguration; +import com.azure.developer.loadtesting.models.TestsNotificationEventFilter; +import com.azure.developer.loadtesting.models.Trigger; +import com.azure.developer.loadtesting.models.TriggerState; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * This is the Helper class to enable json merge patch serialization for a model. + */ +public class JsonMergePatchHelper { + private static LoadTestAccessor loadTestAccessor; + + public interface LoadTestAccessor { + LoadTest prepareModelForJsonMergePatch(LoadTest loadTest, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(LoadTest loadTest); + } + + public static void setLoadTestAccessor(LoadTestAccessor accessor) { + loadTestAccessor = accessor; + } + + public static LoadTestAccessor getLoadTestAccessor() { + return loadTestAccessor; + } + + private static PassFailCriteriaAccessor passFailCriteriaAccessor; + + public interface PassFailCriteriaAccessor { + PassFailCriteria prepareModelForJsonMergePatch(PassFailCriteria passFailCriteria, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(PassFailCriteria passFailCriteria); + } + + public static void setPassFailCriteriaAccessor(PassFailCriteriaAccessor accessor) { + passFailCriteriaAccessor = accessor; + } + + public static PassFailCriteriaAccessor getPassFailCriteriaAccessor() { + return passFailCriteriaAccessor; + } + + private static PassFailMetricAccessor passFailMetricAccessor; + + public interface PassFailMetricAccessor { + PassFailMetric prepareModelForJsonMergePatch(PassFailMetric passFailMetric, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(PassFailMetric passFailMetric); + } + + public static void setPassFailMetricAccessor(PassFailMetricAccessor accessor) { + passFailMetricAccessor = accessor; + } + + public static PassFailMetricAccessor getPassFailMetricAccessor() { + return passFailMetricAccessor; + } + + private static PassFailServerMetricAccessor passFailServerMetricAccessor; + + public interface PassFailServerMetricAccessor { + PassFailServerMetric prepareModelForJsonMergePatch(PassFailServerMetric passFailServerMetric, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(PassFailServerMetric passFailServerMetric); + } + + public static void setPassFailServerMetricAccessor(PassFailServerMetricAccessor accessor) { + passFailServerMetricAccessor = accessor; + } + + public static PassFailServerMetricAccessor getPassFailServerMetricAccessor() { + return passFailServerMetricAccessor; + } + + private static AutoStopCriteriaAccessor autoStopCriteriaAccessor; + + public interface AutoStopCriteriaAccessor { + AutoStopCriteria prepareModelForJsonMergePatch(AutoStopCriteria autoStopCriteria, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(AutoStopCriteria autoStopCriteria); + } + + public static void setAutoStopCriteriaAccessor(AutoStopCriteriaAccessor accessor) { + autoStopCriteriaAccessor = accessor; + } + + public static AutoStopCriteriaAccessor getAutoStopCriteriaAccessor() { + return autoStopCriteriaAccessor; + } + + private static TestSecretAccessor testSecretAccessor; + + public interface TestSecretAccessor { + TestSecret prepareModelForJsonMergePatch(TestSecret testSecret, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestSecret testSecret); + } + + public static void setTestSecretAccessor(TestSecretAccessor accessor) { + testSecretAccessor = accessor; + } + + public static TestSecretAccessor getTestSecretAccessor() { + return testSecretAccessor; + } + + private static TestCertificateAccessor testCertificateAccessor; + + public interface TestCertificateAccessor { + TestCertificate prepareModelForJsonMergePatch(TestCertificate testCertificate, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestCertificate testCertificate); + } + + public static void setTestCertificateAccessor(TestCertificateAccessor accessor) { + testCertificateAccessor = accessor; + } + + public static TestCertificateAccessor getTestCertificateAccessor() { + return testCertificateAccessor; + } + + private static LoadTestConfigurationAccessor loadTestConfigurationAccessor; + + public interface LoadTestConfigurationAccessor { + LoadTestConfiguration prepareModelForJsonMergePatch(LoadTestConfiguration loadTestConfiguration, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(LoadTestConfiguration loadTestConfiguration); + } + + public static void setLoadTestConfigurationAccessor(LoadTestConfigurationAccessor accessor) { + loadTestConfigurationAccessor = accessor; + } + + public static LoadTestConfigurationAccessor getLoadTestConfigurationAccessor() { + return loadTestConfigurationAccessor; + } + + private static OptionalLoadTestConfigurationAccessor optionalLoadTestConfigurationAccessor; + + public interface OptionalLoadTestConfigurationAccessor { + OptionalLoadTestConfiguration prepareModelForJsonMergePatch( + OptionalLoadTestConfiguration optionalLoadTestConfiguration, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(OptionalLoadTestConfiguration optionalLoadTestConfiguration); + } + + public static void setOptionalLoadTestConfigurationAccessor(OptionalLoadTestConfigurationAccessor accessor) { + optionalLoadTestConfigurationAccessor = accessor; + } + + public static OptionalLoadTestConfigurationAccessor getOptionalLoadTestConfigurationAccessor() { + return optionalLoadTestConfigurationAccessor; + } + + private static RegionalConfigurationAccessor regionalConfigurationAccessor; + + public interface RegionalConfigurationAccessor { + RegionalConfiguration prepareModelForJsonMergePatch(RegionalConfiguration regionalConfiguration, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(RegionalConfiguration regionalConfiguration); + } + + public static void setRegionalConfigurationAccessor(RegionalConfigurationAccessor accessor) { + regionalConfigurationAccessor = accessor; + } + + public static RegionalConfigurationAccessor getRegionalConfigurationAccessor() { + return regionalConfigurationAccessor; + } + + private static TestAppComponentsAccessor testAppComponentsAccessor; + + public interface TestAppComponentsAccessor { + TestAppComponents prepareModelForJsonMergePatch(TestAppComponents testAppComponents, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestAppComponents testAppComponents); + } + + public static void setTestAppComponentsAccessor(TestAppComponentsAccessor accessor) { + testAppComponentsAccessor = accessor; + } + + public static TestAppComponentsAccessor getTestAppComponentsAccessor() { + return testAppComponentsAccessor; + } + + private static LoadTestingAppComponentAccessor loadTestingAppComponentAccessor; + + public interface LoadTestingAppComponentAccessor { + LoadTestingAppComponent prepareModelForJsonMergePatch(LoadTestingAppComponent loadTestingAppComponent, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(LoadTestingAppComponent loadTestingAppComponent); + } + + public static void setLoadTestingAppComponentAccessor(LoadTestingAppComponentAccessor accessor) { + loadTestingAppComponentAccessor = accessor; + } + + public static LoadTestingAppComponentAccessor getLoadTestingAppComponentAccessor() { + return loadTestingAppComponentAccessor; + } + + private static TestServerMetricsConfigurationAccessor testServerMetricsConfigurationAccessor; + + public interface TestServerMetricsConfigurationAccessor { + TestServerMetricsConfiguration prepareModelForJsonMergePatch( + TestServerMetricsConfiguration testServerMetricsConfiguration, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestServerMetricsConfiguration testServerMetricsConfiguration); + } + + public static void setTestServerMetricsConfigurationAccessor(TestServerMetricsConfigurationAccessor accessor) { + testServerMetricsConfigurationAccessor = accessor; + } + + public static TestServerMetricsConfigurationAccessor getTestServerMetricsConfigurationAccessor() { + return testServerMetricsConfigurationAccessor; + } + + private static ResourceMetricAccessor resourceMetricAccessor; + + public interface ResourceMetricAccessor { + ResourceMetric prepareModelForJsonMergePatch(ResourceMetric resourceMetric, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(ResourceMetric resourceMetric); + } + + public static void setResourceMetricAccessor(ResourceMetricAccessor accessor) { + resourceMetricAccessor = accessor; + } + + public static ResourceMetricAccessor getResourceMetricAccessor() { + return resourceMetricAccessor; + } + + private static TestProfileAccessor testProfileAccessor; + + public interface TestProfileAccessor { + TestProfile prepareModelForJsonMergePatch(TestProfile testProfile, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestProfile testProfile); + } + + public static void setTestProfileAccessor(TestProfileAccessor accessor) { + testProfileAccessor = accessor; + } + + public static TestProfileAccessor getTestProfileAccessor() { + return testProfileAccessor; + } + + private static TargetResourceConfigurationsAccessor targetResourceConfigurationsAccessor; + + public interface TargetResourceConfigurationsAccessor { + TargetResourceConfigurations prepareModelForJsonMergePatch( + TargetResourceConfigurations targetResourceConfigurations, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TargetResourceConfigurations targetResourceConfigurations); + } + + public static void setTargetResourceConfigurationsAccessor(TargetResourceConfigurationsAccessor accessor) { + targetResourceConfigurationsAccessor = accessor; + } + + public static TargetResourceConfigurationsAccessor getTargetResourceConfigurationsAccessor() { + return targetResourceConfigurationsAccessor; + } + + private static FunctionFlexConsumptionResourceConfigurationAccessor functionFlexConsumptionResourceConfigurationAccessor; + + public interface FunctionFlexConsumptionResourceConfigurationAccessor { + FunctionFlexConsumptionResourceConfiguration prepareModelForJsonMergePatch( + FunctionFlexConsumptionResourceConfiguration functionFlexConsumptionResourceConfiguration, + boolean jsonMergePatchEnabled); + + boolean + isJsonMergePatch(FunctionFlexConsumptionResourceConfiguration functionFlexConsumptionResourceConfiguration); + } + + public static void setFunctionFlexConsumptionResourceConfigurationAccessor( + FunctionFlexConsumptionResourceConfigurationAccessor accessor) { + functionFlexConsumptionResourceConfigurationAccessor = accessor; + } + + public static FunctionFlexConsumptionResourceConfigurationAccessor + getFunctionFlexConsumptionResourceConfigurationAccessor() { + return functionFlexConsumptionResourceConfigurationAccessor; + } + + private static TriggerAccessor triggerAccessor; + + public interface TriggerAccessor { + Trigger prepareModelForJsonMergePatch(Trigger trigger, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(Trigger trigger); + + void setTriggerId(Trigger trigger, String triggerId); + + void setDisplayName(Trigger trigger, String displayName); + + void setDescription(Trigger trigger, String description); + + void setState(Trigger trigger, TriggerState state); + + void setStateDetails(Trigger trigger, StateDetails stateDetails); + + void setCreatedDateTime(Trigger trigger, OffsetDateTime createdDateTime); + + void setCreatedBy(Trigger trigger, String createdBy); + + void setLastModifiedDateTime(Trigger trigger, OffsetDateTime lastModifiedDateTime); + + void setLastModifiedBy(Trigger trigger, String lastModifiedBy); + } + + public static void setTriggerAccessor(TriggerAccessor accessor) { + triggerAccessor = accessor; + } + + public static TriggerAccessor getTriggerAccessor() { + return triggerAccessor; + } + + private static RecurrenceAccessor recurrenceAccessor; + + public interface RecurrenceAccessor { + Recurrence prepareModelForJsonMergePatch(Recurrence recurrence, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(Recurrence recurrence); + + void setRecurrenceEnd(Recurrence recurrence, RecurrenceEnd recurrenceEnd); + } + + public static void setRecurrenceAccessor(RecurrenceAccessor accessor) { + recurrenceAccessor = accessor; + } + + public static RecurrenceAccessor getRecurrenceAccessor() { + return recurrenceAccessor; + } + + private static RecurrenceEndAccessor recurrenceEndAccessor; + + public interface RecurrenceEndAccessor { + RecurrenceEnd prepareModelForJsonMergePatch(RecurrenceEnd recurrenceEnd, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(RecurrenceEnd recurrenceEnd); + } + + public static void setRecurrenceEndAccessor(RecurrenceEndAccessor accessor) { + recurrenceEndAccessor = accessor; + } + + public static RecurrenceEndAccessor getRecurrenceEndAccessor() { + return recurrenceEndAccessor; + } + + private static NotificationRuleAccessor notificationRuleAccessor; + + public interface NotificationRuleAccessor { + NotificationRule prepareModelForJsonMergePatch(NotificationRule notificationRule, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(NotificationRule notificationRule); + + void setNotificationRuleId(NotificationRule notificationRule, String notificationRuleId); + + void setDisplayName(NotificationRule notificationRule, String displayName); + + void setActionGroupIds(NotificationRule notificationRule, List actionGroupIds); + + void setCreatedDateTime(NotificationRule notificationRule, OffsetDateTime createdDateTime); + + void setCreatedBy(NotificationRule notificationRule, String createdBy); + + void setLastModifiedDateTime(NotificationRule notificationRule, OffsetDateTime lastModifiedDateTime); + + void setLastModifiedBy(NotificationRule notificationRule, String lastModifiedBy); + } + + public static void setNotificationRuleAccessor(NotificationRuleAccessor accessor) { + notificationRuleAccessor = accessor; + } + + public static NotificationRuleAccessor getNotificationRuleAccessor() { + return notificationRuleAccessor; + } + + private static TestsNotificationEventFilterAccessor testsNotificationEventFilterAccessor; + + public interface TestsNotificationEventFilterAccessor { + TestsNotificationEventFilter prepareModelForJsonMergePatch( + TestsNotificationEventFilter testsNotificationEventFilter, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestsNotificationEventFilter testsNotificationEventFilter); + } + + public static void setTestsNotificationEventFilterAccessor(TestsNotificationEventFilterAccessor accessor) { + testsNotificationEventFilterAccessor = accessor; + } + + public static TestsNotificationEventFilterAccessor getTestsNotificationEventFilterAccessor() { + return testsNotificationEventFilterAccessor; + } + + private static TestRunEndedEventConditionAccessor testRunEndedEventConditionAccessor; + + public interface TestRunEndedEventConditionAccessor { + TestRunEndedEventCondition prepareModelForJsonMergePatch(TestRunEndedEventCondition testRunEndedEventCondition, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestRunEndedEventCondition testRunEndedEventCondition); + } + + public static void setTestRunEndedEventConditionAccessor(TestRunEndedEventConditionAccessor accessor) { + testRunEndedEventConditionAccessor = accessor; + } + + public static TestRunEndedEventConditionAccessor getTestRunEndedEventConditionAccessor() { + return testRunEndedEventConditionAccessor; + } + + private static LoadTestRunAccessor loadTestRunAccessor; + + public interface LoadTestRunAccessor { + LoadTestRun prepareModelForJsonMergePatch(LoadTestRun loadTestRun, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(LoadTestRun loadTestRun); + } + + public static void setLoadTestRunAccessor(LoadTestRunAccessor accessor) { + loadTestRunAccessor = accessor; + } + + public static LoadTestRunAccessor getLoadTestRunAccessor() { + return loadTestRunAccessor; + } + + private static TestRunAppComponentsAccessor testRunAppComponentsAccessor; + + public interface TestRunAppComponentsAccessor { + TestRunAppComponents prepareModelForJsonMergePatch(TestRunAppComponents testRunAppComponents, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestRunAppComponents testRunAppComponents); + } + + public static void setTestRunAppComponentsAccessor(TestRunAppComponentsAccessor accessor) { + testRunAppComponentsAccessor = accessor; + } + + public static TestRunAppComponentsAccessor getTestRunAppComponentsAccessor() { + return testRunAppComponentsAccessor; + } + + private static TestRunServerMetricsConfigurationAccessor testRunServerMetricsConfigurationAccessor; + + public interface TestRunServerMetricsConfigurationAccessor { + TestRunServerMetricsConfiguration prepareModelForJsonMergePatch( + TestRunServerMetricsConfiguration testRunServerMetricsConfiguration, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestRunServerMetricsConfiguration testRunServerMetricsConfiguration); + } + + public static void + setTestRunServerMetricsConfigurationAccessor(TestRunServerMetricsConfigurationAccessor accessor) { + testRunServerMetricsConfigurationAccessor = accessor; + } + + public static TestRunServerMetricsConfigurationAccessor getTestRunServerMetricsConfigurationAccessor() { + return testRunServerMetricsConfigurationAccessor; + } + + private static TestProfileRunAccessor testProfileRunAccessor; + + public interface TestProfileRunAccessor { + TestProfileRun prepareModelForJsonMergePatch(TestProfileRun testProfileRun, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(TestProfileRun testProfileRun); + } + + public static void setTestProfileRunAccessor(TestProfileRunAccessor accessor) { + testProfileRunAccessor = accessor; + } + + public static TestProfileRunAccessor getTestProfileRunAccessor() { + return testProfileRunAccessor; + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java new file mode 100644 index 000000000000..170c1ea3f100 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java @@ -0,0 +1,4458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.UrlBuilder; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.TypeReference; +import com.azure.developer.loadtesting.LoadTestingServiceVersion; +import com.azure.developer.loadtesting.models.LoadTest; +import com.azure.developer.loadtesting.models.OperationStatus; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the LoadTestAdministrationClient type. + */ +public final class LoadTestAdministrationClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final LoadTestAdministrationClientService service; + + /** + */ + private final String endpoint; + + /** + * Gets. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final LoadTestingServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public LoadTestingServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of LoadTestAdministrationClient client. + * + * @param endpoint + * @param serviceVersion Service version. + */ + public LoadTestAdministrationClientImpl(String endpoint, LoadTestingServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of LoadTestAdministrationClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint + * @param serviceVersion Service version. + */ + public LoadTestAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, + LoadTestingServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of LoadTestAdministrationClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint + * @param serviceVersion Service version. + */ + public LoadTestAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint, LoadTestingServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(LoadTestAdministrationClientService.class, this.httpPipeline, + this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for LoadTestAdministrationClient to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{endpoint}") + @ServiceInterface(name = "LoadTestAdministrati") + public interface LoadTestAdministrationClientService { + @Patch("/tests/{testId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateTest(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Patch("/tests/{testId}/app-components") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateAppComponents(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, + @PathParam("testId") String testId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Patch("/tests/{testId}/server-metrics-config") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateServerMetricsConfig(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, + @PathParam("testId") String testId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Get("/tests/{testId}/app-components") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAppComponents(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/tests/{testId}/server-metrics-config") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getServerMetricsConfig(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/tests/{testId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTest(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/tests/{testId}/files/{fileName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestFile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @PathParam("fileName") String fileName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/tests/{testId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTestFiles(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/tests") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTests(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/tests/{testId}/files/{fileName}") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadTestFile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, + @PathParam("testId") String testId, @PathParam("fileName") String fileName, + @HeaderParam("Accept") String accept, @BodyParam("application/octet-stream") BinaryData body, + RequestOptions requestOptions, Context context); + + @Delete("/tests/{testId}/files/{fileName}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTestFile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @PathParam("fileName") String fileName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/tests/{testId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTest(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/test-profiles/{testProfileId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateTestProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testProfileId") String testProfileId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Delete("/test-profiles/{testProfileId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTestProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testProfileId") String testProfileId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/test-profiles/{testProfileId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTestProfile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testProfileId") String testProfileId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/test-profiles") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTestProfiles(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Patch("/triggers/{triggerId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateTrigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("triggerId") String triggerId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Delete("/triggers/{triggerId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTrigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("triggerId") String triggerId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/triggers/{triggerId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getTrigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("triggerId") String triggerId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/triggers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTriggers(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Patch("/notification-rules/{notificationRuleId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateNotificationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("notificationRuleId") String notificationRuleId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); + + @Delete("/notification-rules/{notificationRuleId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteNotificationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("notificationRuleId") String notificationRuleId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/notification-rules/{notificationRuleId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getNotificationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("notificationRuleId") String notificationRuleId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/notification-rules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNotificationRules(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/tests/{testId}:clone") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> cloneTest(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testId") String testId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData cloneTestRequest1, RequestOptions requestOptions, + Context context); + + @Get("/operations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOperationStatus(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTestFilesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTestsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTestProfilesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listTriggersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNotificationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Create a new test or update an existing test by providing the test Id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTestWithResponseAsync(String testId, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrUpdateTest(this.getEndpoint(), + this.getServiceVersion().getVersion(), testId, contentType, accept, body, requestOptions, context)); + } + + /** + * Create a new test or update an existing test by providing the test Id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateTestWithResponse(String testId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateTestWithResponseAsync(testId, body, requestOptions).block(); + } + + /** + * Add an app component to a test. + * + * Add an app component to a test by providing the resource Id, name and type. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test app components along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateAppComponentsWithResponseAsync(String testId, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrUpdateAppComponents(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, testId, accept, body, requestOptions, context)); + } + + /** + * Add an app component to a test. + * + * Add an app component to a test by providing the resource Id, name and type. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test app components along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateAppComponentsWithResponseAsync(testId, body, requestOptions).block(); + } + + /** + * Configure server metrics for a test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateServerMetricsConfigWithResponseAsync(String testId, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrUpdateServerMetricsConfig(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, testId, accept, body, requestOptions, context)); + } + + /** + * Configure server metrics for a test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test server metrics configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateServerMetricsConfigWithResponseAsync(testId, body, requestOptions).block(); + } + + /** + * Get associated app component (collection of azure resources) for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return associated app component (collection of azure resources) for the given test along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAppComponentsWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getAppComponents(this.getEndpoint(), + this.getServiceVersion().getVersion(), testId, accept, requestOptions, context)); + } + + /** + * Get associated app component (collection of azure resources) for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
+     *         }
+     *     }
+     *     testId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return associated app component (collection of azure resources) for the given test along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { + return getAppComponentsWithResponseAsync(testId, requestOptions).block(); + } + + /** + * List server metrics configuration for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsConfigWithResponseAsync(String testId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getServerMetricsConfig(this.getEndpoint(), + this.getServiceVersion().getVersion(), testId, accept, requestOptions, context)); + } + + /** + * List server metrics configuration for the given test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testId: String (Optional)
+     *     metrics (Optional, Required on create): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test server metrics configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { + return getServerMetricsConfigWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get load test details by test Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test Id along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getTest(this.getEndpoint(), + this.getServiceVersion().getVersion(), testId, accept, requestOptions, context)); + } + + /** + * Get load test details by test Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test details by test Id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestWithResponse(String testId, RequestOptions requestOptions) { + return getTestWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Get all the files that are associated with a test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all the files that are associated with a test along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestFileWithResponseAsync(String testId, String fileName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getTestFile(this.getEndpoint(), + this.getServiceVersion().getVersion(), testId, fileName, accept, requestOptions, context)); + } + + /** + * Get all the files that are associated with a test. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all the files that are associated with a test along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { + return getTestFileWithResponseAsync(testId, fileName, requestOptions).block(); + } + + /** + * Get all test files. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestFilesSinglePageAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTestFiles(this.getEndpoint(), this.getServiceVersion().getVersion(), + testId, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get all test files. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestFilesAsync(String testId, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listTestFilesSinglePageAsync(testId, requestOptions), + nextLink -> listTestFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all test files. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test files as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestFiles(String testId, RequestOptions requestOptions) { + return new PagedIterable<>(listTestFilesAsync(testId, requestOptions)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTests(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestsSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * displayName, + * createdBy. For example, to search for a test, with display name is Login Test, + * the search parameter can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTests(RequestOptions requestOptions) { + return new PagedIterable<>(listTestsAsync(requestOptions)); + } + + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", + * "ADDITIONAL_ARTIFACTS", "ZIPPED_ARTIFACTS", "URL_TEST_CONFIG", "TEST_SCRIPT".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file info along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> uploadTestFileWithResponseAsync(String testId, String fileName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.uploadTestFile(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, testId, fileName, accept, body, requestOptions, context)); + } + + /** + * Upload input file for a given test Id. File size can't be more than 50 MB. + * Existing file with same name for the given test will be overwritten. File + * should be provided in the request body as application/octet-stream. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", + * "ADDITIONAL_ARTIFACTS", "ZIPPED_ARTIFACTS", "URL_TEST_CONFIG", "TEST_SCRIPT".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testId Unique name for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Unique name for test file with file extension like : App.jmx. + * @param body The file content as application/octet-stream. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test file info along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadTestFileWithResponse(String testId, String fileName, BinaryData body, + RequestOptions requestOptions) { + return uploadTestFileWithResponseAsync(testId, fileName, body, requestOptions).block(); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestFileWithResponseAsync(String testId, String fileName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteTestFile(this.getEndpoint(), + this.getServiceVersion().getVersion(), testId, fileName, accept, requestOptions, context)); + } + + /** + * Delete file by the file name for a test. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param fileName Name of the file. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { + return deleteTestFileWithResponseAsync(testId, fileName, requestOptions).block(); + } + + /** + * Delete a test by its test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestWithResponseAsync(String testId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteTest(this.getEndpoint(), + this.getServiceVersion().getVersion(), testId, accept, requestOptions, context)); + } + + /** + * Delete a test by its test Id. + * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestWithResponse(String testId, RequestOptions requestOptions) { + return deleteTestWithResponseAsync(testId, requestOptions).block(); + } + + /** + * Create a new test profile or update an existing test profile. + * + * Create a new test profile or update an existing test profile by providing the test profile Id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test Profile Model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTestProfileWithResponseAsync(String testProfileId, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrUpdateTestProfile(this.getEndpoint(), + this.getServiceVersion().getVersion(), testProfileId, contentType, accept, body, requestOptions, context)); + } + + /** + * Create a new test profile or update an existing test profile. + * + * Create a new test profile or update an existing test profile by providing the test profile Id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test Profile Model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateTestProfileWithResponse(String testProfileId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateTestProfileWithResponseAsync(testProfileId, body, requestOptions).block(); + } + + /** + * Delete a test profile. + * + * Delete a test profile by its test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestProfileWithResponseAsync(String testProfileId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteTestProfile(this.getEndpoint(), + this.getServiceVersion().getVersion(), testProfileId, accept, requestOptions, context)); + } + + /** + * Delete a test profile. + * + * Delete a test profile by its test profile Id. + * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestProfileWithResponse(String testProfileId, RequestOptions requestOptions) { + return deleteTestProfileWithResponseAsync(testProfileId, requestOptions).block(); + } + + /** + * Get load test profile details. + * + * Get load test profile details by test profile Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test profile details. + * + * Get load test profile details by test profile Id along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTestProfileWithResponseAsync(String testProfileId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getTestProfile(this.getEndpoint(), + this.getServiceVersion().getVersion(), testProfileId, accept, requestOptions, context)); + } + + /** + * Get load test profile details. + * + * Get load test profile details by test profile Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testProfileId Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test profile details. + * + * Get load test profile details by test profile Id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestProfileWithResponse(String testProfileId, RequestOptions requestOptions) { + return getTestProfileWithResponseAsync(testProfileId, requestOptions).block(); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter test profiles.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter test profiles.
testProfileIdsList<String>NoComma separated list of IDs of the test + * profiles to filter. In the form of "," separated string.
testIdsList<String>NoComma separated list IDs of the tests which should + * be associated with the test profiles to fetch. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfile items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestProfilesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTestProfiles(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter test profiles.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter test profiles.
testProfileIdsList<String>NoComma separated list of IDs of the test + * profiles to filter. In the form of "," separated string.
testIdsList<String>NoComma separated list IDs of the tests which should + * be associated with the test profiles to fetch. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfile items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfilesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestProfilesSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestProfilesNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * List test profiles. + * + * Get all test profiles for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter test profiles.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter test profiles.
testProfileIdsList<String>NoComma separated list of IDs of the test + * profiles to filter. In the form of "," separated string.
testIdsList<String>NoComma separated list IDs of the tests which should + * be associated with the test profiles to fetch. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfile items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfiles(RequestOptions requestOptions) { + return new PagedIterable<>(listTestProfilesAsync(requestOptions)); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateTriggerWithResponseAsync(String triggerId, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrUpdateTrigger(this.getEndpoint(), + this.getServiceVersion().getVersion(), triggerId, contentType, accept, body, requestOptions, context)); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateTriggerWithResponse(String triggerId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateTriggerWithResponseAsync(triggerId, body, requestOptions).block(); + } + + /** + * Resource delete operation template. + * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTriggerWithResponseAsync(String triggerId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteTrigger(this.getEndpoint(), + this.getServiceVersion().getVersion(), triggerId, accept, requestOptions, context)); + } + + /** + * Resource delete operation template. + * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTriggerWithResponse(String triggerId, RequestOptions requestOptions) { + return deleteTriggerWithResponseAsync(triggerId, requestOptions).block(); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTriggerWithResponseAsync(String triggerId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getTrigger(this.getEndpoint(), + this.getServiceVersion().getVersion(), triggerId, accept, requestOptions, context)); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param triggerId The unique identifier of the trigger. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return trigger model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTriggerWithResponse(String triggerId, RequestOptions requestOptions) { + return getTriggerWithResponseAsync(triggerId, requestOptions).block(); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on triggers associated with the provided test + * ids.
statesStringNoFilter triggers based on a comma separated list of states. + * Allowed values: "Active", "Paused", "Completed", "Disabled".
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter triggers.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter triggers.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Trigger items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTriggersSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTriggers(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on triggers associated with the provided test + * ids.
statesStringNoFilter triggers based on a comma separated list of states. + * Allowed values: "Active", "Paused", "Completed", "Disabled".
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter triggers.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter triggers.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Trigger items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTriggersAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTriggersSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTriggersNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on triggers associated with the provided test + * ids.
statesStringNoFilter triggers based on a comma separated list of states. + * Allowed values: "Active", "Paused", "Completed", "Disabled".
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter triggers.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter triggers.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Trigger items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTriggers(RequestOptions requestOptions) { + return new PagedIterable<>(listTriggersAsync(requestOptions)); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateNotificationRuleWithResponseAsync(String notificationRuleId, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.createOrUpdateNotificationRule(this.getEndpoint(), this.getServiceVersion().getVersion(), + notificationRuleId, contentType, accept, body, requestOptions, context)); + } + + /** + * Create or update operation template. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param body The resource instance. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateNotificationRuleWithResponse(String notificationRuleId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateNotificationRuleWithResponseAsync(notificationRuleId, body, requestOptions).block(); + } + + /** + * Resource delete operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteNotificationRuleWithResponseAsync(String notificationRuleId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteNotificationRule(this.getEndpoint(), + this.getServiceVersion().getVersion(), notificationRuleId, accept, requestOptions, context)); + } + + /** + * Resource delete operation template. + * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteNotificationRuleWithResponse(String notificationRuleId, RequestOptions requestOptions) { + return deleteNotificationRuleWithResponseAsync(notificationRuleId, requestOptions).block(); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getNotificationRuleWithResponseAsync(String notificationRuleId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getNotificationRule(this.getEndpoint(), + this.getServiceVersion().getVersion(), notificationRuleId, accept, requestOptions, context)); + } + + /** + * Resource read operation template. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param notificationRuleId The unique identifier of the notification rule. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return notification rule model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNotificationRuleWithResponse(String notificationRuleId, + RequestOptions requestOptions) { + return getNotificationRuleWithResponseAsync(notificationRuleId, requestOptions).block(); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on notification rules associated with the provided + * test ids.
scopesStringNoSearch based on notification rules for the provided + * scopes.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter notification rules.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter notification rules.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of NotificationRule items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNotificationRulesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNotificationRules(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on notification rules associated with the provided + * test ids.
scopesStringNoSearch based on notification rules for the provided + * scopes.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter notification rules.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter notification rules.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of NotificationRule items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNotificationRulesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listNotificationRulesSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listNotificationRulesNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Resource list operation template. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
testIdsStringNoSearch based on notification rules associated with the provided + * test ids.
scopesStringNoSearch based on notification rules for the provided + * scopes.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) + * of the last updated time range to filter notification rules.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of + * the last updated time range to filter notification rules.
maxpagesizeIntegerNoNumber of results in response. Default page size is + * 50.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of NotificationRule items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNotificationRules(RequestOptions requestOptions) { + return new PagedIterable<>(listNotificationRulesAsync(requestOptions)); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     newTestId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param cloneTestRequest1 The cloneTestRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return provides status details for long running operations along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cloneTestWithResponseAsync(String testId, BinaryData cloneTestRequest1, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cloneTest(this.getEndpoint(), this.getServiceVersion().getVersion(), testId, + contentType, accept, cloneTestRequest1, requestOptions, context)); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     newTestId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param cloneTestRequest1 The cloneTestRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCloneTestAsync(String testId, BinaryData cloneTestRequest1, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.cloneTestWithResponseAsync(testId, cloneTestRequest1, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     newTestId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param cloneTestRequest1 The cloneTestRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCloneTest(String testId, BinaryData cloneTestRequest1, + RequestOptions requestOptions) { + return this.beginCloneTestAsync(testId, cloneTestRequest1, requestOptions).getSyncPoller(); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     newTestId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param cloneTestRequest1 The cloneTestRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCloneTestWithModelAsync(String testId, + BinaryData cloneTestRequest1, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.cloneTestWithResponseAsync(testId, cloneTestRequest1, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(OperationStatus.class), TypeReference.createInstance(LoadTest.class)); + } + + /** + * Clone a load test. + * + * Clone the given test with optional overrides applied to the clone test. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     newTestId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param testId Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, + * underscore or hyphen characters. + * @param cloneTestRequest1 The cloneTestRequest1 parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of provides status details for long running operations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCloneTestWithModel(String testId, BinaryData cloneTestRequest1, + RequestOptions requestOptions) { + return this.beginCloneTestWithModelAsync(testId, cloneTestRequest1, requestOptions).getSyncPoller(); + } + + /** + * Get the status of a long running operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     kind: String(CloneTest) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     id: String (Required)
+     * }
+     * }
+     * 
+ * + * @param operationId The unique ID of the operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a long running operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationStatusWithResponseAsync(String operationId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getOperationStatus(this.getEndpoint(), + this.getServiceVersion().getVersion(), operationId, accept, requestOptions, context)); + } + + /** + * Get the status of a long running operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     kind: String(CloneTest) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     *     id: String (Required)
+     * }
+     * }
+     * 
+ * + * @param operationId The unique ID of the operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a long running operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { + return getOperationStatusWithResponseAsync(operationId, requestOptions).block(); + } + + /** + * Get all test files. + * + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestFileInfo items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestFilesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listTestFilesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get all load tests by the fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     baselineTestRunId: String (Optional)
+     *     inputArtifacts (Optional): {
+     *         configFileInfo (Optional): {
+     *             fileName: String (Required)
+     *             url: String (Optional)
+     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *             expireDateTime: OffsetDateTime (Optional)
+     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *             validationFailureDetails: String (Optional)
+     *         }
+     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *         urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *         additionalFileInfo (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *     }
+     *     testId: String (Required)
+     *     description: String (Optional)
+     *     displayName: String (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     keyvaultReferenceIdentityType: String (Optional)
+     *     keyvaultReferenceIdentityId: String (Optional)
+     *     metricsReferenceIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     metricsReferenceIdentityId: String (Optional)
+     *     engineBuiltInIdentityType: String(SystemAssigned/UserAssigned) (Optional)
+     *     engineBuiltInIdentityIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Test items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listTestsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List test profiles. + * + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testProfileId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfile items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestProfilesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listTestProfilesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(ScheduleTestsTrigger) (Required)
+     *     triggerId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     description: String (Optional)
+     *     state: String(Active/Paused/Completed/Disabled) (Optional)
+     *     stateDetails (Optional): {
+     *         message: String (Optional)
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of Trigger items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTriggersNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listTriggersNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String(Tests) (Required)
+     *     notificationRuleId: String (Required)
+     *     displayName: String (Optional, Required on create)
+     *     actionGroupIds (Optional, Required on create): [
+     *         String (Optional, Required on create)
+     *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of NotificationRule items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNotificationRulesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listNotificationRulesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java deleted file mode 100644 index 66fecbd19792..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationsImpl.java +++ /dev/null @@ -1,2509 +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.developer.loadtesting.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.UrlBuilder; -import com.azure.developer.loadtesting.LoadTestingServiceVersion; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LoadTestAdministrations. - */ -public final class LoadTestAdministrationsImpl { - /** - * The proxy service used to perform REST calls. - */ - private final LoadTestAdministrationsService service; - - /** - * The service client containing this operation class. - */ - private final LoadTestingClientImpl client; - - /** - * Initializes an instance of LoadTestAdministrationsImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LoadTestAdministrationsImpl(LoadTestingClientImpl client) { - this.service = RestProxy.create(LoadTestAdministrationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public LoadTestingServiceVersion getServiceVersion() { - return client.getServiceVersion(); - } - - /** - * The interface defining all the services for LoadTestingClientLoadTestAdministrations to be used by the proxy - * service to perform REST calls. - */ - @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestingClientLoa") - public interface LoadTestAdministrationsService { - @Patch("/tests/{testId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateTest(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateTestSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/tests/{testId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteTest(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/tests/{testId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteTestSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getTest(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTests(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestsSync(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Put("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> uploadTestFile(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/octet-stream") BinaryData body, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response uploadTestFileSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/octet-stream") BinaryData body, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getTestFile(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestFileSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @PathParam("fileName") String fileName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteTestFile(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @PathParam("fileName") String fileName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/tests/{testId}/files/{fileName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteTestFileSync(@HostParam("Endpoint") String endpoint, @PathParam("testId") String testId, - @PathParam("fileName") String fileName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTestFiles(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestFilesSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/app-components") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateAppComponents(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/app-components") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateAppComponentsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/app-components") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAppComponents(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/app-components") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAppComponentsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/server-metrics-config") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateServerMetricsConfig(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/tests/{testId}/server-metrics-config") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateServerMetricsConfigSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/server-metrics-config") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getServerMetricsConfig(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/tests/{testId}/server-metrics-config") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getServerMetricsConfigSync(@HostParam("Endpoint") String endpoint, - @PathParam("testId") String testId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTestsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTestFilesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestFilesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * Create a new test or update an existing test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Load test model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateTestWithResponseAsync(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateTest(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Create a new test or update an existing test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Load test model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test model along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateTestWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateTestSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Delete a test by its name. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTestWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteTest(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Delete a test by its name. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTestWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteTestSync(this.client.getEndpoint(), testId, this.client.getServiceVersion().getVersion(), - accept, requestOptions, Context.NONE); - } - - /** - * Get load test details by test name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTest(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get load test details by test name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test details by test name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getTestSync(this.client.getEndpoint(), testId, this.client.getServiceVersion().getVersion(), - accept, requestOptions, Context.NONE); - } - - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestsSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listTests(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestsAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsSinglePageAsync(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsNextSinglePageAsync(nextLink, requestOptionsLocal); - }); - } - - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestsSinglePage(RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listTestsSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * lastModifiedDateTime asc. Supported fields - lastModifiedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * displayName, createdBy. For example, to search for a test, with display name is Login Test, the search parameter - * can be Login.
lastModifiedStartTimeOffsetDateTimeNoStart DateTime(ISO 8601 literal format) - * of the last updated time range to filter tests.
lastModifiedEndTimeOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of - * the last updated time range to filter tests.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all load tests by the fully qualified resource Id e.g - * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTests(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsSinglePage(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestsNextSinglePage(nextLink, requestOptionsLocal); - }); - } - - /** - * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the - * given test will be overwritten. File should be provided in the request body as application/octet-stream. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", - * "ADDITIONAL_ARTIFACTS".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
-     * {@code
-     * BinaryData
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadTestFileWithResponseAsync(String testId, String fileName, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.uploadTestFile(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Upload input file for a given test name. File size can't be more than 50 MB. Existing file with same name for the - * given test will be overwritten. File should be provided in the request body as application/octet-stream. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
fileTypeStringNoFile type. Allowed values: "JMX_FILE", "USER_PROPERTIES", - * "ADDITIONAL_ARTIFACTS".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Request Body Schema

- * - *
-     * {@code
-     * BinaryData
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName Unique name for test file with file extension like : App.jmx. - * @param body The file content as application/octet-stream. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return file info along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadTestFileWithResponse(String testId, String fileName, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.uploadTestFileSync(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Get test file by the file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestFileWithResponseAsync(String testId, String fileName, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTestFile(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get test file by the file name. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test file by the file name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getTestFileSync(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTestFileWithResponseAsync(String testId, String fileName, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteTestFile(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Delete file by the file name for a test. - * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param fileName File name with file extension like app.jmx. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTestFileWithResponse(String testId, String fileName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteTestFileSync(this.client.getEndpoint(), testId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestFilesSinglePageAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listTestFiles(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestFilesAsync(String testId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listTestFilesSinglePageAsync(testId, requestOptions), - nextLink -> listTestFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestFilesSinglePage(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listTestFilesSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get all test files. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test files as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTestFiles(String testId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listTestFilesSinglePage(testId, requestOptions), - nextLink -> listTestFilesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body App Component model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test app component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponseAsync(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateAppComponents(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Associate an app component (collection of azure resources) to a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body App Component model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test app component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateAppComponentsSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * Get associated app component (collection of azure resources) for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentsWithResponseAsync(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAppComponents(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Get associated app component (collection of azure resources) for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     components (Required): {
-     *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
-     *         }
-     *     }
-     *     testId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentsWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAppComponentsSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponseAsync(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateServerMetricsConfig(this.client.getEndpoint(), - testId, this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); - } - - /** - * Configure server metrics for a test. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param body Server metric configuration model. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateServerMetricsConfigSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); - } - - /** - * List server metrics configuration for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsConfigWithResponseAsync(String testId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getServerMetricsConfig(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * List server metrics configuration for the given test. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     testId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testId Unique name for the load test, must contain only lower-case alphabetic, numeric, underscore or - * hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test server metrics configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsConfigWithResponse(String testId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getServerMetricsConfigSync(this.client.getEndpoint(), testId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of tests along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listTestsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     inputArtifacts (Optional): {
-     *         configFileInfo (Optional): {
-     *             url: String (Optional)
-     *             fileName: String (Optional)
-     *             fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *             expireDateTime: OffsetDateTime (Optional)
-     *             validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *             validationFailureDetails: String (Optional)
-     *         }
-     *         testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *         userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *         inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *         additionalFileInfo (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *     }
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     displayName: String (Optional)
-     *     subnetId: String (Optional)
-     *     keyvaultReferenceIdentityType: String (Optional)
-     *     keyvaultReferenceIdentityId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of tests along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listTestsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of files along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestFilesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listTestFilesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of files along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestFilesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listTestFilesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunsImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunClientImpl.java similarity index 60% rename from sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunsImpl.java rename to sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunClientImpl.java index f585a0d8af1f..2a0b0504dea1 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunsImpl.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.developer.loadtesting.implementation; @@ -24,6 +24,10 @@ import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; @@ -35,6 +39,8 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.UrlBuilder; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; import com.azure.developer.loadtesting.LoadTestingServiceVersion; import java.util.List; import java.util.Map; @@ -42,97 +48,147 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in LoadTestRuns. + * Initializes a new instance of the LoadTestRunClient type. */ -public final class LoadTestRunsImpl { +public final class LoadTestRunClientImpl { /** * The proxy service used to perform REST calls. */ - private final LoadTestRunsService service; + private final LoadTestRunClientService service; /** - * The service client containing this operation class. */ - private final LoadTestingClientImpl client; + private final String endpoint; /** - * Initializes an instance of LoadTestRunsImpl. + * Gets. * - * @param client the instance of the service client containing this operation class. + * @return the endpoint value. */ - LoadTestRunsImpl(LoadTestingClientImpl client) { - this.service - = RestProxy.create(LoadTestRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; + public String getEndpoint() { + return this.endpoint; } + /** + * Service version. + */ + private final LoadTestingServiceVersion serviceVersion; + /** * Gets Service version. * * @return the serviceVersion value. */ public LoadTestingServiceVersion getServiceVersion() { - return client.getServiceVersion(); + return this.serviceVersion; } /** - * The interface defining all the services for LoadTestingClientLoadTestRuns to be used by the proxy service to - * perform REST calls. + * The HTTP pipeline to send requests through. */ - @Host("https://{Endpoint}") - @ServiceInterface(name = "LoadTestingClientLoa") - public interface LoadTestRunsService { - @Patch("/test-runs/{testRunId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateTestRun(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of LoadTestRunClient client. + * + * @param endpoint + * @param serviceVersion Service version. + */ + public LoadTestRunClientImpl(String endpoint, LoadTestingServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of LoadTestRunClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint + * @param serviceVersion Service version. + */ + public LoadTestRunClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestingServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of LoadTestRunClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint + * @param serviceVersion Service version. + */ + public LoadTestRunClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + LoadTestingServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(LoadTestRunClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + /** + * The interface defining all the services for LoadTestRunClient to be used by the proxy service to perform REST + * calls. + */ + @Host("https://{endpoint}") + @ServiceInterface(name = "LoadTestRunClient") + public interface LoadTestRunClientService { @Patch("/test-runs/{testRunId}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateTestRunSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getTestRun(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> createOrUpdateTestRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}") - @ExpectedResponses({ 200 }) + @Patch("/test-runs/{testRunId}/app-components") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestRunSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> createOrUpdateAppComponents(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, + @PathParam("testRunId") String testRunId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); - @Delete("/test-runs/{testRunId}") - @ExpectedResponses({ 204 }) + @Patch("/test-runs/{testRunId}/server-metrics-config") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteTestRun(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> createOrUpdateServerMetricsConfig(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, + @PathParam("testRunId") String testRunId, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); @Delete("/test-runs/{testRunId}") @ExpectedResponses({ 204 }) @@ -140,90 +196,61 @@ Mono> deleteTestRun(@HostParam("Endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteTestRunSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, + Mono> deleteTestRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}/files/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getTestRunFile(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/files/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getTestRunFileSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTestRuns(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs") + @Get("/test-runs/{testRunId}/app-components") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestRunsSync(@HostParam("Endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getAppComponents(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Post("/test-runs/{testRunId}:stop") + @Get("/test-runs/{testRunId}/server-metrics-config") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> stopTestRun(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, + Mono> getServerMetricsConfig(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Post("/test-runs/{testRunId}:stop") + @Get("/test-runs/{testRunId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response stopTestRunSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, + Mono> getTestRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}/metric-namespaces") + @Get("/test-runs/{testRunId}/files/{fileName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMetricNamespaces(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> getTestRunFile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, + @PathParam("fileName") String fileName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); - @Get("/test-runs/{testRunId}/metric-namespaces") + @Get("/test-runs/{testRunId}/metric-dimensions/{name}/values") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMetricNamespacesSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, + Mono> listMetricDimensionValues(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, + @PathParam("name") String name, @QueryParam("metricname") String metricname, + @QueryParam("metricNamespace") String metricNamespace, @QueryParam("timespan") String timespan, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/test-runs/{testRunId}/metric-definitions") @@ -232,21 +259,20 @@ Response getMetricNamespacesSync(@HostParam("Endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getMetricDefinitions(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + Mono> getMetricDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, + @QueryParam("metricNamespace") String metricNamespace, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}/metric-definitions") + @Get("/test-runs/{testRunId}/metric-namespaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getMetricDefinitionsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getMetricNamespaces(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/test-runs/{testRunId}/metrics") @ExpectedResponses({ 200 }) @@ -254,130 +280,81 @@ Response getMetricDefinitionsSync(@HostParam("Endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMetrics(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricname") String metricName, - @QueryParam("metricNamespace") String metricNamespace, @QueryParam("timespan") String timespan, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, + @QueryParam("metricname") String metricname, @QueryParam("metricNamespace") String metricNamespace, + @QueryParam("timespan") String timespan, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Post("/test-runs/{testRunId}/metrics") + @Get("/test-runs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listMetricsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("metricname") String metricName, - @QueryParam("metricNamespace") String metricNamespace, @QueryParam("timespan") String timespan, + Mono> listTestRuns(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}/metric-dimensions/{name}/values") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMetricDimensionValues(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @PathParam("name") String name, - @QueryParam("metricname") String metricName, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("timespan") String timespan, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/metric-dimensions/{name}/values") + @Post("/test-runs/{testRunId}:stop") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listMetricDimensionValuesSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @PathParam("name") String name, - @QueryParam("metricname") String metricName, @QueryParam("metricNamespace") String metricNamespace, - @QueryParam("timespan") String timespan, @QueryParam("api-version") String apiVersion, + Mono> stopTestRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testRunId") String testRunId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Patch("/test-runs/{testRunId}/app-components") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateAppComponents(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/test-runs/{testRunId}/app-components") + @Patch("/test-profile-runs/{testProfileRunId}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateAppComponentsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> createOrUpdateTestProfileRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testProfileRunId") String testProfileRunId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData body, RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}/app-components") - @ExpectedResponses({ 200 }) + @Delete("/test-profile-runs/{testProfileRunId}") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAppComponents(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, + Mono> deleteTestProfileRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testProfileRunId") String testProfileRunId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}/app-components") + @Get("/test-profile-runs/{testProfileRunId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAppComponentsSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, + Mono> getTestProfileRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testProfileRunId") String testProfileRunId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Patch("/test-runs/{testRunId}/server-metrics-config") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateServerMetricsConfig(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Patch("/test-runs/{testRunId}/server-metrics-config") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createOrUpdateServerMetricsConfigSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData body, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/test-runs/{testRunId}/server-metrics-config") + @Get("/test-profile-runs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getServerMetricsConfig(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> listTestProfileRuns(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("/test-runs/{testRunId}/server-metrics-config") + @Post("/test-profile-runs/{testProfileRunId}:stop") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getServerMetricsConfigSync(@HostParam("Endpoint") String endpoint, - @PathParam("testRunId") String testRunId, @QueryParam("api-version") String apiVersion, + Mono> stopTestProfileRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("testProfileRunId") String testProfileRunId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -386,19 +363,9 @@ Response getServerMetricsConfigSync(@HostParam("Endpoint") String en @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listTestRunsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listTestRunsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); + Mono> listMetricDimensionValuesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -407,7 +374,7 @@ Response listTestRunsNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listMetricsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -416,8 +383,8 @@ Mono> listMetricsNext(@PathParam(value = "nextLink", encode @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listMetricsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("Endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Mono> listTestRunsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -426,30 +393,22 @@ Response listMetricsNextSync(@PathParam(value = "nextLink", encoded @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listMetricDimensionValuesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listMetricDimensionValuesNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("Endpoint") String endpoint, + Mono> listTestProfileRunsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); } /** - * Create and start a new test run with the given name. + * Create and start a new test run with the given test run Id. *

Query Parameters

* * * * + * is provided, the + * test will run with the JMX file, configuration and app components from the + * existing test run. You can override the configuration values for new test run + * in the request body. *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this - * is provided, the test will run with the JMX file, configuration and app components from the existing test run. - * You can override the configuration values for new test run in the request body.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

@@ -457,11 +416,12 @@ Response listMetricDimensionValuesNextSync( *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -470,6 +430,25 @@ Response listMetricDimensionValuesNextSync(
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -503,28 +482,45 @@ Response listMetricDimensionValuesNextSync(
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -532,6 +528,7 @@ Response listMetricDimensionValuesNextSync(
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -539,11 +536,15 @@ Response listMetricDimensionValuesNextSync(
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -553,7 +554,14 @@ Response listMetricDimensionValuesNextSync(
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -567,11 +575,12 @@ Response listMetricDimensionValuesNextSync(
      * 
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -580,6 +589,25 @@ Response listMetricDimensionValuesNextSync(
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -613,28 +641,45 @@ Response listMetricDimensionValuesNextSync(
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -642,6 +687,7 @@ Response listMetricDimensionValuesNextSync(
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -649,11 +695,15 @@ Response listMetricDimensionValuesNextSync(
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -663,7 +713,14 @@ Response listMetricDimensionValuesNextSync(
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -672,9 +729,9 @@ Response listMetricDimensionValuesNextSync(
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -685,20 +742,23 @@ Response listMetricDimensionValuesNextSync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrUpdateTestRunWithResponseAsync(String testRunId, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateTestRun(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrUpdateTestRun(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, contentType, accept, body, requestOptions, context)); } /** - * Create and start a new test run with the given name. + * Create and start a new test run with the given test run Id. *

Query Parameters

* * * * + * is provided, the + * test will run with the JMX file, configuration and app components from the + * existing test run. You can override the configuration values for new test run + * in the request body. *
Query Parameters
NameTypeRequiredDescription
oldTestRunIdStringNoExisting test run identifier that should be rerun, if this - * is provided, the test will run with the JMX file, configuration and app components from the existing test run. - * You can override the configuration values for new test run in the request body.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Request Body Schema

@@ -706,11 +766,12 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -719,6 +780,25 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -752,28 +832,45 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -781,6 +878,7 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -788,11 +886,15 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -802,7 +904,14 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -816,11 +925,12 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      * 
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -829,6 +939,25 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -862,28 +991,45 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -891,6 +1037,7 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -898,11 +1045,15 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -912,7 +1063,14 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -921,9 +1079,9 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Load test run model. + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -934,115 +1092,55 @@ public Mono> createOrUpdateTestRunWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateTestRunWithResponse(String testRunId, BinaryData body, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); + return createOrUpdateTestRunWithResponseAsync(testRunId, body, requestOptions).block(); } /** - * Get test run details by name. - *

Response Body Schema

+ * Add an app component to a test run. + * + * Add an app component to a test run by providing the resource Id, name and type. + *

Request Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
+     *     components (Optional, Required on create): {
+     *         String (Required): {
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
      *         }
      *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
+     *     testRunId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
      *         }
      *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
      *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1051,126 +1149,71 @@ public Response createOrUpdateTestRunWithResponse(String testRunId,
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name along with {@link Response} on successful completion of {@link Mono}. + * @return test run app component along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + public Mono> createOrUpdateAppComponentsWithResponseAsync(String testRunId, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTestRun(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrUpdateAppComponents(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, testRunId, accept, body, requestOptions, context)); } /** - * Get test run details by name. - *

Response Body Schema

+ * Add an app component to a test run. + * + * Add an app component to a test run by providing the resource Id, name and type. + *

Request Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
      *         }
      *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
+     *     testRunId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
      *         }
      *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
      *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1179,252 +1222,226 @@ public Mono> getTestRunWithResponseAsync(String testRunId,
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run details by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Delete a test run by its name. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteTestRun(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Delete a test run by its name. - * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body App Component model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return test run app component along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + public Response createOrUpdateAppComponentsWithResponse(String testRunId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateAppComponentsWithResponseAsync(testRunId, body, requestOptions).block(); } /** - * Get test run file by file name. - *

Response Body Schema

+ * Configure server metrics for a test run. + *

Request Body Schema

* *
      * {@code
      * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
-     * }
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. + * testRunId: String (Optional) + * metrics (Optional): { + * String (Required): { + * id: String (Optional) + * resourceId: String (Optional, Required on create) + * metricNamespace: String (Optional, Required on create) + * displayDescription: String (Optional) + * name: String (Optional, Required on create) + * aggregation: String (Optional, Required on create) + * unit: String (Optional) + * resourceType: String (Optional, Required on create) + * } + * } + * createdDateTime: OffsetDateTime (Optional) + * createdBy: String (Optional) + * lastModifiedDateTime: OffsetDateTime (Optional) + * lastModifiedBy: String (Optional) + * } + * } + *
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. + * @return test run server metrics configuration along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTestRunFileWithResponseAsync(String testRunId, String fileName, - RequestOptions requestOptions) { + public Mono> createOrUpdateServerMetricsConfigWithResponseAsync(String testRunId, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTestRunFile(this.client.getEndpoint(), testRunId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createOrUpdateServerMetricsConfig(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, testRunId, accept, body, requestOptions, context)); } /** - * Get test run file by file name. + * Configure server metrics for a test run. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
-     *     url: String (Optional)
-     *     fileName: String (Optional)
-     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *     expireDateTime: OffsetDateTime (Optional)
-     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *     validationFailureDetails: String (Optional)
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
+     *         }
+     *     }
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param fileName Test run file name with file extension. + * @param testRunId Unique Id for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run file by file name along with {@link Response}. + * @return test run server metrics configuration along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTestRunFileWithResponse(String testRunId, String fileName, + public Response createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, RequestOptions requestOptions) { + return createOrUpdateServerMetricsConfigWithResponseAsync(testRunId, body, requestOptions).block(); + } + + /** + * Delete an existing load test run. + * + * Delete an existing load test run by providing the testRunId. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getTestRunFileSync(this.client.getEndpoint(), testRunId, fileName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return FluxUtil.withContext(context -> service.deleteTestRun(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, accept, requestOptions, context)); } /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Delete an existing load test run. + * + * Delete an existing load test run by providing the testRunId. + * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return deleteTestRunWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Get associated app component (collection of azure resources) for the given test + * run. *

Response Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
      *         }
      *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
      *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1433,146 +1450,133 @@ public Response getTestRunFileWithResponse(String testRunId, String
      * }
      * 
* + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return associated app component (collection of azure resources) for the given test + * run along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestRunsSinglePageAsync(RequestOptions requestOptions) { + public Mono> getAppComponentsWithResponseAsync(String testRunId, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listTestRuns(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + return FluxUtil.withContext(context -> service.getAppComponents(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, accept, requestOptions, context)); } /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get associated app component (collection of azure resources) for the given test + * run. *

Response Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
+     *     components (Optional, Required on create): {
      *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *             resourceId: String (Required)
+     *             resourceName: String (Optional, Required on create)
+     *             resourceType: String (Optional, Required on create)
+     *             displayName: String (Optional)
+     *             resourceGroup: String (Optional)
+     *             subscriptionId: String (Optional)
+     *             kind: String (Optional)
      *         }
      *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
+     *     testRunId: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return associated app component (collection of azure resources) for the given test + * run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAppComponentsWithResponse(String testRunId, RequestOptions requestOptions) { + return getAppComponentsWithResponseAsync(testRunId, requestOptions).block(); + } + + /** + * Get associated server metrics configuration for the given test run. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
      *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
      *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return associated server metrics configuration for the given test run along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getServerMetricsConfigWithResponseAsync(String testRunId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getServerMetricsConfig(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, accept, requestOptions, context)); + } + + /** + * Get associated server metrics configuration for the given test run. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Optional)
+     *     metrics (Optional): {
+     *         String (Required): {
+     *             id: String (Optional)
+     *             resourceId: String (Optional, Required on create)
+     *             metricNamespace: String (Optional, Required on create)
+     *             displayDescription: String (Optional)
+     *             name: String (Optional, Required on create)
+     *             aggregation: String (Optional, Required on create)
+     *             unit: String (Optional)
+     *             resourceType: String (Optional, Required on create)
      *         }
      *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1581,72 +1585,33 @@ private Mono> listTestRunsSinglePageAsync(RequestOptio
      * }
      * 
* + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedFlux}. + * @return associated server metrics configuration for the given test run along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTestRunsAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsSinglePageAsync(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsNextSinglePageAsync(nextLink, requestOptionsLocal); - }); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServerMetricsConfigWithResponse(String testRunId, RequestOptions requestOptions) { + return getServerMetricsConfigWithResponseAsync(testRunId, requestOptions).block(); } /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get test run details by test run Id. *

Response Body Schema

* *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -1655,6 +1620,25 @@ public PagedFlux listTestRunsAsync(RequestOptions requestOptions) {
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -1688,28 +1672,45 @@ public PagedFlux listTestRunsAsync(RequestOptions requestOptions) {
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -1717,6 +1718,7 @@ public PagedFlux listTestRunsAsync(RequestOptions requestOptions) {
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -1724,11 +1726,15 @@ public PagedFlux listTestRunsAsync(RequestOptions requestOptions) {
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -1738,7 +1744,14 @@ public PagedFlux listTestRunsAsync(RequestOptions requestOptions) {
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1747,52 +1760,35 @@ public PagedFlux listTestRunsAsync(RequestOptions requestOptions) {
      * }
      * 
* + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters along with {@link PagedResponse}. + * @return test run details by test run Id along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listTestRunsSinglePage(RequestOptions requestOptions) { + public Mono> getTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listTestRunsSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + return FluxUtil.withContext(context -> service.getTestRun(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, accept, requestOptions, context)); } /** - * Get all test runs with given filters. - *

Query Parameters

- * - * - * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: - * executedDateTime asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - - * description, executedUser. For example, to search for a test run, with description 500 VUs, the search parameter - * can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(ISO 8601 literal format) of - * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(ISO 8601 literal format) of test-run - * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get test run details by test run Id. *

Response Body Schema

* *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -1801,6 +1797,25 @@ private PagedResponse listTestRunsSinglePage(RequestOptions requestO
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -1834,28 +1849,45 @@ private PagedResponse listTestRunsSinglePage(RequestOptions requestO
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -1863,6 +1895,7 @@ private PagedResponse listTestRunsSinglePage(RequestOptions requestO
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -1870,11 +1903,15 @@ private PagedResponse listTestRunsSinglePage(RequestOptions requestO
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -1884,7 +1921,14 @@ private PagedResponse listTestRunsSinglePage(RequestOptions requestO
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -1893,364 +1937,213 @@ private PagedResponse listTestRunsSinglePage(RequestOptions requestO
      * }
      * 
* + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return all test runs with given filters as paginated response with {@link PagedIterable}. + * @return test run details by test run Id along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTestRuns(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsSinglePage(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listTestRunsNextSinglePage(nextLink, requestOptionsLocal); - }); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return getTestRunWithResponseAsync(testRunId, requestOptions).block(); } /** - * Stop test run by name. + * Get test run file by file name. *

Response Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Name of the file. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + * @return test run file by file name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + public Mono> getTestRunFileWithResponseAsync(String testRunId, String fileName, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stopTestRun(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getTestRunFile(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, fileName, accept, requestOptions, context)); } /** - * Stop test run by name. + * Get test run file by file name. *

Response Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
-     *          (Optional){
-     *             message: String (Optional)
-     *         }
-     *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
-     *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
+     *     fileName: String (Required)
+     *     url: String (Optional)
+     *     fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *     expireDateTime: OffsetDateTime (Optional)
+     *     validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *     validationFailureDetails: String (Optional)
      * }
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param fileName Name of the file. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return load test run model along with {@link Response}. + * @return test run file by file name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.stopTestRunSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + public Response getTestRunFileWithResponse(String testRunId, String fileName, + RequestOptions requestOptions) { + return getTestRunFileWithResponseAsync(testRunId, fileName, requestOptions).block(); } /** - * List the metric namespaces for a load test run. + * List the dimension values for the given metric dimension name. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: + * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
-     * }
+     * String
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response} on successful completion of - * {@link Mono}. + * @return metrics dimension values along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMetricNamespacesWithResponseAsync(String testRunId, - RequestOptions requestOptions) { + private Mono> listMetricDimensionValuesSinglePageAsync(String testRunId, String name, + String metricname, String metricNamespace, String timespan, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMetricNamespaces(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil + .withContext( + context -> service.listMetricDimensionValues(this.getEndpoint(), this.getServiceVersion().getVersion(), + testRunId, name, metricname, metricNamespace, timespan, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * List the metric namespaces for a load test run. + * List the dimension values for the given metric dimension name. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: + * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
-     * {
-     *     value (Required): [
-     *          (Required){
-     *             description: String (Optional)
-     *             name: String (Optional)
-     *         }
-     *     ]
+     * String
      * }
+     * 
+ * + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return metrics dimension values as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetricDimensionValuesAsync(String testRunId, String name, String metricname, + String metricNamespace, String timespan, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>( + () -> listMetricDimensionValuesSinglePageAsync(testRunId, name, metricname, metricNamespace, timespan, + requestOptions), + nextLink -> listMetricDimensionValuesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * List the dimension values for the given metric dimension name. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: + * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param name Dimension name. + * @param metricname Metric name. + * @param metricNamespace Metric namespace to query metric definitions for. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return represents collection of metric namespaces along with {@link Response}. + * @return metrics dimension values as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getMetricNamespacesSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricname, + String metricNamespace, String timespan, RequestOptions requestOptions) { + return new PagedIterable<>( + listMetricDimensionValuesAsync(testRunId, name, metricname, metricNamespace, timespan, requestOptions)); } /** @@ -2271,7 +2164,7 @@ public Response getMetricNamespacesWithResponse(String testRunId, Re * description: String (Optional) * name: String (Optional) * namespace: String (Optional) - * primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional) + * primaryAggregationType: String(Average/Count/None/Total/Percentile75/Percentile90/Percentile95/Percentile96/Percentile97/Percentile98/Percentile99/Percentile999/Percentile9999) (Optional) * supportedAggregationTypes (Optional): [ * String (Optional) * ] @@ -2287,8 +2180,8 @@ public Response getMetricNamespacesWithResponse(String testRunId, Re * } *
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param metricNamespace Metric namespace to query metric definitions for. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2302,8 +2195,8 @@ public Response getMetricNamespacesWithResponse(String testRunId, Re public Mono> getMetricDefinitionsWithResponseAsync(String testRunId, String metricNamespace, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getMetricDefinitions(this.client.getEndpoint(), testRunId, - metricNamespace, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getMetricDefinitions(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, metricNamespace, accept, requestOptions, context)); } /** @@ -2324,7 +2217,7 @@ public Mono> getMetricDefinitionsWithResponseAsync(String t * description: String (Optional) * name: String (Optional) * namespace: String (Optional) - * primaryAggregationType: String(Average/Count/None/Total/Percentile90/Percentile95/Percentile99) (Optional) + * primaryAggregationType: String(Average/Count/None/Total/Percentile75/Percentile90/Percentile95/Percentile96/Percentile97/Percentile98/Percentile99/Percentile999/Percentile9999) (Optional) * supportedAggregationTypes (Optional): [ * String (Optional) * ] @@ -2340,8 +2233,8 @@ public Mono> getMetricDefinitionsWithResponseAsync(String t * } *
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param metricNamespace Metric namespace to query metric definitions for. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2353,98 +2246,73 @@ public Mono> getMetricDefinitionsWithResponseAsync(String t @ServiceMethod(returns = ReturnType.SINGLE) public Response getMetricDefinitionsWithResponse(String testRunId, String metricNamespace, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getMetricDefinitionsSync(this.client.getEndpoint(), testRunId, metricNamespace, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return getMetricDefinitionsWithResponseAsync(testRunId, metricNamespace, requestOptions).block(); } /** - * List the metric values for a load test run. - *

Query Parameters

- * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
aggregationStringNoThe aggregation
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: - * "application/json".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

+ * List the metric namespaces for a load test run. + *

Response Body Schema

* *
      * {@code
      * {
-     *     filters (Optional): [
-     *          (Optional){
+     *     value (Required): [
+     *          (Required){
+     *             description: String (Optional)
      *             name: String (Optional)
-     *             values (Optional): [
-     *                 String (Optional)
-     *             ]
      *         }
      *     ]
      * }
      * }
      * 
* + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents collection of metric namespaces along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMetricNamespacesWithResponseAsync(String testRunId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getMetricNamespaces(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, accept, requestOptions, context)); + } + + /** + * List the metric namespaces for a load test run. *

Response Body Schema

* *
      * {@code
      * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
+     *     value (Required): [
+     *          (Required){
+     *             description: String (Optional)
      *             name: String (Optional)
-     *             value: String (Optional)
      *         }
      *     ]
      * }
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response to a metrics query along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return represents collection of metric namespaces along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsSinglePageAsync(String testRunId, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { - requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); - } - }); - return FluxUtil - .withContext( - context -> service.listMetrics(this.client.getEndpoint(), testRunId, metricName, metricNamespace, - timespan, this.client.getServiceVersion().getVersion(), accept, requestOptionsLocal, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + public Response getMetricNamespacesWithResponse(String testRunId, RequestOptions requestOptions) { + return getMetricNamespacesWithResponseAsync(testRunId, requestOptions).block(); } /** @@ -2490,7 +2358,7 @@ private Mono> listMetricsSinglePageAsync(String testRu * { * data (Optional): [ * (Optional){ - * timestamp: String (Optional) + * timestamp: OffsetDateTime (Optional) * value: Double (Optional) * } * ] @@ -2504,9 +2372,9 @@ private Mono> listMetricsSinglePageAsync(String testRu * } *
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. * @param metricNamespace Metric namespace to query metric definitions for. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. @@ -2515,17 +2383,24 @@ private Mono> listMetricsSinglePageAsync(String testRu * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response to a metrics query as paginated response with {@link PagedFlux}. + * @return the response to a metrics query along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricsAsync(String testRunId, String metricName, String metricNamespace, - String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listMetricsSinglePageAsync(testRunId, metricName, metricNamespace, timespan, requestOptions), - nextLink -> listMetricsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsSinglePageAsync(String testRunId, String metricname, + String metricNamespace, String timespan, RequestOptions requestOptions) { + final String accept = "application/json"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); + return FluxUtil + .withContext(context -> service.listMetrics(this.getEndpoint(), this.getServiceVersion().getVersion(), + testRunId, metricname, metricNamespace, timespan, accept, requestOptionsLocal, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** @@ -2571,7 +2446,7 @@ public PagedFlux listMetricsAsync(String testRunId, String metricNam * { * data (Optional): [ * (Optional){ - * timestamp: String (Optional) + * timestamp: OffsetDateTime (Optional) * value: Double (Optional) * } * ] @@ -2585,9 +2460,9 @@ public PagedFlux listMetricsAsync(String testRunId, String metricNam * } *
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. * @param metricNamespace Metric namespace to query metric definitions for. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. @@ -2596,23 +2471,17 @@ public PagedFlux listMetricsAsync(String testRunId, String metricNam * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response to a metrics query along with {@link PagedResponse}. + * @return the response to a metrics query as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricsSinglePage(String testRunId, String metricName, String metricNamespace, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMetricsAsync(String testRunId, String metricname, String metricNamespace, String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - requestOptionsLocal.addRequestCallback(requestLocal -> { - if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { - requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); - } - }); - Response res - = service.listMetricsSync(this.client.getEndpoint(), testRunId, metricName, metricNamespace, timespan, - this.client.getServiceVersion().getVersion(), accept, requestOptionsLocal, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>( + () -> listMetricsSinglePageAsync(testRunId, metricname, metricNamespace, timespan, requestOptions), + nextLink -> listMetricsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** @@ -2658,7 +2527,7 @@ private PagedResponse listMetricsSinglePage(String testRunId, String * { * data (Optional): [ * (Optional){ - * timestamp: String (Optional) + * timestamp: OffsetDateTime (Optional) * value: Double (Optional) * } * ] @@ -2672,9 +2541,9 @@ private PagedResponse listMetricsSinglePage(String testRunId, String * } * * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param metricName Metric name. + * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param metricname Metric name. * @param metricNamespace Metric namespace to query metric definitions for. * @param timespan The timespan of the query. It is a string with the following format * 'startDateTime_ISO/endDateTime_ISO'. @@ -2686,210 +2555,1021 @@ private PagedResponse listMetricsSinglePage(String testRunId, String * @return the response to a metrics query as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetrics(String testRunId, String metricName, String metricNamespace, + public PagedIterable listMetrics(String testRunId, String metricname, String metricNamespace, String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>( - () -> listMetricsSinglePage(testRunId, metricName, metricNamespace, timespan, requestOptions), - nextLink -> listMetricsNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDimensionValuesSinglePageAsync(String testRunId, String name, - String metricName, String metricNamespace, String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricDimensionValues(this.client.getEndpoint(), testRunId, name, - metricName, metricNamespace, timespan, this.client.getServiceVersion().getVersion(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + return new PagedIterable<>(listMetricsAsync(testRunId, metricname, metricNamespace, timespan, requestOptions)); } /** - * List the dimension values for the given metric dimension name. + * Get all test runs for the given filters. *

Query Parameters

* * * - * + * + * + * + * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * executedDateTime + * asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of test-run + * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
createdByTypesList<String>NoComma separated list of type of entities + * that have created the test run. In the form of "," separated string.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
-     * String
+     * {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs for the given filters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestRunsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTestRuns(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get all test runs for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * executedDateTime + * asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of test-run + * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
createdByTypesList<String>NoComma separated list of type of entities + * that have created the test run. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs for the given filters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestRunsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestRunsSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestRunsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * Get all test runs for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoSort on the supported fields in (field asc/desc) format. eg: + * executedDateTime + * asc. Supported fields - executedDateTime
searchStringNoPrefix based, case sensitive search on searchable fields - + * description, + * executedUser. For example, to search for a test run, with description 500 VUs, + * the search parameter can be 500.
testIdStringNoUnique name of an existing load test.
executionFromOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * test-run execution time filter range.
executionToOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of test-run + * execution time filter range.
statusStringNoComma separated list of test run status.
maxpagesizeIntegerNoNumber of results in response.
createdByTypesList<String>NoComma separated list of type of entities + * that have created the test run. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return all test runs for the given filters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestRuns(RequestOptions requestOptions) { + return new PagedIterable<>(listTestRunsAsync(requestOptions)); + } + + /** + * Stop test run by test run Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return load test run model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopTestRunWithResponseAsync(String testRunId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.stopTestRun(this.getEndpoint(), + this.getServiceVersion().getVersion(), testRunId, accept, requestOptions, context)); + } + + /** + * Stop test run by test run Id. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     testRunId: String (Required)
+     *     passFailCriteria (Optional): {
+     *         passFailMetrics (Optional): {
+     *             String (Required): {
+     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
+     *                 condition: String (Optional)
+     *                 requestName: String (Optional)
+     *                 value: Double (Optional)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
+     *     }
+     *     secrets (Optional): {
+     *         String (Required): {
+     *             value: String (Optional)
+     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
+     *         }
+     *     }
+     *     certificate (Optional): {
+     *         value: String (Optional)
+     *         type: String(AKV_CERT_URI) (Optional)
+     *         name: String (Optional)
+     *     }
+     *     environmentVariables (Optional): {
+     *         String: String (Required)
+     *     }
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     testRunStatistics (Optional): {
+     *         String (Required): {
+     *             transaction: String (Optional)
+     *             sampleCount: Double (Optional)
+     *             errorCount: Double (Optional)
+     *             errorPct: Double (Optional)
+     *             meanResTime: Double (Optional)
+     *             medianResTime: Double (Optional)
+     *             maxResTime: Double (Optional)
+     *             minResTime: Double (Optional)
+     *             pct1ResTime: Double (Optional)
+     *             pct2ResTime: Double (Optional)
+     *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
+     *             throughput: Double (Optional)
+     *             receivedKBytesPerSec: Double (Optional)
+     *             sentKBytesPerSec: Double (Optional)
+     *         }
+     *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
+     *     loadTestConfiguration (Optional): {
+     *         engineInstances: Integer (Optional)
+     *         splitAllCSVs: Boolean (Optional)
+     *         quickStartTest: Boolean (Optional)
+     *         optionalLoadTestConfig (Optional): {
+     *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
+     *             virtualUsers: Integer (Optional)
+     *             rampUpTime: Integer (Optional)
+     *             duration: Long (Optional)
+     *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
+     *     }
+     *     testArtifacts (Optional): {
+     *         inputArtifacts (Optional): {
+     *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
+     *                 url: String (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
+     *                 validationFailureDetails: String (Optional)
+     *             }
+     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
+     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
+     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
+     *             additionalFileInfo (Optional): [
+     *                 (recursive schema, see above)
+     *             ]
+     *         }
+     *         outputArtifacts (Optional): {
+     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
+     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
+     *         }
+     *     }
+     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
+     *     virtualUsers: Integer (Optional)
+     *     displayName: String (Optional)
+     *     testId: String (Optional)
+     *     description: String (Optional)
+     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     executedDateTime: OffsetDateTime (Optional)
+     *     portalUrl: String (Optional)
+     *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
+     *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
-     * 
- * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMetricDimensionValuesAsync(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listMetricDimensionValuesSinglePageAsync(testRunId, name, metricName, metricNamespace, timespan, - requestOptions), - nextLink -> listMetricDimensionValuesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. + * @param testRunId Unique test run identifier for the load test run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse}. + * @return load test run model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricDimensionValuesSinglePage(String testRunId, String name, - String metricName, String metricNamespace, String timespan, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listMetricDimensionValuesSync(this.client.getEndpoint(), testRunId, name, - metricName, metricNamespace, timespan, this.client.getServiceVersion().getVersion(), accept, requestOptions, - Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + public Response stopTestRunWithResponse(String testRunId, RequestOptions requestOptions) { + return stopTestRunWithResponseAsync(testRunId, requestOptions).block(); } /** - * List the dimension values for the given metric dimension name. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
intervalStringNoThe interval (i.e. timegrain) of the query. Allowed values: - * "PT5S", "PT10S", "PT1M", "PT5M", "PT1H".
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
+ * Create and start a new test profile run. * - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param name Dimension name. - * @param metricName Metric name. - * @param metricNamespace Metric namespace to query metric definitions for. - * @param timespan The timespan of the query. It is a string with the following format - * 'startDateTime_ISO/endDateTime_ISO'. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMetricDimensionValues(String testRunId, String name, String metricName, - String metricNamespace, String timespan, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>( - () -> listMetricDimensionValuesSinglePage(testRunId, name, metricName, metricNamespace, timespan, - requestOptions), - nextLink -> listMetricDimensionValuesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Associate an app component (collection of azure resources) to a test run. + * Create and start a new test profile run with the given test profile run Id. *

Request Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
-     *     testRunId: String (Optional)
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -2903,18 +3583,40 @@ public PagedIterable listMetricDimensionValues(String testRunId, Str
      * 
      * {@code
      * {
-     *     components (Required): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
-     *     testRunId: String (Optional)
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -2923,43 +3625,69 @@ public PagedIterable listMetricDimensionValues(String testRunId, Str
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body App Component model. + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run app component along with {@link Response} on successful completion of {@link Mono}. + * @return test Profile Run model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAppComponentsWithResponseAsync(String testRunId, BinaryData body, - RequestOptions requestOptions) { + public Mono> createOrUpdateTestProfileRunWithResponseAsync(String testProfileRunId, + BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateAppComponents(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.createOrUpdateTestProfileRun(this.getEndpoint(), this.getServiceVersion().getVersion(), + testProfileRunId, contentType, accept, body, requestOptions, context)); } /** - * Associate an app component (collection of azure resources) to a test run. + * Create and start a new test profile run. + * + * Create and start a new test profile run with the given test profile run Id. *

Request Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
-     *     testRunId: String (Optional)
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -2973,18 +3701,40 @@ public Mono> createOrUpdateAppComponentsWithResponseAsync(S
      * 
      * {@code
      * {
-     *     components (Required): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
-     *     testRunId: String (Optional)
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -2993,43 +3743,106 @@ public Mono> createOrUpdateAppComponentsWithResponseAsync(S
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body App Component model. + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param body The resource instance. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run app component along with {@link Response}. + * @return test Profile Run model along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAppComponentsWithResponse(String testRunId, BinaryData body, + public Response createOrUpdateTestProfileRunWithResponse(String testProfileRunId, BinaryData body, + RequestOptions requestOptions) { + return createOrUpdateTestProfileRunWithResponseAsync(testProfileRunId, body, requestOptions).block(); + } + + /** + * Delete an existing load test profile run. + * + * Delete an existing load test profile run by providing the test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTestProfileRunWithResponseAsync(String testProfileRunId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createOrUpdateAppComponentsSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); + return FluxUtil.withContext(context -> service.deleteTestProfileRun(this.getEndpoint(), + this.getServiceVersion().getVersion(), testProfileRunId, accept, requestOptions, context)); + } + + /** + * Delete an existing load test profile run. + * + * Delete an existing load test profile run by providing the test profile run Id. + * + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTestProfileRunWithResponse(String testProfileRunId, RequestOptions requestOptions) { + return deleteTestProfileRunWithResponseAsync(testProfileRunId, requestOptions).block(); } /** - * Get associated app component (collection of azure resources) for the given test run. + * Get test profile run details. + * + * Get test profile run details by test profile run Id. *

Response Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
-     *     testRunId: String (Optional)
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3038,43 +3851,69 @@ public Response createOrUpdateAppComponentsWithResponse(String testR
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response} on successful completion of {@link Mono}. + * @return test profile run details. + * + * Get test profile run details by test profile run Id along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAppComponentsWithResponseAsync(String testRunId, + public Mono> getTestProfileRunWithResponseAsync(String testProfileRunId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAppComponents(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getTestProfileRun(this.getEndpoint(), + this.getServiceVersion().getVersion(), testProfileRunId, accept, requestOptions, context)); } /** - * Get associated app component (collection of azure resources) for the given test run. + * Get test profile run details. + * + * Get test profile run details by test profile run Id. *

Response Body Schema

* *
      * {@code
      * {
-     *     components (Required): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             resourceId: String (Optional)
-     *             resourceName: String (Optional)
-     *             resourceType: String (Optional)
-     *             displayName: String (Optional)
-     *             resourceGroup: String (Optional)
-     *             subscriptionId: String (Optional)
-     *             kind: String (Optional)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
-     *     testRunId: String (Optional)
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3083,69 +3922,91 @@ public Mono> getAppComponentsWithResponseAsync(String testR
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return associated app component (collection of azure resources) for the given test run along with - * {@link Response}. + * @return test profile run details. + * + * Get test profile run details by test profile run Id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAppComponentsWithResponse(String testRunId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAppComponentsSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + public Response getTestProfileRunWithResponse(String testProfileRunId, RequestOptions requestOptions) { + return getTestProfileRunWithResponseAsync(testProfileRunId, requestOptions).block(); } /** - * Configure server metrics for a test run. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
-     *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
-     *         }
-     *     }
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
-     * }
-     * }
-     * 
+ * List test profile runs. * + * Get all test profile runs for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
minStartDateTimeOffsetDateTimeNoMinimum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
maxStartDateTimeOffsetDateTimeNoMaximum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
minEndDateTimeOffsetDateTimeNoMinimum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
maxEndDateTimeOffsetDateTimeNoMaximum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
createdDateStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * the created time range to filter test profile runs.
createdDateEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of the + * created time range to filter test profile runs.
testProfileRunIdsList<String>NoComma separated list of IDs of the test + * profile runs to filter. In the form of "," separated string.
testProfileIdsList<String>NoComma separated IDs of the test profiles + * which should be associated with the test profile runs to fetch. In the form of "," separated string.
statusesList<String>NoComma separated list of Statuses of the test + * profile runs to filter. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3154,45 +4015,93 @@ public Response getAppComponentsWithResponse(String testRunId, Reque
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response} on successful completion of + * @return paged collection of TestProfileRun items along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateServerMetricsConfigWithResponseAsync(String testRunId, - BinaryData body, RequestOptions requestOptions) { + private Mono> listTestProfileRunsSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdateServerMetricsConfig(this.client.getEndpoint(), - testRunId, this.client.getServiceVersion().getVersion(), body, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.listTestProfileRuns(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * Configure server metrics for a test run. - *

Request Body Schema

+ * List test profile runs. + * + * Get all test profile runs for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
minStartDateTimeOffsetDateTimeNoMinimum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
maxStartDateTimeOffsetDateTimeNoMaximum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
minEndDateTimeOffsetDateTimeNoMinimum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
maxEndDateTimeOffsetDateTimeNoMaximum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
createdDateStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * the created time range to filter test profile runs.
createdDateEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of the + * created time range to filter test profile runs.
testProfileRunIdsList<String>NoComma separated list of IDs of the test + * profile runs to filter. In the form of "," separated string.
testProfileIdsList<String>NoComma separated IDs of the test profiles + * which should be associated with the test profile runs to fetch. In the form of "," separated string.
statusesList<String>NoComma separated list of Statuses of the test + * profile runs to filter. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

* *
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3201,24 +4110,111 @@ public Mono> createOrUpdateServerMetricsConfigWithResponseA
      * }
      * 
* + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTestProfileRunsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestProfileRunsSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listTestProfileRunsNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * List test profile runs. + * + * Get all test profile runs for the given filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoMaximum number of results to include in a single + * response.
minStartDateTimeOffsetDateTimeNoMinimum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
maxStartDateTimeOffsetDateTimeNoMaximum Start DateTime(RFC 3339 literal + * format) of the test profile runs to filter on.
minEndDateTimeOffsetDateTimeNoMinimum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
maxEndDateTimeOffsetDateTimeNoMaximum End DateTime(RFC 3339 literal format) of + * the test profile runs to filter on.
createdDateStartTimeOffsetDateTimeNoStart DateTime(RFC 3339 literal format) of + * the created time range to filter test profile runs.
createdDateEndTimeOffsetDateTimeNoEnd DateTime(RFC 3339 literal format) of the + * created time range to filter test profile runs.
testProfileRunIdsList<String>NoComma separated list of IDs of the test + * profile runs to filter. In the form of "," separated string.
testProfileIdsList<String>NoComma separated IDs of the test profiles + * which should be associated with the test profile runs to fetch. In the form of "," separated string.
statusesList<String>NoComma separated list of Statuses of the test + * profile runs to filter. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3227,44 +4223,61 @@ public Mono> createOrUpdateServerMetricsConfigWithResponseA
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. - * @param body Server metric configuration model. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response}. + * @return paged collection of TestProfileRun items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateServerMetricsConfigWithResponse(String testRunId, BinaryData body, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateServerMetricsConfigSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), body, accept, requestOptions, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTestProfileRuns(RequestOptions requestOptions) { + return new PagedIterable<>(listTestProfileRunsAsync(requestOptions)); } /** - * List server metrics configuration for the given test run. + * Stop test profile run. + * + * Stop test profile run for the given test profile run Id. *

Response Body Schema

* *
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3273,44 +4286,66 @@ public Response createOrUpdateServerMetricsConfigWithResponse(String
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response} on successful completion of - * {@link Mono}. + * @return test Profile Run model along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getServerMetricsConfigWithResponseAsync(String testRunId, + public Mono> stopTestProfileRunWithResponseAsync(String testProfileRunId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getServerMetricsConfig(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.stopTestProfileRun(this.getEndpoint(), + this.getServiceVersion().getVersion(), testProfileRunId, accept, requestOptions, context)); } /** - * List server metrics configuration for the given test run. + * Stop test profile run. + * + * Stop test profile run for the given test profile run Id. *

Response Body Schema

* *
      * {@code
      * {
-     *     testRunId: String (Optional)
-     *     metrics (Optional): {
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
+     *          (Optional){
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
      *         String (Required): {
-     *             id: String (Optional)
-     *             resourceId: String (Required)
-     *             metricNamespace: String (Required)
-     *             displayDescription: String (Optional)
-     *             name: String (Required)
-     *             aggregation: String (Required)
-     *             unit: String (Optional)
-     *             resourceType: String (Required)
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     }
+     *     recommendations (Optional): [
+     *          (Optional){
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3319,130 +4354,72 @@ public Mono> getServerMetricsConfigWithResponseAsync(String
      * }
      * 
* - * @param testRunId Unique name for the load test run, must contain only lower-case alphabetic, numeric, underscore - * or hyphen characters. + * @param testProfileRunId Unique identifier for the test profile run, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return test Profile Run model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopTestProfileRunWithResponse(String testProfileRunId, RequestOptions requestOptions) { + return stopTestProfileRunWithResponseAsync(testProfileRunId, requestOptions).block(); + } + + /** + * List the dimension values for the given metric dimension name. + * + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return test run server metrics configuration along with {@link Response}. + * @return metrics dimension values along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getServerMetricsConfigWithResponse(String testRunId, RequestOptions requestOptions) { + private Mono> listMetricDimensionValuesNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.getServerMetricsConfigSync(this.client.getEndpoint(), testRunId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return FluxUtil + .withContext(context -> service.listMetricDimensionValuesNext(nextLink, this.getEndpoint(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** + * List the metric values for a load test run. + * * Get the next page of items. *

Response Body Schema

* *
      * {@code
      * {
-     *     passFailCriteria (Optional): {
-     *         passFailMetrics (Optional): {
-     *             String (Required): {
-     *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
-     *                 condition: String (Optional)
-     *                 requestName: String (Optional)
-     *                 value: Double (Optional)
-     *                 action: String(continue/stop) (Optional)
-     *                 actualValue: Double (Optional)
-     *                 result: String(passed/undetermined/failed) (Optional)
-     *             }
-     *         }
-     *     }
-     *     secrets (Optional): {
-     *         String (Required): {
-     *             value: String (Optional)
-     *             type: String(AKV_SECRET_URI/SECRET_VALUE) (Optional)
-     *         }
-     *     }
-     *     certificate (Optional): {
-     *         value: String (Optional)
-     *         type: String(AKV_CERT_URI) (Optional)
-     *         name: String (Optional)
-     *     }
-     *     environmentVariables (Optional): {
-     *         String: String (Required)
-     *     }
-     *     errorDetails (Optional): [
+     *     data (Optional): [
      *          (Optional){
-     *             message: String (Optional)
+     *             timestamp: OffsetDateTime (Optional)
+     *             value: Double (Optional)
      *         }
      *     ]
-     *     testRunStatistics (Optional): {
-     *         String (Required): {
-     *             transaction: String (Optional)
-     *             sampleCount: Double (Optional)
-     *             errorCount: Double (Optional)
-     *             errorPct: Double (Optional)
-     *             meanResTime: Double (Optional)
-     *             medianResTime: Double (Optional)
-     *             maxResTime: Double (Optional)
-     *             minResTime: Double (Optional)
-     *             pct1ResTime: Double (Optional)
-     *             pct2ResTime: Double (Optional)
-     *             pct3ResTime: Double (Optional)
-     *             throughput: Double (Optional)
-     *             receivedKBytesPerSec: Double (Optional)
-     *             sentKBytesPerSec: Double (Optional)
-     *         }
-     *     }
-     *     loadTestConfiguration (Optional): {
-     *         engineInstances: Integer (Optional)
-     *         splitAllCSVs: Boolean (Optional)
-     *         quickStartTest: Boolean (Optional)
-     *         optionalLoadTestConfig (Optional): {
-     *             endpointUrl: String (Optional)
-     *             virtualUsers: Integer (Optional)
-     *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
-     *         }
-     *     }
-     *     testArtifacts (Optional): {
-     *         inputArtifacts (Optional): {
-     *             configFileInfo (Optional): {
-     *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
-     *                 expireDateTime: OffsetDateTime (Optional)
-     *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
-     *                 validationFailureDetails: String (Optional)
-     *             }
-     *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
-     *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
-     *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
-     *             additionalFileInfo (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *         }
-     *         outputArtifacts (Optional): {
-     *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
-     *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *     dimensionValues (Optional): [
+     *          (Optional){
+     *             name: String (Optional)
+     *             value: String (Optional)
      *         }
-     *     }
-     *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
-     *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
-     *     displayName: String (Optional)
-     *     testId: String (Optional)
-     *     description: String (Optional)
-     *     status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Optional)
-     *     startDateTime: OffsetDateTime (Optional)
-     *     endDateTime: OffsetDateTime (Optional)
-     *     executedDateTime: OffsetDateTime (Optional)
-     *     portalUrl: String (Optional)
-     *     duration: Long (Optional)
-     *     subnetId: String (Optional)
-     *     createdDateTime: OffsetDateTime (Optional)
-     *     createdBy: String (Optional)
-     *     lastModifiedDateTime: OffsetDateTime (Optional)
-     *     lastModifiedBy: String (Optional)
+     *     ]
      * }
      * }
      * 
@@ -3453,30 +4430,35 @@ public Response getServerMetricsConfigWithResponse(String testRunId, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return collection of test runs along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response to a metrics query along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTestRunsNextSinglePageAsync(String nextLink, + private Mono> listMetricsNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listTestRunsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + return FluxUtil + .withContext( + context -> service.listMetricsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** + * Get all test runs for the given filters. + * * Get the next page of items. *

Response Body Schema

* *
      * {@code
      * {
+     *     testRunId: String (Required)
      *     passFailCriteria (Optional): {
      *         passFailMetrics (Optional): {
      *             String (Required): {
      *                 clientMetric: String(response_time_ms/latency/error/requests/requests_per_sec) (Optional)
-     *                 aggregate: String(count/percentage/avg/p50/p90/p95/p99/min/max) (Optional)
+     *                 aggregate: String(count/percentage/avg/p50/p75/p90/p95/p96/p97/p98/p99/p99.9/p99.99/min/max) (Optional)
      *                 condition: String (Optional)
      *                 requestName: String (Optional)
      *                 value: Double (Optional)
@@ -3485,6 +4467,25 @@ private Mono> listTestRunsNextSinglePageAsync(String n
      *                 result: String(passed/undetermined/failed) (Optional)
      *             }
      *         }
+     *         passFailServerMetrics (Optional): {
+     *             String (Required): {
+     *                 resourceId: String (Optional, Required on create)
+     *                 metricNamespace: String (Optional, Required on create)
+     *                 metricName: String (Optional, Required on create)
+     *                 aggregation: String (Optional, Required on create)
+     *                 condition: String (Optional, Required on create)
+     *                 value: double (Optional, Required on create)
+     *                 action: String(continue/stop) (Optional)
+     *                 actualValue: Double (Optional)
+     *                 result: String(passed/undetermined/failed) (Optional)
+     *             }
+     *         }
+     *     }
+     *     autoStopCriteria (Optional): {
+     *         autoStopDisabled: Boolean (Optional)
+     *         errorRate: Double (Optional)
+     *         errorRateTimeWindowInSeconds: Long (Optional)
+     *         maximumVirtualUsersPerEngine: Integer (Optional)
      *     }
      *     secrets (Optional): {
      *         String (Required): {
@@ -3518,28 +4519,45 @@ private Mono> listTestRunsNextSinglePageAsync(String n
      *             pct1ResTime: Double (Optional)
      *             pct2ResTime: Double (Optional)
      *             pct3ResTime: Double (Optional)
+     *             pct75ResTime: Double (Optional)
+     *             pct96ResTime: Double (Optional)
+     *             pct97ResTime: Double (Optional)
+     *             pct98ResTime: Double (Optional)
+     *             pct999ResTime: Double (Optional)
+     *             pct9999ResTime: Double (Optional)
      *             throughput: Double (Optional)
      *             receivedKBytesPerSec: Double (Optional)
      *             sentKBytesPerSec: Double (Optional)
      *         }
      *     }
+     *     regionalStatistics (Optional): {
+     *         String (Required): (recursive schema, see String above)
+     *     }
      *     loadTestConfiguration (Optional): {
      *         engineInstances: Integer (Optional)
      *         splitAllCSVs: Boolean (Optional)
      *         quickStartTest: Boolean (Optional)
      *         optionalLoadTestConfig (Optional): {
      *             endpointUrl: String (Optional)
+     *             requestsPerSecond: Integer (Optional)
+     *             maxResponseTimeInMs: Integer (Optional)
      *             virtualUsers: Integer (Optional)
      *             rampUpTime: Integer (Optional)
-     *             duration: Integer (Optional)
+     *             duration: Long (Optional)
      *         }
+     *         regionalLoadTestConfig (Optional): [
+     *              (Optional){
+     *                 engineInstances: int (Optional, Required on create)
+     *                 region: String (Optional, Required on create)
+     *             }
+     *         ]
      *     }
      *     testArtifacts (Optional): {
      *         inputArtifacts (Optional): {
      *             configFileInfo (Optional): {
+     *                 fileName: String (Required)
      *                 url: String (Optional)
-     *                 fileName: String (Optional)
-     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS) (Optional)
+     *                 fileType: String(JMX_FILE/USER_PROPERTIES/ADDITIONAL_ARTIFACTS/ZIPPED_ARTIFACTS/URL_TEST_CONFIG/TEST_SCRIPT) (Optional)
      *                 expireDateTime: OffsetDateTime (Optional)
      *                 validationStatus: String(NOT_VALIDATED/VALIDATION_SUCCESS/VALIDATION_FAILURE/VALIDATION_INITIATED/VALIDATION_NOT_REQUIRED) (Optional)
      *                 validationFailureDetails: String (Optional)
@@ -3547,6 +4565,7 @@ private Mono> listTestRunsNextSinglePageAsync(String n
      *             testScriptFileInfo (Optional): (recursive schema, see testScriptFileInfo above)
      *             userPropFileInfo (Optional): (recursive schema, see userPropFileInfo above)
      *             inputArtifactsZipFileInfo (Optional): (recursive schema, see inputArtifactsZipFileInfo above)
+     *             urlTestConfigFileInfo (Optional): (recursive schema, see urlTestConfigFileInfo above)
      *             additionalFileInfo (Optional): [
      *                 (recursive schema, see above)
      *             ]
@@ -3554,11 +4573,15 @@ private Mono> listTestRunsNextSinglePageAsync(String n
      *         outputArtifacts (Optional): {
      *             resultFileInfo (Optional): (recursive schema, see resultFileInfo above)
      *             logsFileInfo (Optional): (recursive schema, see logsFileInfo above)
+     *             artifactsContainerInfo (Optional): {
+     *                 url: String (Optional)
+     *                 expireDateTime: OffsetDateTime (Optional)
+     *             }
+     *             reportFileInfo (Optional): (recursive schema, see reportFileInfo above)
      *         }
      *     }
      *     testResult: String(PASSED/NOT_APPLICABLE/FAILED) (Optional)
      *     virtualUsers: Integer (Optional)
-     *     testRunId: String (Optional)
      *     displayName: String (Optional)
      *     testId: String (Optional)
      *     description: String (Optional)
@@ -3568,7 +4591,14 @@ private Mono> listTestRunsNextSinglePageAsync(String n
      *     executedDateTime: OffsetDateTime (Optional)
      *     portalUrl: String (Optional)
      *     duration: Long (Optional)
+     *     virtualUserHours: Double (Optional)
      *     subnetId: String (Optional)
+     *     kind: String(URL/JMX/Locust) (Optional)
+     *     requestDataLevel: String(NONE/ERRORS) (Optional)
+     *     debugLogsEnabled: Boolean (Optional)
+     *     publicIPDisabled: Boolean (Optional)
+     *     createdByType: String(User/ScheduledTrigger/AzurePipelines/GitHubWorkflows) (Optional)
+     *     createdByUri: String (Optional)
      *     createdDateTime: OffsetDateTime (Optional)
      *     createdBy: String (Optional)
      *     lastModifiedDateTime: OffsetDateTime (Optional)
@@ -3583,78 +4613,67 @@ private Mono> listTestRunsNextSinglePageAsync(String n
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return collection of test runs along with {@link PagedResponse}.
-     */
-    @ServiceMethod(returns = ReturnType.SINGLE)
-    private PagedResponse listTestRunsNextSinglePage(String nextLink, RequestOptions requestOptions) {
-        final String accept = "application/json";
-        Response res
-            = service.listTestRunsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE);
-        return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
-            getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
-    }
-
-    /**
-     * Get the next page of items.
-     * 

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     data (Optional): [
-     *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
-     *         }
-     *     ]
-     *     dimensionValues (Optional): [
-     *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response to a metrics query along with {@link PagedResponse} on successful completion of + * @return paged collection of TestRun items along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricsNextSinglePageAsync(String nextLink, + private Mono> listTestRunsNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + return FluxUtil + .withContext( + context -> service.listTestRunsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** + * List test profile runs. + * * Get the next page of items. *

Response Body Schema

* *
      * {@code
      * {
-     *     data (Optional): [
+     *     testProfileRunId: String (Required)
+     *     displayName: String (Optional)
+     *     description: String (Optional)
+     *     testProfileId: String (Optional)
+     *     targetResourceId: String (Optional)
+     *     targetResourceConfigurations (Optional): {
+     *         kind: String(FunctionsFlexConsumption) (Required)
+     *     }
+     *     status: String(ACCEPTED/NOTSTARTED/EXECUTING/DONE/CANCELLING/CANCELLED/FAILED) (Optional)
+     *     errorDetails (Optional): [
      *          (Optional){
-     *             timestamp: String (Optional)
-     *             value: Double (Optional)
+     *             message: String (Optional)
      *         }
      *     ]
-     *     dimensionValues (Optional): [
+     *     startDateTime: OffsetDateTime (Optional)
+     *     endDateTime: OffsetDateTime (Optional)
+     *     durationInSeconds: Long (Optional)
+     *     testRunDetails (Optional): {
+     *         String (Required): {
+     *             status: String(ACCEPTED/NOTSTARTED/PROVISIONING/PROVISIONED/CONFIGURING/CONFIGURED/EXECUTING/EXECUTED/DEPROVISIONING/DEPROVISIONED/DONE/CANCELLING/CANCELLED/FAILED/VALIDATION_SUCCESS/VALIDATION_FAILURE) (Required)
+     *             configurationId: String (Required)
+     *             properties (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     recommendations (Optional): [
      *          (Optional){
-     *             name: String (Optional)
-     *             value: String (Optional)
+     *             category: String(ThroughputOptimized/CostOptimized) (Required)
+     *             configurations (Optional): [
+     *                 String (Optional)
+     *             ]
      *         }
      *     ]
+     *     createdDateTime: OffsetDateTime (Optional)
+     *     createdBy: String (Optional)
+     *     lastModifiedDateTime: OffsetDateTime (Optional)
+     *     lastModifiedBy: String (Optional)
      * }
      * }
      * 
@@ -3665,74 +4684,19 @@ private Mono> listMetricsNextSinglePageAsync(String ne * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response to a metrics query along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listMetricsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of TestProfileRun items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMetricDimensionValuesNextSinglePageAsync(String nextLink, + private Mono> listTestProfileRunsNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listMetricDimensionValuesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) + return FluxUtil.withContext( + context -> service.listTestProfileRunsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return metrics dimension values along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listMetricDimensionValuesNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listMetricDimensionValuesNextSync(nextLink, this.client.getEndpoint(), - accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - private List getValues(BinaryData binaryData, String path) { try { Map obj = binaryData.toObject(Map.class); diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java deleted file mode 100644 index a391923f7629..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestingClientImpl.java +++ /dev/null @@ -1,142 +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.developer.loadtesting.implementation; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.developer.loadtesting.LoadTestingServiceVersion; - -/** - * Initializes a new instance of the LoadTestingClient type. - */ -public final class LoadTestingClientImpl { - /** - * URL to perform data plane API operations on the resource. - */ - private final String endpoint; - - /** - * Gets URL to perform data plane API operations on the resource. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * Service version. - */ - private final LoadTestingServiceVersion serviceVersion; - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public LoadTestingServiceVersion getServiceVersion() { - return this.serviceVersion; - } - - /** - * The HTTP pipeline to send requests through. - */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** - * The serializer to serialize an object into a string. - */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - public SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** - * The LoadTestAdministrationsImpl object to access its operations. - */ - private final LoadTestAdministrationsImpl loadTestAdministrations; - - /** - * Gets the LoadTestAdministrationsImpl object to access its operations. - * - * @return the LoadTestAdministrationsImpl object. - */ - public LoadTestAdministrationsImpl getLoadTestAdministrations() { - return this.loadTestAdministrations; - } - - /** - * The LoadTestRunsImpl object to access its operations. - */ - private final LoadTestRunsImpl loadTestRuns; - - /** - * Gets the LoadTestRunsImpl object to access its operations. - * - * @return the LoadTestRunsImpl object. - */ - public LoadTestRunsImpl getLoadTestRuns() { - return this.loadTestRuns; - } - - /** - * Initializes an instance of LoadTestingClient client. - * - * @param endpoint URL to perform data plane API operations on the resource. - * @param serviceVersion Service version. - */ - public LoadTestingClientImpl(String endpoint, LoadTestingServiceVersion serviceVersion) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - } - - /** - * Initializes an instance of LoadTestingClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint URL to perform data plane API operations on the resource. - * @param serviceVersion Service version. - */ - public LoadTestingClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestingServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); - } - - /** - * Initializes an instance of LoadTestingClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint URL to perform data plane API operations on the resource. - * @param serviceVersion Service version. - */ - public LoadTestingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - LoadTestingServiceVersion serviceVersion) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.serviceVersion = serviceVersion; - this.loadTestAdministrations = new LoadTestAdministrationsImpl(this); - this.loadTestRuns = new LoadTestRunsImpl(this); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/CloneTestRequest1.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/CloneTestRequest1.java new file mode 100644 index 000000000000..e4116afbe9b6 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/CloneTestRequest1.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CloneTestRequest1 model. + */ +@Fluent +public final class CloneTestRequest1 implements JsonSerializable { + /* + * Unique identifier for the new test that will be created. + */ + @Generated + private final String newTestId; + + /* + * Display Name override for the newly created test. + */ + @Generated + private String displayName; + + /* + * Description override for the newly created test. + */ + @Generated + private String description; + + /** + * Creates an instance of CloneTestRequest1 class. + * + * @param newTestId the newTestId value to set. + */ + @Generated + public CloneTestRequest1(String newTestId) { + this.newTestId = newTestId; + } + + /** + * Get the newTestId property: Unique identifier for the new test that will be created. + * + * @return the newTestId value. + */ + @Generated + public String getNewTestId() { + return this.newTestId; + } + + /** + * Get the displayName property: Display Name override for the newly created test. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display Name override for the newly created test. + * + * @param displayName the displayName value to set. + * @return the CloneTestRequest1 object itself. + */ + @Generated + public CloneTestRequest1 setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: Description override for the newly created test. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Description override for the newly created test. + * + * @param description the description value to set. + * @return the CloneTestRequest1 object itself. + */ + @Generated + public CloneTestRequest1 setDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("newTestId", this.newTestId); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloneTestRequest1 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloneTestRequest1 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloneTestRequest1. + */ + @Generated + public static CloneTestRequest1 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String newTestId = null; + String displayName = null; + String description = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("newTestId".equals(fieldName)) { + newTestId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + CloneTestRequest1 deserializedCloneTestRequest1 = new CloneTestRequest1(newTestId); + deserializedCloneTestRequest1.displayName = displayName; + deserializedCloneTestRequest1.description = description; + + return deserializedCloneTestRequest1; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java new file mode 100644 index 000000000000..f589f565e3d7 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for LoadTesting. + * These APIs allow end users to create, view and run load tests using Azure Load Test Service. + * + */ +package com.azure.developer.loadtesting.implementation.models; diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java index 918f9c45b17b..bb46a586166a 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/package-info.java @@ -1,8 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + /** - * Package containing the implementations for LoadTestingClient. These APIs allow end users to create, view and run load - * tests using Azure Load Test Service. + * + * Package containing the implementations for LoadTesting. + * These APIs allow end users to create, view and run load tests using Azure Load Test Service. + * */ package com.azure.developer.loadtesting.implementation; diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AggregationType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AggregationType.java new file mode 100644 index 000000000000..73c7e3a8636f --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AggregationType.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Aggregation type. + */ +public final class AggregationType extends ExpandableStringEnum { + /** + * Average value. + */ + @Generated + public static final AggregationType AVERAGE = fromString("Average"); + + /** + * Total count. + */ + @Generated + public static final AggregationType COUNT = fromString("Count"); + + /** + * Aggregation will be average in this case. + */ + @Generated + public static final AggregationType NONE = fromString("None"); + + /** + * Total sum. + */ + @Generated + public static final AggregationType TOTAL = fromString("Total"); + + /** + * 75th percentile. + */ + @Generated + public static final AggregationType PERCENTILE75 = fromString("Percentile75"); + + /** + * 90th percentile. + */ + @Generated + public static final AggregationType PERCENTILE90 = fromString("Percentile90"); + + /** + * 95th percentile. + */ + @Generated + public static final AggregationType PERCENTILE95 = fromString("Percentile95"); + + /** + * 96th percentile. + */ + @Generated + public static final AggregationType PERCENTILE96 = fromString("Percentile96"); + + /** + * 97th percentile. + */ + @Generated + public static final AggregationType PERCENTILE97 = fromString("Percentile97"); + + /** + * 98th percentile. + */ + @Generated + public static final AggregationType PERCENTILE98 = fromString("Percentile98"); + + /** + * 99th percentile. + */ + @Generated + public static final AggregationType PERCENTILE99 = fromString("Percentile99"); + + /** + * 99.9th percentile. + */ + @Generated + public static final AggregationType PERCENTILE999 = fromString("Percentile999"); + + /** + * 99.99th percentile. + */ + @Generated + public static final AggregationType PERCENTILE9999 = fromString("Percentile9999"); + + /** + * Creates a new instance of AggregationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AggregationType() { + } + + /** + * Creates or finds a AggregationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AggregationType. + */ + @Generated + public static AggregationType fromString(String name) { + return fromString(name, AggregationType.class); + } + + /** + * Gets known AggregationType values. + * + * @return known AggregationType values. + */ + @Generated + public static Collection values() { + return values(AggregationType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ArtifactsContainerInfo.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ArtifactsContainerInfo.java new file mode 100644 index 000000000000..16546c753bc3 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ArtifactsContainerInfo.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Artifacts container info. + */ +@Immutable +public final class ArtifactsContainerInfo implements JsonSerializable { + /* + * This is a SAS URI to an Azure Storage Container that contains the test run artifacts. + */ + @Generated + private String url; + + /* + * Expiry time of the container (RFC 3339 literal format) + */ + @Generated + private OffsetDateTime expiresOn; + + /** + * Creates an instance of ArtifactsContainerInfo class. + */ + @Generated + private ArtifactsContainerInfo() { + } + + /** + * Get the url property: This is a SAS URI to an Azure Storage Container that contains the test run artifacts. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the expiresOn property: Expiry time of the container (RFC 3339 literal format). + * + * @return the expiresOn value. + */ + @Generated + public OffsetDateTime getExpiresOn() { + return this.expiresOn; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("expireDateTime", + this.expiresOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiresOn)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArtifactsContainerInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArtifactsContainerInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ArtifactsContainerInfo. + */ + @Generated + public static ArtifactsContainerInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ArtifactsContainerInfo deserializedArtifactsContainerInfo = new ArtifactsContainerInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedArtifactsContainerInfo.url = reader.getString(); + } else if ("expireDateTime".equals(fieldName)) { + deserializedArtifactsContainerInfo.expiresOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedArtifactsContainerInfo; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AutoStopCriteria.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AutoStopCriteria.java new file mode 100644 index 000000000000..59dcd38d292a --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/AutoStopCriteria.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.HashSet; +import java.util.Set; + +/** + * Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a certain + * time window. + */ +@Fluent +public final class AutoStopCriteria implements JsonSerializable { + /* + * Whether auto-stop should be disabled. The default value is false. + */ + @Generated + private Boolean autoStopDisabled; + + /* + * Threshold percentage of errors on which test run should be automatically stopped. Allowed values are in range of + * 0.0-100.0 + */ + @Generated + private Double errorRate; + + /* + * Time window during which the error percentage should be evaluated in seconds. + */ + @Generated + private Long errorRateTimeWindow; + + /* + * Maximum number of virtual users per load testing engine, at which the test run should be automatically stopped. + */ + @Generated + private Integer maximumVirtualUsersPerEngine; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setAutoStopCriteriaAccessor(new JsonMergePatchHelper.AutoStopCriteriaAccessor() { + @Override + public AutoStopCriteria prepareModelForJsonMergePatch(AutoStopCriteria model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(AutoStopCriteria model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of AutoStopCriteria class. + */ + @Generated + public AutoStopCriteria() { + } + + /** + * Get the autoStopDisabled property: Whether auto-stop should be disabled. The default value is false. + * + * @return the autoStopDisabled value. + */ + @Generated + public Boolean isAutoStopDisabled() { + return this.autoStopDisabled; + } + + /** + * Set the autoStopDisabled property: Whether auto-stop should be disabled. The default value is false. + * + * @param autoStopDisabled the autoStopDisabled value to set. + * @return the AutoStopCriteria object itself. + */ + @Generated + public AutoStopCriteria setAutoStopDisabled(Boolean autoStopDisabled) { + this.autoStopDisabled = autoStopDisabled; + this.updatedProperties.add("autoStopDisabled"); + return this; + } + + /** + * Get the errorRate property: Threshold percentage of errors on which test run should be automatically stopped. + * Allowed values are in range of 0.0-100.0. + * + * @return the errorRate value. + */ + @Generated + public Double getErrorRate() { + return this.errorRate; + } + + /** + * Set the errorRate property: Threshold percentage of errors on which test run should be automatically stopped. + * Allowed values are in range of 0.0-100.0. + * + * @param errorRate the errorRate value to set. + * @return the AutoStopCriteria object itself. + */ + @Generated + public AutoStopCriteria setErrorRate(Double errorRate) { + this.errorRate = errorRate; + this.updatedProperties.add("errorRate"); + return this; + } + + /** + * Get the errorRateTimeWindow property: Time window during which the error percentage should be evaluated in + * seconds. + * + * @return the errorRateTimeWindow value. + */ + @Generated + public Duration getErrorRateTimeWindow() { + if (this.errorRateTimeWindow == null) { + return null; + } + return Duration.ofSeconds(this.errorRateTimeWindow); + } + + /** + * Set the errorRateTimeWindow property: Time window during which the error percentage should be evaluated in + * seconds. + * + * @param errorRateTimeWindow the errorRateTimeWindow value to set. + * @return the AutoStopCriteria object itself. + */ + @Generated + public AutoStopCriteria setErrorRateTimeWindow(Duration errorRateTimeWindow) { + if (errorRateTimeWindow == null) { + this.errorRateTimeWindow = null; + } else { + this.errorRateTimeWindow = errorRateTimeWindow.getSeconds(); + } + this.updatedProperties.add("errorRateTimeWindow"); + return this; + } + + /** + * Get the maximumVirtualUsersPerEngine property: Maximum number of virtual users per load testing engine, at which + * the test run should be automatically stopped. + * + * @return the maximumVirtualUsersPerEngine value. + */ + @Generated + public Integer getMaximumVirtualUsersPerEngine() { + return this.maximumVirtualUsersPerEngine; + } + + /** + * Set the maximumVirtualUsersPerEngine property: Maximum number of virtual users per load testing engine, at which + * the test run should be automatically stopped. + * + * @param maximumVirtualUsersPerEngine the maximumVirtualUsersPerEngine value to set. + * @return the AutoStopCriteria object itself. + */ + @Generated + public AutoStopCriteria setMaximumVirtualUsersPerEngine(Integer maximumVirtualUsersPerEngine) { + this.maximumVirtualUsersPerEngine = maximumVirtualUsersPerEngine; + this.updatedProperties.add("maximumVirtualUsersPerEngine"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("autoStopDisabled", this.autoStopDisabled); + jsonWriter.writeNumberField("errorRate", this.errorRate); + jsonWriter.writeNumberField("errorRateTimeWindowInSeconds", this.errorRateTimeWindow); + jsonWriter.writeNumberField("maximumVirtualUsersPerEngine", this.maximumVirtualUsersPerEngine); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("autoStopDisabled")) { + if (this.autoStopDisabled == null) { + jsonWriter.writeNullField("autoStopDisabled"); + } else { + jsonWriter.writeBooleanField("autoStopDisabled", this.autoStopDisabled); + } + } + if (updatedProperties.contains("errorRate")) { + if (this.errorRate == null) { + jsonWriter.writeNullField("errorRate"); + } else { + jsonWriter.writeNumberField("errorRate", this.errorRate); + } + } + if (updatedProperties.contains("errorRateTimeWindow")) { + if (this.errorRateTimeWindow == null) { + jsonWriter.writeNullField("errorRateTimeWindowInSeconds"); + } else { + jsonWriter.writeNumberField("errorRateTimeWindowInSeconds", this.errorRateTimeWindow); + } + } + if (updatedProperties.contains("maximumVirtualUsersPerEngine")) { + if (this.maximumVirtualUsersPerEngine == null) { + jsonWriter.writeNullField("maximumVirtualUsersPerEngine"); + } else { + jsonWriter.writeNumberField("maximumVirtualUsersPerEngine", this.maximumVirtualUsersPerEngine); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoStopCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoStopCriteria if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoStopCriteria. + */ + @Generated + public static AutoStopCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoStopCriteria deserializedAutoStopCriteria = new AutoStopCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoStopDisabled".equals(fieldName)) { + deserializedAutoStopCriteria.autoStopDisabled = reader.getNullable(JsonReader::getBoolean); + } else if ("errorRate".equals(fieldName)) { + deserializedAutoStopCriteria.errorRate = reader.getNullable(JsonReader::getDouble); + } else if ("errorRateTimeWindowInSeconds".equals(fieldName)) { + deserializedAutoStopCriteria.errorRateTimeWindow = reader.getNullable(JsonReader::getLong); + } else if ("maximumVirtualUsersPerEngine".equals(fieldName)) { + deserializedAutoStopCriteria.maximumVirtualUsersPerEngine = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoStopCriteria; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CertificateType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CertificateType.java new file mode 100644 index 000000000000..4f2391eac0d3 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CertificateType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Types of certificates supported. + */ +public final class CertificateType extends ExpandableStringEnum { + /** + * If the certificate is stored in an Azure Key Vault. + */ + @Generated + public static final CertificateType KEY_VAULT_CERTIFICATE_URI = fromString("AKV_CERT_URI"); + + /** + * Creates a new instance of CertificateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public CertificateType() { + } + + /** + * Creates or finds a CertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateType. + */ + @Generated + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** + * Gets known CertificateType values. + * + * @return known CertificateType values. + */ + @Generated + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CreatedByType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CreatedByType.java new file mode 100644 index 000000000000..424f63d6319d --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/CreatedByType.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the entity that created the test run. (E.x. User, ScheduleTrigger, etc). + */ +public final class CreatedByType extends ExpandableStringEnum { + /** + * Entity was created by a user. + */ + @Generated + public static final CreatedByType USER = fromString("User"); + + /** + * Entity was created by a scheduled trigger. + */ + @Generated + public static final CreatedByType SCHEDULED_TRIGGER = fromString("ScheduledTrigger"); + + /** + * Entity was created by Azure DevOps pipelines. + */ + @Generated + public static final CreatedByType AZURE_PIPELINES = fromString("AzurePipelines"); + + /** + * Entity was created by GitHub Workflows. + */ + @Generated + public static final CreatedByType GIT_HUB_WORKFLOWS = fromString("GitHubWorkflows"); + + /** + * Creates a new instance of CreatedByType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public CreatedByType() { + } + + /** + * Creates or finds a CreatedByType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreatedByType. + */ + @Generated + public static CreatedByType fromString(String name) { + return fromString(name, CreatedByType.class); + } + + /** + * Gets known CreatedByType values. + * + * @return known CreatedByType values. + */ + @Generated + public static Collection values() { + return values(CreatedByType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DailyRecurrence.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DailyRecurrence.java new file mode 100644 index 000000000000..8fbdcef93588 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DailyRecurrence.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Recurrence model when frequency is set as Daily. + */ +@Fluent +public final class DailyRecurrence extends Recurrence { + /* + * Frequency of the recurrence. + */ + @Generated + private Frequency frequency = Frequency.DAILY; + + /* + * The interval at which the recurrence should repeat. It signifies the number of days between each recurrence. + */ + @Generated + private int interval; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of DailyRecurrence class. + */ + @Generated + public DailyRecurrence() { + } + + /** + * Get the frequency property: Frequency of the recurrence. + * + * @return the frequency value. + */ + @Generated + @Override + public Frequency getFrequency() { + return this.frequency; + } + + /** + * Get the interval property: The interval at which the recurrence should repeat. It signifies the number of days + * between each recurrence. + * + * @return the interval value. + */ + @Generated + public int getInterval() { + return this.interval; + } + + /** + * Set the interval property: The interval at which the recurrence should repeat. It signifies the number of days + * between each recurrence. + *

Required when create the resource.

+ * + * @param interval the interval value to set. + * @return the DailyRecurrence object itself. + */ + @Generated + public DailyRecurrence setInterval(int interval) { + this.interval = interval; + this.updatedProperties.add("interval"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public DailyRecurrence setRecurrenceEnd(RecurrenceEnd recurrenceEnd) { + super.setRecurrenceEnd(recurrenceEnd); + this.updatedProperties.add("recurrenceEnd"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getRecurrenceAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeIntField("interval", this.interval); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("recurrenceEnd")) { + if (getRecurrenceEnd() == null) { + jsonWriter.writeNullField("recurrenceEnd"); + } else { + JsonMergePatchHelper.getRecurrenceEndAccessor().prepareModelForJsonMergePatch(getRecurrenceEnd(), true); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + JsonMergePatchHelper.getRecurrenceEndAccessor() + .prepareModelForJsonMergePatch(getRecurrenceEnd(), false); + } + } + jsonWriter.writeStringField("frequency", this.frequency.toString()); + if (updatedProperties.contains("interval")) { + jsonWriter.writeIntField("interval", this.interval); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DailyRecurrence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DailyRecurrence if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DailyRecurrence. + */ + @Generated + public static DailyRecurrence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DailyRecurrence deserializedDailyRecurrence = new DailyRecurrence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recurrenceEnd".equals(fieldName)) { + JsonMergePatchHelper.getRecurrenceAccessor() + .setRecurrenceEnd(deserializedDailyRecurrence, RecurrenceEnd.fromJson(reader)); + } else if ("frequency".equals(fieldName)) { + deserializedDailyRecurrence.frequency = Frequency.fromString(reader.getString()); + } else if ("interval".equals(fieldName)) { + deserializedDailyRecurrence.interval = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedDailyRecurrence; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionFilter.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionFilter.java new file mode 100644 index 000000000000..8743a3a6383e --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionFilter.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Dimension name and values to filter. + */ +@Fluent +public final class DimensionFilter implements JsonSerializable { + /* + * The dimension name + */ + @Generated + private String name; + + /* + * The dimension values. Maximum values can be 20. + */ + @Generated + private List values; + + /** + * Creates an instance of DimensionFilter class. + */ + @Generated + public DimensionFilter() { + } + + /** + * Get the name property: The dimension name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The dimension name. + * + * @param name the name value to set. + * @return the DimensionFilter object itself. + */ + @Generated + public DimensionFilter setName(String name) { + this.name = name; + return this; + } + + /** + * Get the values property: The dimension values. Maximum values can be 20. + * + * @return the values value. + */ + @Generated + public List getValues() { + return this.values; + } + + /** + * Set the values property: The dimension values. Maximum values can be 20. + * + * @param values the values value to set. + * @return the DimensionFilter object itself. + */ + @Generated + public DimensionFilter setValues(List values) { + this.values = values; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DimensionFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DimensionFilter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DimensionFilter. + */ + @Generated + public static DimensionFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DimensionFilter deserializedDimensionFilter = new DimensionFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimensionFilter.name = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedDimensionFilter.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedDimensionFilter; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionValue.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionValue.java new file mode 100644 index 000000000000..9e4c2f005480 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/DimensionValue.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a metric dimension value. + */ +@Immutable +public final class DimensionValue implements JsonSerializable { + /* + * The name of the dimension. + */ + @Generated + private String name; + + /* + * The value of the dimension. + */ + @Generated + private String value; + + /** + * Creates an instance of DimensionValue class. + */ + @Generated + private DimensionValue() { + } + + /** + * Get the name property: The name of the dimension. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the value property: The value of the dimension. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DimensionValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DimensionValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DimensionValue. + */ + @Generated + public static DimensionValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DimensionValue deserializedDimensionValue = new DimensionValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimensionValue.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedDimensionValue.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimensionValue; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ErrorDetails.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ErrorDetails.java new file mode 100644 index 000000000000..dcd2d2cda2d6 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ErrorDetails.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Error details if there is any failure in load test run. + */ +@Immutable +public final class ErrorDetails implements JsonSerializable { + /* + * Error details in case test run was not successfully run. + */ + @Generated + private String message; + + /** + * Creates an instance of ErrorDetails class. + */ + @Generated + private ErrorDetails() { + } + + /** + * Get the message property: Error details in case test run was not successfully run. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorDetails. + */ + @Generated + public static ErrorDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorDetails deserializedErrorDetails = new ErrorDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedErrorDetails.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDetails; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FileValidationStatus.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FileValidationStatus.java new file mode 100644 index 000000000000..09c5870d06a9 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FileValidationStatus.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * File status. + */ +public final class FileValidationStatus extends ExpandableStringEnum { + /** + * File is not validated. + */ + @Generated + public static final FileValidationStatus NOT_VALIDATED = fromString("NOT_VALIDATED"); + + /** + * File is validated. + */ + @Generated + public static final FileValidationStatus VALIDATION_SUCCESS = fromString("VALIDATION_SUCCESS"); + + /** + * File validation is failed. + */ + @Generated + public static final FileValidationStatus VALIDATION_FAILURE = fromString("VALIDATION_FAILURE"); + + /** + * File validation is in progress. + */ + @Generated + public static final FileValidationStatus VALIDATION_INITIATED = fromString("VALIDATION_INITIATED"); + + /** + * Validation is not required. + */ + @Generated + public static final FileValidationStatus VALIDATION_NOT_REQUIRED = fromString("VALIDATION_NOT_REQUIRED"); + + /** + * Creates a new instance of FileValidationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FileValidationStatus() { + } + + /** + * Creates or finds a FileValidationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileValidationStatus. + */ + @Generated + public static FileValidationStatus fromString(String name) { + return fromString(name, FileValidationStatus.class); + } + + /** + * Gets known FileValidationStatus values. + * + * @return known FileValidationStatus values. + */ + @Generated + public static Collection values() { + return values(FileValidationStatus.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Frequency.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Frequency.java new file mode 100644 index 000000000000..b1b7bc63555a --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Frequency.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Frequency of recurrence for a trigger. + */ +public final class Frequency extends ExpandableStringEnum { + /** + * Recurrence defined by a cron expression. + */ + @Generated + public static final Frequency CRON = fromString("Cron"); + + /** + * Recurrence defined on an hourly basis, as specified by HourlyRecurrence. + */ + @Generated + public static final Frequency HOURLY = fromString("Hourly"); + + /** + * Recurrence defined on a daily basis, as specified by DailyRecurrence. + */ + @Generated + public static final Frequency DAILY = fromString("Daily"); + + /** + * Recurrence defined on a weekly basis, as specified by WeeklyRecurrence. + */ + @Generated + public static final Frequency WEEKLY = fromString("Weekly"); + + /** + * Recurrence defined monthly on specific days, as specified by MonthlyRecurrenceByWeekDays. + */ + @Generated + public static final Frequency MONTHLY_BY_DAYS = fromString("MonthlyByDays"); + + /** + * Recurrence defined monthly on specific dates, as specified by MonthlyRecurrenceByDates. + */ + @Generated + public static final Frequency MONTHLY_BY_DATES = fromString("MonthlyByDates"); + + /** + * Creates a new instance of Frequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public Frequency() { + } + + /** + * Creates or finds a Frequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding Frequency. + */ + @Generated + public static Frequency fromString(String name) { + return fromString(name, Frequency.class); + } + + /** + * Gets known Frequency values. + * + * @return known Frequency values. + */ + @Generated + public static Collection values() { + return values(Frequency.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionResourceConfiguration.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionResourceConfiguration.java new file mode 100644 index 000000000000..eeb22ae7879e --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionResourceConfiguration.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Resource configuration instance for a Flex Consumption based Azure Function App. + */ +@Fluent +public final class FunctionFlexConsumptionResourceConfiguration + implements JsonSerializable { + /* + * Memory size of the instance. Supported values are 2048, 4096. + */ + @Generated + private long instanceMemoryMB; + + /* + * HTTP Concurrency for the function app. + */ + @Generated + private Long httpConcurrency; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setFunctionFlexConsumptionResourceConfigurationAccessor( + new JsonMergePatchHelper.FunctionFlexConsumptionResourceConfigurationAccessor() { + @Override + public FunctionFlexConsumptionResourceConfiguration prepareModelForJsonMergePatch( + FunctionFlexConsumptionResourceConfiguration model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(FunctionFlexConsumptionResourceConfiguration model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of FunctionFlexConsumptionResourceConfiguration class. + */ + @Generated + public FunctionFlexConsumptionResourceConfiguration() { + } + + /** + * Get the instanceMemoryMB property: Memory size of the instance. Supported values are 2048, 4096. + * + * @return the instanceMemoryMB value. + */ + @Generated + public long getInstanceMemoryMB() { + return this.instanceMemoryMB; + } + + /** + * Set the instanceMemoryMB property: Memory size of the instance. Supported values are 2048, 4096. + *

Required when create the resource.

+ * + * @param instanceMemoryMB the instanceMemoryMB value to set. + * @return the FunctionFlexConsumptionResourceConfiguration object itself. + */ + @Generated + public FunctionFlexConsumptionResourceConfiguration setInstanceMemoryMB(long instanceMemoryMB) { + this.instanceMemoryMB = instanceMemoryMB; + this.updatedProperties.add("instanceMemoryMB"); + return this; + } + + /** + * Get the httpConcurrency property: HTTP Concurrency for the function app. + * + * @return the httpConcurrency value. + */ + @Generated + public Long getHttpConcurrency() { + return this.httpConcurrency; + } + + /** + * Set the httpConcurrency property: HTTP Concurrency for the function app. + * + * @param httpConcurrency the httpConcurrency value to set. + * @return the FunctionFlexConsumptionResourceConfiguration object itself. + */ + @Generated + public FunctionFlexConsumptionResourceConfiguration setHttpConcurrency(Long httpConcurrency) { + this.httpConcurrency = httpConcurrency; + this.updatedProperties.add("httpConcurrency"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("instanceMemoryMB", this.instanceMemoryMB); + jsonWriter.writeNumberField("httpConcurrency", this.httpConcurrency); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("instanceMemoryMB")) { + jsonWriter.writeLongField("instanceMemoryMB", this.instanceMemoryMB); + } + if (updatedProperties.contains("httpConcurrency")) { + if (this.httpConcurrency == null) { + jsonWriter.writeNullField("httpConcurrency"); + } else { + jsonWriter.writeNumberField("httpConcurrency", this.httpConcurrency); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FunctionFlexConsumptionResourceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionFlexConsumptionResourceConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FunctionFlexConsumptionResourceConfiguration. + */ + @Generated + public static FunctionFlexConsumptionResourceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FunctionFlexConsumptionResourceConfiguration deserializedFunctionFlexConsumptionResourceConfiguration + = new FunctionFlexConsumptionResourceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceMemoryMB".equals(fieldName)) { + deserializedFunctionFlexConsumptionResourceConfiguration.instanceMemoryMB = reader.getLong(); + } else if ("httpConcurrency".equals(fieldName)) { + deserializedFunctionFlexConsumptionResourceConfiguration.httpConcurrency + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedFunctionFlexConsumptionResourceConfiguration; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionTargetResourceConfigurations.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionTargetResourceConfigurations.java new file mode 100644 index 000000000000..00e3c330bf69 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/FunctionFlexConsumptionTargetResourceConfigurations.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Configurations for a Function App using Flex Consumption Plan. + */ +@Fluent +public final class FunctionFlexConsumptionTargetResourceConfigurations extends TargetResourceConfigurations { + /* + * Kind of the resource for which the configurations apply. + */ + @Generated + private ResourceKind kind = ResourceKind.FUNCTIONS_FLEX_CONSUMPTION; + + /* + * A map of configurations for a Function app using Flex Consumption Plan. + */ + @Generated + private Map configurations; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of FunctionFlexConsumptionTargetResourceConfigurations class. + */ + @Generated + public FunctionFlexConsumptionTargetResourceConfigurations() { + } + + /** + * Get the kind property: Kind of the resource for which the configurations apply. + * + * @return the kind value. + */ + @Generated + @Override + public ResourceKind getKind() { + return this.kind; + } + + /** + * Get the configurations property: A map of configurations for a Function app using Flex Consumption Plan. + * + * @return the configurations value. + */ + @Generated + public Map getConfigurations() { + return this.configurations; + } + + /** + * Set the configurations property: A map of configurations for a Function app using Flex Consumption Plan. + * + * @param configurations the configurations value to set. + * @return the FunctionFlexConsumptionTargetResourceConfigurations object itself. + */ + @Generated + public FunctionFlexConsumptionTargetResourceConfigurations + setConfigurations(Map configurations) { + this.configurations = configurations; + this.updatedProperties.add("configurations"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getTargetResourceConfigurationsAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeMapField("configurations", this.configurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + if (updatedProperties.contains("configurations")) { + if (this.configurations == null) { + jsonWriter.writeNullField("configurations"); + } else { + jsonWriter.writeMapField("configurations", this.configurations, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getFunctionFlexConsumptionResourceConfigurationAccessor() + .prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getFunctionFlexConsumptionResourceConfigurationAccessor() + .prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FunctionFlexConsumptionTargetResourceConfigurations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionFlexConsumptionTargetResourceConfigurations if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FunctionFlexConsumptionTargetResourceConfigurations. + */ + @Generated + public static FunctionFlexConsumptionTargetResourceConfigurations fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + FunctionFlexConsumptionTargetResourceConfigurations deserializedFunctionFlexConsumptionTargetResourceConfigurations + = new FunctionFlexConsumptionTargetResourceConfigurations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedFunctionFlexConsumptionTargetResourceConfigurations.kind + = ResourceKind.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + Map configurations + = reader.readMap(reader1 -> FunctionFlexConsumptionResourceConfiguration.fromJson(reader1)); + deserializedFunctionFlexConsumptionTargetResourceConfigurations.configurations = configurations; + } else { + reader.skipChildren(); + } + } + + return deserializedFunctionFlexConsumptionTargetResourceConfigurations; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/HourlyRecurrence.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/HourlyRecurrence.java new file mode 100644 index 000000000000..daa8eeda40b8 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/HourlyRecurrence.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Recurrence model when frequency is set as Hourly. + */ +@Fluent +public final class HourlyRecurrence extends Recurrence { + /* + * Frequency of the recurrence. + */ + @Generated + private Frequency frequency = Frequency.HOURLY; + + /* + * The interval at which the recurrence should repeat. It signifies the number of hours between each recurrence. + */ + @Generated + private int interval; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of HourlyRecurrence class. + */ + @Generated + public HourlyRecurrence() { + } + + /** + * Get the frequency property: Frequency of the recurrence. + * + * @return the frequency value. + */ + @Generated + @Override + public Frequency getFrequency() { + return this.frequency; + } + + /** + * Get the interval property: The interval at which the recurrence should repeat. It signifies the number of hours + * between each recurrence. + * + * @return the interval value. + */ + @Generated + public int getInterval() { + return this.interval; + } + + /** + * Set the interval property: The interval at which the recurrence should repeat. It signifies the number of hours + * between each recurrence. + *

Required when create the resource.

+ * + * @param interval the interval value to set. + * @return the HourlyRecurrence object itself. + */ + @Generated + public HourlyRecurrence setInterval(int interval) { + this.interval = interval; + this.updatedProperties.add("interval"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public HourlyRecurrence setRecurrenceEnd(RecurrenceEnd recurrenceEnd) { + super.setRecurrenceEnd(recurrenceEnd); + this.updatedProperties.add("recurrenceEnd"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getRecurrenceAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeIntField("interval", this.interval); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("recurrenceEnd")) { + if (getRecurrenceEnd() == null) { + jsonWriter.writeNullField("recurrenceEnd"); + } else { + JsonMergePatchHelper.getRecurrenceEndAccessor().prepareModelForJsonMergePatch(getRecurrenceEnd(), true); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + JsonMergePatchHelper.getRecurrenceEndAccessor() + .prepareModelForJsonMergePatch(getRecurrenceEnd(), false); + } + } + jsonWriter.writeStringField("frequency", this.frequency.toString()); + if (updatedProperties.contains("interval")) { + jsonWriter.writeIntField("interval", this.interval); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HourlyRecurrence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HourlyRecurrence if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HourlyRecurrence. + */ + @Generated + public static HourlyRecurrence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HourlyRecurrence deserializedHourlyRecurrence = new HourlyRecurrence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recurrenceEnd".equals(fieldName)) { + JsonMergePatchHelper.getRecurrenceAccessor() + .setRecurrenceEnd(deserializedHourlyRecurrence, RecurrenceEnd.fromJson(reader)); + } else if ("frequency".equals(fieldName)) { + deserializedHourlyRecurrence.frequency = Frequency.fromString(reader.getString()); + } else if ("interval".equals(fieldName)) { + deserializedHourlyRecurrence.interval = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedHourlyRecurrence; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTest.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTest.java new file mode 100644 index 000000000000..fad2fa7466e0 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTest.java @@ -0,0 +1,984 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Load test model. + */ +@Fluent +public final class LoadTest implements JsonSerializable { + /* + * Pass fail criteria for a test. + */ + @Generated + private PassFailCriteria passFailCriteria; + + /* + * Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a + * certain time window. + */ + @Generated + private AutoStopCriteria autoStopCriteria; + + /* + * Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + */ + @Generated + private Map secrets; + + /* + * Certificates metadata. + */ + @Generated + private TestCertificate certificate; + + /* + * Environment variables which are defined as a set of pairs. + */ + @Generated + private Map environmentVariables; + + /* + * The load test configuration. + */ + @Generated + private LoadTestConfiguration loadTestConfiguration; + + /* + * Id of the test run to be marked as baseline to view trends of client-side metrics from recent test runs + */ + @Generated + private String baselineTestRunId; + + /* + * The input artifacts for the test. + */ + @Generated + private TestInputArtifacts inputArtifacts; + + /* + * Unique test identifier for the load test, must contain only lower-case alphabetic, numeric, underscore or hyphen + * characters. + */ + @Generated + private String testId; + + /* + * The test description. + */ + @Generated + private String description; + + /* + * Display name of a test. + */ + @Generated + private String displayName; + + /* + * Subnet ID on which the load test instances should run. + */ + @Generated + private String subnetId; + + /* + * Kind of test. + */ + @Generated + private LoadTestKind kind; + + /* + * Inject load test engines without deploying public IP for outbound access + */ + @Generated + private Boolean publicIpDisabled; + + /* + * Type of the managed identity referencing the Key vault. + */ + @Generated + private String keyvaultReferenceIdentityType; + + /* + * Resource Id of the managed identity referencing the Key vault. + */ + @Generated + private String keyvaultReferenceIdentityId; + + /* + * Type of the managed identity referencing the metrics. + */ + @Generated + private LoadTestingManagedIdentityType metricsReferenceIdentityType; + + /* + * Resource Id of the managed identity referencing the metrics. + */ + @Generated + private String metricsReferenceIdentityId; + + /* + * Type of the managed identity built in load test engines + */ + @Generated + private LoadTestingManagedIdentityType engineBuiltInIdentityType; + + /* + * Resource Ids of the managed identity built in to load test engines. Required if engineBuiltInIdentityType is + * UserAssigned. + */ + @Generated + private List engineBuiltInIdentityIds; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setLoadTestAccessor(new JsonMergePatchHelper.LoadTestAccessor() { + @Override + public LoadTest prepareModelForJsonMergePatch(LoadTest model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(LoadTest model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of LoadTest class. + */ + @Generated + public LoadTest() { + } + + /** + * Get the passFailCriteria property: Pass fail criteria for a test. + * + * @return the passFailCriteria value. + */ + @Generated + public PassFailCriteria getPassFailCriteria() { + return this.passFailCriteria; + } + + /** + * Set the passFailCriteria property: Pass fail criteria for a test. + * + * @param passFailCriteria the passFailCriteria value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setPassFailCriteria(PassFailCriteria passFailCriteria) { + this.passFailCriteria = passFailCriteria; + this.updatedProperties.add("passFailCriteria"); + return this; + } + + /** + * Get the autoStopCriteria property: Auto stop criteria for a test. This will automatically stop a load test if the + * error percentage is high for a certain time window. + * + * @return the autoStopCriteria value. + */ + @Generated + public AutoStopCriteria getAutoStopCriteria() { + return this.autoStopCriteria; + } + + /** + * Set the autoStopCriteria property: Auto stop criteria for a test. This will automatically stop a load test if the + * error percentage is high for a certain time window. + * + * @param autoStopCriteria the autoStopCriteria value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setAutoStopCriteria(AutoStopCriteria autoStopCriteria) { + this.autoStopCriteria = autoStopCriteria; + this.updatedProperties.add("autoStopCriteria"); + return this; + } + + /** + * Get the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + * + * @return the secrets value. + */ + @Generated + public Map getSecrets() { + return this.secrets; + } + + /** + * Set the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + * + * @param secrets the secrets value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setSecrets(Map secrets) { + this.secrets = secrets; + this.updatedProperties.add("secrets"); + return this; + } + + /** + * Get the certificate property: Certificates metadata. + * + * @return the certificate value. + */ + @Generated + public TestCertificate getCertificate() { + return this.certificate; + } + + /** + * Set the certificate property: Certificates metadata. + * + * @param certificate the certificate value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setCertificate(TestCertificate certificate) { + this.certificate = certificate; + this.updatedProperties.add("certificate"); + return this; + } + + /** + * Get the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @return the environmentVariables value. + */ + @Generated + public Map getEnvironmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @param environmentVariables the environmentVariables value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + this.updatedProperties.add("environmentVariables"); + return this; + } + + /** + * Get the loadTestConfiguration property: The load test configuration. + * + * @return the loadTestConfiguration value. + */ + @Generated + public LoadTestConfiguration getLoadTestConfiguration() { + return this.loadTestConfiguration; + } + + /** + * Set the loadTestConfiguration property: The load test configuration. + * + * @param loadTestConfiguration the loadTestConfiguration value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setLoadTestConfiguration(LoadTestConfiguration loadTestConfiguration) { + this.loadTestConfiguration = loadTestConfiguration; + this.updatedProperties.add("loadTestConfiguration"); + return this; + } + + /** + * Get the baselineTestRunId property: Id of the test run to be marked as baseline to view trends of client-side + * metrics from recent test runs. + * + * @return the baselineTestRunId value. + */ + @Generated + public String getBaselineTestRunId() { + return this.baselineTestRunId; + } + + /** + * Set the baselineTestRunId property: Id of the test run to be marked as baseline to view trends of client-side + * metrics from recent test runs. + * + * @param baselineTestRunId the baselineTestRunId value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setBaselineTestRunId(String baselineTestRunId) { + this.baselineTestRunId = baselineTestRunId; + this.updatedProperties.add("baselineTestRunId"); + return this; + } + + /** + * Get the inputArtifacts property: The input artifacts for the test. + * + * @return the inputArtifacts value. + */ + @Generated + public TestInputArtifacts getInputArtifacts() { + return this.inputArtifacts; + } + + /** + * Get the testId property: Unique test identifier for the load test, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * + * @return the testId value. + */ + @Generated + public String getTestId() { + return this.testId; + } + + /** + * Get the description property: The test description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The test description. + * + * @param description the description value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setDescription(String description) { + this.description = description; + this.updatedProperties.add("description"); + return this; + } + + /** + * Get the displayName property: Display name of a test. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of a test. + * + * @param displayName the displayName value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setDisplayName(String displayName) { + this.displayName = displayName; + this.updatedProperties.add("displayName"); + return this; + } + + /** + * Get the subnetId property: Subnet ID on which the load test instances should run. + * + * @return the subnetId value. + */ + @Generated + public String getSubnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Subnet ID on which the load test instances should run. + * + * @param subnetId the subnetId value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setSubnetId(String subnetId) { + this.subnetId = subnetId; + this.updatedProperties.add("subnetId"); + return this; + } + + /** + * Get the kind property: Kind of test. + * + * @return the kind value. + */ + @Generated + public LoadTestKind getKind() { + return this.kind; + } + + /** + * Set the kind property: Kind of test. + * + * @param kind the kind value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setKind(LoadTestKind kind) { + this.kind = kind; + this.updatedProperties.add("kind"); + return this; + } + + /** + * Get the publicIpDisabled property: Inject load test engines without deploying public IP for outbound access. + * + * @return the publicIpDisabled value. + */ + @Generated + public Boolean isPublicIpDisabled() { + return this.publicIpDisabled; + } + + /** + * Set the publicIpDisabled property: Inject load test engines without deploying public IP for outbound access. + * + * @param publicIpDisabled the publicIpDisabled value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setPublicIpDisabled(Boolean publicIpDisabled) { + this.publicIpDisabled = publicIpDisabled; + this.updatedProperties.add("publicIpDisabled"); + return this; + } + + /** + * Get the keyvaultReferenceIdentityType property: Type of the managed identity referencing the Key vault. + * + * @return the keyvaultReferenceIdentityType value. + */ + @Generated + public String getKeyvaultReferenceIdentityType() { + return this.keyvaultReferenceIdentityType; + } + + /** + * Set the keyvaultReferenceIdentityType property: Type of the managed identity referencing the Key vault. + * + * @param keyvaultReferenceIdentityType the keyvaultReferenceIdentityType value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setKeyvaultReferenceIdentityType(String keyvaultReferenceIdentityType) { + this.keyvaultReferenceIdentityType = keyvaultReferenceIdentityType; + this.updatedProperties.add("keyvaultReferenceIdentityType"); + return this; + } + + /** + * Get the keyvaultReferenceIdentityId property: Resource Id of the managed identity referencing the Key vault. + * + * @return the keyvaultReferenceIdentityId value. + */ + @Generated + public String getKeyvaultReferenceIdentityId() { + return this.keyvaultReferenceIdentityId; + } + + /** + * Set the keyvaultReferenceIdentityId property: Resource Id of the managed identity referencing the Key vault. + * + * @param keyvaultReferenceIdentityId the keyvaultReferenceIdentityId value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setKeyvaultReferenceIdentityId(String keyvaultReferenceIdentityId) { + this.keyvaultReferenceIdentityId = keyvaultReferenceIdentityId; + this.updatedProperties.add("keyvaultReferenceIdentityId"); + return this; + } + + /** + * Get the metricsReferenceIdentityType property: Type of the managed identity referencing the metrics. + * + * @return the metricsReferenceIdentityType value. + */ + @Generated + public LoadTestingManagedIdentityType getMetricsReferenceIdentityType() { + return this.metricsReferenceIdentityType; + } + + /** + * Set the metricsReferenceIdentityType property: Type of the managed identity referencing the metrics. + * + * @param metricsReferenceIdentityType the metricsReferenceIdentityType value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setMetricsReferenceIdentityType(LoadTestingManagedIdentityType metricsReferenceIdentityType) { + this.metricsReferenceIdentityType = metricsReferenceIdentityType; + this.updatedProperties.add("metricsReferenceIdentityType"); + return this; + } + + /** + * Get the metricsReferenceIdentityId property: Resource Id of the managed identity referencing the metrics. + * + * @return the metricsReferenceIdentityId value. + */ + @Generated + public String getMetricsReferenceIdentityId() { + return this.metricsReferenceIdentityId; + } + + /** + * Set the metricsReferenceIdentityId property: Resource Id of the managed identity referencing the metrics. + * + * @param metricsReferenceIdentityId the metricsReferenceIdentityId value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setMetricsReferenceIdentityId(String metricsReferenceIdentityId) { + this.metricsReferenceIdentityId = metricsReferenceIdentityId; + this.updatedProperties.add("metricsReferenceIdentityId"); + return this; + } + + /** + * Get the engineBuiltInIdentityType property: Type of the managed identity built in load test engines. + * + * @return the engineBuiltInIdentityType value. + */ + @Generated + public LoadTestingManagedIdentityType getEngineBuiltInIdentityType() { + return this.engineBuiltInIdentityType; + } + + /** + * Set the engineBuiltInIdentityType property: Type of the managed identity built in load test engines. + * + * @param engineBuiltInIdentityType the engineBuiltInIdentityType value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setEngineBuiltInIdentityType(LoadTestingManagedIdentityType engineBuiltInIdentityType) { + this.engineBuiltInIdentityType = engineBuiltInIdentityType; + this.updatedProperties.add("engineBuiltInIdentityType"); + return this; + } + + /** + * Get the engineBuiltInIdentityIds property: Resource Ids of the managed identity built in to load test engines. + * Required if engineBuiltInIdentityType is UserAssigned. + * + * @return the engineBuiltInIdentityIds value. + */ + @Generated + public List getEngineBuiltInIdentityIds() { + return this.engineBuiltInIdentityIds; + } + + /** + * Set the engineBuiltInIdentityIds property: Resource Ids of the managed identity built in to load test engines. + * Required if engineBuiltInIdentityType is UserAssigned. + * + * @param engineBuiltInIdentityIds the engineBuiltInIdentityIds value to set. + * @return the LoadTest object itself. + */ + @Generated + public LoadTest setEngineBuiltInIdentityIds(List engineBuiltInIdentityIds) { + this.engineBuiltInIdentityIds = engineBuiltInIdentityIds; + this.updatedProperties.add("engineBuiltInIdentityIds"); + return this; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("passFailCriteria", this.passFailCriteria); + jsonWriter.writeJsonField("autoStopCriteria", this.autoStopCriteria); + jsonWriter.writeMapField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("certificate", this.certificate); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("loadTestConfiguration", this.loadTestConfiguration); + jsonWriter.writeStringField("baselineTestRunId", this.baselineTestRunId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeBooleanField("publicIPDisabled", this.publicIpDisabled); + jsonWriter.writeStringField("keyvaultReferenceIdentityType", this.keyvaultReferenceIdentityType); + jsonWriter.writeStringField("keyvaultReferenceIdentityId", this.keyvaultReferenceIdentityId); + jsonWriter.writeStringField("metricsReferenceIdentityType", + this.metricsReferenceIdentityType == null ? null : this.metricsReferenceIdentityType.toString()); + jsonWriter.writeStringField("metricsReferenceIdentityId", this.metricsReferenceIdentityId); + jsonWriter.writeStringField("engineBuiltInIdentityType", + this.engineBuiltInIdentityType == null ? null : this.engineBuiltInIdentityType.toString()); + jsonWriter.writeArrayField("engineBuiltInIdentityIds", this.engineBuiltInIdentityIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("passFailCriteria")) { + if (this.passFailCriteria == null) { + jsonWriter.writeNullField("passFailCriteria"); + } else { + JsonMergePatchHelper.getPassFailCriteriaAccessor() + .prepareModelForJsonMergePatch(this.passFailCriteria, true); + jsonWriter.writeJsonField("passFailCriteria", this.passFailCriteria); + JsonMergePatchHelper.getPassFailCriteriaAccessor() + .prepareModelForJsonMergePatch(this.passFailCriteria, false); + } + } + if (updatedProperties.contains("autoStopCriteria")) { + if (this.autoStopCriteria == null) { + jsonWriter.writeNullField("autoStopCriteria"); + } else { + JsonMergePatchHelper.getAutoStopCriteriaAccessor() + .prepareModelForJsonMergePatch(this.autoStopCriteria, true); + jsonWriter.writeJsonField("autoStopCriteria", this.autoStopCriteria); + JsonMergePatchHelper.getAutoStopCriteriaAccessor() + .prepareModelForJsonMergePatch(this.autoStopCriteria, false); + } + } + if (updatedProperties.contains("secrets")) { + if (this.secrets == null) { + jsonWriter.writeNullField("secrets"); + } else { + jsonWriter.writeMapField("secrets", this.secrets, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getTestSecretAccessor().prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getTestSecretAccessor().prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + if (updatedProperties.contains("certificate")) { + if (this.certificate == null) { + jsonWriter.writeNullField("certificate"); + } else { + JsonMergePatchHelper.getTestCertificateAccessor().prepareModelForJsonMergePatch(this.certificate, true); + jsonWriter.writeJsonField("certificate", this.certificate); + JsonMergePatchHelper.getTestCertificateAccessor() + .prepareModelForJsonMergePatch(this.certificate, false); + } + } + if (updatedProperties.contains("environmentVariables")) { + if (this.environmentVariables == null) { + jsonWriter.writeNullField("environmentVariables"); + } else { + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, (writer, element) -> { + if (element != null) { + writer.writeString(element); + } else { + writer.writeNull(); + } + }); + } + } + if (updatedProperties.contains("loadTestConfiguration")) { + if (this.loadTestConfiguration == null) { + jsonWriter.writeNullField("loadTestConfiguration"); + } else { + JsonMergePatchHelper.getLoadTestConfigurationAccessor() + .prepareModelForJsonMergePatch(this.loadTestConfiguration, true); + jsonWriter.writeJsonField("loadTestConfiguration", this.loadTestConfiguration); + JsonMergePatchHelper.getLoadTestConfigurationAccessor() + .prepareModelForJsonMergePatch(this.loadTestConfiguration, false); + } + } + if (updatedProperties.contains("baselineTestRunId")) { + if (this.baselineTestRunId == null) { + jsonWriter.writeNullField("baselineTestRunId"); + } else { + jsonWriter.writeStringField("baselineTestRunId", this.baselineTestRunId); + } + } + if (updatedProperties.contains("description")) { + if (this.description == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", this.description); + } + } + if (updatedProperties.contains("displayName")) { + if (this.displayName == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", this.displayName); + } + } + if (updatedProperties.contains("subnetId")) { + if (this.subnetId == null) { + jsonWriter.writeNullField("subnetId"); + } else { + jsonWriter.writeStringField("subnetId", this.subnetId); + } + } + if (updatedProperties.contains("kind")) { + if (this.kind == null) { + jsonWriter.writeNullField("kind"); + } else { + jsonWriter.writeStringField("kind", this.kind.toString()); + } + } + if (updatedProperties.contains("publicIpDisabled")) { + if (this.publicIpDisabled == null) { + jsonWriter.writeNullField("publicIPDisabled"); + } else { + jsonWriter.writeBooleanField("publicIPDisabled", this.publicIpDisabled); + } + } + if (updatedProperties.contains("keyvaultReferenceIdentityType")) { + if (this.keyvaultReferenceIdentityType == null) { + jsonWriter.writeNullField("keyvaultReferenceIdentityType"); + } else { + jsonWriter.writeStringField("keyvaultReferenceIdentityType", this.keyvaultReferenceIdentityType); + } + } + if (updatedProperties.contains("keyvaultReferenceIdentityId")) { + if (this.keyvaultReferenceIdentityId == null) { + jsonWriter.writeNullField("keyvaultReferenceIdentityId"); + } else { + jsonWriter.writeStringField("keyvaultReferenceIdentityId", this.keyvaultReferenceIdentityId); + } + } + if (updatedProperties.contains("metricsReferenceIdentityType")) { + if (this.metricsReferenceIdentityType == null) { + jsonWriter.writeNullField("metricsReferenceIdentityType"); + } else { + jsonWriter.writeStringField("metricsReferenceIdentityType", + this.metricsReferenceIdentityType.toString()); + } + } + if (updatedProperties.contains("metricsReferenceIdentityId")) { + if (this.metricsReferenceIdentityId == null) { + jsonWriter.writeNullField("metricsReferenceIdentityId"); + } else { + jsonWriter.writeStringField("metricsReferenceIdentityId", this.metricsReferenceIdentityId); + } + } + if (updatedProperties.contains("engineBuiltInIdentityType")) { + if (this.engineBuiltInIdentityType == null) { + jsonWriter.writeNullField("engineBuiltInIdentityType"); + } else { + jsonWriter.writeStringField("engineBuiltInIdentityType", this.engineBuiltInIdentityType.toString()); + } + } + if (updatedProperties.contains("engineBuiltInIdentityIds")) { + if (this.engineBuiltInIdentityIds == null) { + jsonWriter.writeNullField("engineBuiltInIdentityIds"); + } else { + jsonWriter.writeArrayField("engineBuiltInIdentityIds", this.engineBuiltInIdentityIds, + (writer, element) -> writer.writeString(element)); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadTest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadTest if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoadTest. + */ + @Generated + public static LoadTest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadTest deserializedLoadTest = new LoadTest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testId".equals(fieldName)) { + deserializedLoadTest.testId = reader.getString(); + } else if ("passFailCriteria".equals(fieldName)) { + deserializedLoadTest.passFailCriteria = PassFailCriteria.fromJson(reader); + } else if ("autoStopCriteria".equals(fieldName)) { + deserializedLoadTest.autoStopCriteria = AutoStopCriteria.fromJson(reader); + } else if ("secrets".equals(fieldName)) { + Map secrets = reader.readMap(reader1 -> TestSecret.fromJson(reader1)); + deserializedLoadTest.secrets = secrets; + } else if ("certificate".equals(fieldName)) { + deserializedLoadTest.certificate = TestCertificate.fromJson(reader); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedLoadTest.environmentVariables = environmentVariables; + } else if ("loadTestConfiguration".equals(fieldName)) { + deserializedLoadTest.loadTestConfiguration = LoadTestConfiguration.fromJson(reader); + } else if ("baselineTestRunId".equals(fieldName)) { + deserializedLoadTest.baselineTestRunId = reader.getString(); + } else if ("inputArtifacts".equals(fieldName)) { + deserializedLoadTest.inputArtifacts = TestInputArtifacts.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedLoadTest.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLoadTest.displayName = reader.getString(); + } else if ("subnetId".equals(fieldName)) { + deserializedLoadTest.subnetId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedLoadTest.kind = LoadTestKind.fromString(reader.getString()); + } else if ("publicIPDisabled".equals(fieldName)) { + deserializedLoadTest.publicIpDisabled = reader.getNullable(JsonReader::getBoolean); + } else if ("keyvaultReferenceIdentityType".equals(fieldName)) { + deserializedLoadTest.keyvaultReferenceIdentityType = reader.getString(); + } else if ("keyvaultReferenceIdentityId".equals(fieldName)) { + deserializedLoadTest.keyvaultReferenceIdentityId = reader.getString(); + } else if ("metricsReferenceIdentityType".equals(fieldName)) { + deserializedLoadTest.metricsReferenceIdentityType + = LoadTestingManagedIdentityType.fromString(reader.getString()); + } else if ("metricsReferenceIdentityId".equals(fieldName)) { + deserializedLoadTest.metricsReferenceIdentityId = reader.getString(); + } else if ("engineBuiltInIdentityType".equals(fieldName)) { + deserializedLoadTest.engineBuiltInIdentityType + = LoadTestingManagedIdentityType.fromString(reader.getString()); + } else if ("engineBuiltInIdentityIds".equals(fieldName)) { + List engineBuiltInIdentityIds = reader.readArray(reader1 -> reader1.getString()); + deserializedLoadTest.engineBuiltInIdentityIds = engineBuiltInIdentityIds; + } else if ("createdDateTime".equals(fieldName)) { + deserializedLoadTest.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedLoadTest.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedLoadTest.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedLoadTest.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadTest; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestConfiguration.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestConfiguration.java new file mode 100644 index 000000000000..00f20cb9aab0 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestConfiguration.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Configurations for the load test. + */ +@Fluent +public final class LoadTestConfiguration implements JsonSerializable { + /* + * The number of engine instances to execute load test. Supported values are in range of 1-400. Required for + * creating a new test. + */ + @Generated + private Integer engineInstances; + + /* + * If false, Azure Load Testing copies and processes your input files unmodified + * across all test engine instances. If true, Azure Load Testing splits the CSV + * input data evenly across all engine instances. If you provide multiple CSV + * files, each file will be split evenly. + */ + @Generated + private Boolean splitAllCsvs; + + /* + * If true, optionalLoadTestConfig is required and JMX script for the load test is + * not required to upload. + */ + @Generated + private Boolean quickStartTest; + + /* + * Configuration for quick load test + */ + @Generated + private OptionalLoadTestConfiguration optionalLoadTestConfiguration; + + /* + * Region distribution configuration for the load test. + */ + @Generated + private List regionalLoadTestConfiguration; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setLoadTestConfigurationAccessor(new JsonMergePatchHelper.LoadTestConfigurationAccessor() { + @Override + public LoadTestConfiguration prepareModelForJsonMergePatch(LoadTestConfiguration model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(LoadTestConfiguration model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of LoadTestConfiguration class. + */ + @Generated + public LoadTestConfiguration() { + } + + /** + * Get the engineInstances property: The number of engine instances to execute load test. Supported values are in + * range of 1-400. Required for creating a new test. + * + * @return the engineInstances value. + */ + @Generated + public Integer getEngineInstances() { + return this.engineInstances; + } + + /** + * Set the engineInstances property: The number of engine instances to execute load test. Supported values are in + * range of 1-400. Required for creating a new test. + * + * @param engineInstances the engineInstances value to set. + * @return the LoadTestConfiguration object itself. + */ + @Generated + public LoadTestConfiguration setEngineInstances(Integer engineInstances) { + this.engineInstances = engineInstances; + this.updatedProperties.add("engineInstances"); + return this; + } + + /** + * Get the splitAllCsvs property: If false, Azure Load Testing copies and processes your input files unmodified + * across all test engine instances. If true, Azure Load Testing splits the CSV + * input data evenly across all engine instances. If you provide multiple CSV + * files, each file will be split evenly. + * + * @return the splitAllCsvs value. + */ + @Generated + public Boolean isSplitAllCsvs() { + return this.splitAllCsvs; + } + + /** + * Set the splitAllCsvs property: If false, Azure Load Testing copies and processes your input files unmodified + * across all test engine instances. If true, Azure Load Testing splits the CSV + * input data evenly across all engine instances. If you provide multiple CSV + * files, each file will be split evenly. + * + * @param splitAllCsvs the splitAllCsvs value to set. + * @return the LoadTestConfiguration object itself. + */ + @Generated + public LoadTestConfiguration setSplitAllCsvs(Boolean splitAllCsvs) { + this.splitAllCsvs = splitAllCsvs; + this.updatedProperties.add("splitAllCsvs"); + return this; + } + + /** + * Get the quickStartTest property: If true, optionalLoadTestConfig is required and JMX script for the load test is + * not required to upload. + * + * @return the quickStartTest value. + */ + @Generated + public Boolean isQuickStartTest() { + return this.quickStartTest; + } + + /** + * Set the quickStartTest property: If true, optionalLoadTestConfig is required and JMX script for the load test is + * not required to upload. + * + * @param quickStartTest the quickStartTest value to set. + * @return the LoadTestConfiguration object itself. + */ + @Generated + public LoadTestConfiguration setQuickStartTest(Boolean quickStartTest) { + this.quickStartTest = quickStartTest; + this.updatedProperties.add("quickStartTest"); + return this; + } + + /** + * Get the optionalLoadTestConfiguration property: Configuration for quick load test. + * + * @return the optionalLoadTestConfiguration value. + */ + @Generated + public OptionalLoadTestConfiguration getOptionalLoadTestConfiguration() { + return this.optionalLoadTestConfiguration; + } + + /** + * Set the optionalLoadTestConfiguration property: Configuration for quick load test. + * + * @param optionalLoadTestConfiguration the optionalLoadTestConfiguration value to set. + * @return the LoadTestConfiguration object itself. + */ + @Generated + public LoadTestConfiguration + setOptionalLoadTestConfiguration(OptionalLoadTestConfiguration optionalLoadTestConfiguration) { + this.optionalLoadTestConfiguration = optionalLoadTestConfiguration; + this.updatedProperties.add("optionalLoadTestConfiguration"); + return this; + } + + /** + * Get the regionalLoadTestConfiguration property: Region distribution configuration for the load test. + * + * @return the regionalLoadTestConfiguration value. + */ + @Generated + public List getRegionalLoadTestConfiguration() { + return this.regionalLoadTestConfiguration; + } + + /** + * Set the regionalLoadTestConfiguration property: Region distribution configuration for the load test. + * + * @param regionalLoadTestConfiguration the regionalLoadTestConfiguration value to set. + * @return the LoadTestConfiguration object itself. + */ + @Generated + public LoadTestConfiguration + setRegionalLoadTestConfiguration(List regionalLoadTestConfiguration) { + this.regionalLoadTestConfiguration = regionalLoadTestConfiguration; + this.updatedProperties.add("regionalLoadTestConfiguration"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("engineInstances", this.engineInstances); + jsonWriter.writeBooleanField("splitAllCSVs", this.splitAllCsvs); + jsonWriter.writeBooleanField("quickStartTest", this.quickStartTest); + jsonWriter.writeJsonField("optionalLoadTestConfig", this.optionalLoadTestConfiguration); + jsonWriter.writeArrayField("regionalLoadTestConfig", this.regionalLoadTestConfiguration, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("engineInstances")) { + if (this.engineInstances == null) { + jsonWriter.writeNullField("engineInstances"); + } else { + jsonWriter.writeNumberField("engineInstances", this.engineInstances); + } + } + if (updatedProperties.contains("splitAllCsvs")) { + if (this.splitAllCsvs == null) { + jsonWriter.writeNullField("splitAllCSVs"); + } else { + jsonWriter.writeBooleanField("splitAllCSVs", this.splitAllCsvs); + } + } + if (updatedProperties.contains("quickStartTest")) { + if (this.quickStartTest == null) { + jsonWriter.writeNullField("quickStartTest"); + } else { + jsonWriter.writeBooleanField("quickStartTest", this.quickStartTest); + } + } + if (updatedProperties.contains("optionalLoadTestConfiguration")) { + if (this.optionalLoadTestConfiguration == null) { + jsonWriter.writeNullField("optionalLoadTestConfig"); + } else { + JsonMergePatchHelper.getOptionalLoadTestConfigurationAccessor() + .prepareModelForJsonMergePatch(this.optionalLoadTestConfiguration, true); + jsonWriter.writeJsonField("optionalLoadTestConfig", this.optionalLoadTestConfiguration); + JsonMergePatchHelper.getOptionalLoadTestConfigurationAccessor() + .prepareModelForJsonMergePatch(this.optionalLoadTestConfiguration, false); + } + } + if (updatedProperties.contains("regionalLoadTestConfiguration")) { + if (this.regionalLoadTestConfiguration == null) { + jsonWriter.writeNullField("regionalLoadTestConfig"); + } else { + jsonWriter.writeArrayField("regionalLoadTestConfig", this.regionalLoadTestConfiguration, + (writer, element) -> writer.writeJson(element)); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadTestConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadTestConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadTestConfiguration. + */ + @Generated + public static LoadTestConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadTestConfiguration deserializedLoadTestConfiguration = new LoadTestConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("engineInstances".equals(fieldName)) { + deserializedLoadTestConfiguration.engineInstances = reader.getNullable(JsonReader::getInt); + } else if ("splitAllCSVs".equals(fieldName)) { + deserializedLoadTestConfiguration.splitAllCsvs = reader.getNullable(JsonReader::getBoolean); + } else if ("quickStartTest".equals(fieldName)) { + deserializedLoadTestConfiguration.quickStartTest = reader.getNullable(JsonReader::getBoolean); + } else if ("optionalLoadTestConfig".equals(fieldName)) { + deserializedLoadTestConfiguration.optionalLoadTestConfiguration + = OptionalLoadTestConfiguration.fromJson(reader); + } else if ("regionalLoadTestConfig".equals(fieldName)) { + List regionalLoadTestConfiguration + = reader.readArray(reader1 -> RegionalConfiguration.fromJson(reader1)); + deserializedLoadTestConfiguration.regionalLoadTestConfiguration = regionalLoadTestConfiguration; + } else { + reader.skipChildren(); + } + } + + return deserializedLoadTestConfiguration; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestKind.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestKind.java new file mode 100644 index 000000000000..91a960e136a2 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestKind.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Test kind. + */ +public final class LoadTestKind extends ExpandableStringEnum { + /** + * URL Test. + */ + @Generated + public static final LoadTestKind URL = fromString("URL"); + + /** + * JMX Test. + */ + @Generated + public static final LoadTestKind JMX = fromString("JMX"); + + /** + * Locust Test. + */ + @Generated + public static final LoadTestKind LOCUST = fromString("Locust"); + + /** + * Creates a new instance of LoadTestKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public LoadTestKind() { + } + + /** + * Creates or finds a LoadTestKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadTestKind. + */ + @Generated + public static LoadTestKind fromString(String name) { + return fromString(name, LoadTestKind.class); + } + + /** + * Gets known LoadTestKind values. + * + * @return known LoadTestKind values. + */ + @Generated + public static Collection values() { + return values(LoadTestKind.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestRun.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestRun.java new file mode 100644 index 000000000000..44fe809b6f85 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestRun.java @@ -0,0 +1,1029 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Load test run model. + */ +@Fluent +public final class LoadTestRun implements JsonSerializable { + /* + * Unique test run identifier for the load test run, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + */ + @Generated + private String testRunId; + + /* + * Pass fail criteria for a test. + */ + @Generated + private PassFailCriteria passFailCriteria; + + /* + * Auto stop criteria for a test. This will automatically stop a load test if the error percentage is high for a + * certain time window. + */ + @Generated + private AutoStopCriteria autoStopCriteria; + + /* + * Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + */ + @Generated + private Map secrets; + + /* + * Certificates metadata + */ + @Generated + private TestCertificate certificate; + + /* + * Environment variables which are defined as a set of pairs. + */ + @Generated + private Map environmentVariables; + + /* + * Error details if there is any failure in load test run + */ + @Generated + private List errorDetails; + + /* + * Test run statistics. Key is the sampler name and value is the set of statistics for performance metrics like + * response time, throughput, etc. from the load test run. + * The sampler name is the same as the name mentioned in the test script. + * Sampler name "Total" represents the aggregated statistics of all the samplers. + */ + @Generated + private Map testRunStatistics; + + /* + * Regional statistics. Key is the Azure region name and value is the test run statistics. + * The region name should of format accepted by ARM, and should be a region supported by Azure Load Testing. For + * example, East US should be passed as "eastus". + * The region name must match one of the strings in the "Name" column returned from running the + * "az account list-locations -o table" Azure CLI command. + */ + @Generated + private Map regionalStatistics; + + /* + * The load test configuration. + */ + @Generated + private LoadTestConfiguration loadTestConfiguration; + + /* + * Collection of test run artifacts + */ + @Generated + private TestRunArtifacts testArtifacts; + + /* + * Test result for pass/Fail criteria used during the test run. + */ + @Generated + private PassFailTestResult testResult; + + /* + * Number of virtual users, for which test has been run. + */ + @Generated + private Integer virtualUsers; + + /* + * Display name of a testRun. + */ + @Generated + private String displayName; + + /* + * Associated test Id. + */ + @Generated + private String testId; + + /* + * The test run description. + */ + @Generated + private String description; + + /* + * The test run status. + */ + @Generated + private TestRunStatus status; + + /* + * The test run start DateTime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime startDateTime; + + /* + * The test run end DateTime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime endDateTime; + + /* + * Test run initiated time. + */ + @Generated + private OffsetDateTime executedDateTime; + + /* + * Portal url. + */ + @Generated + private String portalUrl; + + /* + * Test run duration in milliseconds. + */ + @Generated + private Long duration; + + /* + * Virtual user hours consumed by the test run. + */ + @Generated + private Double virtualUserHours; + + /* + * Subnet ID on which the load test instances should run. + */ + @Generated + private String subnetId; + + /* + * Type of test. + */ + @Generated + private LoadTestKind kind; + + /* + * Request data collection level for test run + */ + @Generated + private RequestDataLevel requestDataLevel; + + /* + * Enable or disable debug level logging. True if debug logs are enabled for the test run. False otherwise + */ + @Generated + private Boolean debugLogsEnabled; + + /* + * Inject load test engines without deploying public IP for outbound access + */ + @Generated + private Boolean publicIpDisabled; + + /* + * The type of the entity that created the test run. (E.x. User, ScheduleTrigger, etc). + */ + @Generated + private CreatedByType createdByType; + + /* + * The URI pointing to the entity that created the test run. + */ + @Generated + private String createdByUri; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setLoadTestRunAccessor(new JsonMergePatchHelper.LoadTestRunAccessor() { + @Override + public LoadTestRun prepareModelForJsonMergePatch(LoadTestRun model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(LoadTestRun model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of LoadTestRun class. + */ + @Generated + public LoadTestRun() { + } + + /** + * Get the testRunId property: Unique test run identifier for the load test run, must contain only lower-case + * alphabetic, numeric, underscore or hyphen characters. + * + * @return the testRunId value. + */ + @Generated + public String getTestRunId() { + return this.testRunId; + } + + /** + * Get the passFailCriteria property: Pass fail criteria for a test. + * + * @return the passFailCriteria value. + */ + @Generated + public PassFailCriteria getPassFailCriteria() { + return this.passFailCriteria; + } + + /** + * Set the passFailCriteria property: Pass fail criteria for a test. + * + * @param passFailCriteria the passFailCriteria value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setPassFailCriteria(PassFailCriteria passFailCriteria) { + this.passFailCriteria = passFailCriteria; + this.updatedProperties.add("passFailCriteria"); + return this; + } + + /** + * Get the autoStopCriteria property: Auto stop criteria for a test. This will automatically stop a load test if the + * error percentage is high for a certain time window. + * + * @return the autoStopCriteria value. + */ + @Generated + public AutoStopCriteria getAutoStopCriteria() { + return this.autoStopCriteria; + } + + /** + * Set the autoStopCriteria property: Auto stop criteria for a test. This will automatically stop a load test if the + * error percentage is high for a certain time window. + * + * @param autoStopCriteria the autoStopCriteria value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setAutoStopCriteria(AutoStopCriteria autoStopCriteria) { + this.autoStopCriteria = autoStopCriteria; + this.updatedProperties.add("autoStopCriteria"); + return this; + } + + /** + * Get the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + * + * @return the secrets value. + */ + @Generated + public Map getSecrets() { + return this.secrets; + } + + /** + * Set the secrets property: Secrets can be stored in an Azure Key Vault or any other secret store. If the + * secret is stored in an Azure Key Vault, the value should be the secret + * identifier and the type should be AKV_SECRET_URI. If the secret is stored + * elsewhere, the secret value should be provided directly and the type should be + * SECRET_VALUE. + * + * @param secrets the secrets value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setSecrets(Map secrets) { + this.secrets = secrets; + this.updatedProperties.add("secrets"); + return this; + } + + /** + * Get the certificate property: Certificates metadata. + * + * @return the certificate value. + */ + @Generated + public TestCertificate getCertificate() { + return this.certificate; + } + + /** + * Set the certificate property: Certificates metadata. + * + * @param certificate the certificate value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setCertificate(TestCertificate certificate) { + this.certificate = certificate; + this.updatedProperties.add("certificate"); + return this; + } + + /** + * Get the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @return the environmentVariables value. + */ + @Generated + public Map getEnvironmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment variables which are defined as a set of <name,value> + * pairs. + * + * @param environmentVariables the environmentVariables value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + this.updatedProperties.add("environmentVariables"); + return this; + } + + /** + * Get the errorDetails property: Error details if there is any failure in load test run. + * + * @return the errorDetails value. + */ + @Generated + public List getErrorDetails() { + return this.errorDetails; + } + + /** + * Get the testRunStatistics property: Test run statistics. Key is the sampler name and value is the set of + * statistics for performance metrics like response time, throughput, etc. from the load test run. + * The sampler name is the same as the name mentioned in the test script. + * Sampler name "Total" represents the aggregated statistics of all the samplers. + * + * @return the testRunStatistics value. + */ + @Generated + public Map getTestRunStatistics() { + return this.testRunStatistics; + } + + /** + * Get the regionalStatistics property: Regional statistics. Key is the Azure region name and value is the test run + * statistics. + * The region name should of format accepted by ARM, and should be a region supported by Azure Load Testing. For + * example, East US should be passed as "eastus". + * The region name must match one of the strings in the "Name" column returned from running the "az account + * list-locations -o table" Azure CLI command. + * + * @return the regionalStatistics value. + */ + @Generated + public Map getRegionalStatistics() { + return this.regionalStatistics; + } + + /** + * Get the loadTestConfiguration property: The load test configuration. + * + * @return the loadTestConfiguration value. + */ + @Generated + public LoadTestConfiguration getLoadTestConfiguration() { + return this.loadTestConfiguration; + } + + /** + * Get the testArtifacts property: Collection of test run artifacts. + * + * @return the testArtifacts value. + */ + @Generated + public TestRunArtifacts getTestArtifacts() { + return this.testArtifacts; + } + + /** + * Get the testResult property: Test result for pass/Fail criteria used during the test run. + * + * @return the testResult value. + */ + @Generated + public PassFailTestResult getTestResult() { + return this.testResult; + } + + /** + * Get the virtualUsers property: Number of virtual users, for which test has been run. + * + * @return the virtualUsers value. + */ + @Generated + public Integer getVirtualUsers() { + return this.virtualUsers; + } + + /** + * Get the displayName property: Display name of a testRun. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of a testRun. + * + * @param displayName the displayName value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setDisplayName(String displayName) { + this.displayName = displayName; + this.updatedProperties.add("displayName"); + return this; + } + + /** + * Get the testId property: Associated test Id. + * + * @return the testId value. + */ + @Generated + public String getTestId() { + return this.testId; + } + + /** + * Set the testId property: Associated test Id. + * + * @param testId the testId value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setTestId(String testId) { + this.testId = testId; + this.updatedProperties.add("testId"); + return this; + } + + /** + * Get the description property: The test run description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The test run description. + * + * @param description the description value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setDescription(String description) { + this.description = description; + this.updatedProperties.add("description"); + return this; + } + + /** + * Get the status property: The test run status. + * + * @return the status value. + */ + @Generated + public TestRunStatus getStatus() { + return this.status; + } + + /** + * Get the startDateTime property: The test run start DateTime(RFC 3339 literal format). + * + * @return the startDateTime value. + */ + @Generated + public OffsetDateTime getStartDateTime() { + return this.startDateTime; + } + + /** + * Get the endDateTime property: The test run end DateTime(RFC 3339 literal format). + * + * @return the endDateTime value. + */ + @Generated + public OffsetDateTime getEndDateTime() { + return this.endDateTime; + } + + /** + * Get the executedDateTime property: Test run initiated time. + * + * @return the executedDateTime value. + */ + @Generated + public OffsetDateTime getExecutedDateTime() { + return this.executedDateTime; + } + + /** + * Get the portalUrl property: Portal url. + * + * @return the portalUrl value. + */ + @Generated + public String getPortalUrl() { + return this.portalUrl; + } + + /** + * Get the duration property: Test run duration in milliseconds. + * + * @return the duration value. + */ + @Generated + public Long getDuration() { + return this.duration; + } + + /** + * Get the virtualUserHours property: Virtual user hours consumed by the test run. + * + * @return the virtualUserHours value. + */ + @Generated + public Double getVirtualUserHours() { + return this.virtualUserHours; + } + + /** + * Get the subnetId property: Subnet ID on which the load test instances should run. + * + * @return the subnetId value. + */ + @Generated + public String getSubnetId() { + return this.subnetId; + } + + /** + * Get the kind property: Type of test. + * + * @return the kind value. + */ + @Generated + public LoadTestKind getKind() { + return this.kind; + } + + /** + * Get the requestDataLevel property: Request data collection level for test run. + * + * @return the requestDataLevel value. + */ + @Generated + public RequestDataLevel getRequestDataLevel() { + return this.requestDataLevel; + } + + /** + * Set the requestDataLevel property: Request data collection level for test run. + * + * @param requestDataLevel the requestDataLevel value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setRequestDataLevel(RequestDataLevel requestDataLevel) { + this.requestDataLevel = requestDataLevel; + this.updatedProperties.add("requestDataLevel"); + return this; + } + + /** + * Get the debugLogsEnabled property: Enable or disable debug level logging. True if debug logs are enabled for the + * test run. False otherwise. + * + * @return the debugLogsEnabled value. + */ + @Generated + public Boolean isDebugLogsEnabled() { + return this.debugLogsEnabled; + } + + /** + * Set the debugLogsEnabled property: Enable or disable debug level logging. True if debug logs are enabled for the + * test run. False otherwise. + * + * @param debugLogsEnabled the debugLogsEnabled value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setDebugLogsEnabled(Boolean debugLogsEnabled) { + this.debugLogsEnabled = debugLogsEnabled; + this.updatedProperties.add("debugLogsEnabled"); + return this; + } + + /** + * Get the publicIpDisabled property: Inject load test engines without deploying public IP for outbound access. + * + * @return the publicIpDisabled value. + */ + @Generated + public Boolean isPublicIpDisabled() { + return this.publicIpDisabled; + } + + /** + * Get the createdByType property: The type of the entity that created the test run. (E.x. User, ScheduleTrigger, + * etc). + * + * @return the createdByType value. + */ + @Generated + public CreatedByType getCreatedByType() { + return this.createdByType; + } + + /** + * Set the createdByType property: The type of the entity that created the test run. (E.x. User, ScheduleTrigger, + * etc). + * + * @param createdByType the createdByType value to set. + * @return the LoadTestRun object itself. + */ + @Generated + public LoadTestRun setCreatedByType(CreatedByType createdByType) { + this.createdByType = createdByType; + this.updatedProperties.add("createdByType"); + return this; + } + + /** + * Get the createdByUri property: The URI pointing to the entity that created the test run. + * + * @return the createdByUri value. + */ + @Generated + public String getCreatedByUri() { + return this.createdByUri; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("passFailCriteria", this.passFailCriteria); + jsonWriter.writeJsonField("autoStopCriteria", this.autoStopCriteria); + jsonWriter.writeMapField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("certificate", this.certificate); + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("testId", this.testId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("requestDataLevel", + this.requestDataLevel == null ? null : this.requestDataLevel.toString()); + jsonWriter.writeBooleanField("debugLogsEnabled", this.debugLogsEnabled); + jsonWriter.writeStringField("createdByType", + this.createdByType == null ? null : this.createdByType.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("passFailCriteria")) { + if (this.passFailCriteria == null) { + jsonWriter.writeNullField("passFailCriteria"); + } else { + JsonMergePatchHelper.getPassFailCriteriaAccessor() + .prepareModelForJsonMergePatch(this.passFailCriteria, true); + jsonWriter.writeJsonField("passFailCriteria", this.passFailCriteria); + JsonMergePatchHelper.getPassFailCriteriaAccessor() + .prepareModelForJsonMergePatch(this.passFailCriteria, false); + } + } + if (updatedProperties.contains("autoStopCriteria")) { + if (this.autoStopCriteria == null) { + jsonWriter.writeNullField("autoStopCriteria"); + } else { + JsonMergePatchHelper.getAutoStopCriteriaAccessor() + .prepareModelForJsonMergePatch(this.autoStopCriteria, true); + jsonWriter.writeJsonField("autoStopCriteria", this.autoStopCriteria); + JsonMergePatchHelper.getAutoStopCriteriaAccessor() + .prepareModelForJsonMergePatch(this.autoStopCriteria, false); + } + } + if (updatedProperties.contains("secrets")) { + if (this.secrets == null) { + jsonWriter.writeNullField("secrets"); + } else { + jsonWriter.writeMapField("secrets", this.secrets, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getTestSecretAccessor().prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getTestSecretAccessor().prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + if (updatedProperties.contains("certificate")) { + if (this.certificate == null) { + jsonWriter.writeNullField("certificate"); + } else { + JsonMergePatchHelper.getTestCertificateAccessor().prepareModelForJsonMergePatch(this.certificate, true); + jsonWriter.writeJsonField("certificate", this.certificate); + JsonMergePatchHelper.getTestCertificateAccessor() + .prepareModelForJsonMergePatch(this.certificate, false); + } + } + if (updatedProperties.contains("environmentVariables")) { + if (this.environmentVariables == null) { + jsonWriter.writeNullField("environmentVariables"); + } else { + jsonWriter.writeMapField("environmentVariables", this.environmentVariables, (writer, element) -> { + if (element != null) { + writer.writeString(element); + } else { + writer.writeNull(); + } + }); + } + } + if (updatedProperties.contains("displayName")) { + if (this.displayName == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", this.displayName); + } + } + if (updatedProperties.contains("testId")) { + if (this.testId == null) { + jsonWriter.writeNullField("testId"); + } else { + jsonWriter.writeStringField("testId", this.testId); + } + } + if (updatedProperties.contains("description")) { + if (this.description == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", this.description); + } + } + if (updatedProperties.contains("requestDataLevel")) { + if (this.requestDataLevel == null) { + jsonWriter.writeNullField("requestDataLevel"); + } else { + jsonWriter.writeStringField("requestDataLevel", this.requestDataLevel.toString()); + } + } + if (updatedProperties.contains("debugLogsEnabled")) { + if (this.debugLogsEnabled == null) { + jsonWriter.writeNullField("debugLogsEnabled"); + } else { + jsonWriter.writeBooleanField("debugLogsEnabled", this.debugLogsEnabled); + } + } + if (updatedProperties.contains("createdByType")) { + if (this.createdByType == null) { + jsonWriter.writeNullField("createdByType"); + } else { + jsonWriter.writeStringField("createdByType", this.createdByType.toString()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadTestRun from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadTestRun if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoadTestRun. + */ + @Generated + public static LoadTestRun fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadTestRun deserializedLoadTestRun = new LoadTestRun(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testRunId".equals(fieldName)) { + deserializedLoadTestRun.testRunId = reader.getString(); + } else if ("passFailCriteria".equals(fieldName)) { + deserializedLoadTestRun.passFailCriteria = PassFailCriteria.fromJson(reader); + } else if ("autoStopCriteria".equals(fieldName)) { + deserializedLoadTestRun.autoStopCriteria = AutoStopCriteria.fromJson(reader); + } else if ("secrets".equals(fieldName)) { + Map secrets = reader.readMap(reader1 -> TestSecret.fromJson(reader1)); + deserializedLoadTestRun.secrets = secrets; + } else if ("certificate".equals(fieldName)) { + deserializedLoadTestRun.certificate = TestCertificate.fromJson(reader); + } else if ("environmentVariables".equals(fieldName)) { + Map environmentVariables = reader.readMap(reader1 -> reader1.getString()); + deserializedLoadTestRun.environmentVariables = environmentVariables; + } else if ("errorDetails".equals(fieldName)) { + List errorDetails = reader.readArray(reader1 -> ErrorDetails.fromJson(reader1)); + deserializedLoadTestRun.errorDetails = errorDetails; + } else if ("testRunStatistics".equals(fieldName)) { + Map testRunStatistics + = reader.readMap(reader1 -> TestRunStatistics.fromJson(reader1)); + deserializedLoadTestRun.testRunStatistics = testRunStatistics; + } else if ("regionalStatistics".equals(fieldName)) { + Map regionalStatistics + = reader.readMap(reader1 -> TestRunStatistics.fromJson(reader1)); + deserializedLoadTestRun.regionalStatistics = regionalStatistics; + } else if ("loadTestConfiguration".equals(fieldName)) { + deserializedLoadTestRun.loadTestConfiguration = LoadTestConfiguration.fromJson(reader); + } else if ("testArtifacts".equals(fieldName)) { + deserializedLoadTestRun.testArtifacts = TestRunArtifacts.fromJson(reader); + } else if ("testResult".equals(fieldName)) { + deserializedLoadTestRun.testResult = PassFailTestResult.fromString(reader.getString()); + } else if ("virtualUsers".equals(fieldName)) { + deserializedLoadTestRun.virtualUsers = reader.getNullable(JsonReader::getInt); + } else if ("displayName".equals(fieldName)) { + deserializedLoadTestRun.displayName = reader.getString(); + } else if ("testId".equals(fieldName)) { + deserializedLoadTestRun.testId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedLoadTestRun.description = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedLoadTestRun.status = TestRunStatus.fromString(reader.getString()); + } else if ("startDateTime".equals(fieldName)) { + deserializedLoadTestRun.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDateTime".equals(fieldName)) { + deserializedLoadTestRun.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("executedDateTime".equals(fieldName)) { + deserializedLoadTestRun.executedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("portalUrl".equals(fieldName)) { + deserializedLoadTestRun.portalUrl = reader.getString(); + } else if ("duration".equals(fieldName)) { + deserializedLoadTestRun.duration = reader.getNullable(JsonReader::getLong); + } else if ("virtualUserHours".equals(fieldName)) { + deserializedLoadTestRun.virtualUserHours = reader.getNullable(JsonReader::getDouble); + } else if ("subnetId".equals(fieldName)) { + deserializedLoadTestRun.subnetId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedLoadTestRun.kind = LoadTestKind.fromString(reader.getString()); + } else if ("requestDataLevel".equals(fieldName)) { + deserializedLoadTestRun.requestDataLevel = RequestDataLevel.fromString(reader.getString()); + } else if ("debugLogsEnabled".equals(fieldName)) { + deserializedLoadTestRun.debugLogsEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("publicIPDisabled".equals(fieldName)) { + deserializedLoadTestRun.publicIpDisabled = reader.getNullable(JsonReader::getBoolean); + } else if ("createdByType".equals(fieldName)) { + deserializedLoadTestRun.createdByType = CreatedByType.fromString(reader.getString()); + } else if ("createdByUri".equals(fieldName)) { + deserializedLoadTestRun.createdByUri = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedLoadTestRun.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedLoadTestRun.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedLoadTestRun.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedLoadTestRun.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadTestRun; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingAppComponent.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingAppComponent.java new file mode 100644 index 000000000000..45770491c028 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingAppComponent.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * An Azure resource object (Refer azure generic resource model + * :https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id#genericresource). + */ +@Fluent +public final class LoadTestingAppComponent implements JsonSerializable { + /* + * fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName} + */ + @Generated + private String resourceId; + + /* + * Azure resource name, required while creating the app component. + */ + @Generated + private String resourceName; + + /* + * Azure resource type, required while creating the app component. + */ + @Generated + private String resourceType; + + /* + * Azure resource display name + */ + @Generated + private String displayName; + + /* + * Resource group name of the Azure resource + */ + @Generated + private String resourceGroup; + + /* + * Subscription Id of the Azure resource + */ + @Generated + private String subscriptionId; + + /* + * Kind of Azure resource type + */ + @Generated + private String kind; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper + .setLoadTestingAppComponentAccessor(new JsonMergePatchHelper.LoadTestingAppComponentAccessor() { + @Override + public LoadTestingAppComponent prepareModelForJsonMergePatch(LoadTestingAppComponent model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(LoadTestingAppComponent model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of LoadTestingAppComponent class. + */ + @Generated + public LoadTestingAppComponent() { + } + + /** + * Get the resourceId property: fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}. + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Get the resourceName property: Azure resource name, required while creating the app component. + * + * @return the resourceName value. + */ + @Generated + public String getResourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: Azure resource name, required while creating the app component. + *

Required when create the resource.

+ * + * @param resourceName the resourceName value to set. + * @return the LoadTestingAppComponent object itself. + */ + @Generated + public LoadTestingAppComponent setResourceName(String resourceName) { + this.resourceName = resourceName; + this.updatedProperties.add("resourceName"); + return this; + } + + /** + * Get the resourceType property: Azure resource type, required while creating the app component. + * + * @return the resourceType value. + */ + @Generated + public String getResourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Azure resource type, required while creating the app component. + *

Required when create the resource.

+ * + * @param resourceType the resourceType value to set. + * @return the LoadTestingAppComponent object itself. + */ + @Generated + public LoadTestingAppComponent setResourceType(String resourceType) { + this.resourceType = resourceType; + this.updatedProperties.add("resourceType"); + return this; + } + + /** + * Get the displayName property: Azure resource display name. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Azure resource display name. + * + * @param displayName the displayName value to set. + * @return the LoadTestingAppComponent object itself. + */ + @Generated + public LoadTestingAppComponent setDisplayName(String displayName) { + this.displayName = displayName; + this.updatedProperties.add("displayName"); + return this; + } + + /** + * Get the resourceGroup property: Resource group name of the Azure resource. + * + * @return the resourceGroup value. + */ + @Generated + public String getResourceGroup() { + return this.resourceGroup; + } + + /** + * Get the subscriptionId property: Subscription Id of the Azure resource. + * + * @return the subscriptionId value. + */ + @Generated + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * Get the kind property: Kind of Azure resource type. + * + * @return the kind value. + */ + @Generated + public String getKind() { + return this.kind; + } + + /** + * Set the kind property: Kind of Azure resource type. + * + * @param kind the kind value to set. + * @return the LoadTestingAppComponent object itself. + */ + @Generated + public LoadTestingAppComponent setKind(String kind) { + this.kind = kind; + this.updatedProperties.add("kind"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("resourceType", this.resourceType); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("kind", this.kind); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("resourceName")) { + if (this.resourceName == null) { + jsonWriter.writeNullField("resourceName"); + } else { + jsonWriter.writeStringField("resourceName", this.resourceName); + } + } + if (updatedProperties.contains("resourceType")) { + if (this.resourceType == null) { + jsonWriter.writeNullField("resourceType"); + } else { + jsonWriter.writeStringField("resourceType", this.resourceType); + } + } + if (updatedProperties.contains("displayName")) { + if (this.displayName == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", this.displayName); + } + } + if (updatedProperties.contains("kind")) { + if (this.kind == null) { + jsonWriter.writeNullField("kind"); + } else { + jsonWriter.writeStringField("kind", this.kind); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadTestingAppComponent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadTestingAppComponent if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoadTestingAppComponent. + */ + @Generated + public static LoadTestingAppComponent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadTestingAppComponent deserializedLoadTestingAppComponent = new LoadTestingAppComponent(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedLoadTestingAppComponent.resourceId = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedLoadTestingAppComponent.resourceName = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedLoadTestingAppComponent.resourceType = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLoadTestingAppComponent.displayName = reader.getString(); + } else if ("resourceGroup".equals(fieldName)) { + deserializedLoadTestingAppComponent.resourceGroup = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedLoadTestingAppComponent.subscriptionId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedLoadTestingAppComponent.kind = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadTestingAppComponent; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingFileType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingFileType.java new file mode 100644 index 000000000000..5ae9be8d5453 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingFileType.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Types of file supported. + */ +public final class LoadTestingFileType extends ExpandableStringEnum { + /** + * If the file is a JMX script. + */ + @Generated + public static final LoadTestingFileType JMX_FILE = fromString("JMX_FILE"); + + /** + * If the file is a user properties file. + */ + @Generated + public static final LoadTestingFileType USER_PROPERTIES = fromString("USER_PROPERTIES"); + + /** + * If the file is not among any of the other supported file types. + */ + @Generated + public static final LoadTestingFileType ADDITIONAL_ARTIFACTS = fromString("ADDITIONAL_ARTIFACTS"); + + /** + * If the file is a compressed archive containing a collection of various artifacts or resources. + */ + @Generated + public static final LoadTestingFileType ZIPPED_ARTIFACTS = fromString("ZIPPED_ARTIFACTS"); + + /** + * If the file is a JSON config file to define the requests for a URL test. + */ + @Generated + public static final LoadTestingFileType URL_TEST_CONFIG = fromString("URL_TEST_CONFIG"); + + /** + * If the file is a test script. + */ + @Generated + public static final LoadTestingFileType TEST_SCRIPT = fromString("TEST_SCRIPT"); + + /** + * Creates a new instance of LoadTestingFileType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public LoadTestingFileType() { + } + + /** + * Creates or finds a LoadTestingFileType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadTestingFileType. + */ + @Generated + public static LoadTestingFileType fromString(String name) { + return fromString(name, LoadTestingFileType.class); + } + + /** + * Gets known LoadTestingFileType values. + * + * @return known LoadTestingFileType values. + */ + @Generated + public static Collection values() { + return values(LoadTestingFileType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingManagedIdentityType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingManagedIdentityType.java new file mode 100644 index 000000000000..bc9898bd2dbb --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/LoadTestingManagedIdentityType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Managed identity type. + */ +public final class LoadTestingManagedIdentityType extends ExpandableStringEnum { + /** + * System-assigned managed identity. + */ + @Generated + public static final LoadTestingManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User-assigned managed identity. + */ + @Generated + public static final LoadTestingManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates a new instance of LoadTestingManagedIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public LoadTestingManagedIdentityType() { + } + + /** + * Creates or finds a LoadTestingManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadTestingManagedIdentityType. + */ + @Generated + public static LoadTestingManagedIdentityType fromString(String name) { + return fromString(name, LoadTestingManagedIdentityType.class); + } + + /** + * Gets known LoadTestingManagedIdentityType values. + * + * @return known LoadTestingManagedIdentityType values. + */ + @Generated + public static Collection values() { + return values(LoadTestingManagedIdentityType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricAvailability.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricAvailability.java new file mode 100644 index 000000000000..76d19461c2db --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricAvailability.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Metric availability specifies the time grain (aggregation interval or frequency). + */ +@Immutable +public final class MetricAvailability implements JsonSerializable { + /* + * The time grain specifies the aggregation interval for the metric. Expressed as + * a duration 'PT1M', 'PT1H', etc. + */ + @Generated + private TimeGrain timeGrain; + + /** + * Creates an instance of MetricAvailability class. + */ + @Generated + private MetricAvailability() { + } + + /** + * Get the timeGrain property: The time grain specifies the aggregation interval for the metric. Expressed as + * a duration 'PT1M', 'PT1H', etc. + * + * @return the timeGrain value. + */ + @Generated + public TimeGrain getTimeGrain() { + return this.timeGrain; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeGrain", this.timeGrain == null ? null : this.timeGrain.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricAvailability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricAvailability if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricAvailability. + */ + @Generated + public static MetricAvailability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricAvailability deserializedMetricAvailability = new MetricAvailability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeGrain".equals(fieldName)) { + deserializedMetricAvailability.timeGrain = TimeGrain.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricAvailability; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinition.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinition.java new file mode 100644 index 000000000000..3a5d3f600a45 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinition.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Metric definition. + */ +@Immutable +public final class MetricDefinition implements JsonSerializable { + /* + * List of dimensions + */ + @Generated + private List dimensions; + + /* + * The metric description + */ + @Generated + private String description; + + /* + * The metric name + */ + @Generated + private String name; + + /* + * The namespace the metric belongs to. + */ + @Generated + private String namespace; + + /* + * The primary aggregation type value defining how to use the values for display. + */ + @Generated + private AggregationType primaryAggregationType; + + /* + * The collection of what all aggregation types are supported. + */ + @Generated + private List supportedAggregationTypes; + + /* + * The unit of the metric. + */ + @Generated + private MetricUnit unit; + + /* + * Metric availability specifies the time grain (aggregation interval or + * frequency). + */ + @Generated + private List metricAvailabilities; + + /** + * Creates an instance of MetricDefinition class. + */ + @Generated + private MetricDefinition() { + } + + /** + * Get the dimensions property: List of dimensions. + * + * @return the dimensions value. + */ + @Generated + public List getDimensions() { + return this.dimensions; + } + + /** + * Get the description property: The metric description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the name property: The metric name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the namespace property: The namespace the metric belongs to. + * + * @return the namespace value. + */ + @Generated + public String getNamespace() { + return this.namespace; + } + + /** + * Get the primaryAggregationType property: The primary aggregation type value defining how to use the values for + * display. + * + * @return the primaryAggregationType value. + */ + @Generated + public AggregationType getPrimaryAggregationType() { + return this.primaryAggregationType; + } + + /** + * Get the supportedAggregationTypes property: The collection of what all aggregation types are supported. + * + * @return the supportedAggregationTypes value. + */ + @Generated + public List getSupportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Get the unit property: The unit of the metric. + * + * @return the unit value. + */ + @Generated + public MetricUnit getUnit() { + return this.unit; + } + + /** + * Get the metricAvailabilities property: Metric availability specifies the time grain (aggregation interval or + * frequency). + * + * @return the metricAvailabilities value. + */ + @Generated + public List getMetricAvailabilities() { + return this.metricAvailabilities; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("namespace", this.namespace); + jsonWriter.writeStringField("primaryAggregationType", + this.primaryAggregationType == null ? null : this.primaryAggregationType.toString()); + jsonWriter.writeArrayField("supportedAggregationTypes", this.supportedAggregationTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeArrayField("metricAvailabilities", this.metricAvailabilities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricDefinition. + */ + @Generated + public static MetricDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricDefinition deserializedMetricDefinition = new MetricDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dimensions".equals(fieldName)) { + List dimensions + = reader.readArray(reader1 -> NameAndDescription.fromJson(reader1)); + deserializedMetricDefinition.dimensions = dimensions; + } else if ("description".equals(fieldName)) { + deserializedMetricDefinition.description = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMetricDefinition.name = reader.getString(); + } else if ("namespace".equals(fieldName)) { + deserializedMetricDefinition.namespace = reader.getString(); + } else if ("primaryAggregationType".equals(fieldName)) { + deserializedMetricDefinition.primaryAggregationType + = AggregationType.fromString(reader.getString()); + } else if ("supportedAggregationTypes".equals(fieldName)) { + List supportedAggregationTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricDefinition.supportedAggregationTypes = supportedAggregationTypes; + } else if ("unit".equals(fieldName)) { + deserializedMetricDefinition.unit = MetricUnit.fromString(reader.getString()); + } else if ("metricAvailabilities".equals(fieldName)) { + List metricAvailabilities + = reader.readArray(reader1 -> MetricAvailability.fromJson(reader1)); + deserializedMetricDefinition.metricAvailabilities = metricAvailabilities; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricDefinition; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinitions.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinitions.java new file mode 100644 index 000000000000..89ea654a672f --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricDefinitions.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents collection of metric definitions. + */ +@Immutable +public final class MetricDefinitions implements JsonSerializable { + /* + * the values for the metric definitions. + */ + @Generated + private final List value; + + /** + * Creates an instance of MetricDefinitions class. + * + * @param value the value value to set. + */ + @Generated + private MetricDefinitions(List value) { + this.value = value; + } + + /** + * Get the value property: the values for the metric definitions. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricDefinitions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricDefinitions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetricDefinitions. + */ + @Generated + public static MetricDefinitions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.readArray(reader1 -> MetricDefinition.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new MetricDefinitions(value); + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespace.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespace.java new file mode 100644 index 000000000000..2f064cde7ff9 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespace.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Metric namespace class specifies the metadata for a metric namespace. + */ +@Immutable +public final class MetricNamespace implements JsonSerializable { + /* + * The namespace description. + */ + @Generated + private String description; + + /* + * The metric namespace name. + */ + @Generated + private String name; + + /** + * Creates an instance of MetricNamespace class. + */ + @Generated + private MetricNamespace() { + } + + /** + * Get the description property: The namespace description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the name property: The metric namespace name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricNamespace from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricNamespace if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricNamespace. + */ + @Generated + public static MetricNamespace fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricNamespace deserializedMetricNamespace = new MetricNamespace(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedMetricNamespace.description = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMetricNamespace.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricNamespace; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespaces.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespaces.java new file mode 100644 index 000000000000..24a06272a82c --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricNamespaces.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents collection of metric namespaces. + */ +@Immutable +public final class MetricNamespaces implements JsonSerializable { + /* + * The values for the metric namespaces. + */ + @Generated + private final List value; + + /** + * Creates an instance of MetricNamespaces class. + * + * @param value the value value to set. + */ + @Generated + private MetricNamespaces(List value) { + this.value = value; + } + + /** + * Get the value property: The values for the metric namespaces. + * + * @return the value value. + */ + @Generated + public List getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricNamespaces from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricNamespaces if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetricNamespaces. + */ + @Generated + public static MetricNamespaces fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List value = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + value = reader.readArray(reader1 -> MetricNamespace.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new MetricNamespaces(value); + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricUnit.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricUnit.java new file mode 100644 index 000000000000..83a787b2aff2 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricUnit.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Metric unit. + */ +public final class MetricUnit extends ExpandableStringEnum { + /** + * No unit specified. + */ + @Generated + public static final MetricUnit NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Percentage. + */ + @Generated + public static final MetricUnit PERCENT = fromString("Percent"); + + /** + * Value count. + */ + @Generated + public static final MetricUnit COUNT = fromString("Count"); + + /** + * Seconds. + */ + @Generated + public static final MetricUnit SECONDS = fromString("Seconds"); + + /** + * Milliseconds. + */ + @Generated + public static final MetricUnit MILLISECONDS = fromString("Milliseconds"); + + /** + * Bytes. + */ + @Generated + public static final MetricUnit BYTES = fromString("Bytes"); + + /** + * Bytes per second. + */ + @Generated + public static final MetricUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** + * Count per second. + */ + @Generated + public static final MetricUnit COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** + * Creates a new instance of MetricUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public MetricUnit() { + } + + /** + * Creates or finds a MetricUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricUnit. + */ + @Generated + public static MetricUnit fromString(String name) { + return fromString(name, MetricUnit.class); + } + + /** + * Gets known MetricUnit values. + * + * @return known MetricUnit values. + */ + @Generated + public static Collection values() { + return values(MetricUnit.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricValue.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricValue.java new file mode 100644 index 000000000000..84b10e65cd28 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricValue.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents a metric value. + */ +@Immutable +public final class MetricValue implements JsonSerializable { + /* + * The timestamp for the metric value in RFC 3339 format. + */ + @Generated + private OffsetDateTime timestamp; + + /* + * The metric value. + */ + @Generated + private Double value; + + /** + * Creates an instance of MetricValue class. + */ + @Generated + private MetricValue() { + } + + /** + * Get the timestamp property: The timestamp for the metric value in RFC 3339 format. + * + * @return the timestamp value. + */ + @Generated + public OffsetDateTime getTimestamp() { + return this.timestamp; + } + + /** + * Get the value property: The metric value. + * + * @return the value value. + */ + @Generated + public Double getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timestamp", + this.timestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timestamp)); + jsonWriter.writeNumberField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricValue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricValue. + */ + @Generated + public static MetricValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricValue deserializedMetricValue = new MetricValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timestamp".equals(fieldName)) { + deserializedMetricValue.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("value".equals(fieldName)) { + deserializedMetricValue.value = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricValue; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricsFilters.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricsFilters.java new file mode 100644 index 000000000000..34a1f019344d --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MetricsFilters.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Filters to fetch the set of metric. + */ +@Fluent +public final class MetricsFilters implements JsonSerializable { + /* + * Get metrics for specific dimension values. Example: Metric contains dimension + * like SamplerName, Error. To retrieve all the time series data where SamplerName + * is equals to HTTPRequest1 or HTTPRequest2, the DimensionFilter value will be + * {"SamplerName", ["HTTPRequest1", "HTTPRequest2"} + */ + @Generated + private List filters; + + /** + * Creates an instance of MetricsFilters class. + */ + @Generated + public MetricsFilters() { + } + + /** + * Get the filters property: Get metrics for specific dimension values. Example: Metric contains dimension + * like SamplerName, Error. To retrieve all the time series data where SamplerName + * is equals to HTTPRequest1 or HTTPRequest2, the DimensionFilter value will be + * {"SamplerName", ["HTTPRequest1", "HTTPRequest2"}. + * + * @return the filters value. + */ + @Generated + public List getFilters() { + return this.filters; + } + + /** + * Set the filters property: Get metrics for specific dimension values. Example: Metric contains dimension + * like SamplerName, Error. To retrieve all the time series data where SamplerName + * is equals to HTTPRequest1 or HTTPRequest2, the DimensionFilter value will be + * {"SamplerName", ["HTTPRequest1", "HTTPRequest2"}. + * + * @param filters the filters value to set. + * @return the MetricsFilters object itself. + */ + @Generated + public MetricsFilters setFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsFilters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsFilters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricsFilters. + */ + @Generated + public static MetricsFilters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsFilters deserializedMetricsFilters = new MetricsFilters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filters".equals(fieldName)) { + List filters = reader.readArray(reader1 -> DimensionFilter.fromJson(reader1)); + deserializedMetricsFilters.filters = filters; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsFilters; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByDates.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByDates.java new file mode 100644 index 000000000000..3fa0753bf666 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByDates.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Recurrence model when frequency is set as MonthlyByDates. + */ +@Fluent +public final class MonthlyRecurrenceByDates extends Recurrence { + /* + * Frequency of the recurrence. + */ + @Generated + private Frequency frequency = Frequency.MONTHLY_BY_DATES; + + /* + * Recurrence set to repeat on the specified dates of the month. Value of dates can be 1 to 31 and -1. -1 represents + * the last day of the month. + */ + @Generated + private List datesInMonth; + + /* + * The interval at which the recurrence should repeat. It signifies the number of months between each recurrence. + */ + @Generated + private Integer interval; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of MonthlyRecurrenceByDates class. + */ + @Generated + public MonthlyRecurrenceByDates() { + } + + /** + * Get the frequency property: Frequency of the recurrence. + * + * @return the frequency value. + */ + @Generated + @Override + public Frequency getFrequency() { + return this.frequency; + } + + /** + * Get the datesInMonth property: Recurrence set to repeat on the specified dates of the month. Value of dates can + * be 1 to 31 and -1. -1 represents the last day of the month. + * + * @return the datesInMonth value. + */ + @Generated + public List getDatesInMonth() { + return this.datesInMonth; + } + + /** + * Set the datesInMonth property: Recurrence set to repeat on the specified dates of the month. Value of dates can + * be 1 to 31 and -1. -1 represents the last day of the month. + * + * @param datesInMonth the datesInMonth value to set. + * @return the MonthlyRecurrenceByDates object itself. + */ + @Generated + public MonthlyRecurrenceByDates setDatesInMonth(List datesInMonth) { + this.datesInMonth = datesInMonth; + this.updatedProperties.add("datesInMonth"); + return this; + } + + /** + * Get the interval property: The interval at which the recurrence should repeat. It signifies the number of months + * between each recurrence. + * + * @return the interval value. + */ + @Generated + public Integer getInterval() { + return this.interval; + } + + /** + * Set the interval property: The interval at which the recurrence should repeat. It signifies the number of months + * between each recurrence. + * + * @param interval the interval value to set. + * @return the MonthlyRecurrenceByDates object itself. + */ + @Generated + public MonthlyRecurrenceByDates setInterval(Integer interval) { + this.interval = interval; + this.updatedProperties.add("interval"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public MonthlyRecurrenceByDates setRecurrenceEnd(RecurrenceEnd recurrenceEnd) { + super.setRecurrenceEnd(recurrenceEnd); + this.updatedProperties.add("recurrenceEnd"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getRecurrenceAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeArrayField("datesInMonth", this.datesInMonth, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeNumberField("interval", this.interval); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("recurrenceEnd")) { + if (getRecurrenceEnd() == null) { + jsonWriter.writeNullField("recurrenceEnd"); + } else { + JsonMergePatchHelper.getRecurrenceEndAccessor().prepareModelForJsonMergePatch(getRecurrenceEnd(), true); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + JsonMergePatchHelper.getRecurrenceEndAccessor() + .prepareModelForJsonMergePatch(getRecurrenceEnd(), false); + } + } + jsonWriter.writeStringField("frequency", this.frequency.toString()); + if (updatedProperties.contains("datesInMonth")) { + if (this.datesInMonth == null) { + jsonWriter.writeNullField("datesInMonth"); + } else { + jsonWriter.writeArrayField("datesInMonth", this.datesInMonth, + (writer, element) -> writer.writeInt(element)); + } + } + if (updatedProperties.contains("interval")) { + if (this.interval == null) { + jsonWriter.writeNullField("interval"); + } else { + jsonWriter.writeNumberField("interval", this.interval); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonthlyRecurrenceByDates from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonthlyRecurrenceByDates if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonthlyRecurrenceByDates. + */ + @Generated + public static MonthlyRecurrenceByDates fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonthlyRecurrenceByDates deserializedMonthlyRecurrenceByDates = new MonthlyRecurrenceByDates(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recurrenceEnd".equals(fieldName)) { + JsonMergePatchHelper.getRecurrenceAccessor() + .setRecurrenceEnd(deserializedMonthlyRecurrenceByDates, RecurrenceEnd.fromJson(reader)); + } else if ("frequency".equals(fieldName)) { + deserializedMonthlyRecurrenceByDates.frequency = Frequency.fromString(reader.getString()); + } else if ("datesInMonth".equals(fieldName)) { + List datesInMonth = reader.readArray(reader1 -> reader1.getInt()); + deserializedMonthlyRecurrenceByDates.datesInMonth = datesInMonth; + } else if ("interval".equals(fieldName)) { + deserializedMonthlyRecurrenceByDates.interval = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMonthlyRecurrenceByDates; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByWeekDays.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByWeekDays.java new file mode 100644 index 000000000000..ab39d7eccad6 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/MonthlyRecurrenceByWeekDays.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Recurrence model when frequency is set as MonthlyByDays . + */ +@Fluent +public final class MonthlyRecurrenceByWeekDays extends Recurrence { + /* + * Frequency of the recurrence. + */ + @Generated + private Frequency frequency = Frequency.MONTHLY_BY_DAYS; + + /* + * Specific days of the week when the recurrence should repeat. + */ + @Generated + private List weekDaysInMonth; + + /* + * Index of the week in a month at which the recurrence should repeat. For example, if the index is '2', weekDay is + * 'Monday', interval is 3 and frequency is 'Month', the recurrence will run every second Monday of the month and + * repeat every 3 months. Value of index can be 1 to 5. + */ + @Generated + private int index; + + /* + * The interval at which the recurrence should repeat. It signifies the number of months between each recurrence. + */ + @Generated + private int interval; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of MonthlyRecurrenceByWeekDays class. + */ + @Generated + public MonthlyRecurrenceByWeekDays() { + } + + /** + * Get the frequency property: Frequency of the recurrence. + * + * @return the frequency value. + */ + @Generated + @Override + public Frequency getFrequency() { + return this.frequency; + } + + /** + * Get the weekDaysInMonth property: Specific days of the week when the recurrence should repeat. + * + * @return the weekDaysInMonth value. + */ + @Generated + public List getWeekDaysInMonth() { + return this.weekDaysInMonth; + } + + /** + * Set the weekDaysInMonth property: Specific days of the week when the recurrence should repeat. + * + * @param weekDaysInMonth the weekDaysInMonth value to set. + * @return the MonthlyRecurrenceByWeekDays object itself. + */ + @Generated + public MonthlyRecurrenceByWeekDays setWeekDaysInMonth(List weekDaysInMonth) { + this.weekDaysInMonth = weekDaysInMonth; + this.updatedProperties.add("weekDaysInMonth"); + return this; + } + + /** + * Get the index property: Index of the week in a month at which the recurrence should repeat. For example, if the + * index is '2', weekDay is 'Monday', interval is 3 and frequency is 'Month', the recurrence will run every second + * Monday of the month and repeat every 3 months. Value of index can be 1 to 5. + * + * @return the index value. + */ + @Generated + public int getIndex() { + return this.index; + } + + /** + * Set the index property: Index of the week in a month at which the recurrence should repeat. For example, if the + * index is '2', weekDay is 'Monday', interval is 3 and frequency is 'Month', the recurrence will run every second + * Monday of the month and repeat every 3 months. Value of index can be 1 to 5. + *

Required when create the resource.

+ * + * @param index the index value to set. + * @return the MonthlyRecurrenceByWeekDays object itself. + */ + @Generated + public MonthlyRecurrenceByWeekDays setIndex(int index) { + this.index = index; + this.updatedProperties.add("index"); + return this; + } + + /** + * Get the interval property: The interval at which the recurrence should repeat. It signifies the number of months + * between each recurrence. + * + * @return the interval value. + */ + @Generated + public int getInterval() { + return this.interval; + } + + /** + * Set the interval property: The interval at which the recurrence should repeat. It signifies the number of months + * between each recurrence. + *

Required when create the resource.

+ * + * @param interval the interval value to set. + * @return the MonthlyRecurrenceByWeekDays object itself. + */ + @Generated + public MonthlyRecurrenceByWeekDays setInterval(int interval) { + this.interval = interval; + this.updatedProperties.add("interval"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public MonthlyRecurrenceByWeekDays setRecurrenceEnd(RecurrenceEnd recurrenceEnd) { + super.setRecurrenceEnd(recurrenceEnd); + this.updatedProperties.add("recurrenceEnd"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getRecurrenceAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeArrayField("weekDaysInMonth", this.weekDaysInMonth, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeIntField("index", this.index); + jsonWriter.writeIntField("interval", this.interval); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("recurrenceEnd")) { + if (getRecurrenceEnd() == null) { + jsonWriter.writeNullField("recurrenceEnd"); + } else { + JsonMergePatchHelper.getRecurrenceEndAccessor().prepareModelForJsonMergePatch(getRecurrenceEnd(), true); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + JsonMergePatchHelper.getRecurrenceEndAccessor() + .prepareModelForJsonMergePatch(getRecurrenceEnd(), false); + } + } + jsonWriter.writeStringField("frequency", this.frequency.toString()); + if (updatedProperties.contains("weekDaysInMonth")) { + if (this.weekDaysInMonth == null) { + jsonWriter.writeNullField("weekDaysInMonth"); + } else { + jsonWriter.writeArrayField("weekDaysInMonth", this.weekDaysInMonth, + (writer, element) -> writer.writeString(element.toString())); + } + } + if (updatedProperties.contains("index")) { + jsonWriter.writeIntField("index", this.index); + } + if (updatedProperties.contains("interval")) { + jsonWriter.writeIntField("interval", this.interval); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonthlyRecurrenceByWeekDays from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonthlyRecurrenceByWeekDays if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MonthlyRecurrenceByWeekDays. + */ + @Generated + public static MonthlyRecurrenceByWeekDays fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonthlyRecurrenceByWeekDays deserializedMonthlyRecurrenceByWeekDays = new MonthlyRecurrenceByWeekDays(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recurrenceEnd".equals(fieldName)) { + JsonMergePatchHelper.getRecurrenceAccessor() + .setRecurrenceEnd(deserializedMonthlyRecurrenceByWeekDays, RecurrenceEnd.fromJson(reader)); + } else if ("frequency".equals(fieldName)) { + deserializedMonthlyRecurrenceByWeekDays.frequency = Frequency.fromString(reader.getString()); + } else if ("weekDaysInMonth".equals(fieldName)) { + List weekDaysInMonth + = reader.readArray(reader1 -> WeekDays.fromString(reader1.getString())); + deserializedMonthlyRecurrenceByWeekDays.weekDaysInMonth = weekDaysInMonth; + } else if ("index".equals(fieldName)) { + deserializedMonthlyRecurrenceByWeekDays.index = reader.getInt(); + } else if ("interval".equals(fieldName)) { + deserializedMonthlyRecurrenceByWeekDays.interval = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonthlyRecurrenceByWeekDays; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NameAndDescription.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NameAndDescription.java new file mode 100644 index 000000000000..5a1f27c8385f --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NameAndDescription.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The name and description. + */ +@Immutable +public final class NameAndDescription implements JsonSerializable { + /* + * The description + */ + @Generated + private String description; + + /* + * The name + */ + @Generated + private String name; + + /** + * Creates an instance of NameAndDescription class. + */ + @Generated + private NameAndDescription() { + } + + /** + * Get the description property: The description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameAndDescription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameAndDescription if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NameAndDescription. + */ + @Generated + public static NameAndDescription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameAndDescription deserializedNameAndDescription = new NameAndDescription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedNameAndDescription.description = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNameAndDescription.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameAndDescription; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationEventType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationEventType.java new file mode 100644 index 000000000000..c05c9e073539 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationEventType.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Notification event type. + */ +public final class NotificationEventType extends ExpandableStringEnum { + /** + * Test run ended event. This event would occur when a test run reaches terminal state. + */ + @Generated + public static final NotificationEventType TEST_RUN_ENDED = fromString("TestRunEnded"); + + /** + * Test run started event. This event would occur when a new test run is triggered. + */ + @Generated + public static final NotificationEventType TEST_RUN_STARTED = fromString("TestRunStarted"); + + /** + * Trigger completed event. This event would occur when a trigger completes. + */ + @Generated + public static final NotificationEventType TRIGGER_COMPLETED = fromString("TriggerCompleted"); + + /** + * Trigger disabled event. This event would occur when a trigger is disabled. + */ + @Generated + public static final NotificationEventType TRIGGER_DISABLED = fromString("TriggerDisabled"); + + /** + * Creates a new instance of NotificationEventType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public NotificationEventType() { + } + + /** + * Creates or finds a NotificationEventType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NotificationEventType. + */ + @Generated + public static NotificationEventType fromString(String name) { + return fromString(name, NotificationEventType.class); + } + + /** + * Gets known NotificationEventType values. + * + * @return known NotificationEventType values. + */ + @Generated + public static Collection values() { + return values(NotificationEventType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationRule.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationRule.java new file mode 100644 index 000000000000..1e4a06871257 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationRule.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Notification rule model. + */ +@Fluent +public class NotificationRule implements JsonSerializable { + /* + * The scope of the notification rule. + */ + @Generated + private NotificationScopeType scope = NotificationScopeType.fromString("NotificationRule"); + + /* + * The unique identifier of the notification rule. + */ + @Generated + private String notificationRuleId; + + /* + * The name of the notification rule. + */ + @Generated + private String displayName; + + /* + * The action groups to notify. + */ + @Generated + private List actionGroupIds; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setNotificationRuleAccessor(new JsonMergePatchHelper.NotificationRuleAccessor() { + @Override + public NotificationRule prepareModelForJsonMergePatch(NotificationRule model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(NotificationRule model) { + return model.jsonMergePatch; + } + + @Override + public void setNotificationRuleId(NotificationRule model, String notificationRuleId) { + model.notificationRuleId = notificationRuleId; + } + + @Override + public void setDisplayName(NotificationRule model, String displayName) { + model.displayName = displayName; + } + + @Override + public void setActionGroupIds(NotificationRule model, List actionGroupIds) { + model.actionGroupIds = actionGroupIds; + } + + @Override + public void setCreatedDateTime(NotificationRule model, OffsetDateTime createdDateTime) { + model.createdDateTime = createdDateTime; + } + + @Override + public void setCreatedBy(NotificationRule model, String createdBy) { + model.createdBy = createdBy; + } + + @Override + public void setLastModifiedDateTime(NotificationRule model, OffsetDateTime lastModifiedDateTime) { + model.lastModifiedDateTime = lastModifiedDateTime; + } + + @Override + public void setLastModifiedBy(NotificationRule model, String lastModifiedBy) { + model.lastModifiedBy = lastModifiedBy; + } + }); + } + + /** + * Creates an instance of NotificationRule class. + */ + @Generated + public NotificationRule() { + } + + /** + * Get the scope property: The scope of the notification rule. + * + * @return the scope value. + */ + @Generated + public NotificationScopeType getScope() { + return this.scope; + } + + /** + * Get the notificationRuleId property: The unique identifier of the notification rule. + * + * @return the notificationRuleId value. + */ + @Generated + public String getNotificationRuleId() { + return this.notificationRuleId; + } + + /** + * Get the displayName property: The name of the notification rule. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: The name of the notification rule. + *

Required when create the resource.

+ * + * @param displayName the displayName value to set. + * @return the NotificationRule object itself. + */ + @Generated + public NotificationRule setDisplayName(String displayName) { + this.displayName = displayName; + this.updatedProperties.add("displayName"); + return this; + } + + /** + * Get the actionGroupIds property: The action groups to notify. + * + * @return the actionGroupIds value. + */ + @Generated + public List getActionGroupIds() { + return this.actionGroupIds; + } + + /** + * Set the actionGroupIds property: The action groups to notify. + *

Required when create the resource.

+ * + * @param actionGroupIds the actionGroupIds value to set. + * @return the NotificationRule object itself. + */ + @Generated + public NotificationRule setActionGroupIds(List actionGroupIds) { + this.actionGroupIds = actionGroupIds; + this.updatedProperties.add("actionGroupIds"); + return this; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("actionGroupIds", this.actionGroupIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", this.scope.toString()); + if (updatedProperties.contains("displayName")) { + if (this.displayName == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", this.displayName); + } + } + if (updatedProperties.contains("actionGroupIds")) { + if (this.actionGroupIds == null) { + jsonWriter.writeNullField("actionGroupIds"); + } else { + jsonWriter.writeArrayField("actionGroupIds", this.actionGroupIds, + (writer, element) -> writer.writeString(element)); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NotificationRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NotificationRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NotificationRule. + */ + @Generated + public static NotificationRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("scope".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Tests".equals(discriminatorValue)) { + return TestsNotificationRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static NotificationRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NotificationRule deserializedNotificationRule = new NotificationRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationRuleId".equals(fieldName)) { + deserializedNotificationRule.notificationRuleId = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedNotificationRule.scope = NotificationScopeType.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedNotificationRule.displayName = reader.getString(); + } else if ("actionGroupIds".equals(fieldName)) { + List actionGroupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedNotificationRule.actionGroupIds = actionGroupIds; + } else if ("createdDateTime".equals(fieldName)) { + deserializedNotificationRule.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedNotificationRule.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedNotificationRule.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedNotificationRule.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNotificationRule; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationScopeType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationScopeType.java new file mode 100644 index 000000000000..de0414824bdf --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/NotificationScopeType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Scope type of a notification rule. + */ +public final class NotificationScopeType extends ExpandableStringEnum { + /** + * Notification rule is for Tests. + */ + @Generated + public static final NotificationScopeType TESTS = fromString("Tests"); + + /** + * Creates a new instance of NotificationScopeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public NotificationScopeType() { + } + + /** + * Creates or finds a NotificationScopeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NotificationScopeType. + */ + @Generated + public static NotificationScopeType fromString(String name) { + return fromString(name, NotificationScopeType.class); + } + + /** + * Gets known NotificationScopeType values. + * + * @return known NotificationScopeType values. + */ + @Generated + public static Collection values() { + return values(NotificationScopeType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationKind.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationKind.java new file mode 100644 index 000000000000..76197757e143 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Kind of the long running operation. + */ +public final class OperationKind extends ExpandableStringEnum { + /** + * Operation represents a clone test operation. + */ + @Generated + public static final OperationKind CLONE_TEST = fromString("CloneTest"); + + /** + * Creates a new instance of OperationKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationKind() { + } + + /** + * Creates or finds a OperationKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationKind. + */ + @Generated + public static OperationKind fromString(String name) { + return fromString(name, OperationKind.class); + } + + /** + * Gets known OperationKind values. + * + * @return known OperationKind values. + */ + @Generated + public static Collection values() { + return values(OperationKind.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationState.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationState.java new file mode 100644 index 000000000000..385cd9b3a169 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationState.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum describing allowed operation states. + */ +public final class OperationState extends ExpandableStringEnum { + /** + * The operation has not started. + */ + @Generated + public static final OperationState NOT_STARTED = fromString("NotStarted"); + + /** + * The operation is in progress. + */ + @Generated + public static final OperationState RUNNING = fromString("Running"); + + /** + * The operation has completed successfully. + */ + @Generated + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + @Generated + public static final OperationState FAILED = fromString("Failed"); + + /** + * The operation has been canceled by the user. + */ + @Generated + public static final OperationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + @Generated + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + @Generated + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationStatus.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationStatus.java new file mode 100644 index 000000000000..cdcf5e1fcb31 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OperationStatus.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Status of a long running operation. + */ +@Immutable +public final class OperationStatus implements JsonSerializable { + /* + * The state of the operation. + */ + @Generated + private final OperationState status; + + /* + * The kind of the operation. + */ + @Generated + private final OperationKind kind; + + /* + * Error object that describes the error when status is "Failed". + */ + @Generated + private ResponseError error; + + /* + * The unique ID of the operation. + */ + @Generated + private String id; + + /** + * Creates an instance of OperationStatus class. + * + * @param status the status value to set. + * @param kind the kind value to set. + */ + @Generated + private OperationStatus(OperationState status, OperationKind kind) { + this.status = status; + this.kind = kind; + } + + /** + * Get the status property: The state of the operation. + * + * @return the status value. + */ + @Generated + public OperationState getStatus() { + return this.status; + } + + /** + * Get the kind property: The kind of the operation. + * + * @return the kind value. + */ + @Generated + public OperationKind getKind() { + return this.kind; + } + + /** + * Get the error property: Error object that describes the error when status is "Failed". + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } + + /** + * Get the id property: The unique ID of the operation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatus. + */ + @Generated + public static OperationStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationState status = null; + OperationKind kind = null; + String id = null; + ResponseError error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + status = OperationState.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + kind = OperationKind.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("error".equals(fieldName)) { + error = ResponseError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + OperationStatus deserializedOperationStatus = new OperationStatus(status, kind); + deserializedOperationStatus.id = id; + deserializedOperationStatus.error = error; + + return deserializedOperationStatus; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OptionalLoadTestConfiguration.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OptionalLoadTestConfiguration.java new file mode 100644 index 000000000000..d9cb9d2a380b --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/OptionalLoadTestConfiguration.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.HashSet; +import java.util.Set; + +/** + * Configuration for quick load test. + */ +@Fluent +public final class OptionalLoadTestConfiguration implements JsonSerializable { + /* + * Test URL. Provide the complete HTTP URL. For example, https://contoso-app.azurewebsites.net/login + */ + @Generated + private String endpointUrl; + + /* + * Target throughput (requests per second). This may not be necessarily achieved. The actual throughput will be + * lower if the application is not capable of handling it. + */ + @Generated + private Integer requestsPerSecond; + + /* + * Maximum response time in milliseconds of the API/endpoint. + */ + @Generated + private Integer maxResponseTimeInMs; + + /* + * No of concurrent virtual users. + */ + @Generated + private Integer virtualUsers; + + /* + * Ramp up time in seconds. + */ + @Generated + private Integer rampUpTime; + + /* + * Test run duration in seconds. + */ + @Generated + private Long duration; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper + .setOptionalLoadTestConfigurationAccessor(new JsonMergePatchHelper.OptionalLoadTestConfigurationAccessor() { + @Override + public OptionalLoadTestConfiguration prepareModelForJsonMergePatch(OptionalLoadTestConfiguration model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(OptionalLoadTestConfiguration model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of OptionalLoadTestConfiguration class. + */ + @Generated + public OptionalLoadTestConfiguration() { + } + + /** + * Get the endpointUrl property: Test URL. Provide the complete HTTP URL. For example, + * https://contoso-app.azurewebsites.net/login. + * + * @return the endpointUrl value. + */ + @Generated + public String getEndpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl property: Test URL. Provide the complete HTTP URL. For example, + * https://contoso-app.azurewebsites.net/login. + * + * @param endpointUrl the endpointUrl value to set. + * @return the OptionalLoadTestConfiguration object itself. + */ + @Generated + public OptionalLoadTestConfiguration setEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + this.updatedProperties.add("endpointUrl"); + return this; + } + + /** + * Get the requestsPerSecond property: Target throughput (requests per second). This may not be necessarily + * achieved. The actual throughput will be lower if the application is not capable of handling it. + * + * @return the requestsPerSecond value. + */ + @Generated + public Integer getRequestsPerSecond() { + return this.requestsPerSecond; + } + + /** + * Set the requestsPerSecond property: Target throughput (requests per second). This may not be necessarily + * achieved. The actual throughput will be lower if the application is not capable of handling it. + * + * @param requestsPerSecond the requestsPerSecond value to set. + * @return the OptionalLoadTestConfiguration object itself. + */ + @Generated + public OptionalLoadTestConfiguration setRequestsPerSecond(Integer requestsPerSecond) { + this.requestsPerSecond = requestsPerSecond; + this.updatedProperties.add("requestsPerSecond"); + return this; + } + + /** + * Get the maxResponseTimeInMs property: Maximum response time in milliseconds of the API/endpoint. + * + * @return the maxResponseTimeInMs value. + */ + @Generated + public Integer getMaxResponseTimeInMs() { + return this.maxResponseTimeInMs; + } + + /** + * Set the maxResponseTimeInMs property: Maximum response time in milliseconds of the API/endpoint. + * + * @param maxResponseTimeInMs the maxResponseTimeInMs value to set. + * @return the OptionalLoadTestConfiguration object itself. + */ + @Generated + public OptionalLoadTestConfiguration setMaxResponseTimeInMs(Integer maxResponseTimeInMs) { + this.maxResponseTimeInMs = maxResponseTimeInMs; + this.updatedProperties.add("maxResponseTimeInMs"); + return this; + } + + /** + * Get the virtualUsers property: No of concurrent virtual users. + * + * @return the virtualUsers value. + */ + @Generated + public Integer getVirtualUsers() { + return this.virtualUsers; + } + + /** + * Set the virtualUsers property: No of concurrent virtual users. + * + * @param virtualUsers the virtualUsers value to set. + * @return the OptionalLoadTestConfiguration object itself. + */ + @Generated + public OptionalLoadTestConfiguration setVirtualUsers(Integer virtualUsers) { + this.virtualUsers = virtualUsers; + this.updatedProperties.add("virtualUsers"); + return this; + } + + /** + * Get the rampUpTime property: Ramp up time in seconds. + * + * @return the rampUpTime value. + */ + @Generated + public Integer getRampUpTime() { + return this.rampUpTime; + } + + /** + * Set the rampUpTime property: Ramp up time in seconds. + * + * @param rampUpTime the rampUpTime value to set. + * @return the OptionalLoadTestConfiguration object itself. + */ + @Generated + public OptionalLoadTestConfiguration setRampUpTime(Integer rampUpTime) { + this.rampUpTime = rampUpTime; + this.updatedProperties.add("rampUpTime"); + return this; + } + + /** + * Get the duration property: Test run duration in seconds. + * + * @return the duration value. + */ + @Generated + public Duration getDuration() { + if (this.duration == null) { + return null; + } + return Duration.ofSeconds(this.duration); + } + + /** + * Set the duration property: Test run duration in seconds. + * + * @param duration the duration value to set. + * @return the OptionalLoadTestConfiguration object itself. + */ + @Generated + public OptionalLoadTestConfiguration setDuration(Duration duration) { + if (duration == null) { + this.duration = null; + } else { + this.duration = duration.getSeconds(); + } + this.updatedProperties.add("duration"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpointUrl", this.endpointUrl); + jsonWriter.writeNumberField("requestsPerSecond", this.requestsPerSecond); + jsonWriter.writeNumberField("maxResponseTimeInMs", this.maxResponseTimeInMs); + jsonWriter.writeNumberField("virtualUsers", this.virtualUsers); + jsonWriter.writeNumberField("rampUpTime", this.rampUpTime); + jsonWriter.writeNumberField("duration", this.duration); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("endpointUrl")) { + if (this.endpointUrl == null) { + jsonWriter.writeNullField("endpointUrl"); + } else { + jsonWriter.writeStringField("endpointUrl", this.endpointUrl); + } + } + if (updatedProperties.contains("requestsPerSecond")) { + if (this.requestsPerSecond == null) { + jsonWriter.writeNullField("requestsPerSecond"); + } else { + jsonWriter.writeNumberField("requestsPerSecond", this.requestsPerSecond); + } + } + if (updatedProperties.contains("maxResponseTimeInMs")) { + if (this.maxResponseTimeInMs == null) { + jsonWriter.writeNullField("maxResponseTimeInMs"); + } else { + jsonWriter.writeNumberField("maxResponseTimeInMs", this.maxResponseTimeInMs); + } + } + if (updatedProperties.contains("virtualUsers")) { + if (this.virtualUsers == null) { + jsonWriter.writeNullField("virtualUsers"); + } else { + jsonWriter.writeNumberField("virtualUsers", this.virtualUsers); + } + } + if (updatedProperties.contains("rampUpTime")) { + if (this.rampUpTime == null) { + jsonWriter.writeNullField("rampUpTime"); + } else { + jsonWriter.writeNumberField("rampUpTime", this.rampUpTime); + } + } + if (updatedProperties.contains("duration")) { + if (this.duration == null) { + jsonWriter.writeNullField("duration"); + } else { + jsonWriter.writeNumberField("duration", this.duration); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptionalLoadTestConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptionalLoadTestConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OptionalLoadTestConfiguration. + */ + @Generated + public static OptionalLoadTestConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptionalLoadTestConfiguration deserializedOptionalLoadTestConfiguration + = new OptionalLoadTestConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpointUrl".equals(fieldName)) { + deserializedOptionalLoadTestConfiguration.endpointUrl = reader.getString(); + } else if ("requestsPerSecond".equals(fieldName)) { + deserializedOptionalLoadTestConfiguration.requestsPerSecond + = reader.getNullable(JsonReader::getInt); + } else if ("maxResponseTimeInMs".equals(fieldName)) { + deserializedOptionalLoadTestConfiguration.maxResponseTimeInMs + = reader.getNullable(JsonReader::getInt); + } else if ("virtualUsers".equals(fieldName)) { + deserializedOptionalLoadTestConfiguration.virtualUsers = reader.getNullable(JsonReader::getInt); + } else if ("rampUpTime".equals(fieldName)) { + deserializedOptionalLoadTestConfiguration.rampUpTime = reader.getNullable(JsonReader::getInt); + } else if ("duration".equals(fieldName)) { + deserializedOptionalLoadTestConfiguration.duration = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedOptionalLoadTestConfiguration; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAction.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAction.java new file mode 100644 index 000000000000..6ce318f6fc44 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAction.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Action to take on failure of pass/fail criteria. + */ +public final class PassFailAction extends ExpandableStringEnum { + /** + * Test will continue to run even if pass fail metric criteria metric gets failed. + */ + @Generated + public static final PassFailAction CONTINUE = fromString("continue"); + + /** + * Test run will stop if pass fail criteria metric is not passed. + */ + @Generated + public static final PassFailAction STOP = fromString("stop"); + + /** + * Creates a new instance of PassFailAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public PassFailAction() { + } + + /** + * Creates or finds a PassFailAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding PassFailAction. + */ + @Generated + public static PassFailAction fromString(String name) { + return fromString(name, PassFailAction.class); + } + + /** + * Gets known PassFailAction values. + * + * @return known PassFailAction values. + */ + @Generated + public static Collection values() { + return values(PassFailAction.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAggregationFunction.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAggregationFunction.java new file mode 100644 index 000000000000..cc9c29450148 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailAggregationFunction.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Aggregation functions for pass/fail criteria. + */ +public final class PassFailAggregationFunction extends ExpandableStringEnum { + /** + * Criteria applies for count value. + */ + @Generated + public static final PassFailAggregationFunction COUNT = fromString("count"); + + /** + * Criteria applies for given percentage value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTAGE = fromString("percentage"); + + /** + * Criteria applies for avg value. + */ + @Generated + public static final PassFailAggregationFunction AVERAGE = fromString("avg"); + + /** + * Criteria applies for 50th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE50 = fromString("p50"); + + /** + * Criteria applies for 75th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE75 = fromString("p75"); + + /** + * Criteria applies for 90th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE90 = fromString("p90"); + + /** + * Criteria applies for 95th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE95 = fromString("p95"); + + /** + * Criteria applies for 96th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE96 = fromString("p96"); + + /** + * Criteria applies for 97th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE97 = fromString("p97"); + + /** + * Criteria applies for 98th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE98 = fromString("p98"); + + /** + * Criteria applies for 99th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE99 = fromString("p99"); + + /** + * Criteria applies for 99.9th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE999 = fromString("p99.9"); + + /** + * Criteria applies for 99.99th percentile value. + */ + @Generated + public static final PassFailAggregationFunction PERCENTILE9999 = fromString("p99.99"); + + /** + * Criteria applies for minimum value. + */ + @Generated + public static final PassFailAggregationFunction MINIMUM = fromString("min"); + + /** + * Criteria applies for maximum value. + */ + @Generated + public static final PassFailAggregationFunction MAXIMUM = fromString("max"); + + /** + * Creates a new instance of PassFailAggregationFunction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public PassFailAggregationFunction() { + } + + /** + * Creates or finds a PassFailAggregationFunction from its string representation. + * + * @param name a name to look for. + * @return the corresponding PassFailAggregationFunction. + */ + @Generated + public static PassFailAggregationFunction fromString(String name) { + return fromString(name, PassFailAggregationFunction.class); + } + + /** + * Gets known PassFailAggregationFunction values. + * + * @return known PassFailAggregationFunction values. + */ + @Generated + public static Collection values() { + return values(PassFailAggregationFunction.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailCriteria.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailCriteria.java new file mode 100644 index 000000000000..94e073540365 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailCriteria.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Pass fail criteria for a test. + */ +@Fluent +public final class PassFailCriteria implements JsonSerializable { + /* + * Map of id and pass fail metrics { id : pass fail metrics }. + */ + @Generated + private Map passFailMetrics; + + /* + * Map of id and pass fail server metrics { id : pass fail metrics }. + */ + @Generated + private Map passFailServerMetrics; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setPassFailCriteriaAccessor(new JsonMergePatchHelper.PassFailCriteriaAccessor() { + @Override + public PassFailCriteria prepareModelForJsonMergePatch(PassFailCriteria model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(PassFailCriteria model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of PassFailCriteria class. + */ + @Generated + public PassFailCriteria() { + } + + /** + * Get the passFailMetrics property: Map of id and pass fail metrics { id : pass fail metrics }. + * + * @return the passFailMetrics value. + */ + @Generated + public Map getPassFailMetrics() { + return this.passFailMetrics; + } + + /** + * Set the passFailMetrics property: Map of id and pass fail metrics { id : pass fail metrics }. + * + * @param passFailMetrics the passFailMetrics value to set. + * @return the PassFailCriteria object itself. + */ + @Generated + public PassFailCriteria setPassFailMetrics(Map passFailMetrics) { + this.passFailMetrics = passFailMetrics; + this.updatedProperties.add("passFailMetrics"); + return this; + } + + /** + * Get the passFailServerMetrics property: Map of id and pass fail server metrics { id : pass fail metrics }. + * + * @return the passFailServerMetrics value. + */ + @Generated + public Map getPassFailServerMetrics() { + return this.passFailServerMetrics; + } + + /** + * Set the passFailServerMetrics property: Map of id and pass fail server metrics { id : pass fail metrics }. + * + * @param passFailServerMetrics the passFailServerMetrics value to set. + * @return the PassFailCriteria object itself. + */ + @Generated + public PassFailCriteria setPassFailServerMetrics(Map passFailServerMetrics) { + this.passFailServerMetrics = passFailServerMetrics; + this.updatedProperties.add("passFailServerMetrics"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("passFailMetrics", this.passFailMetrics, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("passFailServerMetrics", this.passFailServerMetrics, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("passFailMetrics")) { + if (this.passFailMetrics == null) { + jsonWriter.writeNullField("passFailMetrics"); + } else { + jsonWriter.writeMapField("passFailMetrics", this.passFailMetrics, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getPassFailMetricAccessor().prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getPassFailMetricAccessor().prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + if (updatedProperties.contains("passFailServerMetrics")) { + if (this.passFailServerMetrics == null) { + jsonWriter.writeNullField("passFailServerMetrics"); + } else { + jsonWriter.writeMapField("passFailServerMetrics", this.passFailServerMetrics, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getPassFailServerMetricAccessor() + .prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getPassFailServerMetricAccessor() + .prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PassFailCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PassFailCriteria if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PassFailCriteria. + */ + @Generated + public static PassFailCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PassFailCriteria deserializedPassFailCriteria = new PassFailCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("passFailMetrics".equals(fieldName)) { + Map passFailMetrics + = reader.readMap(reader1 -> PassFailMetric.fromJson(reader1)); + deserializedPassFailCriteria.passFailMetrics = passFailMetrics; + } else if ("passFailServerMetrics".equals(fieldName)) { + Map passFailServerMetrics + = reader.readMap(reader1 -> PassFailServerMetric.fromJson(reader1)); + deserializedPassFailCriteria.passFailServerMetrics = passFailServerMetrics; + } else { + reader.skipChildren(); + } + } + + return deserializedPassFailCriteria; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailMetric.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailMetric.java new file mode 100644 index 000000000000..d2281c9bf0e2 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailMetric.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Pass fail metric. + */ +@Fluent +public final class PassFailMetric implements JsonSerializable { + /* + * The client metric on which the criteria should be applied. + */ + @Generated + private PfMetrics clientMetric; + + /* + * The aggregation function to be applied on the client metric. Allowed functions + * - ‘percentage’ - for error metric , ‘avg’, percentiles like ‘p50’, ‘p90’, & so on, ‘min’, + * ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, + * ‘count’ - for requests + */ + @Generated + private PassFailAggregationFunction aggregate; + + /* + * The comparison operator. Supported types ‘>’, ‘<’ + */ + @Generated + private String condition; + + /* + * Request name for which the Pass fail criteria has to be applied + */ + @Generated + private String requestName; + + /* + * The value to compare with the client metric. Allowed values - ‘error : [0.0 , + * 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. + */ + @Generated + private Double value; + + /* + * Action taken after the threshold is met. Default is ‘continue’. + */ + @Generated + private PassFailAction action; + + /* + * The actual value of the client metric for the test run. + */ + @Generated + private Double actualValue; + + /* + * Outcome of the test run. + */ + @Generated + private PassFailResult result; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setPassFailMetricAccessor(new JsonMergePatchHelper.PassFailMetricAccessor() { + @Override + public PassFailMetric prepareModelForJsonMergePatch(PassFailMetric model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(PassFailMetric model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of PassFailMetric class. + */ + @Generated + public PassFailMetric() { + } + + /** + * Get the clientMetric property: The client metric on which the criteria should be applied. + * + * @return the clientMetric value. + */ + @Generated + public PfMetrics getClientMetric() { + return this.clientMetric; + } + + /** + * Set the clientMetric property: The client metric on which the criteria should be applied. + * + * @param clientMetric the clientMetric value to set. + * @return the PassFailMetric object itself. + */ + @Generated + public PassFailMetric setClientMetric(PfMetrics clientMetric) { + this.clientMetric = clientMetric; + this.updatedProperties.add("clientMetric"); + return this; + } + + /** + * Get the aggregate property: The aggregation function to be applied on the client metric. Allowed functions + * - ‘percentage’ - for error metric , ‘avg’, percentiles like ‘p50’, ‘p90’, & so on, ‘min’, + * ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, + * ‘count’ - for requests. + * + * @return the aggregate value. + */ + @Generated + public PassFailAggregationFunction getAggregate() { + return this.aggregate; + } + + /** + * Set the aggregate property: The aggregation function to be applied on the client metric. Allowed functions + * - ‘percentage’ - for error metric , ‘avg’, percentiles like ‘p50’, ‘p90’, & so on, ‘min’, + * ‘max’ - for response_time_ms and latency metric, ‘avg’ - for requests_per_sec, + * ‘count’ - for requests. + * + * @param aggregate the aggregate value to set. + * @return the PassFailMetric object itself. + */ + @Generated + public PassFailMetric setAggregate(PassFailAggregationFunction aggregate) { + this.aggregate = aggregate; + this.updatedProperties.add("aggregate"); + return this; + } + + /** + * Get the condition property: The comparison operator. Supported types ‘>’, ‘<’. + * + * @return the condition value. + */ + @Generated + public String getCondition() { + return this.condition; + } + + /** + * Set the condition property: The comparison operator. Supported types ‘>’, ‘<’. + * + * @param condition the condition value to set. + * @return the PassFailMetric object itself. + */ + @Generated + public PassFailMetric setCondition(String condition) { + this.condition = condition; + this.updatedProperties.add("condition"); + return this; + } + + /** + * Get the requestName property: Request name for which the Pass fail criteria has to be applied. + * + * @return the requestName value. + */ + @Generated + public String getRequestName() { + return this.requestName; + } + + /** + * Set the requestName property: Request name for which the Pass fail criteria has to be applied. + * + * @param requestName the requestName value to set. + * @return the PassFailMetric object itself. + */ + @Generated + public PassFailMetric setRequestName(String requestName) { + this.requestName = requestName; + this.updatedProperties.add("requestName"); + return this; + } + + /** + * Get the value property: The value to compare with the client metric. Allowed values - ‘error : [0.0 , + * 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. + * + * @return the value value. + */ + @Generated + public Double getValue() { + return this.value; + } + + /** + * Set the value property: The value to compare with the client metric. Allowed values - ‘error : [0.0 , + * 100.0] unit- % ’, response_time_ms and latency : any integer value unit- ms. + * + * @param value the value value to set. + * @return the PassFailMetric object itself. + */ + @Generated + public PassFailMetric setValue(Double value) { + this.value = value; + this.updatedProperties.add("value"); + return this; + } + + /** + * Get the action property: Action taken after the threshold is met. Default is ‘continue’. + * + * @return the action value. + */ + @Generated + public PassFailAction getAction() { + return this.action; + } + + /** + * Set the action property: Action taken after the threshold is met. Default is ‘continue’. + * + * @param action the action value to set. + * @return the PassFailMetric object itself. + */ + @Generated + public PassFailMetric setAction(PassFailAction action) { + this.action = action; + this.updatedProperties.add("action"); + return this; + } + + /** + * Get the actualValue property: The actual value of the client metric for the test run. + * + * @return the actualValue value. + */ + @Generated + public Double getActualValue() { + return this.actualValue; + } + + /** + * Get the result property: Outcome of the test run. + * + * @return the result value. + */ + @Generated + public PassFailResult getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientMetric", + this.clientMetric == null ? null : this.clientMetric.toString()); + jsonWriter.writeStringField("aggregate", this.aggregate == null ? null : this.aggregate.toString()); + jsonWriter.writeStringField("condition", this.condition); + jsonWriter.writeStringField("requestName", this.requestName); + jsonWriter.writeNumberField("value", this.value); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("clientMetric")) { + if (this.clientMetric == null) { + jsonWriter.writeNullField("clientMetric"); + } else { + jsonWriter.writeStringField("clientMetric", this.clientMetric.toString()); + } + } + if (updatedProperties.contains("aggregate")) { + if (this.aggregate == null) { + jsonWriter.writeNullField("aggregate"); + } else { + jsonWriter.writeStringField("aggregate", this.aggregate.toString()); + } + } + if (updatedProperties.contains("condition")) { + if (this.condition == null) { + jsonWriter.writeNullField("condition"); + } else { + jsonWriter.writeStringField("condition", this.condition); + } + } + if (updatedProperties.contains("requestName")) { + if (this.requestName == null) { + jsonWriter.writeNullField("requestName"); + } else { + jsonWriter.writeStringField("requestName", this.requestName); + } + } + if (updatedProperties.contains("value")) { + if (this.value == null) { + jsonWriter.writeNullField("value"); + } else { + jsonWriter.writeNumberField("value", this.value); + } + } + if (updatedProperties.contains("action")) { + if (this.action == null) { + jsonWriter.writeNullField("action"); + } else { + jsonWriter.writeStringField("action", this.action.toString()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PassFailMetric from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PassFailMetric if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PassFailMetric. + */ + @Generated + public static PassFailMetric fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PassFailMetric deserializedPassFailMetric = new PassFailMetric(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientMetric".equals(fieldName)) { + deserializedPassFailMetric.clientMetric = PfMetrics.fromString(reader.getString()); + } else if ("aggregate".equals(fieldName)) { + deserializedPassFailMetric.aggregate = PassFailAggregationFunction.fromString(reader.getString()); + } else if ("condition".equals(fieldName)) { + deserializedPassFailMetric.condition = reader.getString(); + } else if ("requestName".equals(fieldName)) { + deserializedPassFailMetric.requestName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedPassFailMetric.value = reader.getNullable(JsonReader::getDouble); + } else if ("action".equals(fieldName)) { + deserializedPassFailMetric.action = PassFailAction.fromString(reader.getString()); + } else if ("actualValue".equals(fieldName)) { + deserializedPassFailMetric.actualValue = reader.getNullable(JsonReader::getDouble); + } else if ("result".equals(fieldName)) { + deserializedPassFailMetric.result = PassFailResult.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPassFailMetric; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailResult.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailResult.java new file mode 100644 index 000000000000..6bf021cf23d1 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailResult.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Pass/fail criteria result. + */ +public final class PassFailResult extends ExpandableStringEnum { + /** + * Given pass fail criteria metric has passed. + */ + @Generated + public static final PassFailResult PASSED = fromString("passed"); + + /** + * Given pass fail criteria metric couldn't determine. + */ + @Generated + public static final PassFailResult UNDETERMINED = fromString("undetermined"); + + /** + * Given pass fail criteria metric has failed. + */ + @Generated + public static final PassFailResult FAILED = fromString("failed"); + + /** + * Creates a new instance of PassFailResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public PassFailResult() { + } + + /** + * Creates or finds a PassFailResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding PassFailResult. + */ + @Generated + public static PassFailResult fromString(String name) { + return fromString(name, PassFailResult.class); + } + + /** + * Gets known PassFailResult values. + * + * @return known PassFailResult values. + */ + @Generated + public static Collection values() { + return values(PassFailResult.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailServerMetric.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailServerMetric.java new file mode 100644 index 000000000000..426014cbe369 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailServerMetric.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Pass fail server metric. + */ +@Fluent +public final class PassFailServerMetric implements JsonSerializable { + /* + * The resource id of the resource emitting the metric. + */ + @Generated + private String resourceId; + + /* + * The server metric namespace. + */ + @Generated + private String metricNamespace; + + /* + * The server metric name. + */ + @Generated + private String metricName; + + /* + * Aggregation Type + */ + @Generated + private String aggregation; + + /* + * The comparison operator. Supported types ‘>’, ‘<’ + */ + @Generated + private String condition; + + /* + * The value to compare with the server metric. + */ + @Generated + private double value; + + /* + * Action taken after the threshold is met. Default is ‘continue’. + */ + @Generated + private PassFailAction action; + + /* + * The actual value of the server metric + */ + @Generated + private Double actualValue; + + /* + * Outcome of the test run. + */ + @Generated + private PassFailResult result; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setPassFailServerMetricAccessor(new JsonMergePatchHelper.PassFailServerMetricAccessor() { + @Override + public PassFailServerMetric prepareModelForJsonMergePatch(PassFailServerMetric model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(PassFailServerMetric model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of PassFailServerMetric class. + */ + @Generated + public PassFailServerMetric() { + } + + /** + * Get the resourceId property: The resource id of the resource emitting the metric. + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource id of the resource emitting the metric. + *

Required when create the resource.

+ * + * @param resourceId the resourceId value to set. + * @return the PassFailServerMetric object itself. + */ + @Generated + public PassFailServerMetric setResourceId(String resourceId) { + this.resourceId = resourceId; + this.updatedProperties.add("resourceId"); + return this; + } + + /** + * Get the metricNamespace property: The server metric namespace. + * + * @return the metricNamespace value. + */ + @Generated + public String getMetricNamespace() { + return this.metricNamespace; + } + + /** + * Set the metricNamespace property: The server metric namespace. + *

Required when create the resource.

+ * + * @param metricNamespace the metricNamespace value to set. + * @return the PassFailServerMetric object itself. + */ + @Generated + public PassFailServerMetric setMetricNamespace(String metricNamespace) { + this.metricNamespace = metricNamespace; + this.updatedProperties.add("metricNamespace"); + return this; + } + + /** + * Get the metricName property: The server metric name. + * + * @return the metricName value. + */ + @Generated + public String getMetricName() { + return this.metricName; + } + + /** + * Set the metricName property: The server metric name. + *

Required when create the resource.

+ * + * @param metricName the metricName value to set. + * @return the PassFailServerMetric object itself. + */ + @Generated + public PassFailServerMetric setMetricName(String metricName) { + this.metricName = metricName; + this.updatedProperties.add("metricName"); + return this; + } + + /** + * Get the aggregation property: Aggregation Type. + * + * @return the aggregation value. + */ + @Generated + public String getAggregation() { + return this.aggregation; + } + + /** + * Set the aggregation property: Aggregation Type. + *

Required when create the resource.

+ * + * @param aggregation the aggregation value to set. + * @return the PassFailServerMetric object itself. + */ + @Generated + public PassFailServerMetric setAggregation(String aggregation) { + this.aggregation = aggregation; + this.updatedProperties.add("aggregation"); + return this; + } + + /** + * Get the condition property: The comparison operator. Supported types ‘>’, ‘<’. + * + * @return the condition value. + */ + @Generated + public String getCondition() { + return this.condition; + } + + /** + * Set the condition property: The comparison operator. Supported types ‘>’, ‘<’. + *

Required when create the resource.

+ * + * @param condition the condition value to set. + * @return the PassFailServerMetric object itself. + */ + @Generated + public PassFailServerMetric setCondition(String condition) { + this.condition = condition; + this.updatedProperties.add("condition"); + return this; + } + + /** + * Get the value property: The value to compare with the server metric. + * + * @return the value value. + */ + @Generated + public double getValue() { + return this.value; + } + + /** + * Set the value property: The value to compare with the server metric. + *

Required when create the resource.

+ * + * @param value the value value to set. + * @return the PassFailServerMetric object itself. + */ + @Generated + public PassFailServerMetric setValue(double value) { + this.value = value; + this.updatedProperties.add("value"); + return this; + } + + /** + * Get the action property: Action taken after the threshold is met. Default is ‘continue’. + * + * @return the action value. + */ + @Generated + public PassFailAction getAction() { + return this.action; + } + + /** + * Set the action property: Action taken after the threshold is met. Default is ‘continue’. + * + * @param action the action value to set. + * @return the PassFailServerMetric object itself. + */ + @Generated + public PassFailServerMetric setAction(PassFailAction action) { + this.action = action; + this.updatedProperties.add("action"); + return this; + } + + /** + * Get the actualValue property: The actual value of the server metric. + * + * @return the actualValue value. + */ + @Generated + public Double getActualValue() { + return this.actualValue; + } + + /** + * Get the result property: Outcome of the test run. + * + * @return the result value. + */ + @Generated + public PassFailResult getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("metricNamespace", this.metricNamespace); + jsonWriter.writeStringField("metricName", this.metricName); + jsonWriter.writeStringField("aggregation", this.aggregation); + jsonWriter.writeStringField("condition", this.condition); + jsonWriter.writeDoubleField("value", this.value); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("resourceId")) { + if (this.resourceId == null) { + jsonWriter.writeNullField("resourceId"); + } else { + jsonWriter.writeStringField("resourceId", this.resourceId); + } + } + if (updatedProperties.contains("metricNamespace")) { + if (this.metricNamespace == null) { + jsonWriter.writeNullField("metricNamespace"); + } else { + jsonWriter.writeStringField("metricNamespace", this.metricNamespace); + } + } + if (updatedProperties.contains("metricName")) { + if (this.metricName == null) { + jsonWriter.writeNullField("metricName"); + } else { + jsonWriter.writeStringField("metricName", this.metricName); + } + } + if (updatedProperties.contains("aggregation")) { + if (this.aggregation == null) { + jsonWriter.writeNullField("aggregation"); + } else { + jsonWriter.writeStringField("aggregation", this.aggregation); + } + } + if (updatedProperties.contains("condition")) { + if (this.condition == null) { + jsonWriter.writeNullField("condition"); + } else { + jsonWriter.writeStringField("condition", this.condition); + } + } + if (updatedProperties.contains("value")) { + jsonWriter.writeDoubleField("value", this.value); + } + if (updatedProperties.contains("action")) { + if (this.action == null) { + jsonWriter.writeNullField("action"); + } else { + jsonWriter.writeStringField("action", this.action.toString()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PassFailServerMetric from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PassFailServerMetric if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PassFailServerMetric. + */ + @Generated + public static PassFailServerMetric fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PassFailServerMetric deserializedPassFailServerMetric = new PassFailServerMetric(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedPassFailServerMetric.resourceId = reader.getString(); + } else if ("metricNamespace".equals(fieldName)) { + deserializedPassFailServerMetric.metricNamespace = reader.getString(); + } else if ("metricName".equals(fieldName)) { + deserializedPassFailServerMetric.metricName = reader.getString(); + } else if ("aggregation".equals(fieldName)) { + deserializedPassFailServerMetric.aggregation = reader.getString(); + } else if ("condition".equals(fieldName)) { + deserializedPassFailServerMetric.condition = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedPassFailServerMetric.value = reader.getDouble(); + } else if ("action".equals(fieldName)) { + deserializedPassFailServerMetric.action = PassFailAction.fromString(reader.getString()); + } else if ("actualValue".equals(fieldName)) { + deserializedPassFailServerMetric.actualValue = reader.getNullable(JsonReader::getDouble); + } else if ("result".equals(fieldName)) { + deserializedPassFailServerMetric.result = PassFailResult.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPassFailServerMetric; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailTestResult.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailTestResult.java new file mode 100644 index 000000000000..729cb301014d --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PassFailTestResult.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Test result based on pass/fail criteria. + */ +public final class PassFailTestResult extends ExpandableStringEnum { + /** + * Pass/fail criteria has passed. + */ + @Generated + public static final PassFailTestResult PASSED = fromString("PASSED"); + + /** + * Pass/fail criteria is not applicable. + */ + @Generated + public static final PassFailTestResult NOT_APPLICABLE = fromString("NOT_APPLICABLE"); + + /** + * Pass/fail criteria has failed. + */ + @Generated + public static final PassFailTestResult FAILED = fromString("FAILED"); + + /** + * Creates a new instance of PassFailTestResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public PassFailTestResult() { + } + + /** + * Creates or finds a PassFailTestResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding PassFailTestResult. + */ + @Generated + public static PassFailTestResult fromString(String name) { + return fromString(name, PassFailTestResult.class); + } + + /** + * Gets known PassFailTestResult values. + * + * @return known PassFailTestResult values. + */ + @Generated + public static Collection values() { + return values(PassFailTestResult.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PfMetrics.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PfMetrics.java new file mode 100644 index 000000000000..fe5167d8667a --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/PfMetrics.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Metrics for pass/fail criteria. + */ +public final class PfMetrics extends ExpandableStringEnum { + /** + * Pass fail criteria for response time metric in milliseconds. + */ + @Generated + public static final PfMetrics RESPONSE_TIME_IN_MILLISECONDS = fromString("response_time_ms"); + + /** + * Pass fail criteria for latency metric in milliseconds. + */ + @Generated + public static final PfMetrics LATENCY = fromString("latency"); + + /** + * Pass fail criteria for error metric. + */ + @Generated + public static final PfMetrics ERROR = fromString("error"); + + /** + * Pass fail criteria for total requests. + */ + @Generated + public static final PfMetrics REQUESTS = fromString("requests"); + + /** + * Pass fail criteria for request per second. + */ + @Generated + public static final PfMetrics REQUESTS_PER_SECOND = fromString("requests_per_sec"); + + /** + * Creates a new instance of PfMetrics value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public PfMetrics() { + } + + /** + * Creates or finds a PfMetrics from its string representation. + * + * @param name a name to look for. + * @return the corresponding PfMetrics. + */ + @Generated + public static PfMetrics fromString(String name) { + return fromString(name, PfMetrics.class); + } + + /** + * Gets known PfMetrics values. + * + * @return known PfMetrics values. + */ + @Generated + public static Collection values() { + return values(PfMetrics.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecommendationCategory.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecommendationCategory.java new file mode 100644 index 000000000000..79630dae1b43 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecommendationCategory.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Category of Recommendation. + */ +public final class RecommendationCategory extends ExpandableStringEnum { + /** + * The recommendation for this category optimizes the throughput/RPS (Requests per Second) of the app. + */ + @Generated + public static final RecommendationCategory THROUGHPUT_OPTIMIZED = fromString("ThroughputOptimized"); + + /** + * The recommendation for this category optimizes the cost of the app. + */ + @Generated + public static final RecommendationCategory COST_OPTIMIZED = fromString("CostOptimized"); + + /** + * Creates a new instance of RecommendationCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RecommendationCategory() { + } + + /** + * Creates or finds a RecommendationCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecommendationCategory. + */ + @Generated + public static RecommendationCategory fromString(String name) { + return fromString(name, RecommendationCategory.class); + } + + /** + * Gets known RecommendationCategory values. + * + * @return known RecommendationCategory values. + */ + @Generated + public static Collection values() { + return values(RecommendationCategory.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Recurrence.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Recurrence.java new file mode 100644 index 000000000000..2a80ff767239 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Recurrence.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Recurrence model. + */ +@Fluent +public class Recurrence implements JsonSerializable { + /* + * Frequency of the recurrence. + */ + @Generated + private Frequency frequency = Frequency.fromString("Recurrence"); + + /* + * Recurrence end model. You can specify the end either by providing a numberOfOccurrences (which will end the + * recurrence after the specified number of occurrences) or by providing an endDateTime (which will end the + * recurrence after the specified date). If neither value is provided, the recurrence will continue until it is + * manually ended. However, if both values are provided, an error will be thrown. + */ + @Generated + private RecurrenceEnd recurrenceEnd; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setRecurrenceAccessor(new JsonMergePatchHelper.RecurrenceAccessor() { + @Override + public Recurrence prepareModelForJsonMergePatch(Recurrence model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(Recurrence model) { + return model.jsonMergePatch; + } + + @Override + public void setRecurrenceEnd(Recurrence model, RecurrenceEnd recurrenceEnd) { + model.recurrenceEnd = recurrenceEnd; + } + }); + } + + /** + * Creates an instance of Recurrence class. + */ + @Generated + public Recurrence() { + } + + /** + * Get the frequency property: Frequency of the recurrence. + * + * @return the frequency value. + */ + @Generated + public Frequency getFrequency() { + return this.frequency; + } + + /** + * Get the recurrenceEnd property: Recurrence end model. You can specify the end either by providing a + * numberOfOccurrences (which will end the recurrence after the specified number of occurrences) or by providing an + * endDateTime (which will end the recurrence after the specified date). If neither value is provided, the + * recurrence will continue until it is manually ended. However, if both values are provided, an error will be + * thrown. + * + * @return the recurrenceEnd value. + */ + @Generated + public RecurrenceEnd getRecurrenceEnd() { + return this.recurrenceEnd; + } + + /** + * Set the recurrenceEnd property: Recurrence end model. You can specify the end either by providing a + * numberOfOccurrences (which will end the recurrence after the specified number of occurrences) or by providing an + * endDateTime (which will end the recurrence after the specified date). If neither value is provided, the + * recurrence will continue until it is manually ended. However, if both values are provided, an error will be + * thrown. + * + * @param recurrenceEnd the recurrenceEnd value to set. + * @return the Recurrence object itself. + */ + @Generated + public Recurrence setRecurrenceEnd(RecurrenceEnd recurrenceEnd) { + this.recurrenceEnd = recurrenceEnd; + this.updatedProperties.add("recurrenceEnd"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeJsonField("recurrenceEnd", this.recurrenceEnd); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("frequency", this.frequency.toString()); + if (updatedProperties.contains("recurrenceEnd")) { + if (this.recurrenceEnd == null) { + jsonWriter.writeNullField("recurrenceEnd"); + } else { + JsonMergePatchHelper.getRecurrenceEndAccessor().prepareModelForJsonMergePatch(this.recurrenceEnd, true); + jsonWriter.writeJsonField("recurrenceEnd", this.recurrenceEnd); + JsonMergePatchHelper.getRecurrenceEndAccessor() + .prepareModelForJsonMergePatch(this.recurrenceEnd, false); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Recurrence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Recurrence if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Recurrence. + */ + @Generated + public static Recurrence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("frequency".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Daily".equals(discriminatorValue)) { + return DailyRecurrence.fromJson(readerToUse.reset()); + } else if ("Hourly".equals(discriminatorValue)) { + return HourlyRecurrence.fromJson(readerToUse.reset()); + } else if ("MonthlyByDays".equals(discriminatorValue)) { + return MonthlyRecurrenceByWeekDays.fromJson(readerToUse.reset()); + } else if ("MonthlyByDates".equals(discriminatorValue)) { + return MonthlyRecurrenceByDates.fromJson(readerToUse.reset()); + } else if ("Cron".equals(discriminatorValue)) { + return RecurrenceWithCron.fromJson(readerToUse.reset()); + } else if ("Weekly".equals(discriminatorValue)) { + return WeeklyRecurrence.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static Recurrence fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Recurrence deserializedRecurrence = new Recurrence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frequency".equals(fieldName)) { + deserializedRecurrence.frequency = Frequency.fromString(reader.getString()); + } else if ("recurrenceEnd".equals(fieldName)) { + deserializedRecurrence.recurrenceEnd = RecurrenceEnd.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecurrence; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceEnd.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceEnd.java new file mode 100644 index 000000000000..25f89058bb43 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceEnd.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.HashSet; +import java.util.Set; + +/** + * Recurrence end model. Either provide numberOfOccurrences if you want recurrence to end after a specified number of + * occurrences or provide endDate if you want recurrence to end after a specified end date. If both values are provided, + * a validation error will be thrown indicating that only one field should be provided. If neither value is provided, + * the recurrence will end when manually ended. + */ +@Fluent +public final class RecurrenceEnd implements JsonSerializable { + /* + * Number of occurrences after which the recurrence will end. + */ + @Generated + private Integer numberOfOccurrences; + + /* + * The date after which the recurrence will end. (RFC 3339 literal format) + */ + @Generated + private OffsetDateTime endDateTime; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setRecurrenceEndAccessor(new JsonMergePatchHelper.RecurrenceEndAccessor() { + @Override + public RecurrenceEnd prepareModelForJsonMergePatch(RecurrenceEnd model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(RecurrenceEnd model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of RecurrenceEnd class. + */ + @Generated + public RecurrenceEnd() { + } + + /** + * Get the numberOfOccurrences property: Number of occurrences after which the recurrence will end. + * + * @return the numberOfOccurrences value. + */ + @Generated + public Integer getNumberOfOccurrences() { + return this.numberOfOccurrences; + } + + /** + * Set the numberOfOccurrences property: Number of occurrences after which the recurrence will end. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the RecurrenceEnd object itself. + */ + @Generated + public RecurrenceEnd setNumberOfOccurrences(Integer numberOfOccurrences) { + this.numberOfOccurrences = numberOfOccurrences; + this.updatedProperties.add("numberOfOccurrences"); + return this; + } + + /** + * Get the endDateTime property: The date after which the recurrence will end. (RFC 3339 literal format). + * + * @return the endDateTime value. + */ + @Generated + public OffsetDateTime getEndDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The date after which the recurrence will end. (RFC 3339 literal format). + * + * @param endDateTime the endDateTime value to set. + * @return the RecurrenceEnd object itself. + */ + @Generated + public RecurrenceEnd setEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + this.updatedProperties.add("endDateTime"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("numberOfOccurrences", this.numberOfOccurrences); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("numberOfOccurrences")) { + if (this.numberOfOccurrences == null) { + jsonWriter.writeNullField("numberOfOccurrences"); + } else { + jsonWriter.writeNumberField("numberOfOccurrences", this.numberOfOccurrences); + } + } + if (updatedProperties.contains("endDateTime")) { + if (this.endDateTime == null) { + jsonWriter.writeNullField("endDateTime"); + } else { + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecurrenceEnd from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecurrenceEnd if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecurrenceEnd. + */ + @Generated + public static RecurrenceEnd fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecurrenceEnd deserializedRecurrenceEnd = new RecurrenceEnd(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("numberOfOccurrences".equals(fieldName)) { + deserializedRecurrenceEnd.numberOfOccurrences = reader.getNullable(JsonReader::getInt); + } else if ("endDateTime".equals(fieldName)) { + deserializedRecurrenceEnd.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRecurrenceEnd; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceStatus.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceStatus.java new file mode 100644 index 000000000000..0ba3c3fd2a00 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceStatus.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Actual state of the recurrence for the trigger. + */ +@Immutable +public final class RecurrenceStatus implements JsonSerializable { + /* + * The number of occurrences remaining for the trigger. Null if recurrence end has end date instead of number of + * occurrences. + */ + @Generated + private Integer remainingOccurrences; + + /* + * The next three execution times of the trigger. (RFC 3339 literal format) + */ + @Generated + private List nextScheduledDateTimes; + + /** + * Creates an instance of RecurrenceStatus class. + */ + @Generated + private RecurrenceStatus() { + } + + /** + * Get the remainingOccurrences property: The number of occurrences remaining for the trigger. Null if recurrence + * end has end date instead of number of occurrences. + * + * @return the remainingOccurrences value. + */ + @Generated + public Integer getRemainingOccurrences() { + return this.remainingOccurrences; + } + + /** + * Get the nextScheduledDateTimes property: The next three execution times of the trigger. (RFC 3339 literal + * format). + * + * @return the nextScheduledDateTimes value. + */ + @Generated + public List getNextScheduledDateTimes() { + return this.nextScheduledDateTimes; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("remainingOccurrences", this.remainingOccurrences); + jsonWriter.writeArrayField("nextScheduledDateTimes", this.nextScheduledDateTimes, (writer, element) -> writer + .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecurrenceStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecurrenceStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecurrenceStatus. + */ + @Generated + public static RecurrenceStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecurrenceStatus deserializedRecurrenceStatus = new RecurrenceStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remainingOccurrences".equals(fieldName)) { + deserializedRecurrenceStatus.remainingOccurrences = reader.getNullable(JsonReader::getInt); + } else if ("nextScheduledDateTimes".equals(fieldName)) { + List nextScheduledDateTimes = reader.readArray(reader1 -> reader1 + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + deserializedRecurrenceStatus.nextScheduledDateTimes = nextScheduledDateTimes; + } else { + reader.skipChildren(); + } + } + + return deserializedRecurrenceStatus; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceWithCron.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceWithCron.java new file mode 100644 index 000000000000..4a604d760714 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RecurrenceWithCron.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Recurrence is set based on cron expression. + */ +@Fluent +public final class RecurrenceWithCron extends Recurrence { + /* + * Frequency of the recurrence. + */ + @Generated + private Frequency frequency = Frequency.CRON; + + /* + * Cron expression for the recurrence. + */ + @Generated + private String cronExpression; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of RecurrenceWithCron class. + */ + @Generated + public RecurrenceWithCron() { + } + + /** + * Get the frequency property: Frequency of the recurrence. + * + * @return the frequency value. + */ + @Generated + @Override + public Frequency getFrequency() { + return this.frequency; + } + + /** + * Get the cronExpression property: Cron expression for the recurrence. + * + * @return the cronExpression value. + */ + @Generated + public String getCronExpression() { + return this.cronExpression; + } + + /** + * Set the cronExpression property: Cron expression for the recurrence. + *

Required when create the resource.

+ * + * @param cronExpression the cronExpression value to set. + * @return the RecurrenceWithCron object itself. + */ + @Generated + public RecurrenceWithCron setCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + this.updatedProperties.add("cronExpression"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RecurrenceWithCron setRecurrenceEnd(RecurrenceEnd recurrenceEnd) { + super.setRecurrenceEnd(recurrenceEnd); + this.updatedProperties.add("recurrenceEnd"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getRecurrenceAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeStringField("cronExpression", this.cronExpression); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("recurrenceEnd")) { + if (getRecurrenceEnd() == null) { + jsonWriter.writeNullField("recurrenceEnd"); + } else { + JsonMergePatchHelper.getRecurrenceEndAccessor().prepareModelForJsonMergePatch(getRecurrenceEnd(), true); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + JsonMergePatchHelper.getRecurrenceEndAccessor() + .prepareModelForJsonMergePatch(getRecurrenceEnd(), false); + } + } + jsonWriter.writeStringField("frequency", this.frequency.toString()); + if (updatedProperties.contains("cronExpression")) { + if (this.cronExpression == null) { + jsonWriter.writeNullField("cronExpression"); + } else { + jsonWriter.writeStringField("cronExpression", this.cronExpression); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecurrenceWithCron from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecurrenceWithCron if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecurrenceWithCron. + */ + @Generated + public static RecurrenceWithCron fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecurrenceWithCron deserializedRecurrenceWithCron = new RecurrenceWithCron(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recurrenceEnd".equals(fieldName)) { + JsonMergePatchHelper.getRecurrenceAccessor() + .setRecurrenceEnd(deserializedRecurrenceWithCron, RecurrenceEnd.fromJson(reader)); + } else if ("frequency".equals(fieldName)) { + deserializedRecurrenceWithCron.frequency = Frequency.fromString(reader.getString()); + } else if ("cronExpression".equals(fieldName)) { + deserializedRecurrenceWithCron.cronExpression = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecurrenceWithCron; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RegionalConfiguration.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RegionalConfiguration.java new file mode 100644 index 000000000000..d2395d658e09 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RegionalConfiguration.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Region distribution configuration for the load test. + */ +@Fluent +public final class RegionalConfiguration implements JsonSerializable { + /* + * The number of engine instances to execute load test in specified region. Supported values are in range of 1-400. + */ + @Generated + private int engineInstances; + + /* + * Azure region name. + * The region name should of format accepted by ARM, and should be a region supported by Azure Load Testing. For + * example, East US should be passed as "eastus". + * The region name must match one of the strings in the "Name" column returned from running the + * "az account list-locations -o table" Azure CLI command. + */ + @Generated + private String region; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setRegionalConfigurationAccessor(new JsonMergePatchHelper.RegionalConfigurationAccessor() { + @Override + public RegionalConfiguration prepareModelForJsonMergePatch(RegionalConfiguration model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(RegionalConfiguration model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of RegionalConfiguration class. + */ + @Generated + public RegionalConfiguration() { + } + + /** + * Get the engineInstances property: The number of engine instances to execute load test in specified region. + * Supported values are in range of 1-400. + * + * @return the engineInstances value. + */ + @Generated + public int getEngineInstances() { + return this.engineInstances; + } + + /** + * Set the engineInstances property: The number of engine instances to execute load test in specified region. + * Supported values are in range of 1-400. + *

Required when create the resource.

+ * + * @param engineInstances the engineInstances value to set. + * @return the RegionalConfiguration object itself. + */ + @Generated + public RegionalConfiguration setEngineInstances(int engineInstances) { + this.engineInstances = engineInstances; + this.updatedProperties.add("engineInstances"); + return this; + } + + /** + * Get the region property: Azure region name. + * The region name should of format accepted by ARM, and should be a region supported by Azure Load Testing. For + * example, East US should be passed as "eastus". + * The region name must match one of the strings in the "Name" column returned from running the "az account + * list-locations -o table" Azure CLI command. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * Set the region property: Azure region name. + * The region name should of format accepted by ARM, and should be a region supported by Azure Load Testing. For + * example, East US should be passed as "eastus". + * The region name must match one of the strings in the "Name" column returned from running the "az account + * list-locations -o table" Azure CLI command. + *

Required when create the resource.

+ * + * @param region the region value to set. + * @return the RegionalConfiguration object itself. + */ + @Generated + public RegionalConfiguration setRegion(String region) { + this.region = region; + this.updatedProperties.add("region"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("engineInstances", this.engineInstances); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("engineInstances")) { + jsonWriter.writeIntField("engineInstances", this.engineInstances); + } + if (updatedProperties.contains("region")) { + if (this.region == null) { + jsonWriter.writeNullField("region"); + } else { + jsonWriter.writeStringField("region", this.region); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegionalConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegionalConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RegionalConfiguration. + */ + @Generated + public static RegionalConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegionalConfiguration deserializedRegionalConfiguration = new RegionalConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("engineInstances".equals(fieldName)) { + deserializedRegionalConfiguration.engineInstances = reader.getInt(); + } else if ("region".equals(fieldName)) { + deserializedRegionalConfiguration.region = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegionalConfiguration; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RequestDataLevel.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RequestDataLevel.java new file mode 100644 index 000000000000..3eba79f91a9e --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/RequestDataLevel.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Request data collection level for test run. + */ +public final class RequestDataLevel extends ExpandableStringEnum { + /** + * No request data will be collected. + */ + @Generated + public static final RequestDataLevel NONE = fromString("NONE"); + + /** + * Request data will be collected in case of failed requests. + */ + @Generated + public static final RequestDataLevel ERRORS = fromString("ERRORS"); + + /** + * Creates a new instance of RequestDataLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RequestDataLevel() { + } + + /** + * Creates or finds a RequestDataLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestDataLevel. + */ + @Generated + public static RequestDataLevel fromString(String name) { + return fromString(name, RequestDataLevel.class); + } + + /** + * Gets known RequestDataLevel values. + * + * @return known RequestDataLevel values. + */ + @Generated + public static Collection values() { + return values(RequestDataLevel.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceKind.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceKind.java new file mode 100644 index 000000000000..fbedbac3ed1c --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Kind of the resource on which test profile is created. + */ +public final class ResourceKind extends ExpandableStringEnum { + /** + * Resource is a Azure FunctionApp on Flex Consumption Plan. + */ + @Generated + public static final ResourceKind FUNCTIONS_FLEX_CONSUMPTION = fromString("FunctionsFlexConsumption"); + + /** + * Creates a new instance of ResourceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ResourceKind() { + } + + /** + * Creates or finds a ResourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceKind. + */ + @Generated + public static ResourceKind fromString(String name) { + return fromString(name, ResourceKind.class); + } + + /** + * Gets known ResourceKind values. + * + * @return known ResourceKind values. + */ + @Generated + public static Collection values() { + return values(ResourceKind.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceMetric.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceMetric.java new file mode 100644 index 000000000000..9775d1612846 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ResourceMetric.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Associated metric definition for particular metrics of the azure resource ( + * Refer : + * https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition). + */ +@Fluent +public final class ResourceMetric implements JsonSerializable { + /* + * Unique name for metric. + */ + @Generated + private String id; + + /* + * Azure resource id. + */ + @Generated + private String resourceId; + + /* + * Metric name space. + */ + @Generated + private String metricNamespace; + + /* + * Metric description. + */ + @Generated + private String displayDescription; + + /* + * The invariant value of metric name + */ + @Generated + private String name; + + /* + * Metric aggregation. + */ + @Generated + private String aggregation; + + /* + * Metric unit. + */ + @Generated + private String unit; + + /* + * Azure resource type. + */ + @Generated + private String resourceType; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setResourceMetricAccessor(new JsonMergePatchHelper.ResourceMetricAccessor() { + @Override + public ResourceMetric prepareModelForJsonMergePatch(ResourceMetric model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(ResourceMetric model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of ResourceMetric class. + */ + @Generated + public ResourceMetric() { + } + + /** + * Get the id property: Unique name for metric. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the resourceId property: Azure resource id. + * + * @return the resourceId value. + */ + @Generated + public String getResourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Azure resource id. + *

Required when create the resource.

+ * + * @param resourceId the resourceId value to set. + * @return the ResourceMetric object itself. + */ + @Generated + public ResourceMetric setResourceId(String resourceId) { + this.resourceId = resourceId; + this.updatedProperties.add("resourceId"); + return this; + } + + /** + * Get the metricNamespace property: Metric name space. + * + * @return the metricNamespace value. + */ + @Generated + public String getMetricNamespace() { + return this.metricNamespace; + } + + /** + * Set the metricNamespace property: Metric name space. + *

Required when create the resource.

+ * + * @param metricNamespace the metricNamespace value to set. + * @return the ResourceMetric object itself. + */ + @Generated + public ResourceMetric setMetricNamespace(String metricNamespace) { + this.metricNamespace = metricNamespace; + this.updatedProperties.add("metricNamespace"); + return this; + } + + /** + * Get the displayDescription property: Metric description. + * + * @return the displayDescription value. + */ + @Generated + public String getDisplayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Metric description. + * + * @param displayDescription the displayDescription value to set. + * @return the ResourceMetric object itself. + */ + @Generated + public ResourceMetric setDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + this.updatedProperties.add("displayDescription"); + return this; + } + + /** + * Get the name property: The invariant value of metric name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: The invariant value of metric name. + *

Required when create the resource.

+ * + * @param name the name value to set. + * @return the ResourceMetric object itself. + */ + @Generated + public ResourceMetric setName(String name) { + this.name = name; + this.updatedProperties.add("name"); + return this; + } + + /** + * Get the aggregation property: Metric aggregation. + * + * @return the aggregation value. + */ + @Generated + public String getAggregation() { + return this.aggregation; + } + + /** + * Set the aggregation property: Metric aggregation. + *

Required when create the resource.

+ * + * @param aggregation the aggregation value to set. + * @return the ResourceMetric object itself. + */ + @Generated + public ResourceMetric setAggregation(String aggregation) { + this.aggregation = aggregation; + this.updatedProperties.add("aggregation"); + return this; + } + + /** + * Get the unit property: Metric unit. + * + * @return the unit value. + */ + @Generated + public String getUnit() { + return this.unit; + } + + /** + * Set the unit property: Metric unit. + * + * @param unit the unit value to set. + * @return the ResourceMetric object itself. + */ + @Generated + public ResourceMetric setUnit(String unit) { + this.unit = unit; + this.updatedProperties.add("unit"); + return this; + } + + /** + * Get the resourceType property: Azure resource type. + * + * @return the resourceType value. + */ + @Generated + public String getResourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Azure resource type. + *

Required when create the resource.

+ * + * @param resourceType the resourceType value to set. + * @return the ResourceMetric object itself. + */ + @Generated + public ResourceMetric setResourceType(String resourceType) { + this.resourceType = resourceType; + this.updatedProperties.add("resourceType"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("metricNamespace", this.metricNamespace); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("aggregation", this.aggregation); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeStringField("resourceType", this.resourceType); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("resourceId")) { + if (this.resourceId == null) { + jsonWriter.writeNullField("resourceId"); + } else { + jsonWriter.writeStringField("resourceId", this.resourceId); + } + } + if (updatedProperties.contains("metricNamespace")) { + if (this.metricNamespace == null) { + jsonWriter.writeNullField("metricNamespace"); + } else { + jsonWriter.writeStringField("metricNamespace", this.metricNamespace); + } + } + if (updatedProperties.contains("displayDescription")) { + if (this.displayDescription == null) { + jsonWriter.writeNullField("displayDescription"); + } else { + jsonWriter.writeStringField("displayDescription", this.displayDescription); + } + } + if (updatedProperties.contains("name")) { + if (this.name == null) { + jsonWriter.writeNullField("name"); + } else { + jsonWriter.writeStringField("name", this.name); + } + } + if (updatedProperties.contains("aggregation")) { + if (this.aggregation == null) { + jsonWriter.writeNullField("aggregation"); + } else { + jsonWriter.writeStringField("aggregation", this.aggregation); + } + } + if (updatedProperties.contains("unit")) { + if (this.unit == null) { + jsonWriter.writeNullField("unit"); + } else { + jsonWriter.writeStringField("unit", this.unit); + } + } + if (updatedProperties.contains("resourceType")) { + if (this.resourceType == null) { + jsonWriter.writeNullField("resourceType"); + } else { + jsonWriter.writeStringField("resourceType", this.resourceType); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceMetric from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceMetric if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceMetric. + */ + @Generated + public static ResourceMetric fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceMetric deserializedResourceMetric = new ResourceMetric(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceMetric.id = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceMetric.resourceId = reader.getString(); + } else if ("metricNamespace".equals(fieldName)) { + deserializedResourceMetric.metricNamespace = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedResourceMetric.displayDescription = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedResourceMetric.name = reader.getString(); + } else if ("aggregation".equals(fieldName)) { + deserializedResourceMetric.aggregation = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedResourceMetric.unit = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedResourceMetric.resourceType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceMetric; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ScheduleTestsTrigger.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ScheduleTestsTrigger.java new file mode 100644 index 000000000000..a8dcf0fedb1e --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/ScheduleTestsTrigger.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * ScheduleTestsTrigger model. + */ +@Fluent +public final class ScheduleTestsTrigger extends Trigger { + /* + * The type of the trigger. + */ + @Generated + private TriggerType kind = TriggerType.SCHEDULE_TESTS_TRIGGER; + + /* + * The test id of test to be triggered by this schedule trigger. Currently only one test is supported for a trigger. + */ + @Generated + private List testIds; + + /* + * Start date time of the trigger in UTC timezone. (RFC 3339 literal format) + */ + @Generated + private OffsetDateTime startDateTime; + + /* + * The recurrenceStatus property. + */ + @Generated + private RecurrenceStatus recurrenceStatus; + + /* + * Recurrence details of the trigger. Null if schedule is not recurring. + */ + @Generated + private Recurrence recurrence; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of ScheduleTestsTrigger class. + */ + @Generated + public ScheduleTestsTrigger() { + } + + /** + * Get the kind property: The type of the trigger. + * + * @return the kind value. + */ + @Generated + @Override + public TriggerType getKind() { + return this.kind; + } + + /** + * Get the testIds property: The test id of test to be triggered by this schedule trigger. Currently only one test + * is supported for a trigger. + * + * @return the testIds value. + */ + @Generated + public List getTestIds() { + return this.testIds; + } + + /** + * Set the testIds property: The test id of test to be triggered by this schedule trigger. Currently only one test + * is supported for a trigger. + *

Required when create the resource.

+ * + * @param testIds the testIds value to set. + * @return the ScheduleTestsTrigger object itself. + */ + @Generated + public ScheduleTestsTrigger setTestIds(List testIds) { + this.testIds = testIds; + this.updatedProperties.add("testIds"); + return this; + } + + /** + * Get the startDateTime property: Start date time of the trigger in UTC timezone. (RFC 3339 literal format). + * + * @return the startDateTime value. + */ + @Generated + public OffsetDateTime getStartDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: Start date time of the trigger in UTC timezone. (RFC 3339 literal format). + * + * @param startDateTime the startDateTime value to set. + * @return the ScheduleTestsTrigger object itself. + */ + @Generated + public ScheduleTestsTrigger setStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + this.updatedProperties.add("startDateTime"); + return this; + } + + /** + * Get the recurrenceStatus property: The recurrenceStatus property. + * + * @return the recurrenceStatus value. + */ + @Generated + public RecurrenceStatus getRecurrenceStatus() { + return this.recurrenceStatus; + } + + /** + * Get the recurrence property: Recurrence details of the trigger. Null if schedule is not recurring. + * + * @return the recurrence value. + */ + @Generated + public Recurrence getRecurrence() { + return this.recurrence; + } + + /** + * Set the recurrence property: Recurrence details of the trigger. Null if schedule is not recurring. + * + * @param recurrence the recurrence value to set. + * @return the ScheduleTestsTrigger object itself. + */ + @Generated + public ScheduleTestsTrigger setRecurrence(Recurrence recurrence) { + this.recurrence = recurrence; + this.updatedProperties.add("recurrence"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public ScheduleTestsTrigger setDisplayName(String displayName) { + super.setDisplayName(displayName); + this.updatedProperties.add("displayName"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public ScheduleTestsTrigger setDescription(String description) { + super.setDescription(description); + this.updatedProperties.add("description"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public ScheduleTestsTrigger setState(TriggerState state) { + super.setState(state); + this.updatedProperties.add("state"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getTriggerAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("state", getState() == null ? null : getState().toString()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("testIds", this.testIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeJsonField("recurrence", this.recurrence); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("displayName")) { + if (getDisplayName() == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", getDisplayName()); + } + } + if (updatedProperties.contains("description")) { + if (getDescription() == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", getDescription()); + } + } + if (updatedProperties.contains("state")) { + if (getState() == null) { + jsonWriter.writeNullField("state"); + } else { + jsonWriter.writeStringField("state", getState().toString()); + } + } + jsonWriter.writeStringField("kind", this.kind.toString()); + if (updatedProperties.contains("testIds")) { + if (this.testIds == null) { + jsonWriter.writeNullField("testIds"); + } else { + jsonWriter.writeArrayField("testIds", this.testIds, (writer, element) -> writer.writeString(element)); + } + } + if (updatedProperties.contains("startDateTime")) { + if (this.startDateTime == null) { + jsonWriter.writeNullField("startDateTime"); + } else { + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + } + } + if (updatedProperties.contains("recurrence")) { + if (this.recurrence == null) { + jsonWriter.writeNullField("recurrence"); + } else { + JsonMergePatchHelper.getRecurrenceAccessor().prepareModelForJsonMergePatch(this.recurrence, true); + jsonWriter.writeJsonField("recurrence", this.recurrence); + JsonMergePatchHelper.getRecurrenceAccessor().prepareModelForJsonMergePatch(this.recurrence, false); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleTestsTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleTestsTrigger if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScheduleTestsTrigger. + */ + @Generated + public static ScheduleTestsTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScheduleTestsTrigger deserializedScheduleTestsTrigger = new ScheduleTestsTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("triggerId".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setTriggerId(deserializedScheduleTestsTrigger, reader.getString()); + } else if ("displayName".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setDisplayName(deserializedScheduleTestsTrigger, reader.getString()); + } else if ("description".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setDescription(deserializedScheduleTestsTrigger, reader.getString()); + } else if ("state".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setState(deserializedScheduleTestsTrigger, TriggerState.fromString(reader.getString())); + } else if ("stateDetails".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setStateDetails(deserializedScheduleTestsTrigger, StateDetails.fromJson(reader)); + } else if ("createdDateTime".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setCreatedDateTime(deserializedScheduleTestsTrigger, reader.getNullable( + nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("createdBy".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setCreatedBy(deserializedScheduleTestsTrigger, reader.getString()); + } else if ("lastModifiedDateTime".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setLastModifiedDateTime(deserializedScheduleTestsTrigger, reader.getNullable( + nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedBy".equals(fieldName)) { + JsonMergePatchHelper.getTriggerAccessor() + .setLastModifiedBy(deserializedScheduleTestsTrigger, reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedScheduleTestsTrigger.kind = TriggerType.fromString(reader.getString()); + } else if ("testIds".equals(fieldName)) { + List testIds = reader.readArray(reader1 -> reader1.getString()); + deserializedScheduleTestsTrigger.testIds = testIds; + } else if ("startDateTime".equals(fieldName)) { + deserializedScheduleTestsTrigger.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recurrenceStatus".equals(fieldName)) { + deserializedScheduleTestsTrigger.recurrenceStatus = RecurrenceStatus.fromJson(reader); + } else if ("recurrence".equals(fieldName)) { + deserializedScheduleTestsTrigger.recurrence = Recurrence.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScheduleTestsTrigger; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/SecretType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/SecretType.java new file mode 100644 index 000000000000..55870cd154f5 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/SecretType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Types of secrets supported. + */ +public final class SecretType extends ExpandableStringEnum { + /** + * If the secret is stored in an Azure Key Vault. + */ + @Generated + public static final SecretType KEY_VAULT_SECRET_URI = fromString("AKV_SECRET_URI"); + + /** + * If the secret value provided as plain text. + */ + @Generated + public static final SecretType SECRET_VALUE = fromString("SECRET_VALUE"); + + /** + * Creates a new instance of SecretType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SecretType() { + } + + /** + * Creates or finds a SecretType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecretType. + */ + @Generated + public static SecretType fromString(String name) { + return fromString(name, SecretType.class); + } + + /** + * Gets known SecretType values. + * + * @return known SecretType values. + */ + @Generated + public static Collection values() { + return values(SecretType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/StateDetails.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/StateDetails.java new file mode 100644 index 000000000000..90d16d5e0e0a --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/StateDetails.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * State details of the trigger. + */ +@Immutable +public final class StateDetails implements JsonSerializable { + /* + * The error message if the trigger is in disabled state. + */ + @Generated + private String message; + + /** + * Creates an instance of StateDetails class. + */ + @Generated + private StateDetails() { + } + + /** + * Get the message property: The error message if the trigger is in disabled state. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StateDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StateDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StateDetails. + */ + @Generated + public static StateDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StateDetails deserializedStateDetails = new StateDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedStateDetails.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStateDetails; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TargetResourceConfigurations.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TargetResourceConfigurations.java new file mode 100644 index 000000000000..b69acc753de2 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TargetResourceConfigurations.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Configurations of a target resource. This varies with the kind of resource. + */ +@Immutable +public class TargetResourceConfigurations implements JsonSerializable { + /* + * Kind of the resource for which the configurations apply. + */ + @Generated + private ResourceKind kind = ResourceKind.fromString("TargetResourceConfigurations"); + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper + .setTargetResourceConfigurationsAccessor(new JsonMergePatchHelper.TargetResourceConfigurationsAccessor() { + @Override + public TargetResourceConfigurations prepareModelForJsonMergePatch(TargetResourceConfigurations model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TargetResourceConfigurations model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TargetResourceConfigurations class. + */ + @Generated + public TargetResourceConfigurations() { + } + + /** + * Get the kind property: Kind of the resource for which the configurations apply. + * + * @return the kind value. + */ + @Generated + public ResourceKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetResourceConfigurations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetResourceConfigurations if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetResourceConfigurations. + */ + @Generated + public static TargetResourceConfigurations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("FunctionsFlexConsumption".equals(discriminatorValue)) { + return FunctionFlexConsumptionTargetResourceConfigurations.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static TargetResourceConfigurations fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetResourceConfigurations deserializedTargetResourceConfigurations = new TargetResourceConfigurations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTargetResourceConfigurations.kind = ResourceKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetResourceConfigurations; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestAppComponents.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestAppComponents.java new file mode 100644 index 000000000000..fa0f92c5c1da --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestAppComponents.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Test app components. + */ +@Fluent +public final class TestAppComponents implements JsonSerializable { + /* + * Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object } + */ + @Generated + private Map components; + + /* + * Test identifier + */ + @Generated + private String testId; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestAppComponentsAccessor(new JsonMergePatchHelper.TestAppComponentsAccessor() { + @Override + public TestAppComponents prepareModelForJsonMergePatch(TestAppComponents model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestAppComponents model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestAppComponents class. + */ + @Generated + public TestAppComponents() { + } + + /** + * Get the components property: Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object }. + * + * @return the components value. + */ + @Generated + public Map getComponents() { + return this.components; + } + + /** + * Set the components property: Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object }. + *

Required when create the resource.

+ * + * @param components the components value to set. + * @return the TestAppComponents object itself. + */ + @Generated + public TestAppComponents setComponents(Map components) { + this.components = components; + this.updatedProperties.add("components"); + return this; + } + + /** + * Get the testId property: Test identifier. + * + * @return the testId value. + */ + @Generated + public String getTestId() { + return this.testId; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("components", this.components, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("components")) { + if (this.components == null) { + jsonWriter.writeNullField("components"); + } else { + jsonWriter.writeMapField("components", this.components, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getLoadTestingAppComponentAccessor() + .prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getLoadTestingAppComponentAccessor() + .prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestAppComponents from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestAppComponents if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TestAppComponents. + */ + @Generated + public static TestAppComponents fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestAppComponents deserializedTestAppComponents = new TestAppComponents(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("components".equals(fieldName)) { + Map components + = reader.readMap(reader1 -> LoadTestingAppComponent.fromJson(reader1)); + deserializedTestAppComponents.components = components; + } else if ("testId".equals(fieldName)) { + deserializedTestAppComponents.testId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedTestAppComponents.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedTestAppComponents.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedTestAppComponents.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTestAppComponents.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestAppComponents; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestCertificate.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestCertificate.java new file mode 100644 index 000000000000..928bcb7ed6b3 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestCertificate.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Certificates metadata. + */ +@Fluent +public final class TestCertificate implements JsonSerializable { + /* + * The value of the certificate for respective type + */ + @Generated + private String value; + + /* + * Type of certificate + */ + @Generated + private CertificateType type; + + /* + * Name of the certificate. + */ + @Generated + private String name; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestCertificateAccessor(new JsonMergePatchHelper.TestCertificateAccessor() { + @Override + public TestCertificate prepareModelForJsonMergePatch(TestCertificate model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestCertificate model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestCertificate class. + */ + @Generated + public TestCertificate() { + } + + /** + * Get the value property: The value of the certificate for respective type. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * Set the value property: The value of the certificate for respective type. + * + * @param value the value value to set. + * @return the TestCertificate object itself. + */ + @Generated + public TestCertificate setValue(String value) { + this.value = value; + this.updatedProperties.add("value"); + return this; + } + + /** + * Get the type property: Type of certificate. + * + * @return the type value. + */ + @Generated + public CertificateType getType() { + return this.type; + } + + /** + * Set the type property: Type of certificate. + * + * @param type the type value to set. + * @return the TestCertificate object itself. + */ + @Generated + public TestCertificate setType(CertificateType type) { + this.type = type; + this.updatedProperties.add("type"); + return this; + } + + /** + * Get the name property: Name of the certificate. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Name of the certificate. + * + * @param name the name value to set. + * @return the TestCertificate object itself. + */ + @Generated + public TestCertificate setName(String name) { + this.name = name; + this.updatedProperties.add("name"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("value")) { + if (this.value == null) { + jsonWriter.writeNullField("value"); + } else { + jsonWriter.writeStringField("value", this.value); + } + } + if (updatedProperties.contains("type")) { + if (this.type == null) { + jsonWriter.writeNullField("type"); + } else { + jsonWriter.writeStringField("type", this.type.toString()); + } + } + if (updatedProperties.contains("name")) { + if (this.name == null) { + jsonWriter.writeNullField("name"); + } else { + jsonWriter.writeStringField("name", this.name); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestCertificate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TestCertificate. + */ + @Generated + public static TestCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestCertificate deserializedTestCertificate = new TestCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedTestCertificate.value = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTestCertificate.type = CertificateType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedTestCertificate.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestCertificate; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestFileInfo.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestFileInfo.java new file mode 100644 index 000000000000..6a435fe1945a --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestFileInfo.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Test file info. + */ +@Immutable +public final class TestFileInfo implements JsonSerializable { + /* + * Name of the file. + */ + @Generated + private String fileName; + + /* + * File URL. + */ + @Generated + private String url; + + /* + * File type + */ + @Generated + private LoadTestingFileType fileType; + + /* + * Expiry time of the file (RFC 3339 literal format) + */ + @Generated + private OffsetDateTime expiresOn; + + /* + * Validation status of the file + */ + @Generated + private FileValidationStatus validationStatus; + + /* + * Validation failure error details + */ + @Generated + private String validationFailureDetails; + + /** + * Creates an instance of TestFileInfo class. + */ + @Generated + private TestFileInfo() { + } + + /** + * Get the fileName property: Name of the file. + * + * @return the fileName value. + */ + @Generated + public String getFileName() { + return this.fileName; + } + + /** + * Get the url property: File URL. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the fileType property: File type. + * + * @return the fileType value. + */ + @Generated + public LoadTestingFileType getFileType() { + return this.fileType; + } + + /** + * Get the expiresOn property: Expiry time of the file (RFC 3339 literal format). + * + * @return the expiresOn value. + */ + @Generated + public OffsetDateTime getExpiresOn() { + return this.expiresOn; + } + + /** + * Get the validationStatus property: Validation status of the file. + * + * @return the validationStatus value. + */ + @Generated + public FileValidationStatus getValidationStatus() { + return this.validationStatus; + } + + /** + * Get the validationFailureDetails property: Validation failure error details. + * + * @return the validationFailureDetails value. + */ + @Generated + public String getValidationFailureDetails() { + return this.validationFailureDetails; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestFileInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestFileInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestFileInfo. + */ + @Generated + public static TestFileInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestFileInfo deserializedTestFileInfo = new TestFileInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileName".equals(fieldName)) { + deserializedTestFileInfo.fileName = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedTestFileInfo.url = reader.getString(); + } else if ("fileType".equals(fieldName)) { + deserializedTestFileInfo.fileType = LoadTestingFileType.fromString(reader.getString()); + } else if ("expireDateTime".equals(fieldName)) { + deserializedTestFileInfo.expiresOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("validationStatus".equals(fieldName)) { + deserializedTestFileInfo.validationStatus = FileValidationStatus.fromString(reader.getString()); + } else if ("validationFailureDetails".equals(fieldName)) { + deserializedTestFileInfo.validationFailureDetails = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestFileInfo; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestInputArtifacts.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestInputArtifacts.java new file mode 100644 index 000000000000..dd65efe03301 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestInputArtifacts.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The input artifacts for the test. + */ +@Immutable +public final class TestInputArtifacts implements JsonSerializable { + /* + * The load test YAML file that contains the the test configuration + */ + @Generated + private TestFileInfo configFileInfo; + + /* + * The test script file for the test run + */ + @Generated + private TestFileInfo testScriptFileInfo; + + /* + * The user properties file + */ + @Generated + private TestFileInfo userPropertyFileInfo; + + /* + * The zip file with all input artifacts + */ + @Generated + private TestFileInfo inputArtifactsZipFileInfo; + + /* + * The config json file for url based test + */ + @Generated + private TestFileInfo urlTestConfigFileInfo; + + /* + * Additional supported files for the test run + */ + @Generated + private List additionalFileInfo; + + /** + * Creates an instance of TestInputArtifacts class. + */ + @Generated + private TestInputArtifacts() { + } + + /** + * Get the configFileInfo property: The load test YAML file that contains the the test configuration. + * + * @return the configFileInfo value. + */ + @Generated + public TestFileInfo getConfigFileInfo() { + return this.configFileInfo; + } + + /** + * Get the testScriptFileInfo property: The test script file for the test run. + * + * @return the testScriptFileInfo value. + */ + @Generated + public TestFileInfo getTestScriptFileInfo() { + return this.testScriptFileInfo; + } + + /** + * Get the userPropertyFileInfo property: The user properties file. + * + * @return the userPropertyFileInfo value. + */ + @Generated + public TestFileInfo getUserPropertyFileInfo() { + return this.userPropertyFileInfo; + } + + /** + * Get the inputArtifactsZipFileInfo property: The zip file with all input artifacts. + * + * @return the inputArtifactsZipFileInfo value. + */ + @Generated + public TestFileInfo getInputArtifactsZipFileInfo() { + return this.inputArtifactsZipFileInfo; + } + + /** + * Get the urlTestConfigFileInfo property: The config json file for url based test. + * + * @return the urlTestConfigFileInfo value. + */ + @Generated + public TestFileInfo getUrlTestConfigFileInfo() { + return this.urlTestConfigFileInfo; + } + + /** + * Get the additionalFileInfo property: Additional supported files for the test run. + * + * @return the additionalFileInfo value. + */ + @Generated + public List getAdditionalFileInfo() { + return this.additionalFileInfo; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("configFileInfo", this.configFileInfo); + jsonWriter.writeJsonField("testScriptFileInfo", this.testScriptFileInfo); + jsonWriter.writeJsonField("userPropFileInfo", this.userPropertyFileInfo); + jsonWriter.writeJsonField("inputArtifactsZipFileInfo", this.inputArtifactsZipFileInfo); + jsonWriter.writeJsonField("urlTestConfigFileInfo", this.urlTestConfigFileInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestInputArtifacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestInputArtifacts if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TestInputArtifacts. + */ + @Generated + public static TestInputArtifacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestInputArtifacts deserializedTestInputArtifacts = new TestInputArtifacts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configFileInfo".equals(fieldName)) { + deserializedTestInputArtifacts.configFileInfo = TestFileInfo.fromJson(reader); + } else if ("testScriptFileInfo".equals(fieldName)) { + deserializedTestInputArtifacts.testScriptFileInfo = TestFileInfo.fromJson(reader); + } else if ("userPropFileInfo".equals(fieldName)) { + deserializedTestInputArtifacts.userPropertyFileInfo = TestFileInfo.fromJson(reader); + } else if ("inputArtifactsZipFileInfo".equals(fieldName)) { + deserializedTestInputArtifacts.inputArtifactsZipFileInfo = TestFileInfo.fromJson(reader); + } else if ("urlTestConfigFileInfo".equals(fieldName)) { + deserializedTestInputArtifacts.urlTestConfigFileInfo = TestFileInfo.fromJson(reader); + } else if ("additionalFileInfo".equals(fieldName)) { + List additionalFileInfo = reader.readArray(reader1 -> TestFileInfo.fromJson(reader1)); + deserializedTestInputArtifacts.additionalFileInfo = additionalFileInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedTestInputArtifacts; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfile.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfile.java new file mode 100644 index 000000000000..23b32035faad --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfile.java @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.Set; + +/** + * Test Profile Model. + * + * The Test Profile Model. A Test Profile resource enables you to set up a test profile which contains various + * configurations for a supported resource type and a load test to execute on that resource. + */ +@Fluent +public final class TestProfile implements JsonSerializable { + /* + * Unique identifier for the test profile, must contain only lower-case alphabetic, numeric, underscore or hyphen + * characters. + */ + @Generated + private String testProfileId; + + /* + * Display name of the test profile. + */ + @Generated + private String displayName; + + /* + * Description for the test profile. + */ + @Generated + private String description; + + /* + * Associated test ID for the test profile. This property is required for creating a Test Profile and it's not + * allowed to be updated. + */ + @Generated + private String testId; + + /* + * Target resource ID on which the test profile is created. This property is required for creating a Test Profile + * and it's not allowed to be updated. + */ + @Generated + private String targetResourceId; + + /* + * Configurations of the target resource on which testing would be done. + */ + @Generated + private TargetResourceConfigurations targetResourceConfigurations; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestProfileAccessor(new JsonMergePatchHelper.TestProfileAccessor() { + @Override + public TestProfile prepareModelForJsonMergePatch(TestProfile model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestProfile model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestProfile class. + */ + @Generated + public TestProfile() { + } + + /** + * Get the testProfileId property: Unique identifier for the test profile, must contain only lower-case alphabetic, + * numeric, underscore or hyphen characters. + * + * @return the testProfileId value. + */ + @Generated + public String getTestProfileId() { + return this.testProfileId; + } + + /** + * Get the displayName property: Display name of the test profile. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the test profile. + * + * @param displayName the displayName value to set. + * @return the TestProfile object itself. + */ + @Generated + public TestProfile setDisplayName(String displayName) { + this.displayName = displayName; + this.updatedProperties.add("displayName"); + return this; + } + + /** + * Get the description property: Description for the test profile. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Description for the test profile. + * + * @param description the description value to set. + * @return the TestProfile object itself. + */ + @Generated + public TestProfile setDescription(String description) { + this.description = description; + this.updatedProperties.add("description"); + return this; + } + + /** + * Get the testId property: Associated test ID for the test profile. This property is required for creating a Test + * Profile and it's not allowed to be updated. + * + * @return the testId value. + */ + @Generated + public String getTestId() { + return this.testId; + } + + /** + * Set the testId property: Associated test ID for the test profile. This property is required for creating a Test + * Profile and it's not allowed to be updated. + * + * @param testId the testId value to set. + * @return the TestProfile object itself. + */ + @Generated + public TestProfile setTestId(String testId) { + this.testId = testId; + this.updatedProperties.add("testId"); + return this; + } + + /** + * Get the targetResourceId property: Target resource ID on which the test profile is created. This property is + * required for creating a Test Profile and it's not allowed to be updated. + * + * @return the targetResourceId value. + */ + @Generated + public String getTargetResourceId() { + return this.targetResourceId; + } + + /** + * Set the targetResourceId property: Target resource ID on which the test profile is created. This property is + * required for creating a Test Profile and it's not allowed to be updated. + * + * @param targetResourceId the targetResourceId value to set. + * @return the TestProfile object itself. + */ + @Generated + public TestProfile setTargetResourceId(String targetResourceId) { + this.targetResourceId = targetResourceId; + this.updatedProperties.add("targetResourceId"); + return this; + } + + /** + * Get the targetResourceConfigurations property: Configurations of the target resource on which testing would be + * done. + * + * @return the targetResourceConfigurations value. + */ + @Generated + public TargetResourceConfigurations getTargetResourceConfigurations() { + return this.targetResourceConfigurations; + } + + /** + * Set the targetResourceConfigurations property: Configurations of the target resource on which testing would be + * done. + * + * @param targetResourceConfigurations the targetResourceConfigurations value to set. + * @return the TestProfile object itself. + */ + @Generated + public TestProfile setTargetResourceConfigurations(TargetResourceConfigurations targetResourceConfigurations) { + this.targetResourceConfigurations = targetResourceConfigurations; + this.updatedProperties.add("targetResourceConfigurations"); + return this; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("testId", this.testId); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeJsonField("targetResourceConfigurations", this.targetResourceConfigurations); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("displayName")) { + if (this.displayName == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", this.displayName); + } + } + if (updatedProperties.contains("description")) { + if (this.description == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", this.description); + } + } + if (updatedProperties.contains("testId")) { + if (this.testId == null) { + jsonWriter.writeNullField("testId"); + } else { + jsonWriter.writeStringField("testId", this.testId); + } + } + if (updatedProperties.contains("targetResourceId")) { + if (this.targetResourceId == null) { + jsonWriter.writeNullField("targetResourceId"); + } else { + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + } + } + if (updatedProperties.contains("targetResourceConfigurations")) { + if (this.targetResourceConfigurations == null) { + jsonWriter.writeNullField("targetResourceConfigurations"); + } else { + JsonMergePatchHelper.getTargetResourceConfigurationsAccessor() + .prepareModelForJsonMergePatch(this.targetResourceConfigurations, true); + jsonWriter.writeJsonField("targetResourceConfigurations", this.targetResourceConfigurations); + JsonMergePatchHelper.getTargetResourceConfigurationsAccessor() + .prepareModelForJsonMergePatch(this.targetResourceConfigurations, false); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestProfile. + */ + @Generated + public static TestProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestProfile deserializedTestProfile = new TestProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testProfileId".equals(fieldName)) { + deserializedTestProfile.testProfileId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedTestProfile.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedTestProfile.description = reader.getString(); + } else if ("testId".equals(fieldName)) { + deserializedTestProfile.testId = reader.getString(); + } else if ("targetResourceId".equals(fieldName)) { + deserializedTestProfile.targetResourceId = reader.getString(); + } else if ("targetResourceConfigurations".equals(fieldName)) { + deserializedTestProfile.targetResourceConfigurations + = TargetResourceConfigurations.fromJson(reader); + } else if ("createdDateTime".equals(fieldName)) { + deserializedTestProfile.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedTestProfile.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedTestProfile.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTestProfile.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestProfile; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRun.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRun.java new file mode 100644 index 000000000000..ffe3e242d5b9 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRun.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Test Profile Run model. + * + * The Test Profile Run Model. Test Profile Run resource enables you to instantiate an already created test profile and + * run load tests to get recommendations on the optimal configuration for the target resource. + */ +@Fluent +public final class TestProfileRun implements JsonSerializable { + /* + * Unique identifier for the test profile run, must contain only lower-case alphabetic, numeric, underscore or + * hyphen characters. + */ + @Generated + private String testProfileRunId; + + /* + * Display name for the test profile run. + */ + @Generated + private String displayName; + + /* + * The test profile run description + */ + @Generated + private String description; + + /* + * Associated test profile ID for the test profile run. This is required to create a test profile run and can't be + * updated. + */ + @Generated + private String testProfileId; + + /* + * Target resource ID on which the test profile run is created + */ + @Generated + private String targetResourceId; + + /* + * Configurations of the target resource on which the test profile ran. + */ + @Generated + private TargetResourceConfigurations targetResourceConfigurations; + + /* + * The test profile run status. + */ + @Generated + private TestProfileRunStatus status; + + /* + * Error details if there is any failure in test profile run. These errors are specific to the Test Profile Run. + */ + @Generated + private List errorDetails; + + /* + * The test profile run start DateTime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime startDateTime; + + /* + * The test profile run end DateTime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime endDateTime; + + /* + * Test profile run duration in seconds. + */ + @Generated + private Long durationInSeconds; + + /* + * Details of the test runs ran as part of the test profile run. + * Key is the testRunId of the corresponding testRun. + */ + @Generated + private Map testRunDetails; + + /* + * Recommendations provided based on a successful test profile run. + */ + @Generated + private List recommendations; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestProfileRunAccessor(new JsonMergePatchHelper.TestProfileRunAccessor() { + @Override + public TestProfileRun prepareModelForJsonMergePatch(TestProfileRun model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestProfileRun model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestProfileRun class. + */ + @Generated + public TestProfileRun() { + } + + /** + * Get the testProfileRunId property: Unique identifier for the test profile run, must contain only lower-case + * alphabetic, numeric, underscore or hyphen characters. + * + * @return the testProfileRunId value. + */ + @Generated + public String getTestProfileRunId() { + return this.testProfileRunId; + } + + /** + * Get the displayName property: Display name for the test profile run. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name for the test profile run. + * + * @param displayName the displayName value to set. + * @return the TestProfileRun object itself. + */ + @Generated + public TestProfileRun setDisplayName(String displayName) { + this.displayName = displayName; + this.updatedProperties.add("displayName"); + return this; + } + + /** + * Get the description property: The test profile run description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The test profile run description. + * + * @param description the description value to set. + * @return the TestProfileRun object itself. + */ + @Generated + public TestProfileRun setDescription(String description) { + this.description = description; + this.updatedProperties.add("description"); + return this; + } + + /** + * Get the testProfileId property: Associated test profile ID for the test profile run. This is required to create a + * test profile run and can't be updated. + * + * @return the testProfileId value. + */ + @Generated + public String getTestProfileId() { + return this.testProfileId; + } + + /** + * Set the testProfileId property: Associated test profile ID for the test profile run. This is required to create a + * test profile run and can't be updated. + * + * @param testProfileId the testProfileId value to set. + * @return the TestProfileRun object itself. + */ + @Generated + public TestProfileRun setTestProfileId(String testProfileId) { + this.testProfileId = testProfileId; + this.updatedProperties.add("testProfileId"); + return this; + } + + /** + * Get the targetResourceId property: Target resource ID on which the test profile run is created. + * + * @return the targetResourceId value. + */ + @Generated + public String getTargetResourceId() { + return this.targetResourceId; + } + + /** + * Get the targetResourceConfigurations property: Configurations of the target resource on which the test profile + * ran. + * + * @return the targetResourceConfigurations value. + */ + @Generated + public TargetResourceConfigurations getTargetResourceConfigurations() { + return this.targetResourceConfigurations; + } + + /** + * Get the status property: The test profile run status. + * + * @return the status value. + */ + @Generated + public TestProfileRunStatus getStatus() { + return this.status; + } + + /** + * Get the errorDetails property: Error details if there is any failure in test profile run. These errors are + * specific to the Test Profile Run. + * + * @return the errorDetails value. + */ + @Generated + public List getErrorDetails() { + return this.errorDetails; + } + + /** + * Get the startDateTime property: The test profile run start DateTime(RFC 3339 literal format). + * + * @return the startDateTime value. + */ + @Generated + public OffsetDateTime getStartDateTime() { + return this.startDateTime; + } + + /** + * Get the endDateTime property: The test profile run end DateTime(RFC 3339 literal format). + * + * @return the endDateTime value. + */ + @Generated + public OffsetDateTime getEndDateTime() { + return this.endDateTime; + } + + /** + * Get the durationInSeconds property: Test profile run duration in seconds. + * + * @return the durationInSeconds value. + */ + @Generated + public Long getDurationInSeconds() { + return this.durationInSeconds; + } + + /** + * Get the testRunDetails property: Details of the test runs ran as part of the test profile run. + * Key is the testRunId of the corresponding testRun. + * + * @return the testRunDetails value. + */ + @Generated + public Map getTestRunDetails() { + return this.testRunDetails; + } + + /** + * Get the recommendations property: Recommendations provided based on a successful test profile run. + * + * @return the recommendations value. + */ + @Generated + public List getRecommendations() { + return this.recommendations; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("testProfileId", this.testProfileId); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("displayName")) { + if (this.displayName == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", this.displayName); + } + } + if (updatedProperties.contains("description")) { + if (this.description == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", this.description); + } + } + if (updatedProperties.contains("testProfileId")) { + if (this.testProfileId == null) { + jsonWriter.writeNullField("testProfileId"); + } else { + jsonWriter.writeStringField("testProfileId", this.testProfileId); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestProfileRun from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestProfileRun if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestProfileRun. + */ + @Generated + public static TestProfileRun fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestProfileRun deserializedTestProfileRun = new TestProfileRun(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testProfileRunId".equals(fieldName)) { + deserializedTestProfileRun.testProfileRunId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedTestProfileRun.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedTestProfileRun.description = reader.getString(); + } else if ("testProfileId".equals(fieldName)) { + deserializedTestProfileRun.testProfileId = reader.getString(); + } else if ("targetResourceId".equals(fieldName)) { + deserializedTestProfileRun.targetResourceId = reader.getString(); + } else if ("targetResourceConfigurations".equals(fieldName)) { + deserializedTestProfileRun.targetResourceConfigurations + = TargetResourceConfigurations.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedTestProfileRun.status = TestProfileRunStatus.fromString(reader.getString()); + } else if ("errorDetails".equals(fieldName)) { + List errorDetails = reader.readArray(reader1 -> ErrorDetails.fromJson(reader1)); + deserializedTestProfileRun.errorDetails = errorDetails; + } else if ("startDateTime".equals(fieldName)) { + deserializedTestProfileRun.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDateTime".equals(fieldName)) { + deserializedTestProfileRun.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("durationInSeconds".equals(fieldName)) { + deserializedTestProfileRun.durationInSeconds = reader.getNullable(JsonReader::getLong); + } else if ("testRunDetails".equals(fieldName)) { + Map testRunDetails + = reader.readMap(reader1 -> TestRunDetail.fromJson(reader1)); + deserializedTestProfileRun.testRunDetails = testRunDetails; + } else if ("recommendations".equals(fieldName)) { + List recommendations + = reader.readArray(reader1 -> TestProfileRunRecommendation.fromJson(reader1)); + deserializedTestProfileRun.recommendations = recommendations; + } else if ("createdDateTime".equals(fieldName)) { + deserializedTestProfileRun.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedTestProfileRun.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedTestProfileRun.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTestProfileRun.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestProfileRun; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunRecommendation.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunRecommendation.java new file mode 100644 index 000000000000..c4c91ed107dc --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunRecommendation.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A recommendation object that provides a list of configuration that optimizes its category. + */ +@Immutable +public final class TestProfileRunRecommendation implements JsonSerializable { + /* + * Category of the recommendation. + */ + @Generated + private final RecommendationCategory category; + + /* + * List of configurations IDs for which the recommendation is applicable. These are a subset of the provided target + * resource configurations. + */ + @Generated + private List configurations; + + /** + * Creates an instance of TestProfileRunRecommendation class. + * + * @param category the category value to set. + */ + @Generated + private TestProfileRunRecommendation(RecommendationCategory category) { + this.category = category; + } + + /** + * Get the category property: Category of the recommendation. + * + * @return the category value. + */ + @Generated + public RecommendationCategory getCategory() { + return this.category; + } + + /** + * Get the configurations property: List of configurations IDs for which the recommendation is applicable. These are + * a subset of the provided target resource configurations. + * + * @return the configurations value. + */ + @Generated + public List getConfigurations() { + return this.configurations; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeArrayField("configurations", this.configurations, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestProfileRunRecommendation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestProfileRunRecommendation if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestProfileRunRecommendation. + */ + @Generated + public static TestProfileRunRecommendation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationCategory category = null; + List configurations = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + category = RecommendationCategory.fromString(reader.getString()); + } else if ("configurations".equals(fieldName)) { + configurations = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + TestProfileRunRecommendation deserializedTestProfileRunRecommendation + = new TestProfileRunRecommendation(category); + deserializedTestProfileRunRecommendation.configurations = configurations; + + return deserializedTestProfileRunRecommendation; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunStatus.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunStatus.java new file mode 100644 index 000000000000..36102e8f9a52 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestProfileRunStatus.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Test profile run status. + */ +public final class TestProfileRunStatus extends ExpandableStringEnum { + /** + * Test profile run request is accepted. + */ + @Generated + public static final TestProfileRunStatus ACCEPTED = fromString("ACCEPTED"); + + /** + * Test profile run is not yet started. + */ + @Generated + public static final TestProfileRunStatus NOT_STARTED = fromString("NOTSTARTED"); + + /** + * Test profile run has started executing. + */ + @Generated + public static final TestProfileRunStatus EXECUTING = fromString("EXECUTING"); + + /** + * Test profile run has completed successfully. + */ + @Generated + public static final TestProfileRunStatus DONE = fromString("DONE"); + + /** + * Test profile run is being cancelled. + */ + @Generated + public static final TestProfileRunStatus CANCELLING = fromString("CANCELLING"); + + /** + * Test profile run is cancelled. + */ + @Generated + public static final TestProfileRunStatus CANCELLED = fromString("CANCELLED"); + + /** + * Test profile run has failed. + */ + @Generated + public static final TestProfileRunStatus FAILED = fromString("FAILED"); + + /** + * Creates a new instance of TestProfileRunStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TestProfileRunStatus() { + } + + /** + * Creates or finds a TestProfileRunStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestProfileRunStatus. + */ + @Generated + public static TestProfileRunStatus fromString(String name) { + return fromString(name, TestProfileRunStatus.class); + } + + /** + * Gets known TestProfileRunStatus values. + * + * @return known TestProfileRunStatus values. + */ + @Generated + public static Collection values() { + return values(TestProfileRunStatus.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunAppComponents.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunAppComponents.java new file mode 100644 index 000000000000..27bba56fa9f1 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunAppComponents.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Test run app component. + */ +@Fluent +public final class TestRunAppComponents implements JsonSerializable { + /* + * Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object } + */ + @Generated + private Map components; + + /* + * Test run identifier + */ + @Generated + private String testRunId; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestRunAppComponentsAccessor(new JsonMergePatchHelper.TestRunAppComponentsAccessor() { + @Override + public TestRunAppComponents prepareModelForJsonMergePatch(TestRunAppComponents model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestRunAppComponents model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestRunAppComponents class. + */ + @Generated + public TestRunAppComponents() { + } + + /** + * Get the components property: Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object }. + * + * @return the components value. + */ + @Generated + public Map getComponents() { + return this.components; + } + + /** + * Set the components property: Azure resource collection { resource id (fully qualified resource Id e.g + * subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.LoadTestService/loadtests/{resName}) + * : resource object }. + *

Required when create the resource.

+ * + * @param components the components value to set. + * @return the TestRunAppComponents object itself. + */ + @Generated + public TestRunAppComponents setComponents(Map components) { + this.components = components; + this.updatedProperties.add("components"); + return this; + } + + /** + * Get the testRunId property: Test run identifier. + * + * @return the testRunId value. + */ + @Generated + public String getTestRunId() { + return this.testRunId; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("components", this.components, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("components")) { + if (this.components == null) { + jsonWriter.writeNullField("components"); + } else { + jsonWriter.writeMapField("components", this.components, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getLoadTestingAppComponentAccessor() + .prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getLoadTestingAppComponentAccessor() + .prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunAppComponents from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunAppComponents if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunAppComponents. + */ + @Generated + public static TestRunAppComponents fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunAppComponents deserializedTestRunAppComponents = new TestRunAppComponents(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("components".equals(fieldName)) { + Map components + = reader.readMap(reader1 -> LoadTestingAppComponent.fromJson(reader1)); + deserializedTestRunAppComponents.components = components; + } else if ("testRunId".equals(fieldName)) { + deserializedTestRunAppComponents.testRunId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedTestRunAppComponents.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedTestRunAppComponents.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedTestRunAppComponents.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTestRunAppComponents.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunAppComponents; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunArtifacts.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunArtifacts.java new file mode 100644 index 000000000000..c9a65870dc73 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunArtifacts.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Collection of test run artifacts. + */ +@Immutable +public final class TestRunArtifacts implements JsonSerializable { + /* + * The input artifacts for the test run. + */ + @Generated + private TestRunInputArtifacts inputArtifacts; + + /* + * The output artifacts for the test run. + */ + @Generated + private TestRunOutputArtifacts outputArtifacts; + + /** + * Creates an instance of TestRunArtifacts class. + */ + @Generated + private TestRunArtifacts() { + } + + /** + * Get the inputArtifacts property: The input artifacts for the test run. + * + * @return the inputArtifacts value. + */ + @Generated + public TestRunInputArtifacts getInputArtifacts() { + return this.inputArtifacts; + } + + /** + * Get the outputArtifacts property: The output artifacts for the test run. + * + * @return the outputArtifacts value. + */ + @Generated + public TestRunOutputArtifacts getOutputArtifacts() { + return this.outputArtifacts; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("outputArtifacts", this.outputArtifacts); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunArtifacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunArtifacts if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunArtifacts. + */ + @Generated + public static TestRunArtifacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunArtifacts deserializedTestRunArtifacts = new TestRunArtifacts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inputArtifacts".equals(fieldName)) { + deserializedTestRunArtifacts.inputArtifacts = TestRunInputArtifacts.fromJson(reader); + } else if ("outputArtifacts".equals(fieldName)) { + deserializedTestRunArtifacts.outputArtifacts = TestRunOutputArtifacts.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunArtifacts; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunDetail.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunDetail.java new file mode 100644 index 000000000000..d3f9c6d3e57e --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunDetail.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Details of a particular test run for a test profile run. + */ +@Immutable +public final class TestRunDetail implements JsonSerializable { + /* + * Status of the test run. + */ + @Generated + private final TestRunStatus status; + + /* + * ID of the configuration on which the test ran. + */ + @Generated + private final String configurationId; + + /* + * Key value pair of extra properties associated with the test run. + */ + @Generated + private final Map properties; + + /** + * Creates an instance of TestRunDetail class. + * + * @param status the status value to set. + * @param configurationId the configurationId value to set. + * @param properties the properties value to set. + */ + @Generated + private TestRunDetail(TestRunStatus status, String configurationId, Map properties) { + this.status = status; + this.configurationId = configurationId; + this.properties = properties; + } + + /** + * Get the status property: Status of the test run. + * + * @return the status value. + */ + @Generated + public TestRunStatus getStatus() { + return this.status; + } + + /** + * Get the configurationId property: ID of the configuration on which the test ran. + * + * @return the configurationId value. + */ + @Generated + public String getConfigurationId() { + return this.configurationId; + } + + /** + * Get the properties property: Key value pair of extra properties associated with the test run. + * + * @return the properties value. + */ + @Generated + public Map getProperties() { + return this.properties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("configurationId", this.configurationId); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunDetail if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestRunDetail. + */ + @Generated + public static TestRunDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunStatus status = null; + String configurationId = null; + Map properties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + status = TestRunStatus.fromString(reader.getString()); + } else if ("configurationId".equals(fieldName)) { + configurationId = reader.getString(); + } else if ("properties".equals(fieldName)) { + properties = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new TestRunDetail(status, configurationId, properties); + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedEventCondition.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedEventCondition.java new file mode 100644 index 000000000000..2ed8d61249cc --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedEventCondition.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * TestRunEnded Event condition. + */ +@Fluent +public final class TestRunEndedEventCondition implements JsonSerializable { + /* + * The test run statuses to send notification for. + */ + @Generated + private List testRunStatuses; + + /* + * The test run results to send notification for. + */ + @Generated + private List testRunResults; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper + .setTestRunEndedEventConditionAccessor(new JsonMergePatchHelper.TestRunEndedEventConditionAccessor() { + @Override + public TestRunEndedEventCondition prepareModelForJsonMergePatch(TestRunEndedEventCondition model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestRunEndedEventCondition model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestRunEndedEventCondition class. + */ + @Generated + public TestRunEndedEventCondition() { + } + + /** + * Get the testRunStatuses property: The test run statuses to send notification for. + * + * @return the testRunStatuses value. + */ + @Generated + public List getTestRunStatuses() { + return this.testRunStatuses; + } + + /** + * Set the testRunStatuses property: The test run statuses to send notification for. + * + * @param testRunStatuses the testRunStatuses value to set. + * @return the TestRunEndedEventCondition object itself. + */ + @Generated + public TestRunEndedEventCondition setTestRunStatuses(List testRunStatuses) { + this.testRunStatuses = testRunStatuses; + this.updatedProperties.add("testRunStatuses"); + return this; + } + + /** + * Get the testRunResults property: The test run results to send notification for. + * + * @return the testRunResults value. + */ + @Generated + public List getTestRunResults() { + return this.testRunResults; + } + + /** + * Set the testRunResults property: The test run results to send notification for. + * + * @param testRunResults the testRunResults value to set. + * @return the TestRunEndedEventCondition object itself. + */ + @Generated + public TestRunEndedEventCondition setTestRunResults(List testRunResults) { + this.testRunResults = testRunResults; + this.updatedProperties.add("testRunResults"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("testRunStatuses", this.testRunStatuses, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("testRunResults", this.testRunResults, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("testRunStatuses")) { + if (this.testRunStatuses == null) { + jsonWriter.writeNullField("testRunStatuses"); + } else { + jsonWriter.writeArrayField("testRunStatuses", this.testRunStatuses, + (writer, element) -> writer.writeString(element.toString())); + } + } + if (updatedProperties.contains("testRunResults")) { + if (this.testRunResults == null) { + jsonWriter.writeNullField("testRunResults"); + } else { + jsonWriter.writeArrayField("testRunResults", this.testRunResults, + (writer, element) -> writer.writeString(element.toString())); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunEndedEventCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunEndedEventCondition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunEndedEventCondition. + */ + @Generated + public static TestRunEndedEventCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunEndedEventCondition deserializedTestRunEndedEventCondition = new TestRunEndedEventCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testRunStatuses".equals(fieldName)) { + List testRunStatuses + = reader.readArray(reader1 -> TestRunStatus.fromString(reader1.getString())); + deserializedTestRunEndedEventCondition.testRunStatuses = testRunStatuses; + } else if ("testRunResults".equals(fieldName)) { + List testRunResults + = reader.readArray(reader1 -> PassFailTestResult.fromString(reader1.getString())); + deserializedTestRunEndedEventCondition.testRunResults = testRunResults; + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunEndedEventCondition; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedNotificationEventFilter.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedNotificationEventFilter.java new file mode 100644 index 000000000000..a851a1f9ad2a --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunEndedNotificationEventFilter.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * The notification event filter when the event type is TestRunEnded and scope is Tests. + */ +@Fluent +public final class TestRunEndedNotificationEventFilter extends TestsNotificationEventFilter { + /* + * The event type + */ + @Generated + private NotificationEventType kind = NotificationEventType.TEST_RUN_ENDED; + + /* + * Event filtering condition. + */ + @Generated + private TestRunEndedEventCondition condition; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of TestRunEndedNotificationEventFilter class. + */ + @Generated + public TestRunEndedNotificationEventFilter() { + } + + /** + * Get the kind property: The event type. + * + * @return the kind value. + */ + @Generated + @Override + public NotificationEventType getKind() { + return this.kind; + } + + /** + * Get the condition property: Event filtering condition. + * + * @return the condition value. + */ + @Generated + public TestRunEndedEventCondition getCondition() { + return this.condition; + } + + /** + * Set the condition property: Event filtering condition. + * + * @param condition the condition value to set. + * @return the TestRunEndedNotificationEventFilter object itself. + */ + @Generated + public TestRunEndedNotificationEventFilter setCondition(TestRunEndedEventCondition condition) { + this.condition = condition; + this.updatedProperties.add("condition"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getTestsNotificationEventFilterAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("condition", this.condition); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + if (updatedProperties.contains("condition")) { + if (this.condition == null) { + jsonWriter.writeNullField("condition"); + } else { + JsonMergePatchHelper.getTestRunEndedEventConditionAccessor() + .prepareModelForJsonMergePatch(this.condition, true); + jsonWriter.writeJsonField("condition", this.condition); + JsonMergePatchHelper.getTestRunEndedEventConditionAccessor() + .prepareModelForJsonMergePatch(this.condition, false); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunEndedNotificationEventFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunEndedNotificationEventFilter if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunEndedNotificationEventFilter. + */ + @Generated + public static TestRunEndedNotificationEventFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunEndedNotificationEventFilter deserializedTestRunEndedNotificationEventFilter + = new TestRunEndedNotificationEventFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTestRunEndedNotificationEventFilter.kind + = NotificationEventType.fromString(reader.getString()); + } else if ("condition".equals(fieldName)) { + deserializedTestRunEndedNotificationEventFilter.condition + = TestRunEndedEventCondition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunEndedNotificationEventFilter; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunFileInfo.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunFileInfo.java new file mode 100644 index 000000000000..a41cc481796b --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunFileInfo.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Test run file info. + */ +@Immutable +public final class TestRunFileInfo implements JsonSerializable { + /* + * Name of the file. + */ + @Generated + private String fileName; + + /* + * File URL. + */ + @Generated + private String url; + + /* + * File type + */ + @Generated + private LoadTestingFileType fileType; + + /* + * Expiry time of the file (RFC 3339 literal format) + */ + @Generated + private OffsetDateTime expiresOn; + + /* + * Validation status of the file + */ + @Generated + private FileValidationStatus validationStatus; + + /* + * Validation failure error details + */ + @Generated + private String validationFailureDetails; + + /** + * Creates an instance of TestRunFileInfo class. + */ + @Generated + private TestRunFileInfo() { + } + + /** + * Get the fileName property: Name of the file. + * + * @return the fileName value. + */ + @Generated + public String getFileName() { + return this.fileName; + } + + /** + * Get the url property: File URL. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the fileType property: File type. + * + * @return the fileType value. + */ + @Generated + public LoadTestingFileType getFileType() { + return this.fileType; + } + + /** + * Get the expiresOn property: Expiry time of the file (RFC 3339 literal format). + * + * @return the expiresOn value. + */ + @Generated + public OffsetDateTime getExpiresOn() { + return this.expiresOn; + } + + /** + * Get the validationStatus property: Validation status of the file. + * + * @return the validationStatus value. + */ + @Generated + public FileValidationStatus getValidationStatus() { + return this.validationStatus; + } + + /** + * Get the validationFailureDetails property: Validation failure error details. + * + * @return the validationFailureDetails value. + */ + @Generated + public String getValidationFailureDetails() { + return this.validationFailureDetails; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunFileInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunFileInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestRunFileInfo. + */ + @Generated + public static TestRunFileInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunFileInfo deserializedTestRunFileInfo = new TestRunFileInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileName".equals(fieldName)) { + deserializedTestRunFileInfo.fileName = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedTestRunFileInfo.url = reader.getString(); + } else if ("fileType".equals(fieldName)) { + deserializedTestRunFileInfo.fileType = LoadTestingFileType.fromString(reader.getString()); + } else if ("expireDateTime".equals(fieldName)) { + deserializedTestRunFileInfo.expiresOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("validationStatus".equals(fieldName)) { + deserializedTestRunFileInfo.validationStatus = FileValidationStatus.fromString(reader.getString()); + } else if ("validationFailureDetails".equals(fieldName)) { + deserializedTestRunFileInfo.validationFailureDetails = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunFileInfo; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunInputArtifacts.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunInputArtifacts.java new file mode 100644 index 000000000000..1a52f42f88c7 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunInputArtifacts.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The input artifacts for the test run. + */ +@Immutable +public final class TestRunInputArtifacts implements JsonSerializable { + /* + * The load test YAML file that contains the the test configuration + */ + @Generated + private TestRunFileInfo configFileInfo; + + /* + * The test script file for the test run + */ + @Generated + private TestRunFileInfo testScriptFileInfo; + + /* + * The user properties file + */ + @Generated + private TestRunFileInfo userPropertyFileInfo; + + /* + * The zip file for all input artifacts + */ + @Generated + private TestRunFileInfo inputArtifactsZipFileInfo; + + /* + * The config json file for url based test + */ + @Generated + private TestRunFileInfo urlTestConfigFileInfo; + + /* + * Additional supported files for the test run + */ + @Generated + private List additionalFileInfo; + + /** + * Creates an instance of TestRunInputArtifacts class. + */ + @Generated + private TestRunInputArtifacts() { + } + + /** + * Get the configFileInfo property: The load test YAML file that contains the the test configuration. + * + * @return the configFileInfo value. + */ + @Generated + public TestRunFileInfo getConfigFileInfo() { + return this.configFileInfo; + } + + /** + * Get the testScriptFileInfo property: The test script file for the test run. + * + * @return the testScriptFileInfo value. + */ + @Generated + public TestRunFileInfo getTestScriptFileInfo() { + return this.testScriptFileInfo; + } + + /** + * Get the userPropertyFileInfo property: The user properties file. + * + * @return the userPropertyFileInfo value. + */ + @Generated + public TestRunFileInfo getUserPropertyFileInfo() { + return this.userPropertyFileInfo; + } + + /** + * Get the inputArtifactsZipFileInfo property: The zip file for all input artifacts. + * + * @return the inputArtifactsZipFileInfo value. + */ + @Generated + public TestRunFileInfo getInputArtifactsZipFileInfo() { + return this.inputArtifactsZipFileInfo; + } + + /** + * Get the urlTestConfigFileInfo property: The config json file for url based test. + * + * @return the urlTestConfigFileInfo value. + */ + @Generated + public TestRunFileInfo getUrlTestConfigFileInfo() { + return this.urlTestConfigFileInfo; + } + + /** + * Get the additionalFileInfo property: Additional supported files for the test run. + * + * @return the additionalFileInfo value. + */ + @Generated + public List getAdditionalFileInfo() { + return this.additionalFileInfo; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("configFileInfo", this.configFileInfo); + jsonWriter.writeJsonField("testScriptFileInfo", this.testScriptFileInfo); + jsonWriter.writeJsonField("userPropFileInfo", this.userPropertyFileInfo); + jsonWriter.writeJsonField("inputArtifactsZipFileInfo", this.inputArtifactsZipFileInfo); + jsonWriter.writeJsonField("urlTestConfigFileInfo", this.urlTestConfigFileInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunInputArtifacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunInputArtifacts if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunInputArtifacts. + */ + @Generated + public static TestRunInputArtifacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunInputArtifacts deserializedTestRunInputArtifacts = new TestRunInputArtifacts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configFileInfo".equals(fieldName)) { + deserializedTestRunInputArtifacts.configFileInfo = TestRunFileInfo.fromJson(reader); + } else if ("testScriptFileInfo".equals(fieldName)) { + deserializedTestRunInputArtifacts.testScriptFileInfo = TestRunFileInfo.fromJson(reader); + } else if ("userPropFileInfo".equals(fieldName)) { + deserializedTestRunInputArtifacts.userPropertyFileInfo = TestRunFileInfo.fromJson(reader); + } else if ("inputArtifactsZipFileInfo".equals(fieldName)) { + deserializedTestRunInputArtifacts.inputArtifactsZipFileInfo = TestRunFileInfo.fromJson(reader); + } else if ("urlTestConfigFileInfo".equals(fieldName)) { + deserializedTestRunInputArtifacts.urlTestConfigFileInfo = TestRunFileInfo.fromJson(reader); + } else if ("additionalFileInfo".equals(fieldName)) { + List additionalFileInfo + = reader.readArray(reader1 -> TestRunFileInfo.fromJson(reader1)); + deserializedTestRunInputArtifacts.additionalFileInfo = additionalFileInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunInputArtifacts; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunOutputArtifacts.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunOutputArtifacts.java new file mode 100644 index 000000000000..471a7abb75a2 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunOutputArtifacts.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output artifacts for the test run. + */ +@Immutable +public final class TestRunOutputArtifacts implements JsonSerializable { + /* + * The test run results file + */ + @Generated + private TestRunFileInfo resultFileInfo; + + /* + * The test run report with metrics + */ + @Generated + private TestRunFileInfo logsFileInfo; + + /* + * The container for test run artifacts. + */ + @Generated + private ArtifactsContainerInfo artifactsContainerInfo; + + /* + * The report file for the test run. + */ + @Generated + private TestRunFileInfo reportFileInfo; + + /** + * Creates an instance of TestRunOutputArtifacts class. + */ + @Generated + private TestRunOutputArtifacts() { + } + + /** + * Get the resultFileInfo property: The test run results file. + * + * @return the resultFileInfo value. + */ + @Generated + public TestRunFileInfo getResultFileInfo() { + return this.resultFileInfo; + } + + /** + * Get the logsFileInfo property: The test run report with metrics. + * + * @return the logsFileInfo value. + */ + @Generated + public TestRunFileInfo getLogsFileInfo() { + return this.logsFileInfo; + } + + /** + * Get the artifactsContainerInfo property: The container for test run artifacts. + * + * @return the artifactsContainerInfo value. + */ + @Generated + public ArtifactsContainerInfo getArtifactsContainerInfo() { + return this.artifactsContainerInfo; + } + + /** + * Get the reportFileInfo property: The report file for the test run. + * + * @return the reportFileInfo value. + */ + @Generated + public TestRunFileInfo getReportFileInfo() { + return this.reportFileInfo; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resultFileInfo", this.resultFileInfo); + jsonWriter.writeJsonField("logsFileInfo", this.logsFileInfo); + jsonWriter.writeJsonField("artifactsContainerInfo", this.artifactsContainerInfo); + jsonWriter.writeJsonField("reportFileInfo", this.reportFileInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunOutputArtifacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunOutputArtifacts if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunOutputArtifacts. + */ + @Generated + public static TestRunOutputArtifacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunOutputArtifacts deserializedTestRunOutputArtifacts = new TestRunOutputArtifacts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultFileInfo".equals(fieldName)) { + deserializedTestRunOutputArtifacts.resultFileInfo = TestRunFileInfo.fromJson(reader); + } else if ("logsFileInfo".equals(fieldName)) { + deserializedTestRunOutputArtifacts.logsFileInfo = TestRunFileInfo.fromJson(reader); + } else if ("artifactsContainerInfo".equals(fieldName)) { + deserializedTestRunOutputArtifacts.artifactsContainerInfo = ArtifactsContainerInfo.fromJson(reader); + } else if ("reportFileInfo".equals(fieldName)) { + deserializedTestRunOutputArtifacts.reportFileInfo = TestRunFileInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunOutputArtifacts; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunServerMetricsConfiguration.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunServerMetricsConfiguration.java new file mode 100644 index 000000000000..be87f1d079b8 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunServerMetricsConfiguration.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Test run server metrics configuration. + */ +@Fluent +public final class TestRunServerMetricsConfiguration implements JsonSerializable { + /* + * Test run identifier + */ + @Generated + private String testRunId; + + /* + * Azure resource metrics collection {metric id : metrics object} (Refer : + * https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + */ + @Generated + private Map metrics; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestRunServerMetricsConfigurationAccessor( + new JsonMergePatchHelper.TestRunServerMetricsConfigurationAccessor() { + @Override + public TestRunServerMetricsConfiguration prepareModelForJsonMergePatch( + TestRunServerMetricsConfiguration model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestRunServerMetricsConfiguration model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestRunServerMetricsConfiguration class. + */ + @Generated + public TestRunServerMetricsConfiguration() { + } + + /** + * Get the testRunId property: Test run identifier. + * + * @return the testRunId value. + */ + @Generated + public String getTestRunId() { + return this.testRunId; + } + + /** + * Get the metrics property: Azure resource metrics collection {metric id : metrics object} (Refer : + * https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + * + * @return the metrics value. + */ + @Generated + public Map getMetrics() { + return this.metrics; + } + + /** + * Set the metrics property: Azure resource metrics collection {metric id : metrics object} (Refer : + * https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + * + * @param metrics the metrics value to set. + * @return the TestRunServerMetricsConfiguration object itself. + */ + @Generated + public TestRunServerMetricsConfiguration setMetrics(Map metrics) { + this.metrics = metrics; + this.updatedProperties.add("metrics"); + return this; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metrics", this.metrics, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("metrics")) { + if (this.metrics == null) { + jsonWriter.writeNullField("metrics"); + } else { + jsonWriter.writeMapField("metrics", this.metrics, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getResourceMetricAccessor().prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getResourceMetricAccessor().prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunServerMetricsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunServerMetricsConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunServerMetricsConfiguration. + */ + @Generated + public static TestRunServerMetricsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunServerMetricsConfiguration deserializedTestRunServerMetricsConfiguration + = new TestRunServerMetricsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testRunId".equals(fieldName)) { + deserializedTestRunServerMetricsConfiguration.testRunId = reader.getString(); + } else if ("metrics".equals(fieldName)) { + Map metrics = reader.readMap(reader1 -> ResourceMetric.fromJson(reader1)); + deserializedTestRunServerMetricsConfiguration.metrics = metrics; + } else if ("createdDateTime".equals(fieldName)) { + deserializedTestRunServerMetricsConfiguration.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedTestRunServerMetricsConfiguration.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedTestRunServerMetricsConfiguration.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTestRunServerMetricsConfiguration.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunServerMetricsConfiguration; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStartedNotificationEventFilter.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStartedNotificationEventFilter.java new file mode 100644 index 000000000000..5182d3004672 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStartedNotificationEventFilter.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * The notification event filter when the event type is TestRunStarted and scope is Tests. + */ +@Immutable +public final class TestRunStartedNotificationEventFilter extends TestsNotificationEventFilter { + /* + * The event type + */ + @Generated + private NotificationEventType kind = NotificationEventType.TEST_RUN_STARTED; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of TestRunStartedNotificationEventFilter class. + */ + @Generated + public TestRunStartedNotificationEventFilter() { + } + + /** + * Get the kind property: The event type. + * + * @return the kind value. + */ + @Generated + @Override + public NotificationEventType getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getTestsNotificationEventFilterAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunStartedNotificationEventFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunStartedNotificationEventFilter if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunStartedNotificationEventFilter. + */ + @Generated + public static TestRunStartedNotificationEventFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunStartedNotificationEventFilter deserializedTestRunStartedNotificationEventFilter + = new TestRunStartedNotificationEventFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTestRunStartedNotificationEventFilter.kind + = NotificationEventType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunStartedNotificationEventFilter; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatistics.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatistics.java new file mode 100644 index 000000000000..a2a72df55f6e --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatistics.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Test run statistics. + */ +@Immutable +public final class TestRunStatistics implements JsonSerializable { + /* + * Transaction name. + */ + @Generated + private String transaction; + + /* + * Sampler count. + */ + @Generated + private Double sampleCount; + + /* + * Error count. + */ + @Generated + private Double errorCount; + + /* + * Error percentage. + */ + @Generated + private Double errorPercentage; + + /* + * Mean response time. + */ + @Generated + private Double meanResponseTime; + + /* + * Median response time. + */ + @Generated + private Double medianResponseTime; + + /* + * Max response time. + */ + @Generated + private Double maxResponseTime; + + /* + * Minimum response time. + */ + @Generated + private Double minResponseTime; + + /* + * 90 percentile response time. + */ + @Generated + private Double percentile90ResponseTime; + + /* + * 95 percentile response time. + */ + @Generated + private Double percentile95ResponseTime; + + /* + * 99 percentile response time. + */ + @Generated + private Double percentile99ResponseTime; + + /* + * 75 percentile response time. + */ + @Generated + private Double percentile75ResponseTime; + + /* + * 96 percentile response time. + */ + @Generated + private Double percentile96ResponseTime; + + /* + * 97 percentile response time. + */ + @Generated + private Double percentile97ResponseTime; + + /* + * 98 percentile response time. + */ + @Generated + private Double percentile98ResponseTime; + + /* + * 99.9 percentile response time. + */ + @Generated + private Double percentile999ResponseTime; + + /* + * 99.99 percentile response time. + */ + @Generated + private Double percentile9999ResponseTime; + + /* + * Throughput. + */ + @Generated + private Double throughput; + + /* + * Received network bytes. + */ + @Generated + private Double receivedKBytesPerSec; + + /* + * Send network bytes. + */ + @Generated + private Double sentKBytesPerSec; + + /** + * Creates an instance of TestRunStatistics class. + */ + @Generated + private TestRunStatistics() { + } + + /** + * Get the transaction property: Transaction name. + * + * @return the transaction value. + */ + @Generated + public String getTransaction() { + return this.transaction; + } + + /** + * Get the sampleCount property: Sampler count. + * + * @return the sampleCount value. + */ + @Generated + public Double getSampleCount() { + return this.sampleCount; + } + + /** + * Get the errorCount property: Error count. + * + * @return the errorCount value. + */ + @Generated + public Double getErrorCount() { + return this.errorCount; + } + + /** + * Get the errorPercentage property: Error percentage. + * + * @return the errorPercentage value. + */ + @Generated + public Double getErrorPercentage() { + return this.errorPercentage; + } + + /** + * Get the meanResponseTime property: Mean response time. + * + * @return the meanResponseTime value. + */ + @Generated + public Double getMeanResponseTime() { + return this.meanResponseTime; + } + + /** + * Get the medianResponseTime property: Median response time. + * + * @return the medianResponseTime value. + */ + @Generated + public Double getMedianResponseTime() { + return this.medianResponseTime; + } + + /** + * Get the maxResponseTime property: Max response time. + * + * @return the maxResponseTime value. + */ + @Generated + public Double getMaxResponseTime() { + return this.maxResponseTime; + } + + /** + * Get the minResponseTime property: Minimum response time. + * + * @return the minResponseTime value. + */ + @Generated + public Double getMinResponseTime() { + return this.minResponseTime; + } + + /** + * Get the percentile90ResponseTime property: 90 percentile response time. + * + * @return the percentile90ResponseTime value. + */ + @Generated + public Double getPercentile90ResponseTime() { + return this.percentile90ResponseTime; + } + + /** + * Get the percentile95ResponseTime property: 95 percentile response time. + * + * @return the percentile95ResponseTime value. + */ + @Generated + public Double getPercentile95ResponseTime() { + return this.percentile95ResponseTime; + } + + /** + * Get the percentile99ResponseTime property: 99 percentile response time. + * + * @return the percentile99ResponseTime value. + */ + @Generated + public Double getPercentile99ResponseTime() { + return this.percentile99ResponseTime; + } + + /** + * Get the percentile75ResponseTime property: 75 percentile response time. + * + * @return the percentile75ResponseTime value. + */ + @Generated + public Double getPercentile75ResponseTime() { + return this.percentile75ResponseTime; + } + + /** + * Get the percentile96ResponseTime property: 96 percentile response time. + * + * @return the percentile96ResponseTime value. + */ + @Generated + public Double getPercentile96ResponseTime() { + return this.percentile96ResponseTime; + } + + /** + * Get the percentile97ResponseTime property: 97 percentile response time. + * + * @return the percentile97ResponseTime value. + */ + @Generated + public Double getPercentile97ResponseTime() { + return this.percentile97ResponseTime; + } + + /** + * Get the percentile98ResponseTime property: 98 percentile response time. + * + * @return the percentile98ResponseTime value. + */ + @Generated + public Double getPercentile98ResponseTime() { + return this.percentile98ResponseTime; + } + + /** + * Get the percentile999ResponseTime property: 99.9 percentile response time. + * + * @return the percentile999ResponseTime value. + */ + @Generated + public Double getPercentile999ResponseTime() { + return this.percentile999ResponseTime; + } + + /** + * Get the percentile9999ResponseTime property: 99.99 percentile response time. + * + * @return the percentile9999ResponseTime value. + */ + @Generated + public Double getPercentile9999ResponseTime() { + return this.percentile9999ResponseTime; + } + + /** + * Get the throughput property: Throughput. + * + * @return the throughput value. + */ + @Generated + public Double getThroughput() { + return this.throughput; + } + + /** + * Get the receivedKBytesPerSec property: Received network bytes. + * + * @return the receivedKBytesPerSec value. + */ + @Generated + public Double getReceivedKBytesPerSec() { + return this.receivedKBytesPerSec; + } + + /** + * Get the sentKBytesPerSec property: Send network bytes. + * + * @return the sentKBytesPerSec value. + */ + @Generated + public Double getSentKBytesPerSec() { + return this.sentKBytesPerSec; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunStatistics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunStatistics if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunStatistics. + */ + @Generated + public static TestRunStatistics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunStatistics deserializedTestRunStatistics = new TestRunStatistics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("transaction".equals(fieldName)) { + deserializedTestRunStatistics.transaction = reader.getString(); + } else if ("sampleCount".equals(fieldName)) { + deserializedTestRunStatistics.sampleCount = reader.getNullable(JsonReader::getDouble); + } else if ("errorCount".equals(fieldName)) { + deserializedTestRunStatistics.errorCount = reader.getNullable(JsonReader::getDouble); + } else if ("errorPct".equals(fieldName)) { + deserializedTestRunStatistics.errorPercentage = reader.getNullable(JsonReader::getDouble); + } else if ("meanResTime".equals(fieldName)) { + deserializedTestRunStatistics.meanResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("medianResTime".equals(fieldName)) { + deserializedTestRunStatistics.medianResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("maxResTime".equals(fieldName)) { + deserializedTestRunStatistics.maxResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("minResTime".equals(fieldName)) { + deserializedTestRunStatistics.minResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct1ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile90ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct2ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile95ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct3ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile99ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct75ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile75ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct96ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile96ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct97ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile97ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct98ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile98ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct999ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile999ResponseTime = reader.getNullable(JsonReader::getDouble); + } else if ("pct9999ResTime".equals(fieldName)) { + deserializedTestRunStatistics.percentile9999ResponseTime + = reader.getNullable(JsonReader::getDouble); + } else if ("throughput".equals(fieldName)) { + deserializedTestRunStatistics.throughput = reader.getNullable(JsonReader::getDouble); + } else if ("receivedKBytesPerSec".equals(fieldName)) { + deserializedTestRunStatistics.receivedKBytesPerSec = reader.getNullable(JsonReader::getDouble); + } else if ("sentKBytesPerSec".equals(fieldName)) { + deserializedTestRunStatistics.sentKBytesPerSec = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunStatistics; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatus.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatus.java new file mode 100644 index 000000000000..ca85f719b1ac --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestRunStatus.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Test run status. + */ +public final class TestRunStatus extends ExpandableStringEnum { + /** + * Test run request is accepted. + */ + @Generated + public static final TestRunStatus ACCEPTED = fromString("ACCEPTED"); + + /** + * Test run is not yet started. + */ + @Generated + public static final TestRunStatus NOT_STARTED = fromString("NOTSTARTED"); + + /** + * Test run is provisioning. + */ + @Generated + public static final TestRunStatus PROVISIONING = fromString("PROVISIONING"); + + /** + * Test run is provisioned. + */ + @Generated + public static final TestRunStatus PROVISIONED = fromString("PROVISIONED"); + + /** + * Test run is getting configured. + */ + @Generated + public static final TestRunStatus CONFIGURING = fromString("CONFIGURING"); + + /** + * Test run configuration is done. + */ + @Generated + public static final TestRunStatus CONFIGURED = fromString("CONFIGURED"); + + /** + * Test run has started executing. + */ + @Generated + public static final TestRunStatus EXECUTING = fromString("EXECUTING"); + + /** + * Test run execution is completed. + */ + @Generated + public static final TestRunStatus EXECUTED = fromString("EXECUTED"); + + /** + * Test run is getting deprovisioned. + */ + @Generated + public static final TestRunStatus DEPROVISIONING = fromString("DEPROVISIONING"); + + /** + * Test run is deprovisioned. + */ + @Generated + public static final TestRunStatus DEPROVISIONED = fromString("DEPROVISIONED"); + + /** + * Test run is completed. + */ + @Generated + public static final TestRunStatus DONE = fromString("DONE"); + + /** + * Test run is being cancelled. + */ + @Generated + public static final TestRunStatus CANCELLING = fromString("CANCELLING"); + + /** + * Test run request is cancelled. + */ + @Generated + public static final TestRunStatus CANCELLED = fromString("CANCELLED"); + + /** + * Test run request is failed. + */ + @Generated + public static final TestRunStatus FAILED = fromString("FAILED"); + + /** + * Test run JMX file is validated. + */ + @Generated + public static final TestRunStatus VALIDATION_SUCCESS = fromString("VALIDATION_SUCCESS"); + + /** + * Test run JMX file validation is failed. + */ + @Generated + public static final TestRunStatus VALIDATION_FAILURE = fromString("VALIDATION_FAILURE"); + + /** + * Creates a new instance of TestRunStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TestRunStatus() { + } + + /** + * Creates or finds a TestRunStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestRunStatus. + */ + @Generated + public static TestRunStatus fromString(String name) { + return fromString(name, TestRunStatus.class); + } + + /** + * Gets known TestRunStatus values. + * + * @return known TestRunStatus values. + */ + @Generated + public static Collection values() { + return values(TestRunStatus.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestSecret.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestSecret.java new file mode 100644 index 000000000000..6ab0142d4471 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestSecret.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Secret. + */ +@Fluent +public final class TestSecret implements JsonSerializable { + /* + * The value of the secret for the respective type + */ + @Generated + private String value; + + /* + * Type of secret + */ + @Generated + private SecretType type; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestSecretAccessor(new JsonMergePatchHelper.TestSecretAccessor() { + @Override + public TestSecret prepareModelForJsonMergePatch(TestSecret model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestSecret model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestSecret class. + */ + @Generated + public TestSecret() { + } + + /** + * Get the value property: The value of the secret for the respective type. + * + * @return the value value. + */ + @Generated + public String getValue() { + return this.value; + } + + /** + * Set the value property: The value of the secret for the respective type. + * + * @param value the value value to set. + * @return the TestSecret object itself. + */ + @Generated + public TestSecret setValue(String value) { + this.value = value; + this.updatedProperties.add("value"); + return this; + } + + /** + * Get the type property: Type of secret. + * + * @return the type value. + */ + @Generated + public SecretType getType() { + return this.type; + } + + /** + * Set the type property: Type of secret. + * + * @param type the type value to set. + * @return the TestSecret object itself. + */ + @Generated + public TestSecret setType(SecretType type) { + this.type = type; + this.updatedProperties.add("type"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("value")) { + if (this.value == null) { + jsonWriter.writeNullField("value"); + } else { + jsonWriter.writeStringField("value", this.value); + } + } + if (updatedProperties.contains("type")) { + if (this.type == null) { + jsonWriter.writeNullField("type"); + } else { + jsonWriter.writeStringField("type", this.type.toString()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestSecret from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestSecret if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TestSecret. + */ + @Generated + public static TestSecret fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestSecret deserializedTestSecret = new TestSecret(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedTestSecret.value = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTestSecret.type = SecretType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTestSecret; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestServerMetricsConfiguration.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestServerMetricsConfiguration.java new file mode 100644 index 000000000000..c64d064d30f2 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestServerMetricsConfiguration.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Test server metrics configuration. + */ +@Fluent +public final class TestServerMetricsConfiguration implements JsonSerializable { + /* + * Test identifier + */ + @Generated + private String testId; + + /* + * Azure resource metrics collection {metric id : metrics object} (Refer : + * https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + */ + @Generated + private Map metrics; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTestServerMetricsConfigurationAccessor( + new JsonMergePatchHelper.TestServerMetricsConfigurationAccessor() { + @Override + public TestServerMetricsConfiguration + prepareModelForJsonMergePatch(TestServerMetricsConfiguration model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestServerMetricsConfiguration model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestServerMetricsConfiguration class. + */ + @Generated + public TestServerMetricsConfiguration() { + } + + /** + * Get the testId property: Test identifier. + * + * @return the testId value. + */ + @Generated + public String getTestId() { + return this.testId; + } + + /** + * Get the metrics property: Azure resource metrics collection {metric id : metrics object} (Refer : + * https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + * + * @return the metrics value. + */ + @Generated + public Map getMetrics() { + return this.metrics; + } + + /** + * Set the metrics property: Azure resource metrics collection {metric id : metrics object} (Refer : + * https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions/list#metricdefinition + * for metric id). + *

Required when create the resource.

+ * + * @param metrics the metrics value to set. + * @return the TestServerMetricsConfiguration object itself. + */ + @Generated + public TestServerMetricsConfiguration setMetrics(Map metrics) { + this.metrics = metrics; + this.updatedProperties.add("metrics"); + return this; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metrics", this.metrics, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("metrics")) { + if (this.metrics == null) { + jsonWriter.writeNullField("metrics"); + } else { + jsonWriter.writeMapField("metrics", this.metrics, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getResourceMetricAccessor().prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getResourceMetricAccessor().prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestServerMetricsConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestServerMetricsConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestServerMetricsConfiguration. + */ + @Generated + public static TestServerMetricsConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestServerMetricsConfiguration deserializedTestServerMetricsConfiguration + = new TestServerMetricsConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("testId".equals(fieldName)) { + deserializedTestServerMetricsConfiguration.testId = reader.getString(); + } else if ("metrics".equals(fieldName)) { + Map metrics = reader.readMap(reader1 -> ResourceMetric.fromJson(reader1)); + deserializedTestServerMetricsConfiguration.metrics = metrics; + } else if ("createdDateTime".equals(fieldName)) { + deserializedTestServerMetricsConfiguration.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedTestServerMetricsConfiguration.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedTestServerMetricsConfiguration.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTestServerMetricsConfiguration.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestServerMetricsConfiguration; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationEventFilter.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationEventFilter.java new file mode 100644 index 000000000000..4c1dbf30f1b6 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationEventFilter.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * The notification event filter for Tests scope. + */ +@Immutable +public class TestsNotificationEventFilter implements JsonSerializable { + /* + * The event type + */ + @Generated + private NotificationEventType kind = NotificationEventType.fromString("TestsNotificationEventFilter"); + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper + .setTestsNotificationEventFilterAccessor(new JsonMergePatchHelper.TestsNotificationEventFilterAccessor() { + @Override + public TestsNotificationEventFilter prepareModelForJsonMergePatch(TestsNotificationEventFilter model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(TestsNotificationEventFilter model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of TestsNotificationEventFilter class. + */ + @Generated + public TestsNotificationEventFilter() { + } + + /** + * Get the kind property: The event type. + * + * @return the kind value. + */ + @Generated + public NotificationEventType getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestsNotificationEventFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestsNotificationEventFilter if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TestsNotificationEventFilter. + */ + @Generated + public static TestsNotificationEventFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("TestRunEnded".equals(discriminatorValue)) { + return TestRunEndedNotificationEventFilter.fromJson(readerToUse.reset()); + } else if ("TestRunStarted".equals(discriminatorValue)) { + return TestRunStartedNotificationEventFilter.fromJson(readerToUse.reset()); + } else if ("TriggerCompleted".equals(discriminatorValue)) { + return TriggerCompletedNotificationEventFilter.fromJson(readerToUse.reset()); + } else if ("TriggerDisabled".equals(discriminatorValue)) { + return TriggerDisabledNotificationEventFilter.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static TestsNotificationEventFilter fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestsNotificationEventFilter deserializedTestsNotificationEventFilter = new TestsNotificationEventFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTestsNotificationEventFilter.kind + = NotificationEventType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTestsNotificationEventFilter; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationRule.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationRule.java new file mode 100644 index 000000000000..345216739b77 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TestsNotificationRule.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Tests Notification rule model. + */ +@Fluent +public final class TestsNotificationRule extends NotificationRule { + /* + * The scope of the notification rule. + */ + @Generated + private NotificationScopeType scope = NotificationScopeType.TESTS; + + /* + * The test ids to include. If not provided, notification will be sent for all testIds. + */ + @Generated + private List testIds; + + /* + * The event to receive notifications for along with filtering conditions. + * Key is a user-assigned identifier for the event filter. + */ + @Generated + private Map eventFilters; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of TestsNotificationRule class. + */ + @Generated + public TestsNotificationRule() { + } + + /** + * Get the scope property: The scope of the notification rule. + * + * @return the scope value. + */ + @Generated + @Override + public NotificationScopeType getScope() { + return this.scope; + } + + /** + * Get the testIds property: The test ids to include. If not provided, notification will be sent for all testIds. + * + * @return the testIds value. + */ + @Generated + public List getTestIds() { + return this.testIds; + } + + /** + * Set the testIds property: The test ids to include. If not provided, notification will be sent for all testIds. + * + * @param testIds the testIds value to set. + * @return the TestsNotificationRule object itself. + */ + @Generated + public TestsNotificationRule setTestIds(List testIds) { + this.testIds = testIds; + this.updatedProperties.add("testIds"); + return this; + } + + /** + * Get the eventFilters property: The event to receive notifications for along with filtering conditions. + * Key is a user-assigned identifier for the event filter. + * + * @return the eventFilters value. + */ + @Generated + public Map getEventFilters() { + return this.eventFilters; + } + + /** + * Set the eventFilters property: The event to receive notifications for along with filtering conditions. + * Key is a user-assigned identifier for the event filter. + *

Required when create the resource.

+ * + * @param eventFilters the eventFilters value to set. + * @return the TestsNotificationRule object itself. + */ + @Generated + public TestsNotificationRule setEventFilters(Map eventFilters) { + this.eventFilters = eventFilters; + this.updatedProperties.add("eventFilters"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public TestsNotificationRule setDisplayName(String displayName) { + super.setDisplayName(displayName); + this.updatedProperties.add("displayName"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public TestsNotificationRule setActionGroupIds(List actionGroupIds) { + super.setActionGroupIds(actionGroupIds); + this.updatedProperties.add("actionGroupIds"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getNotificationRuleAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", getDisplayName()); + jsonWriter.writeArrayField("actionGroupIds", getActionGroupIds(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeArrayField("testIds", this.testIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("eventFilters", this.eventFilters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("displayName")) { + if (getDisplayName() == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", getDisplayName()); + } + } + if (updatedProperties.contains("actionGroupIds")) { + if (getActionGroupIds() == null) { + jsonWriter.writeNullField("actionGroupIds"); + } else { + jsonWriter.writeArrayField("actionGroupIds", getActionGroupIds(), + (writer, element) -> writer.writeString(element)); + } + } + jsonWriter.writeStringField("scope", this.scope.toString()); + if (updatedProperties.contains("testIds")) { + if (this.testIds == null) { + jsonWriter.writeNullField("testIds"); + } else { + jsonWriter.writeArrayField("testIds", this.testIds, (writer, element) -> writer.writeString(element)); + } + } + if (updatedProperties.contains("eventFilters")) { + if (this.eventFilters == null) { + jsonWriter.writeNullField("eventFilters"); + } else { + jsonWriter.writeMapField("eventFilters", this.eventFilters, (writer, element) -> { + if (element != null) { + JsonMergePatchHelper.getTestsNotificationEventFilterAccessor() + .prepareModelForJsonMergePatch(element, true); + writer.writeJson(element); + JsonMergePatchHelper.getTestsNotificationEventFilterAccessor() + .prepareModelForJsonMergePatch(element, false); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestsNotificationRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestsNotificationRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestsNotificationRule. + */ + @Generated + public static TestsNotificationRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestsNotificationRule deserializedTestsNotificationRule = new TestsNotificationRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("notificationRuleId".equals(fieldName)) { + JsonMergePatchHelper.getNotificationRuleAccessor() + .setNotificationRuleId(deserializedTestsNotificationRule, reader.getString()); + } else if ("displayName".equals(fieldName)) { + JsonMergePatchHelper.getNotificationRuleAccessor() + .setDisplayName(deserializedTestsNotificationRule, reader.getString()); + } else if ("actionGroupIds".equals(fieldName)) { + List actionGroupIds = reader.readArray(reader1 -> reader1.getString()); + JsonMergePatchHelper.getNotificationRuleAccessor() + .setActionGroupIds(deserializedTestsNotificationRule, actionGroupIds); + } else if ("createdDateTime".equals(fieldName)) { + JsonMergePatchHelper.getNotificationRuleAccessor() + .setCreatedDateTime(deserializedTestsNotificationRule, reader.getNullable( + nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("createdBy".equals(fieldName)) { + JsonMergePatchHelper.getNotificationRuleAccessor() + .setCreatedBy(deserializedTestsNotificationRule, reader.getString()); + } else if ("lastModifiedDateTime".equals(fieldName)) { + JsonMergePatchHelper.getNotificationRuleAccessor() + .setLastModifiedDateTime(deserializedTestsNotificationRule, reader.getNullable( + nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedBy".equals(fieldName)) { + JsonMergePatchHelper.getNotificationRuleAccessor() + .setLastModifiedBy(deserializedTestsNotificationRule, reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedTestsNotificationRule.scope = NotificationScopeType.fromString(reader.getString()); + } else if ("testIds".equals(fieldName)) { + List testIds = reader.readArray(reader1 -> reader1.getString()); + deserializedTestsNotificationRule.testIds = testIds; + } else if ("eventFilters".equals(fieldName)) { + Map eventFilters + = reader.readMap(reader1 -> TestsNotificationEventFilter.fromJson(reader1)); + deserializedTestsNotificationRule.eventFilters = eventFilters; + } else { + reader.skipChildren(); + } + } + + return deserializedTestsNotificationRule; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeGrain.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeGrain.java new file mode 100644 index 000000000000..86ee93e19f80 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeGrain.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Time Grain. + */ +public final class TimeGrain extends ExpandableStringEnum { + /** + * 5 seconds, available only if test run duration is less than 10 minutes. + */ + @Generated + public static final TimeGrain FIVE_SECONDS = fromString("PT5S"); + + /** + * 10 seconds, available only if test run duration is less than 10 minutes. + */ + @Generated + public static final TimeGrain TEN_SECONDS = fromString("PT10S"); + + /** + * 1 minute. + */ + @Generated + public static final TimeGrain ONE_MINUTE = fromString("PT1M"); + + /** + * 5 minutes, available only if test run duration is greater than 1 minute. + */ + @Generated + public static final TimeGrain FIVE_MINUTES = fromString("PT5M"); + + /** + * 1 hour, available only if test run duration is greater than 1 minute. + */ + @Generated + public static final TimeGrain ONE_HOUR = fromString("PT1H"); + + /** + * Creates a new instance of TimeGrain value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TimeGrain() { + } + + /** + * Creates or finds a TimeGrain from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeGrain. + */ + @Generated + public static TimeGrain fromString(String name) { + return fromString(name, TimeGrain.class); + } + + /** + * Gets known TimeGrain values. + * + * @return known TimeGrain values. + */ + @Generated + public static Collection values() { + return values(TimeGrain.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeSeriesElement.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeSeriesElement.java new file mode 100644 index 000000000000..5f6a146ce2c0 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TimeSeriesElement.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The time series returned when a data query is performed. + */ +@Immutable +public final class TimeSeriesElement implements JsonSerializable { + /* + * An array of data points representing the metric values. + */ + @Generated + private List data; + + /* + * The dimension values + */ + @Generated + private List dimensionValues; + + /** + * Creates an instance of TimeSeriesElement class. + */ + @Generated + private TimeSeriesElement() { + } + + /** + * Get the data property: An array of data points representing the metric values. + * + * @return the data value. + */ + @Generated + public List getData() { + return this.data; + } + + /** + * Get the dimensionValues property: The dimension values. + * + * @return the dimensionValues value. + */ + @Generated + public List getDimensionValues() { + return this.dimensionValues; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dimensionValues", this.dimensionValues, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimeSeriesElement from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimeSeriesElement if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TimeSeriesElement. + */ + @Generated + public static TimeSeriesElement fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimeSeriesElement deserializedTimeSeriesElement = new TimeSeriesElement(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + List data = reader.readArray(reader1 -> MetricValue.fromJson(reader1)); + deserializedTimeSeriesElement.data = data; + } else if ("dimensionValues".equals(fieldName)) { + List dimensionValues + = reader.readArray(reader1 -> DimensionValue.fromJson(reader1)); + deserializedTimeSeriesElement.dimensionValues = dimensionValues; + } else { + reader.skipChildren(); + } + } + + return deserializedTimeSeriesElement; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Trigger.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Trigger.java new file mode 100644 index 000000000000..7d3ce76741b3 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/Trigger.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.HashSet; +import java.util.Set; + +/** + * Trigger model. + */ +@Fluent +public class Trigger implements JsonSerializable { + /* + * The type of the trigger. + */ + @Generated + private TriggerType kind = TriggerType.fromString("Trigger"); + + /* + * The unique identifier of the trigger. + */ + @Generated + private String triggerId; + + /* + * The name of the trigger. + */ + @Generated + private String displayName; + + /* + * The description of the trigger. + */ + @Generated + private String description; + + /* + * The current state of the trigger. + */ + @Generated + private TriggerState state; + + /* + * Details of current state of the trigger. + */ + @Generated + private StateDetails stateDetails; + + /* + * The creation datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime createdDateTime; + + /* + * The user that created. + */ + @Generated + private String createdBy; + + /* + * The last Modified datetime(RFC 3339 literal format). + */ + @Generated + private OffsetDateTime lastModifiedDateTime; + + /* + * The user that last modified. + */ + @Generated + private String lastModifiedBy; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setTriggerAccessor(new JsonMergePatchHelper.TriggerAccessor() { + @Override + public Trigger prepareModelForJsonMergePatch(Trigger model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(Trigger model) { + return model.jsonMergePatch; + } + + @Override + public void setTriggerId(Trigger model, String triggerId) { + model.triggerId = triggerId; + } + + @Override + public void setDisplayName(Trigger model, String displayName) { + model.displayName = displayName; + } + + @Override + public void setDescription(Trigger model, String description) { + model.description = description; + } + + @Override + public void setState(Trigger model, TriggerState state) { + model.state = state; + } + + @Override + public void setStateDetails(Trigger model, StateDetails stateDetails) { + model.stateDetails = stateDetails; + } + + @Override + public void setCreatedDateTime(Trigger model, OffsetDateTime createdDateTime) { + model.createdDateTime = createdDateTime; + } + + @Override + public void setCreatedBy(Trigger model, String createdBy) { + model.createdBy = createdBy; + } + + @Override + public void setLastModifiedDateTime(Trigger model, OffsetDateTime lastModifiedDateTime) { + model.lastModifiedDateTime = lastModifiedDateTime; + } + + @Override + public void setLastModifiedBy(Trigger model, String lastModifiedBy) { + model.lastModifiedBy = lastModifiedBy; + } + }); + } + + /** + * Creates an instance of Trigger class. + */ + @Generated + public Trigger() { + } + + /** + * Get the kind property: The type of the trigger. + * + * @return the kind value. + */ + @Generated + public TriggerType getKind() { + return this.kind; + } + + /** + * Get the triggerId property: The unique identifier of the trigger. + * + * @return the triggerId value. + */ + @Generated + public String getTriggerId() { + return this.triggerId; + } + + /** + * Get the displayName property: The name of the trigger. + * + * @return the displayName value. + */ + @Generated + public String getDisplayName() { + return this.displayName; + } + + /** + * Set the displayName property: The name of the trigger. + *

Required when create the resource.

+ * + * @param displayName the displayName value to set. + * @return the Trigger object itself. + */ + @Generated + public Trigger setDisplayName(String displayName) { + this.displayName = displayName; + this.updatedProperties.add("displayName"); + return this; + } + + /** + * Get the description property: The description of the trigger. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The description of the trigger. + * + * @param description the description value to set. + * @return the Trigger object itself. + */ + @Generated + public Trigger setDescription(String description) { + this.description = description; + this.updatedProperties.add("description"); + return this; + } + + /** + * Get the state property: The current state of the trigger. + * + * @return the state value. + */ + @Generated + public TriggerState getState() { + return this.state; + } + + /** + * Set the state property: The current state of the trigger. + * + * @param state the state value to set. + * @return the Trigger object itself. + */ + @Generated + public Trigger setState(TriggerState state) { + this.state = state; + this.updatedProperties.add("state"); + return this; + } + + /** + * Get the stateDetails property: Details of current state of the trigger. + * + * @return the stateDetails value. + */ + @Generated + public StateDetails getStateDetails() { + return this.stateDetails; + } + + /** + * Get the createdDateTime property: The creation datetime(RFC 3339 literal format). + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the createdBy property: The user that created. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the lastModifiedDateTime property: The last Modified datetime(RFC 3339 literal format). + * + * @return the lastModifiedDateTime value. + */ + @Generated + public OffsetDateTime getLastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastModifiedBy property: The user that last modified. + * + * @return the lastModifiedBy value. + */ + @Generated + public String getLastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + if (updatedProperties.contains("displayName")) { + if (this.displayName == null) { + jsonWriter.writeNullField("displayName"); + } else { + jsonWriter.writeStringField("displayName", this.displayName); + } + } + if (updatedProperties.contains("description")) { + if (this.description == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", this.description); + } + } + if (updatedProperties.contains("state")) { + if (this.state == null) { + jsonWriter.writeNullField("state"); + } else { + jsonWriter.writeStringField("state", this.state.toString()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Trigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Trigger if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Trigger. + */ + @Generated + public static Trigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ScheduleTestsTrigger".equals(discriminatorValue)) { + return ScheduleTestsTrigger.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static Trigger fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Trigger deserializedTrigger = new Trigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("triggerId".equals(fieldName)) { + deserializedTrigger.triggerId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedTrigger.kind = TriggerType.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedTrigger.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedTrigger.description = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedTrigger.state = TriggerState.fromString(reader.getString()); + } else if ("stateDetails".equals(fieldName)) { + deserializedTrigger.stateDetails = StateDetails.fromJson(reader); + } else if ("createdDateTime".equals(fieldName)) { + deserializedTrigger.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedTrigger.createdBy = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedTrigger.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTrigger.lastModifiedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTrigger; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerCompletedNotificationEventFilter.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerCompletedNotificationEventFilter.java new file mode 100644 index 000000000000..e31f99563414 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerCompletedNotificationEventFilter.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * The notification event filter when the event type is TriggerCompleted. + */ +@Immutable +public final class TriggerCompletedNotificationEventFilter extends TestsNotificationEventFilter { + /* + * The event type + */ + @Generated + private NotificationEventType kind = NotificationEventType.TRIGGER_COMPLETED; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of TriggerCompletedNotificationEventFilter class. + */ + @Generated + public TriggerCompletedNotificationEventFilter() { + } + + /** + * Get the kind property: The event type. + * + * @return the kind value. + */ + @Generated + @Override + public NotificationEventType getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getTestsNotificationEventFilterAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerCompletedNotificationEventFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerCompletedNotificationEventFilter if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TriggerCompletedNotificationEventFilter. + */ + @Generated + public static TriggerCompletedNotificationEventFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerCompletedNotificationEventFilter deserializedTriggerCompletedNotificationEventFilter + = new TriggerCompletedNotificationEventFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTriggerCompletedNotificationEventFilter.kind + = NotificationEventType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerCompletedNotificationEventFilter; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerDisabledNotificationEventFilter.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerDisabledNotificationEventFilter.java new file mode 100644 index 000000000000..e83a3fc742a8 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerDisabledNotificationEventFilter.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * The notification event filter when the event type is TriggerDisabled. + */ +@Immutable +public final class TriggerDisabledNotificationEventFilter extends TestsNotificationEventFilter { + /* + * The event type + */ + @Generated + private NotificationEventType kind = NotificationEventType.TRIGGER_DISABLED; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of TriggerDisabledNotificationEventFilter class. + */ + @Generated + public TriggerDisabledNotificationEventFilter() { + } + + /** + * Get the kind property: The event type. + * + * @return the kind value. + */ + @Generated + @Override + public NotificationEventType getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getTestsNotificationEventFilterAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerDisabledNotificationEventFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerDisabledNotificationEventFilter if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TriggerDisabledNotificationEventFilter. + */ + @Generated + public static TriggerDisabledNotificationEventFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerDisabledNotificationEventFilter deserializedTriggerDisabledNotificationEventFilter + = new TriggerDisabledNotificationEventFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTriggerDisabledNotificationEventFilter.kind + = NotificationEventType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerDisabledNotificationEventFilter; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerState.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerState.java new file mode 100644 index 000000000000..fbbf142ee2d4 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerState.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current state of a trigger. + */ +public final class TriggerState extends ExpandableStringEnum { + /** + * The trigger is active. + */ + @Generated + public static final TriggerState ACTIVE = fromString("Active"); + + /** + * The trigger is paused manually. + */ + @Generated + public static final TriggerState PAUSED = fromString("Paused"); + + /** + * The trigger is completed. + */ + @Generated + public static final TriggerState COMPLETED = fromString("Completed"); + + /** + * The trigger is disabled due to error. + */ + @Generated + public static final TriggerState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of TriggerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TriggerState() { + } + + /** + * Creates or finds a TriggerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerState. + */ + @Generated + public static TriggerState fromString(String name) { + return fromString(name, TriggerState.class); + } + + /** + * Gets known TriggerState values. + * + * @return known TriggerState values. + */ + @Generated + public static Collection values() { + return values(TriggerState.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerType.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerType.java new file mode 100644 index 000000000000..4331230716f9 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/TriggerType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of a trigger. + */ +public final class TriggerType extends ExpandableStringEnum { + /** + * Trigger is a Scheduled Trigger on a Test. + */ + @Generated + public static final TriggerType SCHEDULE_TESTS_TRIGGER = fromString("ScheduleTestsTrigger"); + + /** + * Creates a new instance of TriggerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TriggerType() { + } + + /** + * Creates or finds a TriggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerType. + */ + @Generated + public static TriggerType fromString(String name) { + return fromString(name, TriggerType.class); + } + + /** + * Gets known TriggerType values. + * + * @return known TriggerType values. + */ + @Generated + public static Collection values() { + return values(TriggerType.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeekDays.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeekDays.java new file mode 100644 index 000000000000..76fc7972b86b --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeekDays.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the days of the week. + */ +public final class WeekDays extends ExpandableStringEnum { + /** + * Refers to Sunday. + */ + @Generated + public static final WeekDays SUNDAY = fromString("Sunday"); + + /** + * Refers to Monday. + */ + @Generated + public static final WeekDays MONDAY = fromString("Monday"); + + /** + * Refers to Tuesday. + */ + @Generated + public static final WeekDays TUESDAY = fromString("Tuesday"); + + /** + * Refers to Wednesday. + */ + @Generated + public static final WeekDays WEDNESDAY = fromString("Wednesday"); + + /** + * Refers to Thursday. + */ + @Generated + public static final WeekDays THURSDAY = fromString("Thursday"); + + /** + * Refers to Friday. + */ + @Generated + public static final WeekDays FRIDAY = fromString("Friday"); + + /** + * Refers to Saturday. + */ + @Generated + public static final WeekDays SATURDAY = fromString("Saturday"); + + /** + * Creates a new instance of WeekDays value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public WeekDays() { + } + + /** + * Creates or finds a WeekDays from its string representation. + * + * @param name a name to look for. + * @return the corresponding WeekDays. + */ + @Generated + public static WeekDays fromString(String name) { + return fromString(name, WeekDays.class); + } + + /** + * Gets known WeekDays values. + * + * @return known WeekDays values. + */ + @Generated + public static Collection values() { + return values(WeekDays.class); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeeklyRecurrence.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeeklyRecurrence.java new file mode 100644 index 000000000000..3c51a652d3a1 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/WeeklyRecurrence.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.developer.loadtesting.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Recurrence model when frequency is set as weekly. + */ +@Fluent +public final class WeeklyRecurrence extends Recurrence { + /* + * Frequency of the recurrence. + */ + @Generated + private Frequency frequency = Frequency.WEEKLY; + + /* + * Recurrence set to repeat on the specified days of the week. + */ + @Generated + private List daysOfWeek; + + /* + * The interval at which the recurrence should repeat. It signifies the number of weeks between each recurrence. + */ + @Generated + private Integer interval; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + /** + * Creates an instance of WeeklyRecurrence class. + */ + @Generated + public WeeklyRecurrence() { + } + + /** + * Get the frequency property: Frequency of the recurrence. + * + * @return the frequency value. + */ + @Generated + @Override + public Frequency getFrequency() { + return this.frequency; + } + + /** + * Get the daysOfWeek property: Recurrence set to repeat on the specified days of the week. + * + * @return the daysOfWeek value. + */ + @Generated + public List getDaysOfWeek() { + return this.daysOfWeek; + } + + /** + * Set the daysOfWeek property: Recurrence set to repeat on the specified days of the week. + * + * @param daysOfWeek the daysOfWeek value to set. + * @return the WeeklyRecurrence object itself. + */ + @Generated + public WeeklyRecurrence setDaysOfWeek(List daysOfWeek) { + this.daysOfWeek = daysOfWeek; + this.updatedProperties.add("daysOfWeek"); + return this; + } + + /** + * Get the interval property: The interval at which the recurrence should repeat. It signifies the number of weeks + * between each recurrence. + * + * @return the interval value. + */ + @Generated + public Integer getInterval() { + return this.interval; + } + + /** + * Set the interval property: The interval at which the recurrence should repeat. It signifies the number of weeks + * between each recurrence. + * + * @param interval the interval value to set. + * @return the WeeklyRecurrence object itself. + */ + @Generated + public WeeklyRecurrence setInterval(Integer interval) { + this.interval = interval; + this.updatedProperties.add("interval"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public WeeklyRecurrence setRecurrenceEnd(RecurrenceEnd recurrenceEnd) { + super.setRecurrenceEnd(recurrenceEnd); + this.updatedProperties.add("recurrenceEnd"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (JsonMergePatchHelper.getRecurrenceAccessor().isJsonMergePatch(this)) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + jsonWriter.writeStringField("frequency", this.frequency == null ? null : this.frequency.toString()); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeNumberField("interval", this.interval); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("recurrenceEnd")) { + if (getRecurrenceEnd() == null) { + jsonWriter.writeNullField("recurrenceEnd"); + } else { + JsonMergePatchHelper.getRecurrenceEndAccessor().prepareModelForJsonMergePatch(getRecurrenceEnd(), true); + jsonWriter.writeJsonField("recurrenceEnd", getRecurrenceEnd()); + JsonMergePatchHelper.getRecurrenceEndAccessor() + .prepareModelForJsonMergePatch(getRecurrenceEnd(), false); + } + } + jsonWriter.writeStringField("frequency", this.frequency.toString()); + if (updatedProperties.contains("daysOfWeek")) { + if (this.daysOfWeek == null) { + jsonWriter.writeNullField("daysOfWeek"); + } else { + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element.toString())); + } + } + if (updatedProperties.contains("interval")) { + if (this.interval == null) { + jsonWriter.writeNullField("interval"); + } else { + jsonWriter.writeNumberField("interval", this.interval); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WeeklyRecurrence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WeeklyRecurrence if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WeeklyRecurrence. + */ + @Generated + public static WeeklyRecurrence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WeeklyRecurrence deserializedWeeklyRecurrence = new WeeklyRecurrence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recurrenceEnd".equals(fieldName)) { + JsonMergePatchHelper.getRecurrenceAccessor() + .setRecurrenceEnd(deserializedWeeklyRecurrence, RecurrenceEnd.fromJson(reader)); + } else if ("frequency".equals(fieldName)) { + deserializedWeeklyRecurrence.frequency = Frequency.fromString(reader.getString()); + } else if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek = reader.readArray(reader1 -> WeekDays.fromString(reader1.getString())); + deserializedWeeklyRecurrence.daysOfWeek = daysOfWeek; + } else if ("interval".equals(fieldName)) { + deserializedWeeklyRecurrence.interval = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedWeeklyRecurrence; + }); + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/package-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/package-info.java new file mode 100644 index 000000000000..5d42324765d8 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for LoadTesting. + * These APIs allow end users to create, view and run load tests using Azure Load Test Service. + * + */ +package com.azure.developer.loadtesting.models; diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java index 009f697b6870..d248dd96db41 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/package-info.java @@ -1,8 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. + /** - * Package containing the classes for LoadTestingClient. These APIs allow end users to create, view and run load tests - * using Azure Load Test Service. + * + * Package containing the classes for LoadTesting. + * These APIs allow end users to create, view and run load tests using Azure Load Test Service. + * */ package com.azure.developer.loadtesting; diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/module-info.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/module-info.java index 2c7ca0c94217..2cd5beb41bab 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/module-info.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/module-info.java @@ -1,10 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.developer.loadtesting { requires transitive com.azure.core; - requires com.azure.json; exports com.azure.developer.loadtesting; + exports com.azure.developer.loadtesting.models; + + opens com.azure.developer.loadtesting.implementation.models to com.azure.core; + opens com.azure.developer.loadtesting.models to com.azure.core; } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/resources/META-INF/azure-developer-loadtesting_apiview_properties.json b/sdk/loadtesting/azure-developer-loadtesting/src/main/resources/META-INF/azure-developer-loadtesting_apiview_properties.json new file mode 100644 index 000000000000..f7f48ae8885a --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/resources/META-INF/azure-developer-loadtesting_apiview_properties.json @@ -0,0 +1,267 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient": "Customizations.AdministrationOperations", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.beginCloneTest": "Customizations.AdministrationOperations.cloneTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.beginCloneTestWithModel": "Customizations.AdministrationOperations.cloneTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateAppComponents": "Customizations.AdministrationOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateAppComponentsWithResponse": "Customizations.AdministrationOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateNotificationRule": "Customizations.AdministrationOperations.createOrUpdateNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateNotificationRuleWithResponse": "Customizations.AdministrationOperations.createOrUpdateNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateServerMetricsConfig": "Customizations.AdministrationOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateServerMetricsConfigWithResponse": "Customizations.AdministrationOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateTest": "Customizations.AdministrationOperations.createOrUpdateTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateTestProfile": "Customizations.AdministrationOperations.createOrUpdateTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateTestProfileWithResponse": "Customizations.AdministrationOperations.createOrUpdateTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateTestWithResponse": "Customizations.AdministrationOperations.createOrUpdateTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateTrigger": "Customizations.AdministrationOperations.createOrUpdateTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.createOrUpdateTriggerWithResponse": "Customizations.AdministrationOperations.createOrUpdateTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteNotificationRule": "Customizations.AdministrationOperations.deleteNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteNotificationRuleWithResponse": "Customizations.AdministrationOperations.deleteNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTest": "Customizations.AdministrationOperations.deleteTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTestFile": "Customizations.AdministrationOperations.deleteTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTestFileWithResponse": "Customizations.AdministrationOperations.deleteTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTestProfile": "Customizations.AdministrationOperations.deleteTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTestProfileWithResponse": "Customizations.AdministrationOperations.deleteTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTestWithResponse": "Customizations.AdministrationOperations.deleteTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTrigger": "Customizations.AdministrationOperations.deleteTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.deleteTriggerWithResponse": "Customizations.AdministrationOperations.deleteTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getAppComponents": "Customizations.AdministrationOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getAppComponentsWithResponse": "Customizations.AdministrationOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getNotificationRule": "Customizations.AdministrationOperations.getNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getNotificationRuleWithResponse": "Customizations.AdministrationOperations.getNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getOperationStatus": "Customizations.AdministrationOperations.getOperationStatus", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getOperationStatusWithResponse": "Customizations.AdministrationOperations.getOperationStatus", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getServerMetricsConfig": "Customizations.AdministrationOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getServerMetricsConfigWithResponse": "Customizations.AdministrationOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTest": "Customizations.AdministrationOperations.getTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTestFile": "Customizations.AdministrationOperations.getTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTestFileWithResponse": "Customizations.AdministrationOperations.getTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTestProfile": "Customizations.AdministrationOperations.getTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTestProfileWithResponse": "Customizations.AdministrationOperations.getTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTestWithResponse": "Customizations.AdministrationOperations.getTest", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTrigger": "Customizations.AdministrationOperations.getTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.getTriggerWithResponse": "Customizations.AdministrationOperations.getTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.listNotificationRules": "Customizations.AdministrationOperations.listNotificationRules", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.listTestFiles": "Customizations.AdministrationOperations.listTestFiles", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.listTestProfiles": "Customizations.AdministrationOperations.listTestProfiles", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.listTests": "Customizations.AdministrationOperations.listTests", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.listTriggers": "Customizations.AdministrationOperations.listTriggers", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.uploadTestFile": "Customizations.AdministrationOperations.uploadTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationAsyncClient.uploadTestFileWithResponse": "Customizations.AdministrationOperations.uploadTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient": "Customizations.AdministrationOperations", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.beginCloneTest": "Customizations.AdministrationOperations.cloneTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.beginCloneTestWithModel": "Customizations.AdministrationOperations.cloneTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateAppComponents": "Customizations.AdministrationOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateAppComponentsWithResponse": "Customizations.AdministrationOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateNotificationRule": "Customizations.AdministrationOperations.createOrUpdateNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateNotificationRuleWithResponse": "Customizations.AdministrationOperations.createOrUpdateNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateServerMetricsConfig": "Customizations.AdministrationOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateServerMetricsConfigWithResponse": "Customizations.AdministrationOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateTest": "Customizations.AdministrationOperations.createOrUpdateTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateTestProfile": "Customizations.AdministrationOperations.createOrUpdateTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateTestProfileWithResponse": "Customizations.AdministrationOperations.createOrUpdateTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateTestWithResponse": "Customizations.AdministrationOperations.createOrUpdateTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateTrigger": "Customizations.AdministrationOperations.createOrUpdateTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.createOrUpdateTriggerWithResponse": "Customizations.AdministrationOperations.createOrUpdateTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteNotificationRule": "Customizations.AdministrationOperations.deleteNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteNotificationRuleWithResponse": "Customizations.AdministrationOperations.deleteNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTest": "Customizations.AdministrationOperations.deleteTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTestFile": "Customizations.AdministrationOperations.deleteTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTestFileWithResponse": "Customizations.AdministrationOperations.deleteTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTestProfile": "Customizations.AdministrationOperations.deleteTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTestProfileWithResponse": "Customizations.AdministrationOperations.deleteTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTestWithResponse": "Customizations.AdministrationOperations.deleteTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTrigger": "Customizations.AdministrationOperations.deleteTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.deleteTriggerWithResponse": "Customizations.AdministrationOperations.deleteTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getAppComponents": "Customizations.AdministrationOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getAppComponentsWithResponse": "Customizations.AdministrationOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getNotificationRule": "Customizations.AdministrationOperations.getNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getNotificationRuleWithResponse": "Customizations.AdministrationOperations.getNotificationRule", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getOperationStatus": "Customizations.AdministrationOperations.getOperationStatus", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getOperationStatusWithResponse": "Customizations.AdministrationOperations.getOperationStatus", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getServerMetricsConfig": "Customizations.AdministrationOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getServerMetricsConfigWithResponse": "Customizations.AdministrationOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTest": "Customizations.AdministrationOperations.getTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTestFile": "Customizations.AdministrationOperations.getTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTestFileWithResponse": "Customizations.AdministrationOperations.getTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTestProfile": "Customizations.AdministrationOperations.getTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTestProfileWithResponse": "Customizations.AdministrationOperations.getTestProfile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTestWithResponse": "Customizations.AdministrationOperations.getTest", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTrigger": "Customizations.AdministrationOperations.getTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.getTriggerWithResponse": "Customizations.AdministrationOperations.getTrigger", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.listNotificationRules": "Customizations.AdministrationOperations.listNotificationRules", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.listTestFiles": "Customizations.AdministrationOperations.listTestFiles", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.listTestProfiles": "Customizations.AdministrationOperations.listTestProfiles", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.listTests": "Customizations.AdministrationOperations.listTests", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.listTriggers": "Customizations.AdministrationOperations.listTriggers", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.uploadTestFile": "Customizations.AdministrationOperations.uploadTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationClient.uploadTestFileWithResponse": "Customizations.AdministrationOperations.uploadTestFile", + "com.azure.developer.loadtesting.LoadTestAdministrationClientBuilder": "Customizations.AdministrationOperations", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient": "Customizations.TestRunOperations", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateAppComponents": "Customizations.TestRunOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateAppComponentsWithResponse": "Customizations.TestRunOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateServerMetricsConfig": "Customizations.TestRunOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateServerMetricsConfigWithResponse": "Customizations.TestRunOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateTestProfileRun": "Customizations.TestRunOperations.createOrUpdateTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateTestProfileRunWithResponse": "Customizations.TestRunOperations.createOrUpdateTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateTestRun": "Customizations.TestRunOperations.createOrUpdateTestRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.createOrUpdateTestRunWithResponse": "Customizations.TestRunOperations.createOrUpdateTestRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.deleteTestProfileRun": "Customizations.TestRunOperations.deleteTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.deleteTestProfileRunWithResponse": "Customizations.TestRunOperations.deleteTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.deleteTestRun": "Customizations.TestRunOperations.deleteTestRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.deleteTestRunWithResponse": "Customizations.TestRunOperations.deleteTestRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getAppComponents": "Customizations.TestRunOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getAppComponentsWithResponse": "Customizations.TestRunOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getMetricDefinitions": "Customizations.TestRunOperations.listMetricDefinitions", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getMetricDefinitionsWithResponse": "Customizations.TestRunOperations.listMetricDefinitions", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getMetricNamespaces": "Customizations.TestRunOperations.listMetricNamespaces", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getMetricNamespacesWithResponse": "Customizations.TestRunOperations.listMetricNamespaces", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getServerMetricsConfig": "Customizations.TestRunOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getServerMetricsConfigWithResponse": "Customizations.TestRunOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getTestProfileRun": "Customizations.TestRunOperations.getTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getTestProfileRunWithResponse": "Customizations.TestRunOperations.getTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getTestRun": "Customizations.TestRunOperations.getTestRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getTestRunFile": "Customizations.TestRunOperations.getTestRunFile", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getTestRunFileWithResponse": "Customizations.TestRunOperations.getTestRunFile", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.getTestRunWithResponse": "Customizations.TestRunOperations.getTestRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.listMetricDimensionValues": "Customizations.TestRunOperations.listMetricDimensionValues", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.listMetrics": "Customizations.TestRunOperations.listMetrics", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.listTestProfileRuns": "Customizations.TestRunOperations.listTestProfileRuns", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.listTestRuns": "Customizations.TestRunOperations.listTestRuns", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.stopTestProfileRun": "Customizations.TestRunOperations.stopTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.stopTestProfileRunWithResponse": "Customizations.TestRunOperations.stopTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.stopTestRun": "Customizations.TestRunOperations.stop", + "com.azure.developer.loadtesting.LoadTestRunAsyncClient.stopTestRunWithResponse": "Customizations.TestRunOperations.stop", + "com.azure.developer.loadtesting.LoadTestRunClient": "Customizations.TestRunOperations", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateAppComponents": "Customizations.TestRunOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateAppComponentsWithResponse": "Customizations.TestRunOperations.createOrUpdateAppComponents", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateServerMetricsConfig": "Customizations.TestRunOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateServerMetricsConfigWithResponse": "Customizations.TestRunOperations.createOrUpdateServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateTestProfileRun": "Customizations.TestRunOperations.createOrUpdateTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateTestProfileRunWithResponse": "Customizations.TestRunOperations.createOrUpdateTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateTestRun": "Customizations.TestRunOperations.createOrUpdateTestRun", + "com.azure.developer.loadtesting.LoadTestRunClient.createOrUpdateTestRunWithResponse": "Customizations.TestRunOperations.createOrUpdateTestRun", + "com.azure.developer.loadtesting.LoadTestRunClient.deleteTestProfileRun": "Customizations.TestRunOperations.deleteTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.deleteTestProfileRunWithResponse": "Customizations.TestRunOperations.deleteTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.deleteTestRun": "Customizations.TestRunOperations.deleteTestRun", + "com.azure.developer.loadtesting.LoadTestRunClient.deleteTestRunWithResponse": "Customizations.TestRunOperations.deleteTestRun", + "com.azure.developer.loadtesting.LoadTestRunClient.getAppComponents": "Customizations.TestRunOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestRunClient.getAppComponentsWithResponse": "Customizations.TestRunOperations.getAppComponents", + "com.azure.developer.loadtesting.LoadTestRunClient.getMetricDefinitions": "Customizations.TestRunOperations.listMetricDefinitions", + "com.azure.developer.loadtesting.LoadTestRunClient.getMetricDefinitionsWithResponse": "Customizations.TestRunOperations.listMetricDefinitions", + "com.azure.developer.loadtesting.LoadTestRunClient.getMetricNamespaces": "Customizations.TestRunOperations.listMetricNamespaces", + "com.azure.developer.loadtesting.LoadTestRunClient.getMetricNamespacesWithResponse": "Customizations.TestRunOperations.listMetricNamespaces", + "com.azure.developer.loadtesting.LoadTestRunClient.getServerMetricsConfig": "Customizations.TestRunOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunClient.getServerMetricsConfigWithResponse": "Customizations.TestRunOperations.getServerMetricsConfig", + "com.azure.developer.loadtesting.LoadTestRunClient.getTestProfileRun": "Customizations.TestRunOperations.getTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.getTestProfileRunWithResponse": "Customizations.TestRunOperations.getTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.getTestRun": "Customizations.TestRunOperations.getTestRun", + "com.azure.developer.loadtesting.LoadTestRunClient.getTestRunFile": "Customizations.TestRunOperations.getTestRunFile", + "com.azure.developer.loadtesting.LoadTestRunClient.getTestRunFileWithResponse": "Customizations.TestRunOperations.getTestRunFile", + "com.azure.developer.loadtesting.LoadTestRunClient.getTestRunWithResponse": "Customizations.TestRunOperations.getTestRun", + "com.azure.developer.loadtesting.LoadTestRunClient.listMetricDimensionValues": "Customizations.TestRunOperations.listMetricDimensionValues", + "com.azure.developer.loadtesting.LoadTestRunClient.listMetrics": "Customizations.TestRunOperations.listMetrics", + "com.azure.developer.loadtesting.LoadTestRunClient.listTestProfileRuns": "Customizations.TestRunOperations.listTestProfileRuns", + "com.azure.developer.loadtesting.LoadTestRunClient.listTestRuns": "Customizations.TestRunOperations.listTestRuns", + "com.azure.developer.loadtesting.LoadTestRunClient.stopTestProfileRun": "Customizations.TestRunOperations.stopTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.stopTestProfileRunWithResponse": "Customizations.TestRunOperations.stopTestProfileRun", + "com.azure.developer.loadtesting.LoadTestRunClient.stopTestRun": "Customizations.TestRunOperations.stop", + "com.azure.developer.loadtesting.LoadTestRunClient.stopTestRunWithResponse": "Customizations.TestRunOperations.stop", + "com.azure.developer.loadtesting.LoadTestRunClientBuilder": "Customizations.TestRunOperations", + "com.azure.developer.loadtesting.implementation.models.CloneTestRequest1": "Customizations.cloneTest.Request.anonymous", + "com.azure.developer.loadtesting.models.AggregationType": "Microsoft.LoadTestService.Aggregation", + "com.azure.developer.loadtesting.models.ArtifactsContainerInfo": "Microsoft.LoadTestService.ArtifactsContainerInfo", + "com.azure.developer.loadtesting.models.AutoStopCriteria": "Microsoft.LoadTestService.AutoStopCriteria", + "com.azure.developer.loadtesting.models.CertificateType": "Microsoft.LoadTestService.CertificateType", + "com.azure.developer.loadtesting.models.CreatedByType": "Microsoft.LoadTestService.CreatedByType", + "com.azure.developer.loadtesting.models.DailyRecurrence": "Microsoft.LoadTestService.DailyRecurrence", + "com.azure.developer.loadtesting.models.DimensionFilter": "Microsoft.LoadTestService.DimensionFilter", + "com.azure.developer.loadtesting.models.DimensionValue": "Microsoft.LoadTestService.DimensionValue", + "com.azure.developer.loadtesting.models.ErrorDetails": "Microsoft.LoadTestService.ErrorDetails", + "com.azure.developer.loadtesting.models.FileValidationStatus": "Microsoft.LoadTestService.FileValidationStatus", + "com.azure.developer.loadtesting.models.Frequency": "Microsoft.LoadTestService.Frequency", + "com.azure.developer.loadtesting.models.FunctionFlexConsumptionResourceConfiguration": "Microsoft.LoadTestService.FunctionFlexConsumptionResourceConfiguration", + "com.azure.developer.loadtesting.models.FunctionFlexConsumptionTargetResourceConfigurations": "Microsoft.LoadTestService.FunctionFlexConsumptionTargetResourceConfigurations", + "com.azure.developer.loadtesting.models.HourlyRecurrence": "Microsoft.LoadTestService.HourlyRecurrence", + "com.azure.developer.loadtesting.models.LoadTest": "Microsoft.LoadTestService.Test", + "com.azure.developer.loadtesting.models.LoadTestConfiguration": "Microsoft.LoadTestService.LoadTestConfiguration", + "com.azure.developer.loadtesting.models.LoadTestKind": "Microsoft.LoadTestService.TestKind", + "com.azure.developer.loadtesting.models.LoadTestRun": "Microsoft.LoadTestService.TestRun", + "com.azure.developer.loadtesting.models.LoadTestingAppComponent": "Microsoft.LoadTestService.AppComponent", + "com.azure.developer.loadtesting.models.LoadTestingFileType": "Microsoft.LoadTestService.FileType", + "com.azure.developer.loadtesting.models.LoadTestingManagedIdentityType": "Microsoft.LoadTestService.ManagedIdentityType", + "com.azure.developer.loadtesting.models.MetricAvailability": "Microsoft.LoadTestService.MetricAvailability", + "com.azure.developer.loadtesting.models.MetricDefinition": "Microsoft.LoadTestService.MetricDefinition", + "com.azure.developer.loadtesting.models.MetricDefinitions": "Microsoft.LoadTestService.MetricDefinitionCollection", + "com.azure.developer.loadtesting.models.MetricNamespace": "Microsoft.LoadTestService.MetricNamespace", + "com.azure.developer.loadtesting.models.MetricNamespaces": "Microsoft.LoadTestService.MetricNamespaceCollection", + "com.azure.developer.loadtesting.models.MetricUnit": "Microsoft.LoadTestService.MetricUnit", + "com.azure.developer.loadtesting.models.MetricValue": "Microsoft.LoadTestService.MetricValue", + "com.azure.developer.loadtesting.models.MetricsFilters": "Microsoft.LoadTestService.MetricRequestPayload", + "com.azure.developer.loadtesting.models.MonthlyRecurrenceByDates": "Microsoft.LoadTestService.MonthlyRecurrenceByDates", + "com.azure.developer.loadtesting.models.MonthlyRecurrenceByWeekDays": "Microsoft.LoadTestService.MonthlyRecurrenceByWeekDays", + "com.azure.developer.loadtesting.models.NameAndDescription": "Microsoft.LoadTestService.NameAndDescription", + "com.azure.developer.loadtesting.models.NotificationEventType": "Microsoft.LoadTestService.NotificationEventType", + "com.azure.developer.loadtesting.models.NotificationRule": "Microsoft.LoadTestService.NotificationRule", + "com.azure.developer.loadtesting.models.NotificationScopeType": "Microsoft.LoadTestService.NotificationScopeType", + "com.azure.developer.loadtesting.models.OperationKind": "Microsoft.LoadTestService.OperationKind", + "com.azure.developer.loadtesting.models.OperationState": "Azure.Core.Foundations.OperationState", + "com.azure.developer.loadtesting.models.OperationStatus": "Microsoft.LoadTestService.OperationStatus", + "com.azure.developer.loadtesting.models.OptionalLoadTestConfiguration": "Microsoft.LoadTestService.OptionalLoadTestConfiguration", + "com.azure.developer.loadtesting.models.PassFailAction": "Microsoft.LoadTestService.PassFailAction", + "com.azure.developer.loadtesting.models.PassFailAggregationFunction": "Microsoft.LoadTestService.PassFailAggregationFunction", + "com.azure.developer.loadtesting.models.PassFailCriteria": "Microsoft.LoadTestService.PassFailCriteria", + "com.azure.developer.loadtesting.models.PassFailMetric": "Microsoft.LoadTestService.PassFailMetric", + "com.azure.developer.loadtesting.models.PassFailResult": "Microsoft.LoadTestService.PassFailResult", + "com.azure.developer.loadtesting.models.PassFailServerMetric": "Microsoft.LoadTestService.PassFailServerMetric", + "com.azure.developer.loadtesting.models.PassFailTestResult": "Microsoft.LoadTestService.PassFailTestResult", + "com.azure.developer.loadtesting.models.PfMetrics": "Microsoft.LoadTestService.PFMetrics", + "com.azure.developer.loadtesting.models.RecommendationCategory": "Microsoft.LoadTestService.RecommendationCategory", + "com.azure.developer.loadtesting.models.Recurrence": "Microsoft.LoadTestService.Recurrence", + "com.azure.developer.loadtesting.models.RecurrenceEnd": "Microsoft.LoadTestService.RecurrenceEnd", + "com.azure.developer.loadtesting.models.RecurrenceStatus": "Microsoft.LoadTestService.RecurrenceStatus", + "com.azure.developer.loadtesting.models.RecurrenceWithCron": "Microsoft.LoadTestService.RecurrenceWithCron", + "com.azure.developer.loadtesting.models.RegionalConfiguration": "Microsoft.LoadTestService.RegionalConfiguration", + "com.azure.developer.loadtesting.models.RequestDataLevel": "Microsoft.LoadTestService.RequestDataLevel", + "com.azure.developer.loadtesting.models.ResourceKind": "Microsoft.LoadTestService.ResourceKind", + "com.azure.developer.loadtesting.models.ResourceMetric": "Microsoft.LoadTestService.ResourceMetric", + "com.azure.developer.loadtesting.models.ScheduleTestsTrigger": "Microsoft.LoadTestService.ScheduleTestsTrigger", + "com.azure.developer.loadtesting.models.SecretType": "Microsoft.LoadTestService.SecretType", + "com.azure.developer.loadtesting.models.StateDetails": "Microsoft.LoadTestService.StateDetails", + "com.azure.developer.loadtesting.models.TargetResourceConfigurations": "Microsoft.LoadTestService.TargetResourceConfigurations", + "com.azure.developer.loadtesting.models.TestAppComponents": "Microsoft.LoadTestService.TestAppComponents", + "com.azure.developer.loadtesting.models.TestCertificate": "Microsoft.LoadTestService.CertificateMetadata", + "com.azure.developer.loadtesting.models.TestFileInfo": "Microsoft.LoadTestService.TestFileInfo", + "com.azure.developer.loadtesting.models.TestInputArtifacts": "Microsoft.LoadTestService.TestInputArtifacts", + "com.azure.developer.loadtesting.models.TestProfile": "Microsoft.LoadTestService.TestProfile", + "com.azure.developer.loadtesting.models.TestProfileRun": "Microsoft.LoadTestService.TestProfileRun", + "com.azure.developer.loadtesting.models.TestProfileRunRecommendation": "Microsoft.LoadTestService.TestProfileRunRecommendation", + "com.azure.developer.loadtesting.models.TestProfileRunStatus": "Microsoft.LoadTestService.TestProfileRunStatus", + "com.azure.developer.loadtesting.models.TestRunAppComponents": "Microsoft.LoadTestService.TestRunAppComponents", + "com.azure.developer.loadtesting.models.TestRunArtifacts": "Microsoft.LoadTestService.TestRunArtifacts", + "com.azure.developer.loadtesting.models.TestRunDetail": "Microsoft.LoadTestService.TestRunDetail", + "com.azure.developer.loadtesting.models.TestRunEndedEventCondition": "Microsoft.LoadTestService.TestRunEndedEventCondition", + "com.azure.developer.loadtesting.models.TestRunEndedNotificationEventFilter": "Microsoft.LoadTestService.TestRunEndedNotificationEventFilter", + "com.azure.developer.loadtesting.models.TestRunFileInfo": "Microsoft.LoadTestService.TestRunFileInfo", + "com.azure.developer.loadtesting.models.TestRunInputArtifacts": "Microsoft.LoadTestService.TestRunInputArtifacts", + "com.azure.developer.loadtesting.models.TestRunOutputArtifacts": "Microsoft.LoadTestService.TestRunOutputArtifacts", + "com.azure.developer.loadtesting.models.TestRunServerMetricsConfiguration": "Microsoft.LoadTestService.TestRunServerMetricsConfiguration", + "com.azure.developer.loadtesting.models.TestRunStartedNotificationEventFilter": "Microsoft.LoadTestService.TestRunStartedNotificationEventFilter", + "com.azure.developer.loadtesting.models.TestRunStatistics": "Microsoft.LoadTestService.TestRunStatistics", + "com.azure.developer.loadtesting.models.TestRunStatus": "Microsoft.LoadTestService.TestRunStatus", + "com.azure.developer.loadtesting.models.TestSecret": "Microsoft.LoadTestService.Secret", + "com.azure.developer.loadtesting.models.TestServerMetricsConfiguration": "Microsoft.LoadTestService.TestServerMetricsConfiguration", + "com.azure.developer.loadtesting.models.TestsNotificationEventFilter": "Microsoft.LoadTestService.TestsNotificationEventFilter", + "com.azure.developer.loadtesting.models.TestsNotificationRule": "Microsoft.LoadTestService.TestsNotificationRule", + "com.azure.developer.loadtesting.models.TimeGrain": "Microsoft.LoadTestService.TimeGrain", + "com.azure.developer.loadtesting.models.TimeSeriesElement": "Microsoft.LoadTestService.TimeSeriesElement", + "com.azure.developer.loadtesting.models.Trigger": "Microsoft.LoadTestService.Trigger", + "com.azure.developer.loadtesting.models.TriggerCompletedNotificationEventFilter": "Microsoft.LoadTestService.TriggerCompletedNotificationEventFilter", + "com.azure.developer.loadtesting.models.TriggerDisabledNotificationEventFilter": "Microsoft.LoadTestService.TriggerDisabledNotificationEventFilter", + "com.azure.developer.loadtesting.models.TriggerState": "Microsoft.LoadTestService.TriggerState", + "com.azure.developer.loadtesting.models.TriggerType": "Microsoft.LoadTestService.TriggerType", + "com.azure.developer.loadtesting.models.WeekDays": "Microsoft.LoadTestService.WeekDays", + "com.azure.developer.loadtesting.models.WeeklyRecurrence": "Microsoft.LoadTestService.WeeklyRecurrence" + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/README.md b/sdk/loadtesting/azure-developer-loadtesting/src/samples/README.md deleted file mode 100644 index 2c0b655fa8c4..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/README.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -page_type: sample -languages: - - java -products: - - azure - - azure-load-testing -urlFragment: developer-loadtesting-samples ---- - -# Azure Developer Loadtesting Samples client library for Java - -This document explains samples and how to use them. - -## Examples - - Following section document various examples. - -### Hello World Samples - -* [HelloWorld.java][sample_helloWorld] - Contains samples for following scenarios: - * Authenticate client - * Create Load Test - * Upload Test File - * Create and start Test Run, and get metrics - -### List Operations Samples - -* [ListOperations.java][sample_list] and [ListOperationsAsync.java][sample_listAsync] - Contains samples for following scenarios: - * List Load Tests - * List Test Runs - * List Load Test files - -### Long Running Operations Samples - -* [LongRunningOperations.java][sample_longRunning] and [LongRunningOperationsAsync.java][sample_longRunningAsync] - Contains samples for following scenarios: - * Upload and validate Load Test file - * Start and monitor Test Run - -## Troubleshooting - -### General - -Load Testing clients raise exceptions. For example, if you try to get a load test or test run resource after it is deleted a `404` error is returned, indicating resource not found. In the following snippet, the error is handled gracefully by catching the exception and displaying additional information about the error. - -```java -try { - testRunClient.getTestRunWithResponse("FAKE_TEST_RUN_ID", null); -} catch (ResourceNotFoundException e) { - System.out.println(e.getMessage()); -} -``` - - -[sample_helloWorld]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java -[sample_list]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java -[sample_listAsync]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java -[sample_longRunning]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java -[sample_longRunningAsync]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java deleted file mode 100644 index f5b8484ac39c..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/HelloWorld.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Sample demonstrates how to create and successfully run a test. - */ -@SuppressWarnings("unchecked") -public final class HelloWorld { - /** - * Authenticates with the load testing resource and shows how to list tests, test files and test runs for a given - * resource. - * - * @param args Unused. Arguments to the program. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test - * resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when listing files. - */ - public static void main(String[] args) { - // Initialize the clients - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - // Constants and parameters - final String testId = "6758667a-a57c-47e5-9cef-9b1f1432daca"; - final String testRunId = "f758667a-c5ac-269a-dce1-5c1f14f2d142"; - final String testFileName = "test-script.jmx"; - final String testFilePath = "C:/path/to/file/sample-script.jmx"; - - /* - * BEGIN: Create test - */ - // construct Test object using nested String:Object Maps - Map testMap = new HashMap<>(); - testMap.put("displayName", "Sample Display Name"); - testMap.put("description", "Sample Description"); - - // loadTestConfig describes the number of test engines to generate load - Map loadTestConfigMap = new HashMap<>(); - loadTestConfigMap.put("engineInstances", 1); - testMap.put("loadTestConfiguration", loadTestConfigMap); - - // environmentVariables are plain-text data passed to test engines - Map envVarMap = new HashMap<>(); - envVarMap.put("a", "b"); - envVarMap.put("x", "y"); - testMap.put("environmentVariables", envVarMap); - - // secrets are secure data sent using Azure Key Vault - Map secretMap = new HashMap<>(); - Map sampleSecretMap = new HashMap<>(); - sampleSecretMap.put("value", "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827"); - sampleSecretMap.put("type", "AKV_SECRET_URI"); - secretMap.put("sampleSecret", sampleSecretMap); - testMap.put("secrets", secretMap); - - // passFailCriteria define the conditions to conclude the test as success - Map passFailMap = new HashMap<>(); - Map passFailMetrics = new HashMap<>(); - Map samplePassFailMetric = new HashMap<>(); - samplePassFailMetric.put("clientmetric", "response_time_ms"); - samplePassFailMetric.put("aggregate", "percentage"); - samplePassFailMetric.put("condition", ">"); - samplePassFailMetric.put("value", "20"); - samplePassFailMetric.put("action", "continue"); - passFailMetrics.put("fefd759d-7fe8-4f83-8b6d-aeebe0f491fe", samplePassFailMetric); - passFailMap.put("passFailMetrics", passFailMetrics); - testMap.put("passFailCriteria", passFailMap); - - // convert the object Map to JSON BinaryData - BinaryData test = BinaryData.fromObject(testMap); - - // receive response with BinaryData content - Response testOutResponse = adminClient.createOrUpdateTestWithResponse(testId, test, null); - - System.out.println(testOutResponse.getValue().toString()); - /* - * END: Create test - */ - - /* - * BEGIN: Upload test file - */ - // extract file contents to BinaryData - BinaryData fileData = BinaryData.fromFile(new File(testFilePath).toPath()); - - // receive response with BinaryData content - // NOTE: file name should be passed as input argument `testFileName`. File name in local path is ignored - PollResponse fileUrlOut = adminClient.beginUploadTestFile(testId, testFileName, fileData, null) - .waitForCompletion(Duration.ofMinutes(2)); - - System.out.println(fileUrlOut.getValue().toString()); - /* - * END: Upload test file - */ - - /* - * BEGIN: Start test run - */ - // construct Test Run object using nested String:Object Maps - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", testId); - testRunMap.put("displayName", "SDK-Created-TestRun"); - - // convert the object Map to JSON BinaryData - BinaryData testRun = BinaryData.fromObject(testRunMap); - - // receive response with BinaryData content - SyncPoller testRunPoller = testRunClient.beginTestRun(testRunId, testRun, null); - - System.out.println(testRunPoller.poll().getValue().toString()); - /* - * END: Start test run - */ - - /* - * BEGIN: Stop test run - */ - try { - Thread.sleep(10 * 1000); - } catch (InterruptedException e) { - // handle interruption - } - - Response stoppedTestRunOut = testRunClient.stopTestRunWithResponse(testRunId, null); - - System.out.println(stoppedTestRunOut.getValue().toString()); - /* - * END: Stop test run - */ - - /* - * BEGIN: List metrics - */ - // wait for test to reach terminal state - PollResponse testRunOut = testRunPoller.poll(); - String testStatus = null, startDateTime = null, endDateTime = null; - - while (!testRunOut.getStatus().isComplete()) { - testRunOut = testRunPoller.poll(); - - // parse JSON and read status value - try (JsonReader jsonReader = JsonProviders.createReader(testRunOut.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Status of test run: " + testStatus); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // wait and check test status every 5 seconds - try { - Thread.sleep(5 * 1000); - } catch (InterruptedException e) { - // handle interruption - } - } - - try (JsonReader jsonReader = JsonProviders.createReader(testRunPoller.getFinalResult().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - startDateTime = jsonTree.get("startDateTime").toString(); - endDateTime = jsonTree.get("endDateTime").toString(); - System.out.println("Status of test run: " + testStatus); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // get list of all metric namespaces and pick the first one - Response metricNamespacesOut = testRunClient.getMetricNamespacesWithResponse(testRunId, null); - String metricNamespace = null; - - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricNamespacesOut.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - List> metricNamespaces = (List>) jsonTree.get("value"); - metricNamespace = metricNamespaces.get(0).get("metricNamespaceName").toString(); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // get list of all metric definitions and pick the first one - Response metricDefinitionsOut = testRunClient.getMetricDefinitionsWithResponse(testRunId, metricNamespace, null); - String metricName = null; - - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricDefinitionsOut.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - List metricDefinitions = (List) jsonTree.get("value"); - Map firstMetricDefinition = (Map) metricDefinitions.get(0); - Map name = (Map) firstMetricDefinition.get("name"); - metricName = name.get("value").toString(); - } catch (IOException e) { - e.printStackTrace(); - // handle error condition - } - - // fetch client metrics using metric namespace and metric name - PagedIterable clientMetricsOut = testRunClient.listMetrics(testRunId, metricName, metricNamespace, startDateTime + '/' + endDateTime, null); - - clientMetricsOut.forEach((clientMetric) -> { - System.out.println(clientMetric.toString()); - }); - /* - * END: List metrics - */ - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java deleted file mode 100644 index 8a32237de35b..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperations.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.IOException; -import java.util.Map; - -/** - * Sample demonstrates how to list tests, test files and test runs for a given resource. - */ -public final class ListOperations { - /** - * Authenticates with the load testing resource and shows how to list tests, test files and test runs - * for a given resource. - * - * @param args Unused. Arguments to the program. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when listing files. - */ - public static void main(String[] args) { - listTests(); - listTestRuns(); - listTestFiles(); - } - - public static void listTests() { - // BEGIN: java-listOperations-sample-listTests - LoadTestAdministrationClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); - - PagedIterable tests = client.listTests(reqOpts); - - tests.forEach(testBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s", testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperations-sample-listTests - } - - public static void listTestRuns() { - // BEGIN: java-listOperations-sample-listTestRuns - LoadTestRunClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("search", "scenario1") - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); - - PagedIterable testRuns = client.listTestRuns(reqOpts); - - testRuns.forEach(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testRunId = jsonTree.get("testRunId").toString(); - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s\t%s", testRunId, testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperations-sample-listTestRuns - } - - public static void listTestFiles() { - // BEGIN: java-listOperations-sample-listTestFiles - LoadTestAdministrationClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - PagedIterable files = client.listTestFiles(inputTestId, null); - - files.forEach(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String blobUrl = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - System.out.println(String.format("%s\t%s\t%s", fileName, fileType, blobUrl)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperations-sample-listTestFiles - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java deleted file mode 100644 index 604f2013cb30..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ListOperationsAsync.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.IOException; -import java.util.Map; - -/** - * Sample demonstrates how to list tests, test files and test runs for a given resource. - */ -public final class ListOperationsAsync { - /** - * Authenticates with the load testing resource and shows how to list tests, test files and test runs - * for a given resource. - * - * @param args Unused. Arguments to the program. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when listing files. - */ - public static void main(String[] args) { - listTests(); - listTestRuns(); - listTestFiles(); - } - - public static void listTests() { - // BEGIN: java-listOperationsAsync-sample-listTests - LoadTestAdministrationAsyncClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); - - PagedFlux tests = client.listTests(reqOpts); - - tests.subscribe(testBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s", testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperationsAsync-sample-listTests - } - - public static void listTestRuns() { - // BEGIN: java-listOperationsAsync-sample-listTestRuns - LoadTestRunAsyncClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("search", "scenario1") - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); - - PagedFlux testRuns = client.listTestRuns(reqOpts); - - testRuns.subscribe(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testRunId = jsonTree.get("testRunId").toString(); - String testId = jsonTree.get("testId").toString(); - String displayName = (jsonTree.get("displayName") != null) - ? jsonTree.get("displayName").toString() - : ""; - System.out.println(String.format("%s\t%s\t%s", testRunId, testId, displayName)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperationsAsync-sample-listTestRuns - } - - public static void listTestFiles() { - // BEGIN: java-listOperationsAsync-sample-listTestFiles - LoadTestAdministrationAsyncClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - - PagedFlux files = client.listTestFiles(inputTestId, null); - - files.subscribe(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String blobUrl = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - System.out.println(String.format("%s\t%s\t%s", fileName, fileType, blobUrl)); - } catch (IOException e) { - e.printStackTrace(); - } - }); - // END: java-listOperationsAsync-sample-listTestFiles - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java deleted file mode 100644 index bd5c0ba29cde..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperations.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.Map; - -/** - * Sample demonstrates how to upload and validate a test file, and running a test run. - * - * Authenticates with the load testing resource and shows how to upload and validate a test file, and running a test run - * in a given resource. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when uploading file. - */ -public final class LongRunningOperations { - public void beginUploadTestFile() { - // BEGIN: java-longRunningOperations-sample-beginUploadTestFile - LoadTestAdministrationClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - String inputFileName = "input-test-file.jmx"; - BinaryData fileData = BinaryData.fromFile(new File("C:/fakepath/input-file.jmx").toPath()); - /* Note: file name passed as input argument is used, over the name in local file path */ - - Duration pollInterval = Duration.ofSeconds(1); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("fileType", "JMX_FILE"); - - SyncPoller poller = client.beginUploadTestFile(inputTestId, inputFileName, fileData, reqOpts); - poller = poller.setPollInterval(pollInterval); - - PollResponse pollResponse = poller.poll(); - - while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println("Validation Status: " + validationStatus); - } catch (IOException e) { - e.printStackTrace(); - } - - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); - } - - poller.waitForCompletion(); - - BinaryData fileBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String url = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println(String.format("%s\t%s\t%s\t%s", fileName, fileType, url, validationStatus)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperations-sample-beginUploadTestFile - } - - public void beginTestRun() { - // BEGIN: java-longRunningOperations-sample-beginTestRun - LoadTestRunClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - String inputTestRunId = "12345678-1234-1234-1234-123456789abc"; - String inputTestId = "87654321-1234-1234-1234-123456789abc"; - - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", inputTestId); - testRunMap.put("displayName", "Sample Test Run"); - testRunMap.put("description", "Java SDK Sample Test Run"); - - Duration pollInterval = Duration.ofSeconds(5); - - BinaryData inputTestRunBinary = BinaryData.fromObject(testRunMap); - - SyncPoller poller = client.beginTestRun(inputTestRunId, inputTestRunBinary, null); - poller = poller.setPollInterval(pollInterval); - - PollResponse pollResponse = poller.poll(); - - while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - BinaryData testRunBinary = pollResponse.getValue(); - - System.out.println("Test Run all info: " + testRunBinary.toString()); - - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); - } - - poller.waitForCompletion(); - BinaryData testRunBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String testRunId = jsonTree.get("testRunId").toString(); - String status = jsonTree.get("status").toString(); - System.out.println(String.format("%s\t%s\t%s", testId, testRunId, status)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperations-sample-beginTestRun - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java deleted file mode 100644 index f3b01b173a7d..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/LongRunningOperationsAsync.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.PollerFlux; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.util.HashMap; -import java.util.Map; - -/** - * Sample demonstrates how to upload and validat a test file, and running a test run. - * - * Authenticates with the load testing resource and shows how to upload and validat a test file, and running a test run - * in a given resource. - * - * @throws ClientAuthenticationException - when the credentials have insufficient permissions for load test resource. - * @throws ResourceNotFoundException - when test with `testId` does not exist when uploading file. - */ -public final class LongRunningOperationsAsync { - public void beginUploadTestFile() { - // BEGIN: java-longRunningOperationsAsync-sample-beginUploadTestFile - LoadTestAdministrationAsyncClient client = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - String inputTestId = "12345678-1234-1234-1234-123456789abc"; - String inputFileName = "input-test-file.jmx"; - BinaryData fileData = BinaryData.fromFile(new File("C:/fakepath/input-file.jmx").toPath()); - /* Note: file name passed as input argument is used, over the name in local file path */ - - Duration pollInterval = Duration.ofSeconds(1); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("fileType", "JMX_FILE"); - - PollerFlux poller = client.beginUploadTestFile(inputTestId, inputFileName, fileData, reqOpts); - poller = poller.setPollInterval(pollInterval); - - poller.subscribe(pollResponse -> { - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println("Validation Status: " + validationStatus); - } catch (IOException e) { - e.printStackTrace(); - } - }); - - AsyncPollResponse pollResponse = poller.blockLast(); - BinaryData fileBinary = pollResponse.getFinalResult().block(); - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String url = jsonTree.get("url").toString(); - String fileName = jsonTree.get("fileName").toString(); - String fileType = jsonTree.get("fileType").toString(); - String validationStatus = jsonTree.get("validationStatus").toString(); - System.out.println(String.format("%s\t%s\t%s\t%s", fileName, fileType, url, validationStatus)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperationsAsync-sample-beginUploadTestFile - } - - public void beginTestRun() { - // BEGIN: java-longRunningOperationsAsync-sample-beginTestRun - LoadTestRunAsyncClient client = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildAsyncClient(); - - String inputTestRunId = "12345678-1234-1234-1234-123456789abc"; - String inputTestId = "87654321-1234-1234-1234-123456789abc"; - - Map testRunMap = new HashMap(); - testRunMap.put("testId", inputTestId); - testRunMap.put("displayName", "Sample Test Run"); - testRunMap.put("description", "Java SDK Sample Test Run"); - - Duration pollInterval = Duration.ofSeconds(5); - - BinaryData inputTestRunBinary = BinaryData.fromObject(testRunMap); - - PollerFlux poller = client.beginTestRun(inputTestRunId, inputTestRunBinary, null); - poller = poller.setPollInterval(pollInterval); - - poller.subscribe(pollResponse -> { - BinaryData testRunBinary = pollResponse.getValue(); - System.out.println("Test Run all info: " + testRunBinary.toString()); - }); - - AsyncPollResponse pollResponse = poller.blockLast(); - BinaryData testRunBinary = pollResponse.getFinalResult().block(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - String testId = jsonTree.get("testId").toString(); - String testRunId = jsonTree.get("testRunId").toString(); - String status = jsonTree.get("status").toString(); - System.out.println(String.format("%s\t%s\t%s", testId, testRunId, status)); - } catch (IOException e) { - e.printStackTrace(); - } - // END: java-longRunningOperationsAsync-sample-beginTestRun - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java index 9eb37551d645..41f33cd07e61 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/samples/java/com/azure/developer/loadtesting/ReadmeSamples.java @@ -1,226 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.developer.loadtesting; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; - -import java.io.File; -import java.io.IOException; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@SuppressWarnings("unchecked") public final class ReadmeSamples { - public void auth() { - // BEGIN: java-readme-sample-auth - // ensure the user, service principal or managed identity used has Loadtesting Contributor role for the resource - TokenCredential credential = new DefaultAzureCredentialBuilder().build(); - // create client using DefaultAzureCredential - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); - LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(credential) - .endpoint("") - .buildClient(); - - RequestOptions reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("maxPageSize", "10"); - adminClient.listTests(reqOpts); - - reqOpts = new RequestOptions() - .addQueryParam("orderBy", "lastModifiedDateTime") - .addQueryParam("status", "EXECUTING,DONE") - .addQueryParam("maxPageSize", "10"); - testRunClient.listTestRuns(reqOpts); - // END: java-readme-sample-auth - } - - public void createTest() { - // BEGIN: java-readme-sample-createTest - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - // construct Test object using nested String:Object Maps - Map testMap = new HashMap<>(); - testMap.put("displayName", "Sample Display Name"); - testMap.put("description", "Sample Description"); - - // loadTestConfig describes the number of test engines to generate load - Map loadTestConfigMap = new HashMap<>(); - loadTestConfigMap.put("engineInstances", 1); - testMap.put("loadTestConfiguration", loadTestConfigMap); - - // environmentVariables are plain-text data passed to test engines - Map envVarMap = new HashMap<>(); - envVarMap.put("a", "b"); - envVarMap.put("x", "y"); - testMap.put("environmentVariables", envVarMap); - - // secrets are secure data sent using Azure Key Vault - Map secretMap = new HashMap<>(); - Map sampleSecretMap = new HashMap<>(); - sampleSecretMap.put("value", "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827"); - sampleSecretMap.put("type", "AKV_SECRET_URI"); - secretMap.put("sampleSecret", sampleSecretMap); - testMap.put("secrets", secretMap); - - // passFailCriteria define the conditions to conclude the test as success - Map passFailMap = new HashMap<>(); - Map passFailMetrics = new HashMap<>(); - Map samplePassFailMetric = new HashMap<>(); - samplePassFailMetric.put("clientmetric", "response_time_ms"); - samplePassFailMetric.put("aggregate", "percentage"); - samplePassFailMetric.put("condition", ">"); - samplePassFailMetric.put("value", "20"); - samplePassFailMetric.put("action", "continue"); - passFailMetrics.put("fefd759d-7fe8-4f83-8b6d-aeebe0f491fe", samplePassFailMetric); - passFailMap.put("passFailMetrics", passFailMetrics); - testMap.put("passFailCriteria", passFailMap); - - // convert the object Map to JSON BinaryData - BinaryData test = BinaryData.fromObject(testMap); - - // receive response with BinaryData content - Response testOutResponse = adminClient.createOrUpdateTestWithResponse("test12345", test, null); - System.out.println(testOutResponse.getValue().toString()); - // END: java-readme-sample-createTest - } - - public void uploadTestFile() throws IOException { - // BEGIN: java-readme-sample-uploadTestFile - LoadTestAdministrationClient adminClient = new LoadTestAdministrationClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - // extract file contents to BinaryData - BinaryData fileData = BinaryData.fromFile(new File("path/to/file").toPath()); - - // receive response with BinaryData content - PollResponse fileUrlOut = adminClient.beginUploadTestFile("test12345", "sample-file.jmx", fileData, null) - .waitForCompletion(Duration.ofMinutes(2)); - System.out.println(fileUrlOut.getValue().toString()); - // END: java-readme-sample-uploadTestFile - } - - public void runTest() { - // BEGIN: java-readme-sample-runTest - LoadTestRunClient testRunClient = new LoadTestRunClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("") - .buildClient(); - - // construct Test Run object using nested String:Object Maps - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", "test12345"); - testRunMap.put("displayName", "SDK-Created-TestRun"); - - // convert the object Map to JSON BinaryData - BinaryData testRun = BinaryData.fromObject(testRunMap); - - // start test with poller - SyncPoller poller = testRunClient.beginTestRun("testrun12345", testRun, null); - Duration pollInterval = Duration.ofSeconds(5); - poller = poller.setPollInterval(pollInterval); - - // wait for test to reach terminal state - Map jsonTree = null; - String testStatus; - PollResponse pollResponse = poller.poll(); - while (pollResponse.getStatus() == LongRunningOperationStatus.IN_PROGRESS - || pollResponse.getStatus() == LongRunningOperationStatus.NOT_STARTED) { - - try (JsonReader jsonReader = JsonProviders.createReader(pollResponse.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // wait and check test status every 5 seconds - try { - Thread.sleep(pollInterval.toMillis()); - } catch (InterruptedException e) { - // handle interruption - } - - pollResponse = poller.poll(); - } - - poller.waitForCompletion(); - BinaryData testRunBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - testStatus = jsonTree.get("status").toString(); - System.out.println("Test run status: " + testStatus); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - String startDateTime = jsonTree.get("startDateTime").toString(); - String endDateTime = jsonTree.get("endDateTime").toString(); - OffsetDateTime startOffsetDateTime = OffsetDateTime.parse(startDateTime); - OffsetDateTime endOffsetDateTime = OffsetDateTime.parse(endDateTime); - - // get list of all metric namespaces and pick the first one - Response metricNamespacesOut = testRunClient.getMetricNamespacesWithResponse("testrun12345", null); - String metricNamespace = null; - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricNamespacesOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - Map namespaceMap = (Map) metricNamespaces.get(0); - metricNamespace = namespaceMap.get("name").toString(); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // get list of all metric definitions and pick the first one - Response metricDefinitionsOut = testRunClient.getMetricDefinitionsWithResponse("testrun12345", metricNamespace, null); - String metricName = null; - // parse JSON and read first value - try (JsonReader jsonReader = JsonProviders.createReader(metricDefinitionsOut.getValue().toBytes())) { - jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - Map definitionMap = (Map) metricDefinitions.get(0); - Map nameMap = (Map) definitionMap.get("name"); - metricName = nameMap.get("value").toString(); - } catch (IOException e) { - System.out.println("Error processing JSON response"); - // handle error condition - } - - // fetch client metrics using metric namespace and metric name - PagedIterable clientMetricsOut = testRunClient.listMetrics("testrun12345", metricName, metricNamespace, startDateTime + '/' + endDateTime, null); - clientMetricsOut.forEach((clientMetric) -> { - System.out.println(clientMetric.toString()); - }); - // END: java-readme-sample-runTest + public void readmeSamples() { + // BEGIN: com.azure.developer.loadtesting.readme + // END: com.azure.developer.loadtesting.readme } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncTests.java deleted file mode 100644 index 1cee507f058f..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationAsyncTests.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestAdministrationAsyncTests extends LoadTestingClientTestBase { - - // Helpers - - private Map getTestBodyFromDict() { - Map testMap = new HashMap<>(); - testMap.put("displayName", "Java SDK Sample Test Async"); - testMap.put("description", "Sample Test Async"); - - Map loadTestConfigMap = new HashMap<>(); - loadTestConfigMap.put("engineInstances", 1); - testMap.put("loadTestConfiguration", loadTestConfigMap); - - Map envVarMap = new HashMap<>(); - envVarMap.put("threads_per_engine", 1); - envVarMap.put("ramp_up_time", 0); - envVarMap.put("duration_in_sec", 10); - envVarMap.put("domain", "azure.microsoft.com"); - envVarMap.put("protocol", "https"); - testMap.put("environmentVariables", envVarMap); - - return testMap; - } - - private BinaryData getFileBodyFromResource(String fileName) { - URL url = LoadTestAdministrationAsyncTests.class.getClassLoader().getResource(fileName); - - return BinaryData.fromFile(new File(url.getPath()).toPath()); - } - - // Puts and Patches - - @Test - @Order(1) - public void createOrUpdateTest() { - BinaryData body = BinaryData.fromObject(getTestBodyFromDict()); - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().createOrUpdateTestWithResponse(newTestIdAsync, body, null); - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - @Test - @Order(2) - public void beginUploadTestFileAdditionalFiles() { - BinaryData file = getFileBodyFromResource(uploadCsvFileName); - RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "ADDITIONAL_ARTIFACTS"); - PollerFlux poller = getLoadTestAdministrationAsyncClient() - .beginUploadTestFile(newTestIdAsync, uploadCsvFileName, file, requestOptions); - poller = setPlaybackPollerFluxPollInterval(poller); - - StepVerifier.create(poller.last()) - .assertNext(pollResponse -> assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - pollResponse.getStatus())) - .verifyComplete(); - } - - @Test - @Order(3) - public void beginUploadTestFileTestScript() { - BinaryData file = getFileBodyFromResource(uploadJmxFileName); - RequestOptions fileUploadRequestOptions = new RequestOptions().addQueryParam("fileType", "JMX_FILE"); - PollerFlux poller = getLoadTestAdministrationAsyncClient() - .beginUploadTestFile(newTestIdAsync, uploadJmxFileName, file, fileUploadRequestOptions); - poller = setPlaybackPollerFluxPollInterval(poller); - - StepVerifier.create(poller.takeUntil(pollResponse -> pollResponse.getStatus().isComplete()) - .last() - .flatMap(AsyncPollResponse::getFinalResult)).assertNext(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals("VALIDATION_SUCCESS", jsonTree.get("validationStatus")); - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - }).verifyComplete(); - } - - @Test - @Order(4) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Mono> monoResponse = getLoadTestAdministrationAsyncClient() - .createOrUpdateAppComponentsWithResponse(newTestIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - @Test - @Order(5) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Mono> monoResponse = getLoadTestAdministrationAsyncClient() - .createOrUpdateServerMetricsConfigWithResponse(newTestIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - // Gets - - @Test - @Order(6) - public void getTestFile() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getTestFileWithResponse(newTestIdAsync, uploadJmxFileName, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - }).verifyComplete(); - } - - @Test - @Order(7) - public void getTest() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getTestWithResponse(newTestIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestIdAsync, jsonTree.get("testId")); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - - assertEquals(200, response.getStatusCode()); - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(8) - public void getAppComponents() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getAppComponentsWithResponse(newTestIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading app components", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(9) - public void getServerMetricsConfig() { - Mono> monoResponse - = getLoadTestAdministrationAsyncClient().getServerMetricsConfigWithResponse(newTestIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading server metrics", e); - } - }).verifyComplete(); - } - - // Lists - - @Test - @Order(10) - public void listTestFiles() { - PagedFlux response = getLoadTestAdministrationAsyncClient().listTestFiles(newTestIdAsync, null); - - StepVerifier.create(response).expectNextMatches(fileBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }).thenConsumeWhile(fileBinary -> true).verifyComplete(); - } - - @Test - @Order(11) - public void listTests() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("orderBy", "lastModifiedDateTime desc"); - PagedFlux response = getLoadTestAdministrationAsyncClient().listTests(reqOpts); - - StepVerifier.create(response).expectNextMatches(testBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - return newTestIdAsync.equals(jsonTree.get("testId")); - } catch (IOException e) { - return false; - } - }).thenConsumeWhile(fileBinary -> true).verifyComplete(); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestFile() { - StepVerifier - .create(getLoadTestAdministrationAsyncClient().deleteTestFileWithResponse(newTestIdAsync, uploadCsvFileName, - null)) - .expectNextCount(1) - .verifyComplete(); - StepVerifier - .create(getLoadTestAdministrationAsyncClient().deleteTestFileWithResponse(newTestIdAsync, uploadJmxFileName, - null)) - .expectNextCount(1) - .verifyComplete(); - } - - @Test - @Order(13) - public void deleteTest() { - StepVerifier.create(getLoadTestAdministrationAsyncClient().deleteTestWithResponse(newTestIdAsync, null)) - .expectNextCount(1) - .verifyComplete(); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationTests.java deleted file mode 100644 index 3c54af35f56a..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestAdministrationTests.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestAdministrationTests extends LoadTestingClientTestBase { - - // Helpers - - private Map getTestBodyFromDict() { - Map testMap = new HashMap<>(); - testMap.put("displayName", "Java SDK Sample Test"); - testMap.put("description", "Sample Test"); - - Map loadTestConfigMap = new HashMap<>(); - loadTestConfigMap.put("engineInstances", 1); - testMap.put("loadTestConfiguration", loadTestConfigMap); - - Map envVarMap = new HashMap<>(); - envVarMap.put("threads_per_engine", 1); - envVarMap.put("ramp_up_time", 0); - envVarMap.put("duration_in_sec", 10); - envVarMap.put("domain", "azure.microsoft.com"); - envVarMap.put("protocol", "https"); - testMap.put("environmentVariables", envVarMap); - - return testMap; - } - - private BinaryData getFileBodyFromResource(String fileName) { - URL url = LoadTestAdministrationTests.class.getClassLoader().getResource(fileName); - - return BinaryData.fromFile(new File(url.getPath()).toPath()); - } - - // Puts and Patches - - @Test - @Order(1) - public void createOrUpdateTest() { - BinaryData body = BinaryData.fromObject(getTestBodyFromDict()); - Response response - = getLoadTestAdministrationClient().createOrUpdateTestWithResponse(newTestId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - @Test - @Order(2) - public void beginUploadTestFileAdditionalFiles() { - BinaryData file = getFileBodyFromResource(uploadCsvFileName); - RequestOptions requestOptions = new RequestOptions().addQueryParam("fileType", "ADDITIONAL_ARTIFACTS"); - PollResponse response - = getLoadTestAdministrationClient().beginUploadTestFile(newTestId, uploadCsvFileName, file, requestOptions) - .poll(); - - assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.getStatus()); - } - - @Test - @Order(3) - public void beginUploadTestFileTestScript() { - BinaryData file = getFileBodyFromResource(uploadJmxFileName); - RequestOptions fileUploadRequestOptions = new RequestOptions().addQueryParam("fileType", "JMX_FILE"); - SyncPoller poller = getLoadTestAdministrationClient().beginUploadTestFile(newTestId, - uploadJmxFileName, file, fileUploadRequestOptions); - poller = setPlaybackSyncPollerPollInterval(poller); - PollResponse response = poller.waitForCompletion(); - BinaryData fileBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals("VALIDATION_SUCCESS", jsonTree.get("validationStatus")); - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - - assertNotNull(response.getValue()); - } - - @Test - @Order(4) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Response response - = getLoadTestAdministrationClient().createOrUpdateAppComponentsWithResponse(newTestId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - @Test - @Order(5) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Response response - = getLoadTestAdministrationClient().createOrUpdateServerMetricsConfigWithResponse(newTestId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - // Gets - - @Test - @Order(6) - public void getTestFile() { - Response response - = getLoadTestAdministrationClient().getTestFileWithResponse(newTestId, uploadJmxFileName, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test file data", e); - } - } - - @Test - @Order(7) - public void getTest() { - Response response = getLoadTestAdministrationClient().getTestWithResponse(newTestId, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestId, jsonTree.get("testId")); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - } - - @SuppressWarnings("unchecked") - @Test - @Order(8) - public void getAppComponents() { - Response response = getLoadTestAdministrationClient().getAppComponentsWithResponse(newTestId, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - } - - @SuppressWarnings("unchecked") - @Test - @Order(9) - public void getServerMetricsConfig() { - Response response - = getLoadTestAdministrationClient().getServerMetricsConfigWithResponse(newTestId, null); - - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading test data", e); - } - } - - // Lists - - @Test - @Order(10) - public void listTestFiles() { - PagedIterable response = getLoadTestAdministrationClient().listTestFiles(newTestId, null); - boolean found = response.stream().anyMatch((fileBinary) -> { - try (JsonReader jsonReader = JsonProviders.createReader(fileBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }); - - assertTrue(found); - } - - @Test - @Order(11) - public void listTests() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("orderBy", "lastModifiedDateTime desc"); - PagedIterable response = getLoadTestAdministrationClient().listTests(reqOpts); - boolean found = response.stream().anyMatch((testBinary) -> { - try (JsonReader jsonReader = JsonProviders.createReader(testBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - return newTestId.equals(jsonTree.get("testId")); - } catch (IOException e) { - return false; - } - }); - - assertTrue(found); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestFile() { - assertDoesNotThrow(() -> { - getLoadTestAdministrationClient().deleteTestFileWithResponse(newTestId, uploadCsvFileName, null); - }); - assertDoesNotThrow(() -> { - getLoadTestAdministrationClient().deleteTestFileWithResponse(newTestId, uploadJmxFileName, null); - }); - } - - @Test - @Order(13) - public void deleteTest() { - assertDoesNotThrow(() -> { - getLoadTestAdministrationClient().deleteTestWithResponse(newTestId, null); - }); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunAsyncTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunAsyncTests.java deleted file mode 100644 index 8480172c3925..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunAsyncTests.java +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.PollerFlux; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestRunAsyncTests extends LoadTestingClientTestBase { - - // Helpers - - private Map getTestRunBodyFromDict(String testId) { - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", testId); - testRunMap.put("displayName", "Java SDK Sample Test Run Async"); - testRunMap.put("description", "Sample Test Run Async"); - - return testRunMap; - } - - // Puts and Patches - - @Test - @Order(1) - public void beginTestRun() { - BinaryData body = BinaryData.fromObject(getTestRunBodyFromDict(existingTestId)); - PollerFlux poller - = getLoadTestRunAsyncClient().beginTestRun(newTestRunIdAsync, body, null); - poller = setPlaybackPollerFluxPollInterval(poller); - StepVerifier.create(poller.takeUntil(pollResponse -> pollResponse.getStatus().isComplete()) - .last() - .flatMap(AsyncPollResponse::getFinalResult)).assertNext(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunIdAsync, jsonTree.get("testRunId")); - assertEquals("DONE", jsonTree.get("status")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - }).verifyComplete(); - } - - @Test - @Order(2) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Mono> monoResponse - = getLoadTestRunAsyncClient().createOrUpdateAppComponentsWithResponse(newTestRunIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - @Test - @Order(3) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Mono> monoResponse - = getLoadTestRunAsyncClient().createOrUpdateServerMetricsConfigWithResponse(newTestRunIdAsync, body, null); - - StepVerifier.create(monoResponse) - .assertNext(response -> assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode()))) - .verifyComplete(); - } - - // Gets - - @Test - @Order(4) - public void getTestRunFile() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getTestRunFileWithResponse(newTestRunIdAsync, uploadJmxFileName, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test run file data", e); - } - }).verifyComplete(); - } - - @Test - @Order(5) - public void getTestRun() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getTestRunWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunIdAsync, jsonTree.get("testRunId")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - - assertEquals(200, response.getStatusCode()); - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(6) - public void getAppComponents() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getAppComponentsWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading app components", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(7) - public void getServerMetricsConfig() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getServerMetricsConfigWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - assertEquals(200, response.getStatusCode()); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading server metrics", e); - } - }).verifyComplete(); - } - - @SuppressWarnings({ "WriteOnlyObject", "unchecked" }) - @Test - @Order(8) - public void listMetricNamespaces() { - Mono> monoResponse - = getLoadTestRunAsyncClient().getMetricNamespacesWithResponse(newTestRunIdAsync, null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricNamespaces.forEach(namespace -> { - Map namespaceMap = (Map) namespace; - - if (namespaceMap.get("name").equals("LoadTestRunMetrics")) { - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric namespaces", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(9) - public void listMetricDefinitions() { - Mono> monoResponse = getLoadTestRunAsyncClient() - .getMetricDefinitionsWithResponse(newTestRunIdAsync, "LoadTestRunMetrics", null); - - StepVerifier.create(monoResponse).assertNext(response -> { - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricDefinitions.forEach(definition -> { - Map definitionMap = (Map) definition; - - if (definitionMap.get("namespace").equals("LoadTestRunMetrics") - && definitionMap.get("name") != null - && definitionMap.containsKey("dimensions")) { - - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric definitions", e); - } - }).verifyComplete(); - } - - @SuppressWarnings("unchecked") - @Test - @Order(10) - public void listMetrics() { - Mono monoBoolean - = getLoadTestRunAsyncClient().getTestRunWithResponse(newTestRunIdAsync, null).flatMap(response -> { - String startDateTime = "", endDateTime = ""; - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - startDateTime = jsonTree.get("startDateTime").toString(); - endDateTime = jsonTree.get("endDateTime").toString(); - } catch (IOException e) { - fail("Encountered exception while reading metrics data", e); - } - - String timespan = startDateTime + "/" + endDateTime; - PagedFlux metricsResponse = getLoadTestRunAsyncClient().listMetrics(newTestRunIdAsync, - "VirtualUsers", "LoadTestRunMetrics", timespan, null); - - return metricsResponse.any(metricsBinary -> { - AtomicBoolean found = new AtomicBoolean(false); - - try (JsonReader jsonReader = JsonProviders.createReader(metricsBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - if (jsonTree.containsKey("data")) { - List data = (List) jsonTree.get("data"); - - data.forEach(metric -> { - Map metricMap = (Map) metric; - - if (metricMap.containsKey("value")) { - found.set(true); - } - }); - } - } catch (IOException e) { - // no-op - } - - return found.get(); - }); - }); - - StepVerifier.create(monoBoolean).expectNext(true).thenConsumeWhile(ignored -> true).verifyComplete(); - } - - // Lists - - @Test - @Order(11) - public void listTestRuns() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("testId", existingTestId); - PagedFlux response = getLoadTestRunAsyncClient().listTestRuns(reqOpts); - - StepVerifier.create(response).expectNextMatches(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunIdAsync, jsonTree.get("testRunId")); - assertEquals(existingTestId, jsonTree.get("testId")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }).thenConsumeWhile(testRunBinary -> true).verifyComplete(); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestRun() { - StepVerifier.create(getLoadTestRunAsyncClient().deleteTestRunWithResponse(newTestRunIdAsync, null)) - .expectNextCount(1) - .verifyComplete(); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunTests.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunTests.java deleted file mode 100644 index 04b509441de6..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestRunTests.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.SyncPoller; -import com.azure.json.JsonProviders; -import com.azure.json.JsonReader; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; - -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@SuppressWarnings("unchecked") -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -public final class LoadTestRunTests extends LoadTestingClientTestBase { - - // Helpers - - private Map getTestRunBodyFromDict(String testId) { - Map testRunMap = new HashMap<>(); - testRunMap.put("testId", testId); - testRunMap.put("displayName", "Java SDK Sample Test Run"); - testRunMap.put("description", "Sample Test Run"); - - return testRunMap; - } - - // Puts and Patches - - @Test - @Order(1) - public void beginTestRun() { - BinaryData body = BinaryData.fromObject(getTestRunBodyFromDict(existingTestId)); - SyncPoller poller = getLoadTestRunClient().beginTestRun(newTestRunId, body, null); - poller = setPlaybackSyncPollerPollInterval(poller); - PollResponse response = poller.waitForCompletion(); - BinaryData testRunBinary = poller.getFinalResult(); - - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunId, jsonTree.get("testRunId")); - assertEquals("DONE", jsonTree.get("status")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - - assertNotNull(response.getValue()); - } - - @Test - @Order(2) - public void createOrUpdateAppComponents() { - BinaryData body = BinaryData.fromObject(getAppComponentBodyFromDict()); - Response response - = getLoadTestRunClient().createOrUpdateAppComponentsWithResponse(newTestRunId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - @Test - @Order(3) - public void createOrUpdateServerMetricsConfig() { - BinaryData body = BinaryData.fromObject(getServerMetricsBodyFromDict()); - Response response - = getLoadTestRunClient().createOrUpdateServerMetricsConfigWithResponse(newTestRunId, body, null); - - assertTrue(Arrays.asList(200, 201).contains(response.getStatusCode())); - } - - // Gets - - @Test - @Order(4) - public void getTestRunFile() { - Response response - = getLoadTestRunClient().getTestRunFileWithResponse(newTestRunId, uploadJmxFileName, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(uploadJmxFileName, jsonTree.get("fileName")); - assertEquals("JMX_FILE", jsonTree.get("fileType")); - } catch (IOException e) { - fail("Encountered exception while reading test run file data", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @Test - @Order(5) - public void getTestRun() { - Response response = getLoadTestRunClient().getTestRunWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunId, jsonTree.get("testRunId")); - } catch (IOException e) { - fail("Encountered exception while reading test run data", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @SuppressWarnings("unchecked") - @Test - @Order(6) - public void getAppComponents() { - Response response = getLoadTestRunClient().getAppComponentsWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("components"); - - assertTrue(components.containsKey(defaultAppComponentResourceId)); - - Map appComponentResource - = (Map) components.get(defaultAppComponentResourceId); - - assertTrue( - defaultAppComponentResourceId.equalsIgnoreCase(appComponentResource.get("resourceId").toString())); - } catch (IOException e) { - fail("Encountered exception while reading app components", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @SuppressWarnings("unchecked") - @Test - @Order(7) - public void getServerMetricsConfig() { - Response response = getLoadTestRunClient().getServerMetricsConfigWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - Map components = (Map) jsonTree.get("metrics"); - - assertTrue(components.containsKey(defaultServerMetricId)); - - Map appComponentResource = (Map) components.get(defaultServerMetricId); - - assertTrue(defaultServerMetricId.equalsIgnoreCase(appComponentResource.get("id").toString())); - } catch (IOException e) { - fail("Encountered exception while reading server metrics", e); - } - - assertEquals(200, response.getStatusCode()); - } - - @SuppressWarnings("unchecked") - @Test - @Order(8) - public void listMetricNamespaces() { - Response response = getLoadTestRunClient().getMetricNamespacesWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricNamespaces = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricNamespaces.forEach(namespace -> { - Map namespaceMap = (Map) namespace; - - if (namespaceMap.get("name").equals("LoadTestRunMetrics")) { - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric namespaces", e); - } - } - - @Test - @Order(9) - public void listMetricDefinitions() { - Response response - = getLoadTestRunClient().getMetricDefinitionsWithResponse(newTestRunId, "LoadTestRunMetrics", null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - List metricDefinitions = (List) jsonTree.get("value"); - AtomicBoolean found = new AtomicBoolean(false); - - metricDefinitions.forEach(definition -> { - Map definitionMap = (Map) definition; - - if (definitionMap.get("namespace").equals("LoadTestRunMetrics") - && definitionMap.get("name") != null - && definitionMap.containsKey("dimensions")) { - - found.set(true); - } - }); - - assertTrue(found.get()); - } catch (IOException e) { - fail("Encountered exception while reading metric definitions", e); - } - } - - @Test - @Order(10) - public void listMetrics() { - String startDateTime = "", endDateTime = ""; - Response response = getLoadTestRunClient().getTestRunWithResponse(newTestRunId, null); - - try (JsonReader jsonReader = JsonProviders.createReader(response.getValue().toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - startDateTime = jsonTree.get("startDateTime").toString(); - endDateTime = jsonTree.get("endDateTime").toString(); - } catch (IOException e) { - fail("Encountered exception while reading metrics data", e); - } - - String timespan = startDateTime + "/" + endDateTime; - PagedIterable metricsResponse - = getLoadTestRunClient().listMetrics(newTestRunId, "VirtualUsers", "LoadTestRunMetrics", timespan, null); - boolean valid = metricsResponse.stream().anyMatch(metricsBinary -> { - AtomicBoolean found = new AtomicBoolean(false); - - try (JsonReader jsonReader = JsonProviders.createReader(metricsBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - if (jsonTree.containsKey("data")) { - List data = (List) jsonTree.get("data"); - - data.forEach(metric -> { - Map metricMap = (Map) metric; - - if (metricMap.containsKey("value")) { - found.set(true); - } - }); - } - } catch (IOException e) { - // no-op - } - - return found.get(); - }); - - assertTrue(valid); - } - - // Lists - - @Test - @Order(11) - public void listTestRuns() { - RequestOptions reqOpts = new RequestOptions().addQueryParam("testId", existingTestId); - PagedIterable response = getLoadTestRunClient().listTestRuns(reqOpts); - boolean found = response.stream().anyMatch(testRunBinary -> { - try (JsonReader jsonReader = JsonProviders.createReader(testRunBinary.toBytes())) { - Map jsonTree = jsonReader.readMap(JsonReader::readUntyped); - - assertEquals(newTestRunId, jsonTree.get("testRunId")); - assertEquals(existingTestId, jsonTree.get("testId")); - - return true; - } catch (IOException e) { - // no-op - } - - return false; - }); - - assertTrue(found); - } - - // Deletes - - @Test - @Order(12) - public void deleteTestRun() { - assertDoesNotThrow(() -> { - getLoadTestRunClient().deleteTestRunWithResponse(newTestRunId, null); - }); - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java b/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java deleted file mode 100644 index 25e01492f9a6..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/java/com/azure/developer/loadtesting/LoadTestingClientTestBase.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.developer.loadtesting; - -import com.azure.core.credential.AccessToken; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.test.TestMode; -import com.azure.core.test.TestProxyTestBase; -import com.azure.core.test.http.AssertingHttpClientBuilder; -import com.azure.core.test.models.TestProxyRequestMatcher; -import com.azure.core.test.models.TestProxyRequestMatcher.TestProxyRequestMatcherType; -import com.azure.core.test.models.TestProxySanitizer; -import com.azure.core.test.models.TestProxySanitizerType; -import com.azure.core.test.utils.MockTokenCredential; -import com.azure.core.util.Configuration; -import com.azure.core.util.CoreUtils; -import com.azure.identity.AzureCliCredentialBuilder; -import com.azure.identity.AzureDeveloperCliCredentialBuilder; -import com.azure.identity.AzurePipelinesCredentialBuilder; -import com.azure.identity.AzurePowerShellCredentialBuilder; -import com.azure.identity.ChainedTokenCredentialBuilder; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.identity.EnvironmentCredentialBuilder; -import reactor.core.publisher.Mono; - -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -class LoadTestingClientTestBase extends TestProxyTestBase { - private static final String URL_REGEX = "(?<=http:\\/\\/|https:\\/\\/)([^\\/?]+)"; - private final String defaultEndpoint = "REDACTED.eastus.cnt-prod.loadtesting.azure.com"; - - protected final String existingTestId - = Configuration.getGlobalConfiguration().get("EXISTING_TEST_ID", "11111111-1234-1234-1234-123456789012"); - protected final String newTestId - = Configuration.getGlobalConfiguration().get("NEW_TEST_ID", "22222222-1234-1234-1234-123456789012"); - protected final String newTestIdAsync - = Configuration.getGlobalConfiguration().get("NEW_TEST_ID", "22223333-1234-1234-1234-123456789012"); - protected final String newTestRunId - = Configuration.getGlobalConfiguration().get("NEW_TEST_RUN_ID", "33333333-1234-1234-1234-123456789012"); - protected final String newTestRunIdAsync - = Configuration.getGlobalConfiguration().get("NEW_TEST_RUN_ID_2", "44444444-1234-1234-1234-123456789012"); - protected final String uploadJmxFileName - = Configuration.getGlobalConfiguration().get("UPLOAD_JMX_FILE_NAME", "sample-JMX-file.jmx"); - protected final String uploadCsvFileName - = Configuration.getGlobalConfiguration().get("UPLOAD_CSV_FILE_NAME", "additional-data.csv"); - protected final String defaultAppComponentResourceId = Configuration.getGlobalConfiguration() - .get("APP_COMPONENT_RESOURCE_ID", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource"); - protected final String defaultServerMetricId = Configuration.getGlobalConfiguration() - .get("SERVER_METRIC_ID", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.insights/components/appcomponentresource/providers/microsoft.insights/metricdefinitions/requests/duration"); - - @Override - protected void beforeTest() { - if (getTestMode() != TestMode.LIVE) { - List sanitizers = new ArrayList<>(); - sanitizers.add(new TestProxySanitizer("Location", - "https://[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", - "https://REDACTED", TestProxySanitizerType.HEADER)); - sanitizers.add(new TestProxySanitizer(URL_REGEX, "REDACTED", TestProxySanitizerType.BODY_REGEX)); - interceptorManager.addSanitizers(sanitizers); - // Remove `operation-location`, `id` and `name` sanitizers from the list of common sanitizers. - interceptorManager.removeSanitizers("AZSDK2030", "AZSDK3430", "AZSDK3493"); - } - - if (getTestMode() == TestMode.PLAYBACK) { - List matchers = new ArrayList<>(); - matchers.add(new TestProxyRequestMatcher(TestProxyRequestMatcherType.BODILESS)); - interceptorManager.addMatchers(matchers); - } - } - - // Helpers - - protected LoadTestAdministrationClient getLoadTestAdministrationClient() { - return getLoadTestAdministrationClientBuilder(false).buildClient(); - } - - protected LoadTestAdministrationAsyncClient getLoadTestAdministrationAsyncClient() { - return getLoadTestAdministrationClientBuilder(true).buildAsyncClient(); - } - - protected LoadTestRunClient getLoadTestRunClient() { - return getLoadTestRunClientBuilder(false).buildClient(); - } - - protected LoadTestRunAsyncClient getLoadTestRunAsyncClient() { - return getLoadTestRunClientBuilder(true).buildAsyncClient(); - } - - protected Map getAppComponentBodyFromDict() { - Map appCompMap = new HashMap(); - Map compsMap = new HashMap(); - Map compMap = new HashMap(); - compMap.put("resourceId", defaultAppComponentResourceId); - compMap.put("resourceType", "microsoft.insights/components"); - compMap.put("resourceName", "appcomponentresource"); - compMap.put("displayName", "Performance_LoadTest_Insights"); - compMap.put("kind", "web"); - - compsMap.put(defaultAppComponentResourceId, compMap); - appCompMap.put("components", compsMap); - - return appCompMap; - } - - protected Map getServerMetricsBodyFromDict() { - Map serverMetricsMap = new HashMap(); - Map metricsMap = new HashMap(); - Map metricMap = new HashMap(); - metricMap.put("resourceId", defaultAppComponentResourceId); - metricMap.put("metricNamespace", "microsoft.insights/components"); - metricMap.put("name", "requests/duration"); - metricMap.put("aggregation", "Average"); - metricMap.put("resourceType", "microsoft.insights/components"); - - metricsMap.put(defaultServerMetricId, metricMap); - serverMetricsMap.put("metrics", metricsMap); - - return serverMetricsMap; - } - - private TokenCredential getTokenCredential() { - String authorityHost = Configuration.getGlobalConfiguration().get("AUTHORITY_HOST"); - - switch (getTestMode()) { - case RECORD: - DefaultAzureCredentialBuilder defaultAzureCredentialBuilder = new DefaultAzureCredentialBuilder(); - - if (authorityHost != null && !authorityHost.isEmpty()) { - defaultAzureCredentialBuilder.authorityHost(authorityHost); - } - - return defaultAzureCredentialBuilder.build(); - - case LIVE: - Configuration config = Configuration.getGlobalConfiguration(); - EnvironmentCredentialBuilder environmentCredentialBuilder = new EnvironmentCredentialBuilder(); - - if (authorityHost != null && !authorityHost.isEmpty()) { - environmentCredentialBuilder.authorityHost(authorityHost); - } - - ChainedTokenCredentialBuilder chainedTokenCredentialBuilder - = new ChainedTokenCredentialBuilder().addLast(environmentCredentialBuilder.build()) - .addLast(new AzureCliCredentialBuilder().build()) - .addLast(new AzureDeveloperCliCredentialBuilder().build()) - .addLast(new AzurePowerShellCredentialBuilder().build()); - - String serviceConnectionId = config.get("AZURESUBSCRIPTION_SERVICE_CONNECTION_ID"); - String clientId = config.get("AZURESUBSCRIPTION_CLIENT_ID"); - String tenantId = config.get("AZURESUBSCRIPTION_TENANT_ID"); - String systemAccessToken = config.get("SYSTEM_ACCESSTOKEN"); - - if (!CoreUtils.isNullOrEmpty(serviceConnectionId) - && !CoreUtils.isNullOrEmpty(clientId) - && !CoreUtils.isNullOrEmpty(tenantId) - && !CoreUtils.isNullOrEmpty(systemAccessToken)) { - - chainedTokenCredentialBuilder - .addLast(new AzurePipelinesCredentialBuilder().systemAccessToken(systemAccessToken) - .clientId(clientId) - .tenantId(tenantId) - .serviceConnectionId(serviceConnectionId) - .build()); - } - - return chainedTokenCredentialBuilder.build(); - - default: - // On PLAYBACK mode - return new MockTokenCredential(); - } - } - - private HttpClient buildAsyncAssertingClient(HttpClient httpClient) { - return new AssertingHttpClientBuilder(httpClient).assertAsync().build(); - } - - private HttpClient buildSyncAssertingClient(HttpClient httpClient) { - return new AssertingHttpClientBuilder(httpClient).assertSync().build(); - } - - private HttpClient getTestModeHttpClient() { - HttpClient httpClient; - if (getTestMode() == TestMode.PLAYBACK) { - httpClient = interceptorManager.getPlaybackClient(); - } else { - httpClient = HttpClient.createDefault(); - } - return httpClient; - } - - private LoadTestAdministrationClientBuilder getLoadTestAdministrationClientBuilder(boolean async) { - HttpClient httpClient = getTestModeHttpClient(); - - if (async) { - httpClient = buildAsyncAssertingClient(httpClient); - } else { - httpClient = buildSyncAssertingClient(httpClient); - } - - LoadTestAdministrationClientBuilder loadTestAdministrationClientBuilder - = new LoadTestAdministrationClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", defaultEndpoint)) - .httpClient(httpClient) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - - if (getTestMode() == TestMode.PLAYBACK) { - loadTestAdministrationClientBuilder.credential(new MockTokenCredential()); - } else if (getTestMode() == TestMode.RECORD) { - loadTestAdministrationClientBuilder.addPolicy(interceptorManager.getRecordPolicy()) - .credential(getTokenCredential()); - } else if (getTestMode() == TestMode.LIVE) { - loadTestAdministrationClientBuilder.credential(getTokenCredential()); - } - - return loadTestAdministrationClientBuilder; - } - - private LoadTestRunClientBuilder getLoadTestRunClientBuilder(boolean async) { - HttpClient httpClient = getTestModeHttpClient(); - - if (async) { - httpClient = buildAsyncAssertingClient(httpClient); - } else { - httpClient = buildSyncAssertingClient(httpClient); - } - - LoadTestRunClientBuilder loadTestRunClientBuilder = new LoadTestRunClientBuilder() - .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", defaultEndpoint)) - .httpClient(httpClient) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); - - if (getTestMode() == TestMode.PLAYBACK) { - loadTestRunClientBuilder - .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); - } else if (getTestMode() == TestMode.RECORD) { - loadTestRunClientBuilder.addPolicy(interceptorManager.getRecordPolicy()).credential(getTokenCredential()); - } else if (getTestMode() == TestMode.LIVE) { - loadTestRunClientBuilder.credential(getTokenCredential()); - } - - return loadTestRunClientBuilder; - } -} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/additional-data.csv b/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/additional-data.csv deleted file mode 100644 index 96dbf5b98a39..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/additional-data.csv +++ /dev/null @@ -1,2 +0,0 @@ -a,b,c,d -1,2,3,4 diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx b/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx deleted file mode 100644 index 52feae899c0d..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/src/test/resources/sample-JMX-file.jmx +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - false - true - false - - - - - - - - - - threads_per_engine - ${__BeanShell( System.getenv("threads_per_engine") )} - = - - - ramp_up_time - ${__BeanShell( System.getenv("ramp_up_time") )} - = - - - duration_in_sec - ${__BeanShell( System.getenv("duration_in_sec") )} - = - - - domain - ${__BeanShell( System.getenv("domain") )} - = - - - protocol - ${__BeanShell( System.getenv("protocol") )} - = - - - path - ${__BeanShell( System.getenv("path") )} - = - - - - - - continue - - false - -1 - - ${threads_per_engine} - ${ramp_up_time} - true - ${duration_in_sec} - 5 - true - - - - - - - ${domain} - - ${protocol} - - ${path} - GET - true - false - true - false - - - - - - - - - diff --git a/sdk/loadtesting/azure-developer-loadtesting/swagger/autorest.md b/sdk/loadtesting/azure-developer-loadtesting/swagger/autorest.md deleted file mode 100644 index 3ff6e86a9580..000000000000 --- a/sdk/loadtesting/azure-developer-loadtesting/swagger/autorest.md +++ /dev/null @@ -1,58 +0,0 @@ -# Azure Load Test Service for Java - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Load Test Service. - ---- -## Getting Started -To build the SDKs for Load Test Service, simply [Install Autorest](https://aka.ms/autorest) and in this folder, run: - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` - -### Setup -```ps -npm install -g autorest -``` - -### Generation - -```ps -cd -autorest -``` - -### Configuration - -```yaml -use: '@autorest/java@4.1.42' -output-folder: ../ -java: true -input-file: https://github.com/Azure/azure-rest-api-specs/blob/3e27c70e7c02c07b458bc0e94716c3d82d3fdd19/specification/loadtestservice/data-plane/Microsoft.LoadTestService/stable/2022-11-01/loadtestservice.json -title: LoadTestingClient -namespace: com.azure.developer.loadtesting -artifact-id: azure-developer-loadtesting -enable-sync-stack: true -generate-builder-per-client: true -data-plane: true -security: AADToken -security-scopes: https://cnt-prod.loadtesting.azure.com/.default -partial-update: true -service-versions: -- '2022-11-01' -directive: -- rename-operation: - from: LoadTestRun_ListMetricNamespaces - to: LoadTestRun_GetMetricNamespaces -- rename-operation: - from: LoadTestRun_ListMetricDefinitions - to: LoadTestRun_GetMetricDefinitions -- where-operation: LoadTestRun_ListMetrics - transform: $['parameters'][3]['x-ms-client-name'] = 'metricName' -- where-operation: LoadTestRun_ListMetricDimensionValues - transform: $['parameters'][3]['x-ms-client-name'] = 'metricName' -``` diff --git a/sdk/loadtesting/azure-developer-loadtesting/tsp-location.yaml b/sdk/loadtesting/azure-developer-loadtesting/tsp-location.yaml new file mode 100644 index 000000000000..8a4260fa89fc --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/loadtestservice/LoadTestService +commit: 2ad82511706dc035660b16b4754eb4232a9fc4dc +repo: Azure/azure-rest-api-specs +additionalDirectories: