From 0d937b91f0021c5a846b1e03d96c904af224c52f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 25 Mar 2022 08:18:45 +0000 Subject: [PATCH] CodeGen from PR 18390 in Azure/azure-rest-api-specs Merge fb9611f3fa471827b4455ffe6b68534ea5339287 into 202149c96d7e5cdd07cdcbc138309142b55321ad --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../azure-resourcemanager-testbase/README.md | 102 + .../azure-resourcemanager-testbase/SAMPLE.md | 1483 ++++++++++ .../azure-resourcemanager-testbase/pom.xml | 55 + .../testbase/TestBaseManager.java | 412 +++ .../fluent/AnalysisResultsClient.java | 107 + .../testbase/fluent/AvailableOSClient.java | 77 + .../testbase/fluent/CustomerEventsClient.java | 214 ++ .../testbase/fluent/EmailEventsClient.java | 72 + .../fluent/FavoriteProcessesClient.java | 175 ++ .../testbase/fluent/FlightingRingsClient.java | 74 + .../testbase/fluent/OSUpdatesClient.java | 90 + .../testbase/fluent/OperationsClient.java | 36 + .../testbase/fluent/PackagesClient.java | 371 +++ .../testbase/fluent/SkusClient.java | 36 + .../testbase/fluent/TestBase.java | 151 ++ .../fluent/TestBaseAccountsClient.java | 437 +++ .../testbase/fluent/TestResultsClient.java | 169 ++ .../testbase/fluent/TestSummariesClient.java | 74 + .../testbase/fluent/TestTypesClient.java | 72 + .../testbase/fluent/UsagesClient.java | 43 + .../AnalysisResultSingletonResourceInner.java | 79 + ...ysisResultSingletonResourceProperties.java | 72 + .../fluent/models/AvailableOSProperties.java | 176 ++ .../models/AvailableOSResourceInner.java | 193 ++ .../CheckNameAvailabilityResultInner.java | 94 + .../models/CustomerEventProperties.java | 91 + .../models/CustomerEventResourceInner.java | 103 + .../models/DownloadUrlResponseInner.java | 51 + .../fluent/models/EmailEventProperties.java | 98 + .../models/EmailEventResourceInner.java | 124 + .../models/FavoriteProcessProperties.java | 59 + .../models/FavoriteProcessResourceInner.java | 80 + .../models/FileUploadUrlResponseInner.java | 52 + .../models/FlightingRingProperties.java | 46 + .../models/FlightingRingResourceInner.java | 78 + .../fluent/models/OSUpdateProperties.java | 204 ++ .../fluent/models/OSUpdateResourceInner.java | 218 ++ .../fluent/models/OperationInner.java | 121 + .../fluent/models/PackageProperties.java | 319 +++ .../fluent/models/PackageResourceInner.java | 287 ++ .../PackageUpdateParameterProperties.java | 162 ++ .../models/TestBaseAccountResourceInner.java | 127 + ...estBaseAccountResourcePropertiesInner.java | 88 + .../models/TestBaseAccountSkuInner.java | 159 ++ ...AccountUpdateParameterPropertiesInner.java | 49 + .../TestBaseAccountUpdateParametersInner.java | 90 + .../models/TestBaseAccountUsageDataInner.java | 160 ++ .../fluent/models/TestResultProperties.java | 549 ++++ .../models/TestResultResourceInner.java | 521 ++++ .../fluent/models/TestSummaryProperties.java | 290 ++ .../models/TestSummaryResourceInner.java | 289 ++ .../fluent/models/TestTypeProperties.java | 46 + .../fluent/models/TestTypeResourceInner.java | 78 + .../testbase/fluent/models/package-info.java | 6 + .../testbase/fluent/package-info.java | 6 + .../AnalysisResultSingletonResourceImpl.java | 51 + .../AnalysisResultsClientImpl.java | 577 ++++ .../implementation/AnalysisResultsImpl.java | 106 + .../implementation/AvailableOSClientImpl.java | 543 ++++ .../implementation/AvailableOSImpl.java | 80 + .../AvailableOSResourceImpl.java | 69 + .../CheckNameAvailabilityResultImpl.java | 42 + .../CustomerEventResourceImpl.java | 128 + .../CustomerEventsClientImpl.java | 1159 ++++++++ .../implementation/CustomerEventsImpl.java | 205 ++ .../DownloadUrlResponseImpl.java | 37 + .../EmailEventResourceImpl.java | 57 + .../implementation/EmailEventsClientImpl.java | 525 ++++ .../implementation/EmailEventsImpl.java | 77 + .../FavoriteProcessResourceImpl.java | 131 + .../FavoriteProcessesClientImpl.java | 1059 ++++++++ .../implementation/FavoriteProcessesImpl.java | 261 ++ .../FileUploadUrlResponseImpl.java | 36 + .../FlightingRingResourceImpl.java | 49 + .../FlightingRingsClientImpl.java | 527 ++++ .../implementation/FlightingRingsImpl.java | 78 + .../implementation/OSUpdateResourceImpl.java | 75 + .../implementation/OSUpdatesClientImpl.java | 592 ++++ .../implementation/OSUpdatesImpl.java | 88 + .../implementation/OperationImpl.java | 48 + .../implementation/OperationsClientImpl.java | 270 ++ .../implementation/OperationsImpl.java | 45 + .../implementation/PackageResourceImpl.java | 334 +++ .../implementation/PackagesClientImpl.java | 1907 +++++++++++++ .../testbase/implementation/PackagesImpl.java | 235 ++ .../implementation/SkusClientImpl.java | 293 ++ .../testbase/implementation/SkusImpl.java | 44 + .../TestBaseAccountResourceImpl.java | 255 ++ ...TestBaseAccountResourcePropertiesImpl.java | 49 + .../TestBaseAccountSkuImpl.java | 62 + ...eAccountUpdateParameterPropertiesImpl.java | 40 + .../TestBaseAccountUpdateParametersImpl.java | 51 + .../TestBaseAccountUsageDataImpl.java | 49 + .../TestBaseAccountsClientImpl.java | 2404 +++++++++++++++++ .../implementation/TestBaseAccountsImpl.java | 252 ++ .../implementation/TestBaseBuilder.java | 145 + .../testbase/implementation/TestBaseImpl.java | 489 ++++ .../TestResultResourceImpl.java | 137 + .../implementation/TestResultsClientImpl.java | 1059 ++++++++ .../implementation/TestResultsImpl.java | 161 ++ .../TestSummariesClientImpl.java | 525 ++++ .../implementation/TestSummariesImpl.java | 75 + .../TestSummaryResourceImpl.java | 89 + .../implementation/TestTypeResourceImpl.java | 49 + .../implementation/TestTypesClientImpl.java | 521 ++++ .../implementation/TestTypesImpl.java | 73 + .../implementation/UsagesClientImpl.java | 368 +++ .../testbase/implementation/UsagesImpl.java | 47 + .../testbase/implementation/Utils.java | 204 ++ .../testbase/implementation/package-info.java | 6 + .../testbase/models/Action.java | 43 + .../models/AnalysisResultListResult.java | 70 + .../testbase/models/AnalysisResultName.java | 49 + .../AnalysisResultSingletonResource.java | 53 + .../testbase/models/AnalysisResultType.java | 49 + .../testbase/models/AnalysisResults.java | 98 + .../testbase/models/AnalysisStatus.java | 49 + .../testbase/models/AvailableOS.java | 69 + .../models/AvailableOSListResult.java | 68 + .../testbase/models/AvailableOSResource.java | 88 + .../testbase/models/Category.java | 43 + .../models/CheckNameAvailabilityResult.java | 40 + .../testbase/models/Command.java | 302 +++ .../testbase/models/ContentType.java | 37 + ...sionResultSingletonResourceProperties.java | 65 + ...tionResultSingletonResourceProperties.java | 65 + .../models/CustomerEventListResult.java | 68 + .../models/CustomerEventResource.java | 138 + .../testbase/models/CustomerEvents.java | 143 + .../models/CustomerEventsCreateHeaders.java | 46 + .../models/CustomerEventsCreateResponse.java | 38 + .../models/CustomerEventsDeleteHeaders.java | 72 + .../models/CustomerEventsDeleteResponse.java | 26 + .../DistributionGroupListReceiverValue.java | 47 + .../testbase/models/DownloadUrlResponse.java | 32 + .../testbase/models/EmailEventListResult.java | 68 + .../testbase/models/EmailEventResource.java | 67 + .../testbase/models/EmailEvents.java | 65 + .../testbase/models/ExecutionStatus.java | 52 + .../models/FavoriteProcessListResult.java | 68 + .../models/FavoriteProcessResource.java | 126 + .../testbase/models/FavoriteProcesses.java | 171 ++ .../models/FileUploadUrlResponse.java | 32 + .../models/FlightingRingListResult.java | 68 + .../models/FlightingRingResource.java | 53 + .../testbase/models/FlightingRings.java | 65 + .../models/GetFileUploadUrlParameters.java | 46 + .../testbase/models/Grade.java | 40 + .../testbase/models/IdentifiedFailure.java | 124 + ...sionResultSingletonResourceProperties.java | 65 + ...tionResultSingletonResourceProperties.java | 66 + .../models/NotificationEventReceiver.java | 75 + .../models/NotificationReceiverValue.java | 109 + .../testbase/models/OSUpdateListResult.java | 68 + .../testbase/models/OSUpdateResource.java | 96 + .../testbase/models/OSUpdateTestSummary.java | 307 +++ .../testbase/models/OSUpdates.java | 82 + .../testbase/models/OSUpdatesTestSummary.java | 154 ++ .../testbase/models/Operation.java | 52 + .../testbase/models/OperationDisplay.java | 80 + .../testbase/models/OperationListResult.java | 66 + .../testbase/models/Operations.java | 31 + .../testbase/models/OsUpdateType.java | 34 + ...ackageCheckNameAvailabilityParameters.java | 151 ++ .../testbase/models/PackageListResult.java | 68 + .../testbase/models/PackageResource.java | 460 ++++ .../testbase/models/PackageStatus.java | 55 + .../models/PackageUpdateParameters.java | 186 ++ .../models/PackageValidationResult.java | 66 + .../testbase/models/Packages.java | 196 ++ .../models/PackagesCreateHeaders.java | 46 + .../models/PackagesCreateResponse.java | 37 + .../models/PackagesDeleteHeaders.java | 72 + .../models/PackagesDeleteResponse.java | 26 + .../models/PackagesHardDeleteHeaders.java | 72 + .../models/PackagesHardDeleteResponse.java | 26 + .../models/PackagesUpdateHeaders.java | 72 + .../models/PackagesUpdateResponse.java | 37 + .../testbase/models/ProvisioningState.java | 46 + .../testbase/models/Reason.java | 34 + .../testbase/models/RegressionResult.java | 151 ++ .../models/RegressionTestDetails.java | 72 + .../testbase/models/ReliabilityResult.java | 260 ++ ...lityResultSingletonResourceProperties.java | 65 + .../models/ScriptExecutionResult.java | 151 ++ ...tionResultSingletonResourceProperties.java | 65 + .../resourcemanager/testbase/models/Skus.java | 31 + .../models/SubscriptionReceiverValue.java | 98 + .../testbase/models/TargetOSInfo.java | 89 + .../resourcemanager/testbase/models/Test.java | 128 + .../testbase/models/TestAnalysisResult.java | 102 + ...ysisResultSingletonResourceProperties.java | 63 + .../testbase/models/TestAnalysisStatus.java | 40 + .../models/TestBaseAccountListResult.java | 68 + .../models/TestBaseAccountResource.java | 326 +++ .../TestBaseAccountResourceProperties.java | 38 + .../testbase/models/TestBaseAccountSku.java | 53 + .../models/TestBaseAccountSkuCapability.java | 87 + .../models/TestBaseAccountSkuListResult.java | 68 + ...tBaseAccountUpdateParameterProperties.java | 25 + .../TestBaseAccountUpdateParameters.java | 32 + .../models/TestBaseAccountUsageData.java | 54 + .../models/TestBaseAccountUsageDataList.java | 68 + .../models/TestBaseAccountUsageName.java | 72 + .../testbase/models/TestBaseAccounts.java | 243 ++ .../models/TestBaseAccountsCreateHeaders.java | 46 + .../TestBaseAccountsCreateResponse.java | 38 + .../models/TestBaseAccountsDeleteHeaders.java | 72 + .../TestBaseAccountsDeleteResponse.java | 30 + .../TestBaseAccountsOffboardHeaders.java | 72 + .../TestBaseAccountsOffboardResponse.java | 30 + .../models/TestBaseAccountsUpdateHeaders.java | 72 + .../TestBaseAccountsUpdateResponse.java | 38 + .../models/TestResultAnalysisSummary.java | 98 + .../testbase/models/TestResultListResult.java | 68 + .../testbase/models/TestResultResource.java | 188 ++ .../testbase/models/TestResults.java | 156 ++ .../testbase/models/TestStatus.java | 52 + .../testbase/models/TestSummaries.java | 67 + .../models/TestSummaryListResult.java | 68 + .../testbase/models/TestSummaryResource.java | 116 + .../testbase/models/TestType.java | 34 + .../testbase/models/TestTypeListResult.java | 68 + .../testbase/models/TestTypeResource.java | 53 + .../testbase/models/TestTypes.java | 65 + .../resourcemanager/testbase/models/Tier.java | 31 + .../resourcemanager/testbase/models/Type.java | 34 + .../testbase/models/Usages.java | 38 + .../models/UserObjectReceiverValue.java | 47 + .../testbase/models/UtilizationBound.java | 72 + .../testbase/models/UtilizationEntry.java | 73 + .../testbase/models/UtilizationResult.java | 134 + .../testbase/models/ValidationRunStatus.java | 40 + .../testbase/models/package-info.java | 6 + .../testbase/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../generated/AnalysisResultsGetSamples.java | 91 + .../generated/AnalysisResultsListSamples.java | 92 + .../generated/AvailableOSGetSamples.java | 22 + .../generated/AvailableOSListSamples.java | 23 + .../CustomerEventsCreateSamples.java | 48 + .../CustomerEventsDeleteSamples.java | 22 + .../generated/CustomerEventsGetSamples.java | 24 + ...merEventsListByTestBaseAccountSamples.java | 22 + .../generated/EmailEventsGetSamples.java | 22 + .../generated/EmailEventsListSamples.java | 22 + .../FavoriteProcessesCreateSamples.java | 25 + .../FavoriteProcessesDeleteSamples.java | 25 + .../FavoriteProcessesGetSamples.java | 25 + .../FavoriteProcessesListSamples.java | 22 + .../generated/FlightingRingsGetSamples.java | 24 + .../generated/FlightingRingsListSamples.java | 22 + .../generated/OSUpdatesGetSamples.java | 29 + .../generated/OSUpdatesListSamples.java | 30 + .../generated/OperationsListSamples.java | 22 + .../generated/PackagesCreateSamples.java | 110 + .../generated/PackagesDeleteSamples.java | 22 + .../PackagesGetDownloadUrlSamples.java | 24 + .../generated/PackagesGetSamples.java | 22 + .../generated/PackagesHardDeleteSamples.java | 22 + .../PackagesListByTestBaseAccountSamples.java | 22 + .../generated/PackagesUpdateSamples.java | 113 + .../testbase/generated/SkusListSamples.java | 22 + ...tsCheckPackageNameAvailabilitySamples.java | 33 + .../TestBaseAccountsCreateSamples.java | 29 + .../TestBaseAccountsDeleteSamples.java | 22 + ...BaseAccountsGetByResourceGroupSamples.java | 24 + ...stBaseAccountsGetFileUploadUrlSamples.java | 29 + ...aseAccountsListByResourceGroupSamples.java | 22 + .../TestBaseAccountsListSamples.java | 22 + .../TestBaseAccountsOffboardSamples.java | 22 + .../TestBaseAccountsUpdateSamples.java | 30 + .../TestResultsGetDownloadUrlSamples.java | 29 + .../generated/TestResultsGetSamples.java | 29 + ...TestResultsGetVideoDownloadUrlSamples.java | 29 + .../generated/TestResultsListSamples.java | 31 + .../generated/TestSummariesGetSamples.java | 28 + .../generated/TestSummariesListSamples.java | 22 + .../generated/TestTypesGetSamples.java | 22 + .../generated/TestTypesListSamples.java | 22 + .../testbase/generated/UsageListSamples.java | 22 + sdk/testbase/ci.yml | 39 + sdk/testbase/pom.xml | 53 + 286 files changed, 37946 insertions(+) create mode 100644 sdk/testbase/azure-resourcemanager-testbase/CHANGELOG.md create mode 100644 sdk/testbase/azure-resourcemanager-testbase/README.md create mode 100644 sdk/testbase/azure-resourcemanager-testbase/SAMPLE.md create mode 100644 sdk/testbase/azure-resourcemanager-testbase/pom.xml create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/TestBaseManager.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AnalysisResultsClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AvailableOSClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/CustomerEventsClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/EmailEventsClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FavoriteProcessesClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FlightingRingsClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OSUpdatesClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OperationsClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/PackagesClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/SkusClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBase.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBaseAccountsClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestResultsClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestSummariesClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestTypesClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/UsagesClient.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CheckNameAvailabilityResultInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/DownloadUrlResponseInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FileUploadUrlResponseInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OperationInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageUpdateParameterProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourcePropertiesInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountSkuInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParameterPropertiesInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParametersInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUsageDataInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeResourceInner.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/package-info.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/package-info.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultSingletonResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/DownloadUrlResponseImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FileUploadUrlResponseImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdateResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackageResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourcePropertiesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountSkuImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParameterPropertiesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParametersImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUsageDataImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseBuilder.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummaryResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypeResourceImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesClientImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesImpl.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/Utils.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/package-info.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Action.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultName.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultSingletonResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultType.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResults.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisStatus.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOS.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Category.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CheckNameAvailabilityResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Command.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ContentType.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuRegressionResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuUtilizationResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEvents.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DistributionGroupListReceiverValue.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DownloadUrlResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEvents.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ExecutionStatus.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcesses.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FileUploadUrlResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRings.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/GetFileUploadUrlParameters.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Grade.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/IdentifiedFailure.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryRegressionResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryUtilizationResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationEventReceiver.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationReceiverValue.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateTestSummary.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdates.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdatesTestSummary.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operation.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationDisplay.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operations.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OsUpdateType.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageCheckNameAvailabilityParameters.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageStatus.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageUpdateParameters.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageValidationResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Packages.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ProvisioningState.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Reason.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionTestDetails.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Skus.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/SubscriptionReceiverValue.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TargetOSInfo.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Test.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResultSingletonResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisStatus.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResourceProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSku.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuCapability.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameterProperties.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameters.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageData.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageDataList.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageName.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccounts.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateHeaders.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateResponse.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultAnalysisSummary.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResults.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestStatus.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaries.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestType.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeListResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeResource.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypes.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Tier.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Type.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Usages.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UserObjectReceiverValue.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationBound.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationEntry.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationResult.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ValidationRunStatus.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/package-info.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/package-info.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/main/java/module-info.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsCreateSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsDeleteSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsListByTestBaseAccountSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesCreateSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesDeleteSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OperationsListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesCreateSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesDeleteSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetDownloadUrlSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesHardDeleteSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesListByTestBaseAccountSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesUpdateSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/SkusListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCheckPackageNameAvailabilitySamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCreateSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsDeleteSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetByResourceGroupSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetFileUploadUrlSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListByResourceGroupSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsOffboardSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsUpdateSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetDownloadUrlSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetVideoDownloadUrlSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesGetSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesListSamples.java create mode 100644 sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/UsageListSamples.java create mode 100644 sdk/testbase/ci.yml create mode 100644 sdk/testbase/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 29cf79b0db6f..790c1ad7c83e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -340,6 +340,7 @@ com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.2;1. com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dnsresolver;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.0.0-beta.2;1.0.0-beta.3 +com.azure.resourcemanager:azure-resourcemanager-testbase;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index f3ba561857a5..7ed295f5822b 100644 --- a/pom.xml +++ b/pom.xml @@ -971,6 +971,7 @@ sdk/synapse sdk/tables sdk/template + sdk/testbase sdk/textanalytics sdk/timeseriesinsights sdk/tools diff --git a/sdk/testbase/azure-resourcemanager-testbase/CHANGELOG.md b/sdk/testbase/azure-resourcemanager-testbase/CHANGELOG.md new file mode 100644 index 000000000000..440c88d39d76 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-03-25) + +- Azure Resource Manager TestBase client library for Java. This package contains Microsoft Azure SDK for TestBase Management SDK. Test Base. Package tag package-2020-12-16-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/testbase/azure-resourcemanager-testbase/README.md b/sdk/testbase/azure-resourcemanager-testbase/README.md new file mode 100644 index 000000000000..9ef2adbd87c3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager TestBase client library for Java + +Azure Resource Manager TestBase client library for Java. + +This package contains Microsoft Azure SDK for TestBase Management SDK. Test Base. Package tag package-2020-12-16-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-testbase;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-testbase + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +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 +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +TestBaseManager manager = TestBaseManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/testbase/azure-resourcemanager-testbase/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/testbase/azure-resourcemanager-testbase/SAMPLE.md b/sdk/testbase/azure-resourcemanager-testbase/SAMPLE.md new file mode 100644 index 000000000000..48ed4be9f2f3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/SAMPLE.md @@ -0,0 +1,1483 @@ +# Code snippets and samples + + +## AnalysisResults + +- [Get](#analysisresults_get) +- [List](#analysisresults_list) + +## AvailableOS + +- [Get](#availableos_get) +- [List](#availableos_list) + +## CustomerEvents + +- [Create](#customerevents_create) +- [Delete](#customerevents_delete) +- [Get](#customerevents_get) +- [ListByTestBaseAccount](#customerevents_listbytestbaseaccount) + +## EmailEvents + +- [Get](#emailevents_get) +- [List](#emailevents_list) + +## FavoriteProcesses + +- [Create](#favoriteprocesses_create) +- [Delete](#favoriteprocesses_delete) +- [Get](#favoriteprocesses_get) +- [List](#favoriteprocesses_list) + +## FlightingRings + +- [Get](#flightingrings_get) +- [List](#flightingrings_list) + +## OSUpdates + +- [Get](#osupdates_get) +- [List](#osupdates_list) + +## Operations + +- [List](#operations_list) + +## Packages + +- [Create](#packages_create) +- [Delete](#packages_delete) +- [Get](#packages_get) +- [GetDownloadUrl](#packages_getdownloadurl) +- [HardDelete](#packages_harddelete) +- [ListByTestBaseAccount](#packages_listbytestbaseaccount) +- [Update](#packages_update) + +## Skus + +- [List](#skus_list) + +## TestBaseAccounts + +- [CheckPackageNameAvailability](#testbaseaccounts_checkpackagenameavailability) +- [Create](#testbaseaccounts_create) +- [Delete](#testbaseaccounts_delete) +- [GetByResourceGroup](#testbaseaccounts_getbyresourcegroup) +- [GetFileUploadUrl](#testbaseaccounts_getfileuploadurl) +- [List](#testbaseaccounts_list) +- [ListByResourceGroup](#testbaseaccounts_listbyresourcegroup) +- [Offboard](#testbaseaccounts_offboard) +- [Update](#testbaseaccounts_update) + +## TestResults + +- [Get](#testresults_get) +- [GetDownloadUrl](#testresults_getdownloadurl) +- [GetVideoDownloadUrl](#testresults_getvideodownloadurl) +- [List](#testresults_list) + +## TestSummaries + +- [Get](#testsummaries_get) +- [List](#testsummaries_list) + +## TestTypes + +- [Get](#testtypes_get) +- [List](#testtypes_list) + +## Usage + +- [List](#usage_list) +### AnalysisResults_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.AnalysisResultName; + +/** Samples for AnalysisResults Get. */ +public final class AnalysisResultsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryUtilizationAnalysisResultGet.json + */ + /** + * Sample code: MemoryUtilizationAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryUtilizationAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.MEMORY_UTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPURegressionAnalysisResultGet.json + */ + /** + * Sample code: CPURegressionAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPURegressionAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.CPU_REGRESSION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPUUtilizationAnalysisResultGet.json + */ + /** + * Sample code: CPUUtilizationAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPUUtilizationAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.CPU_UTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryRegressionAnalysisResultGet.json + */ + /** + * Sample code: MemoryRegressionAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryRegressionAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.MEMORY_REGRESSION, + Context.NONE); + } +} +``` + +### AnalysisResults_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.AnalysisResultType; + +/** Samples for AnalysisResults List. */ +public final class AnalysisResultsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryRegressionAnalysisResultsList.json + */ + /** + * Sample code: MemoryRegressionAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryRegressionAnalysisResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.MEMORY_REGRESSION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPUUtilizationAnalysisResultsList.json + */ + /** + * Sample code: CPUUtilizationAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPUUtilizationAnalysisResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.CPUUTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryUtilizationAnalysisResultsList.json + */ + /** + * Sample code: MemoryUtilizationAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryUtilizationAnalysisResultsList( + com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.MEMORY_UTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPURegressionAnalysisResultsList.json + */ + /** + * Sample code: CPURegressionAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPURegressionAnalysisResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.CPUREGRESSION, + Context.NONE); + } +} +``` + +### AvailableOS_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AvailableOS Get. */ +public final class AvailableOSGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/AvailableOSGet.json + */ + /** + * Sample code: AvailableOSGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void availableOSGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.availableOS().getWithResponse("contoso-rg", "contoso-testBaseAccount", "Windows-10-2004", Context.NONE); + } +} +``` + +### AvailableOS_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** Samples for AvailableOS List. */ +public final class AvailableOSListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/AvailableOSsList.json + */ + /** + * Sample code: AvailableOSsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void availableOSsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.availableOS().list("contoso-rg", "contoso-testBaseAccount", OsUpdateType.SECURITY_UPDATE, Context.NONE); + } +} +``` + +### CustomerEvents_Create + +```java +import com.azure.resourcemanager.testbase.models.DistributionGroupListReceiverValue; +import com.azure.resourcemanager.testbase.models.NotificationEventReceiver; +import com.azure.resourcemanager.testbase.models.NotificationReceiverValue; +import com.azure.resourcemanager.testbase.models.UserObjectReceiverValue; +import java.util.Arrays; + +/** Samples for CustomerEvents Create. */ +public final class CustomerEventsCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventCreate.json + */ + /** + * Sample code: CustomerEventCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .customerEvents() + .define("WeeklySummary") + .withExistingTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1") + .withEventName("WeeklySummary") + .withReceivers( + Arrays + .asList( + new NotificationEventReceiver() + .withReceiverType("UserObjects") + .withReceiverValue( + new NotificationReceiverValue() + .withUserObjectReceiverValue( + new UserObjectReceiverValue() + .withUserObjectIds(Arrays.asList("245245245245325", "365365365363565")))), + new NotificationEventReceiver() + .withReceiverType("DistributionGroup") + .withReceiverValue( + new NotificationReceiverValue() + .withDistributionGroupListReceiverValue( + new DistributionGroupListReceiverValue() + .withDistributionGroups(Arrays.asList("test@microsoft.com")))))) + .create(); + } +} +``` + +### CustomerEvents_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for CustomerEvents Delete. */ +public final class CustomerEventsDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventDelete.json + */ + /** + * Sample code: CustomerEventDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.customerEvents().delete("contoso-rg1", "contoso-testBaseAccount1", "WeeklySummary", Context.NONE); + } +} +``` + +### CustomerEvents_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CustomerEvents Get. */ +public final class CustomerEventsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventGet.json + */ + /** + * Sample code: CustomerEventGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .customerEvents() + .getWithResponse("contoso-rg1", "contoso-testBaseAccount1", "WeeklySummary", Context.NONE); + } +} +``` + +### CustomerEvents_ListByTestBaseAccount + +```java +import com.azure.core.util.Context; + +/** Samples for CustomerEvents ListByTestBaseAccount. */ +public final class CustomerEventsListByTestBaseAccountSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventsList.json + */ + /** + * Sample code: CustomerEventsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.customerEvents().listByTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} +``` + +### EmailEvents_Get + +```java +import com.azure.core.util.Context; + +/** Samples for EmailEvents Get. */ +public final class EmailEventsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/EmailEventGet.json + */ + /** + * Sample code: EmailEventGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void emailEventGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.emailEvents().getWithResponse("contoso-rg", "contoso-testBaseAccount", "weekly-summary", Context.NONE); + } +} +``` + +### EmailEvents_List + +```java +import com.azure.core.util.Context; + +/** Samples for EmailEvents List. */ +public final class EmailEventsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/EmailEventsList.json + */ + /** + * Sample code: EmailEventsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void emailEventsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.emailEvents().list("contoso-rg", "contoso-testBaseAccount", Context.NONE); + } +} +``` + +### FavoriteProcesses_Create + +```java +/** Samples for FavoriteProcesses Create. */ +public final class FavoriteProcessesCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessCreate.json + */ + /** + * Sample code: FavoriteProcessCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .favoriteProcesses() + .define("testAppProcess") + .withExistingPackage("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2") + .withActualProcessName("testApp&.exe") + .create(); + } +} +``` + +### FavoriteProcesses_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for FavoriteProcesses Delete. */ +public final class FavoriteProcessesDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessDelete.json + */ + /** + * Sample code: FavoriteProcessDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .favoriteProcesses() + .deleteWithResponse( + "contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", "testAppProcess", Context.NONE); + } +} +``` + +### FavoriteProcesses_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FavoriteProcesses Get. */ +public final class FavoriteProcessesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessGet.json + */ + /** + * Sample code: FavoriteProcessGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .favoriteProcesses() + .getWithResponse( + "contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", "testAppProcess", Context.NONE); + } +} +``` + +### FavoriteProcesses_List + +```java +import com.azure.core.util.Context; + +/** Samples for FavoriteProcesses List. */ +public final class FavoriteProcessesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessesList.json + */ + /** + * Sample code: FavoriteProcessesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.favoriteProcesses().list("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} +``` + +### FlightingRings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for FlightingRings Get. */ +public final class FlightingRingsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FlightingRingGet.json + */ + /** + * Sample code: FlightingRingGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void flightingRingGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .flightingRings() + .getWithResponse("contoso-rg", "contoso-testBaseAccount", "Insider-Beta-Channel", Context.NONE); + } +} +``` + +### FlightingRings_List + +```java +import com.azure.core.util.Context; + +/** Samples for FlightingRings List. */ +public final class FlightingRingsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FlightingRingsList.json + */ + /** + * Sample code: FlightingRingsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void flightingRingsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.flightingRings().list("contoso-rg", "contoso-testBaseAccount", Context.NONE); + } +} +``` + +### OSUpdates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OSUpdates Get. */ +public final class OSUpdatesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/OSUpdateGet.json + */ + /** + * Sample code: OSUpdateGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void oSUpdateGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .oSUpdates() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-2004-2020-12-B-505", + Context.NONE); + } +} +``` + +### OSUpdates_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** Samples for OSUpdates List. */ +public final class OSUpdatesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/OSUpdatesList.json + */ + /** + * Sample code: OSUpdatesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void oSUpdatesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .oSUpdates() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + OsUpdateType.SECURITY_UPDATE, + Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void operationsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### Packages_Create + +```java +import com.azure.resourcemanager.testbase.models.Action; +import com.azure.resourcemanager.testbase.models.Command; +import com.azure.resourcemanager.testbase.models.ContentType; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.azure.resourcemanager.testbase.models.TestType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Packages Create. */ +public final class PackagesCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageCreate.json + */ + /** + * Sample code: PackageCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .packages() + .define("contoso-package2") + .withRegion("westus") + .withExistingTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1") + .withTags(mapOf()) + .withApplicationName("contoso-package2") + .withVersion("1.0.0") + .withTargetOSList( + Arrays + .asList( + new TargetOSInfo() + .withOsUpdateType("Security updates") + .withTargetOSs(Arrays.asList("Windows 10 2004", "Windows 10 1903")))) + .withFlightingRing("Insider Beta Channel") + .withBlobPath("storageAccountPath/package.zip") + .withTests( + Arrays + .asList( + new Test() + .withTestType(TestType.OUT_OF_BOX_TEST) + .withIsActive(true) + .withCommands( + Arrays + .asList( + new Command() + .withName("Install") + .withAction(Action.INSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/install/job.ps1") + .withRunElevated(true) + .withRestartAfter(true) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false), + new Command() + .withName("Launch") + .withAction(Action.LAUNCH) + .withContentType(ContentType.PATH) + .withContent("app/scripts/launch/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(true), + new Command() + .withName("Close") + .withAction(Action.CLOSE) + .withContentType(ContentType.PATH) + .withContent("app/scripts/close/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(false), + new Command() + .withName("Uninstall") + .withAction(Action.UNINSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/uninstall/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Packages_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Packages Delete. */ +public final class PackagesDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageDelete.json + */ + /** + * Sample code: PackageDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().delete("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} +``` + +### Packages_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Packages Get. */ +public final class PackagesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageGet.json + */ + /** + * Sample code: PackageGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().getWithResponse("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} +``` + +### Packages_GetDownloadUrl + +```java +import com.azure.core.util.Context; + +/** Samples for Packages GetDownloadUrl. */ +public final class PackagesGetDownloadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageGetDownloadURL.json + */ + /** + * Sample code: PackageGetDownloadURL. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageGetDownloadURL(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .packages() + .getDownloadUrlWithResponse("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} +``` + +### Packages_HardDelete + +```java +import com.azure.core.util.Context; + +/** Samples for Packages HardDelete. */ +public final class PackagesHardDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageHardDelete.json + */ + /** + * Sample code: PackageHardDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageHardDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().hardDelete("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} +``` + +### Packages_ListByTestBaseAccount + +```java +import com.azure.core.util.Context; + +/** Samples for Packages ListByTestBaseAccount. */ +public final class PackagesListByTestBaseAccountSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackagesList.json + */ + /** + * Sample code: PackagesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packagesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().listByTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} +``` + +### Packages_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.Action; +import com.azure.resourcemanager.testbase.models.Command; +import com.azure.resourcemanager.testbase.models.ContentType; +import com.azure.resourcemanager.testbase.models.PackageResource; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.azure.resourcemanager.testbase.models.TestType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Packages Update. */ +public final class PackagesUpdateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageUpdate.json + */ + /** + * Sample code: PackageUpdate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageUpdate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + PackageResource resource = + manager + .packages() + .getWithResponse("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withTargetOSList( + Arrays + .asList( + new TargetOSInfo() + .withOsUpdateType("Security updates") + .withTargetOSs(Arrays.asList("Windows 10 2004", "Windows 10 1903")))) + .withFlightingRing("Insider Beta Channel") + .withIsEnabled(false) + .withBlobPath("storageAccountPath/package.zip") + .withTests( + Arrays + .asList( + new Test() + .withTestType(TestType.OUT_OF_BOX_TEST) + .withIsActive(true) + .withCommands( + Arrays + .asList( + new Command() + .withName("Install") + .withAction(Action.INSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/install/job.ps1") + .withRunElevated(true) + .withRestartAfter(true) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false), + new Command() + .withName("Launch") + .withAction(Action.LAUNCH) + .withContentType(ContentType.PATH) + .withContent("app/scripts/launch/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(true), + new Command() + .withName("Close") + .withAction(Action.CLOSE) + .withContentType(ContentType.PATH) + .withContent("app/scripts/close/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(false), + new Command() + .withName("Uninstall") + .withAction(Action.UNINSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/uninstall/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false))))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Skus_List + +```java +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountSKUsList.json + */ + /** + * Sample code: TestBaseAccountSKUsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountSKUsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.skus().list(Context.NONE); + } +} +``` + +### TestBaseAccounts_CheckPackageNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.PackageCheckNameAvailabilityParameters; + +/** Samples for TestBaseAccounts CheckPackageNameAvailability. */ +public final class TestBaseAccountsCheckPackageNameAvailabilitySamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CheckPackageNameAvailability.json + */ + /** + * Sample code: CheckPackageNameAvailability. + * + * @param manager Entry point to TestBaseManager. + */ + public static void checkPackageNameAvailability(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .checkPackageNameAvailabilityWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + new PackageCheckNameAvailabilityParameters() + .withName("testApp") + .withApplicationName("testApp") + .withVersion("1.0.0") + .withType("Microsoft.TestBase/testBaseAccounts/packages"), + Context.NONE); + } +} +``` + +### TestBaseAccounts_Create + +```java +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.Tier; + +/** Samples for TestBaseAccounts Create. */ +public final class TestBaseAccountsCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountCreate.json + */ + /** + * Sample code: TestBaseAccountCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .define("contoso-testBaseAccount1") + .withRegion("westus") + .withExistingResourceGroup("contoso-rg1") + .withSku(new TestBaseAccountSkuInner().withName("S0").withTier(Tier.STANDARD)) + .create(); + } +} +``` + +### TestBaseAccounts_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts Delete. */ +public final class TestBaseAccountsDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountDelete.json + */ + /** + * Sample code: TestBaseAccountDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().delete("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} +``` + +### TestBaseAccounts_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts GetByResourceGroup. */ +public final class TestBaseAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountGet.json + */ + /** + * Sample code: TestBaseAccountGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .getByResourceGroupWithResponse("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} +``` + +### TestBaseAccounts_GetFileUploadUrl + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.GetFileUploadUrlParameters; + +/** Samples for TestBaseAccounts GetFileUploadUrl. */ +public final class TestBaseAccountsGetFileUploadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountGetFileUploadUrl.json + */ + /** + * Sample code: TestBaseAccountGetFileUploadUrl. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountGetFileUploadUrl(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .getFileUploadUrlWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + new GetFileUploadUrlParameters().withBlobName("package.zip"), + Context.NONE); + } +} +``` + +### TestBaseAccounts_List + +```java +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts List. */ +public final class TestBaseAccountsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountsListBySubscription.json + */ + /** + * Sample code: TestBaseAccountsListBySubscription. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountsListBySubscription(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().list(null, Context.NONE); + } +} +``` + +### TestBaseAccounts_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts ListByResourceGroup. */ +public final class TestBaseAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountsList.json + */ + /** + * Sample code: TestBaseAccountsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().listByResourceGroup("contoso-rg1", null, Context.NONE); + } +} +``` + +### TestBaseAccounts_Offboard + +```java +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts Offboard. */ +public final class TestBaseAccountsOffboardSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountOffboard.json + */ + /** + * Sample code: TestBaseAccountOffboard. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountOffboard(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().offboard("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} +``` + +### TestBaseAccounts_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountResource; +import com.azure.resourcemanager.testbase.models.Tier; + +/** Samples for TestBaseAccounts Update. */ +public final class TestBaseAccountsUpdateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountUpdate.json + */ + /** + * Sample code: TestBaseAccountUpdate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountUpdate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + TestBaseAccountResource resource = + manager + .testBaseAccounts() + .getByResourceGroupWithResponse("contoso-rg1", "contoso-testBaseAccount1", Context.NONE) + .getValue(); + resource.update().withSku(new TestBaseAccountSkuInner().withName("S0").withTier(Tier.STANDARD)).apply(); + } +} +``` + +### TestResults_Get + +```java +import com.azure.core.util.Context; + +/** Samples for TestResults Get. */ +public final class TestResultsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultGet.json + */ + /** + * Sample code: TestResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", + Context.NONE); + } +} +``` + +### TestResults_GetDownloadUrl + +```java +import com.azure.core.util.Context; + +/** Samples for TestResults GetDownloadUrl. */ +public final class TestResultsGetDownloadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultGetDownloadURL.json + */ + /** + * Sample code: TestResultGetDownloadURL. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultGetDownloadURL(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .getDownloadUrlWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", + Context.NONE); + } +} +``` + +### TestResults_GetVideoDownloadUrl + +```java +import com.azure.core.util.Context; + +/** Samples for TestResults GetVideoDownloadUrl. */ +public final class TestResultsGetVideoDownloadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultGetVideoDownloadURL.json + */ + /** + * Sample code: TestResultGetVideoDownloadURL. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultGetVideoDownloadURL(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .getVideoDownloadUrlWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", + Context.NONE); + } +} +``` + +### TestResults_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** Samples for TestResults List. */ +public final class TestResultsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultsList.json + */ + /** + * Sample code: TestResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + OsUpdateType.SECURITY_UPDATE, + "osName eq 'Windows 10 2004' and releaseName eq '2020.11B'", + Context.NONE); + } +} +``` + +### TestSummaries_Get + +```java +import com.azure.core.util.Context; + +/** Samples for TestSummaries Get. */ +public final class TestSummariesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestSummaryGet.json + */ + /** + * Sample code: TestSummaryGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testSummaryGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testSummaries() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2-096bffb5-5d3d-4305-a66a-953372ed6e88", + Context.NONE); + } +} +``` + +### TestSummaries_List + +```java +import com.azure.core.util.Context; + +/** Samples for TestSummaries List. */ +public final class TestSummariesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestSummariesList.json + */ + /** + * Sample code: TestSummariesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testSummariesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testSummaries().list("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} +``` + +### TestTypes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for TestTypes Get. */ +public final class TestTypesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestTypeGet.json + */ + /** + * Sample code: TestTypeGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testTypeGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testTypes().getWithResponse("contoso-rg", "contoso-testBaseAccount", "Functional-Test", Context.NONE); + } +} +``` + +### TestTypes_List + +```java +import com.azure.core.util.Context; + +/** Samples for TestTypes List. */ +public final class TestTypesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestTypesList.json + */ + /** + * Sample code: TestTypesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testTypesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testTypes().list("contoso-rg", "contoso-testBaseAccount", Context.NONE); + } +} +``` + +### Usage_List + +```java +import com.azure.core.util.Context; + +/** Samples for Usage List. */ +public final class UsageListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountUsagesList.json + */ + /** + * Sample code: TestBaseAccountUsagesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountUsagesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.usages().list("contoso-rg1", "contoso-testBaseAccount1", null, Context.NONE); + } +} +``` + diff --git a/sdk/testbase/azure-resourcemanager-testbase/pom.xml b/sdk/testbase/azure-resourcemanager-testbase/pom.xml new file mode 100644 index 000000000000..11dca7ed0f4b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-testbase + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for TestBase Management + This package contains Microsoft Azure SDK for TestBase Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Test Base. Package tag package-2020-12-16-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.26.0 + + + com.azure + azure-core-management + 1.5.3 + + + diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/TestBaseManager.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/TestBaseManager.java new file mode 100644 index 000000000000..c2a288a53acb --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/TestBaseManager.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.TestBase; +import com.azure.resourcemanager.testbase.implementation.AnalysisResultsImpl; +import com.azure.resourcemanager.testbase.implementation.AvailableOSImpl; +import com.azure.resourcemanager.testbase.implementation.CustomerEventsImpl; +import com.azure.resourcemanager.testbase.implementation.EmailEventsImpl; +import com.azure.resourcemanager.testbase.implementation.FavoriteProcessesImpl; +import com.azure.resourcemanager.testbase.implementation.FlightingRingsImpl; +import com.azure.resourcemanager.testbase.implementation.OSUpdatesImpl; +import com.azure.resourcemanager.testbase.implementation.OperationsImpl; +import com.azure.resourcemanager.testbase.implementation.PackagesImpl; +import com.azure.resourcemanager.testbase.implementation.SkusImpl; +import com.azure.resourcemanager.testbase.implementation.TestBaseAccountsImpl; +import com.azure.resourcemanager.testbase.implementation.TestBaseBuilder; +import com.azure.resourcemanager.testbase.implementation.TestResultsImpl; +import com.azure.resourcemanager.testbase.implementation.TestSummariesImpl; +import com.azure.resourcemanager.testbase.implementation.TestTypesImpl; +import com.azure.resourcemanager.testbase.implementation.UsagesImpl; +import com.azure.resourcemanager.testbase.models.AnalysisResults; +import com.azure.resourcemanager.testbase.models.AvailableOS; +import com.azure.resourcemanager.testbase.models.CustomerEvents; +import com.azure.resourcemanager.testbase.models.EmailEvents; +import com.azure.resourcemanager.testbase.models.FavoriteProcesses; +import com.azure.resourcemanager.testbase.models.FlightingRings; +import com.azure.resourcemanager.testbase.models.OSUpdates; +import com.azure.resourcemanager.testbase.models.Operations; +import com.azure.resourcemanager.testbase.models.Packages; +import com.azure.resourcemanager.testbase.models.Skus; +import com.azure.resourcemanager.testbase.models.TestBaseAccounts; +import com.azure.resourcemanager.testbase.models.TestResults; +import com.azure.resourcemanager.testbase.models.TestSummaries; +import com.azure.resourcemanager.testbase.models.TestTypes; +import com.azure.resourcemanager.testbase.models.Usages; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to TestBaseManager. Test Base. */ +public final class TestBaseManager { + private Skus skus; + + private TestBaseAccounts testBaseAccounts; + + private Usages usages; + + private AvailableOS availableOS; + + private FlightingRings flightingRings; + + private TestTypes testTypes; + + private Packages packages; + + private TestSummaries testSummaries; + + private TestResults testResults; + + private OSUpdates oSUpdates; + + private FavoriteProcesses favoriteProcesses; + + private AnalysisResults analysisResults; + + private EmailEvents emailEvents; + + private CustomerEvents customerEvents; + + private Operations operations; + + private final TestBase clientObject; + + private TestBaseManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new TestBaseBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of TestBase service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the TestBase service API instance. + */ + public static TestBaseManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create TestBaseManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new TestBaseManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of TestBase service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the TestBase service API instance. + */ + public TestBaseManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.testbase") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new TestBaseManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** @return Resource collection API of TestBaseAccounts. */ + public TestBaseAccounts testBaseAccounts() { + if (this.testBaseAccounts == null) { + this.testBaseAccounts = new TestBaseAccountsImpl(clientObject.getTestBaseAccounts(), this); + } + return testBaseAccounts; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** @return Resource collection API of AvailableOS. */ + public AvailableOS availableOS() { + if (this.availableOS == null) { + this.availableOS = new AvailableOSImpl(clientObject.getAvailableOS(), this); + } + return availableOS; + } + + /** @return Resource collection API of FlightingRings. */ + public FlightingRings flightingRings() { + if (this.flightingRings == null) { + this.flightingRings = new FlightingRingsImpl(clientObject.getFlightingRings(), this); + } + return flightingRings; + } + + /** @return Resource collection API of TestTypes. */ + public TestTypes testTypes() { + if (this.testTypes == null) { + this.testTypes = new TestTypesImpl(clientObject.getTestTypes(), this); + } + return testTypes; + } + + /** @return Resource collection API of Packages. */ + public Packages packages() { + if (this.packages == null) { + this.packages = new PackagesImpl(clientObject.getPackages(), this); + } + return packages; + } + + /** @return Resource collection API of TestSummaries. */ + public TestSummaries testSummaries() { + if (this.testSummaries == null) { + this.testSummaries = new TestSummariesImpl(clientObject.getTestSummaries(), this); + } + return testSummaries; + } + + /** @return Resource collection API of TestResults. */ + public TestResults testResults() { + if (this.testResults == null) { + this.testResults = new TestResultsImpl(clientObject.getTestResults(), this); + } + return testResults; + } + + /** @return Resource collection API of OSUpdates. */ + public OSUpdates oSUpdates() { + if (this.oSUpdates == null) { + this.oSUpdates = new OSUpdatesImpl(clientObject.getOSUpdates(), this); + } + return oSUpdates; + } + + /** @return Resource collection API of FavoriteProcesses. */ + public FavoriteProcesses favoriteProcesses() { + if (this.favoriteProcesses == null) { + this.favoriteProcesses = new FavoriteProcessesImpl(clientObject.getFavoriteProcesses(), this); + } + return favoriteProcesses; + } + + /** @return Resource collection API of AnalysisResults. */ + public AnalysisResults analysisResults() { + if (this.analysisResults == null) { + this.analysisResults = new AnalysisResultsImpl(clientObject.getAnalysisResults(), this); + } + return analysisResults; + } + + /** @return Resource collection API of EmailEvents. */ + public EmailEvents emailEvents() { + if (this.emailEvents == null) { + this.emailEvents = new EmailEventsImpl(clientObject.getEmailEvents(), this); + } + return emailEvents; + } + + /** @return Resource collection API of CustomerEvents. */ + public CustomerEvents customerEvents() { + if (this.customerEvents == null) { + this.customerEvents = new CustomerEventsImpl(clientObject.getCustomerEvents(), this); + } + return customerEvents; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * @return Wrapped service client TestBase providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public TestBase serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AnalysisResultsClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AnalysisResultsClient.java new file mode 100644 index 000000000000..27538e05c359 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AnalysisResultsClient.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceInner; +import com.azure.resourcemanager.testbase.models.AnalysisResultName; +import com.azure.resourcemanager.testbase.models.AnalysisResultType; + +/** An instance of this class provides access to all the operations defined in AnalysisResultsClient. */ +public interface AnalysisResultsClient { + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType); + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType, + Context context); + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AnalysisResultSingletonResourceInner get( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName); + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AvailableOSClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AvailableOSClient.java new file mode 100644 index 000000000000..2da75074f9d6 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/AvailableOSClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.AvailableOSResourceInner; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** An instance of this class provides access to all the operations defined in AvailableOSClient. */ +public interface AvailableOSClient { + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType); + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType, Context context); + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AvailableOSResourceInner get(String resourceGroupName, String testBaseAccountName, String availableOSResourceName); + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/CustomerEventsClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/CustomerEventsClient.java new file mode 100644 index 000000000000..6566485a16e2 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/CustomerEventsClient.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner; + +/** An instance of this class provides access to all the operations defined in CustomerEventsClient. */ +public interface CustomerEventsClient { + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName); + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomerEventResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters); + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomerEventResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters, + Context context); + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomerEventResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters); + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomerEventResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters, + Context context); + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String customerEventName); + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context); + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String testBaseAccountName, String customerEventName); + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String testBaseAccountName, String customerEventName, Context context); + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomerEventResourceInner get(String resourceGroupName, String testBaseAccountName, String customerEventName); + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/EmailEventsClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/EmailEventsClient.java new file mode 100644 index 000000000000..62e304d8198f --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/EmailEventsClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.EmailEventResourceInner; + +/** An instance of this class provides access to all the operations defined in EmailEventsClient. */ +public interface EmailEventsClient { + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EmailEventResourceInner get(String resourceGroupName, String testBaseAccountName, String emailEventResourceName); + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FavoriteProcessesClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FavoriteProcessesClient.java new file mode 100644 index 000000000000..cc1d9c2be043 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FavoriteProcessesClient.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.FavoriteProcessResourceInner; + +/** An instance of this class provides access to all the operations defined in FavoriteProcessesClient. */ +public interface FavoriteProcessesClient { + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Create or replace a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FavoriteProcessResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + FavoriteProcessResourceInner parameters); + + /** + * Create or replace a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process identifier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + FavoriteProcessResourceInner parameters, + Context context); + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName); + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context); + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FavoriteProcessResourceInner get( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName); + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FlightingRingsClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FlightingRingsClient.java new file mode 100644 index 000000000000..98133f053883 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/FlightingRingsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.FlightingRingResourceInner; + +/** An instance of this class provides access to all the operations defined in FlightingRingsClient. */ +public interface FlightingRingsClient { + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlightingRingResourceInner get( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName); + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OSUpdatesClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OSUpdatesClient.java new file mode 100644 index 000000000000..e2ad05769861 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OSUpdatesClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.OSUpdateResourceInner; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** An instance of this class provides access to all the operations defined in OSUpdatesClient. */ +public interface OSUpdatesClient { + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType); + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + Context context); + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OSUpdateResourceInner get( + String resourceGroupName, String testBaseAccountName, String packageName, String osUpdateResourceName); + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String osUpdateResourceName, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OperationsClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OperationsClient.java new file mode 100644 index 000000000000..6c27e8fad25c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/PackagesClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/PackagesClient.java new file mode 100644 index 000000000000..f8176eaa5c0d --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/PackagesClient.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; +import com.azure.resourcemanager.testbase.models.PackageUpdateParameters; + +/** An instance of this class provides access to all the operations defined in PackagesClient. */ +public interface PackagesClient { + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTestBaseAccount(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResourceInner> beginCreate( + String resourceGroupName, String testBaseAccountName, String packageName, PackageResourceInner parameters); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageResourceInner parameters, + Context context); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResourceInner create( + String resourceGroupName, String testBaseAccountName, String packageName, PackageResourceInner parameters); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageResourceInner parameters, + Context context); + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResourceInner> beginUpdate( + String resourceGroupName, String testBaseAccountName, String packageName, PackageUpdateParameters parameters); + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PackageResourceInner> beginUpdate( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageUpdateParameters parameters, + Context context); + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResourceInner update( + String resourceGroupName, String testBaseAccountName, String packageName, PackageUpdateParameters parameters); + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResourceInner update( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageUpdateParameters parameters, + Context context); + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageResourceInner get(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginHardDelete( + String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginHardDelete( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlResponseInner getDownloadUrl(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDownloadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/SkusClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/SkusClient.java new file mode 100644 index 000000000000..85317a8bf2f9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/SkusClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBase.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBase.java new file mode 100644 index 000000000000..48ca74c55bb5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBase.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for TestBase class. */ +public interface TestBase { + /** + * Gets The Azure subscription ID. This is a GUID-formatted string. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the TestBaseAccountsClient object to access its operations. + * + * @return the TestBaseAccountsClient object. + */ + TestBaseAccountsClient getTestBaseAccounts(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the AvailableOSClient object to access its operations. + * + * @return the AvailableOSClient object. + */ + AvailableOSClient getAvailableOS(); + + /** + * Gets the FlightingRingsClient object to access its operations. + * + * @return the FlightingRingsClient object. + */ + FlightingRingsClient getFlightingRings(); + + /** + * Gets the TestTypesClient object to access its operations. + * + * @return the TestTypesClient object. + */ + TestTypesClient getTestTypes(); + + /** + * Gets the PackagesClient object to access its operations. + * + * @return the PackagesClient object. + */ + PackagesClient getPackages(); + + /** + * Gets the TestSummariesClient object to access its operations. + * + * @return the TestSummariesClient object. + */ + TestSummariesClient getTestSummaries(); + + /** + * Gets the TestResultsClient object to access its operations. + * + * @return the TestResultsClient object. + */ + TestResultsClient getTestResults(); + + /** + * Gets the OSUpdatesClient object to access its operations. + * + * @return the OSUpdatesClient object. + */ + OSUpdatesClient getOSUpdates(); + + /** + * Gets the FavoriteProcessesClient object to access its operations. + * + * @return the FavoriteProcessesClient object. + */ + FavoriteProcessesClient getFavoriteProcesses(); + + /** + * Gets the AnalysisResultsClient object to access its operations. + * + * @return the AnalysisResultsClient object. + */ + AnalysisResultsClient getAnalysisResults(); + + /** + * Gets the EmailEventsClient object to access its operations. + * + * @return the EmailEventsClient object. + */ + EmailEventsClient getEmailEvents(); + + /** + * Gets the CustomerEventsClient object to access its operations. + * + * @return the CustomerEventsClient object. + */ + CustomerEventsClient getCustomerEvents(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBaseAccountsClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBaseAccountsClient.java new file mode 100644 index 000000000000..ad58034ee8ea --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestBaseAccountsClient.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.testbase.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.testbase.fluent.models.FileUploadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParametersInner; +import com.azure.resourcemanager.testbase.models.GetFileUploadUrlParameters; +import com.azure.resourcemanager.testbase.models.PackageCheckNameAvailabilityParameters; + +/** An instance of this class provides access to all the operations defined in TestBaseAccountsClient. */ +public interface TestBaseAccountsClient { + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Boolean getDeleted, Context context); + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, Boolean getDeleted, Context context); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TestBaseAccountResourceInner> beginCreate( + String resourceGroupName, String testBaseAccountName, TestBaseAccountResourceInner parameters, Boolean restore); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TestBaseAccountResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore, + Context context); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestBaseAccountResourceInner create( + String resourceGroupName, String testBaseAccountName, TestBaseAccountResourceInner parameters, Boolean restore); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestBaseAccountResourceInner create( + String resourceGroupName, String testBaseAccountName, TestBaseAccountResourceInner parameters); + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestBaseAccountResourceInner create( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore, + Context context); + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TestBaseAccountResourceInner> beginUpdate( + String resourceGroupName, String testBaseAccountName, TestBaseAccountUpdateParametersInner parameters); + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TestBaseAccountResourceInner> beginUpdate( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountUpdateParametersInner parameters, + Context context); + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestBaseAccountResourceInner update( + String resourceGroupName, String testBaseAccountName, TestBaseAccountUpdateParametersInner parameters); + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestBaseAccountResourceInner update( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountUpdateParametersInner parameters, + Context context); + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String testBaseAccountName); + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String testBaseAccountName); + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestBaseAccountResourceInner getByResourceGroup(String resourceGroupName, String testBaseAccountName); + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginOffboard(String resourceGroupName, String testBaseAccountName); + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginOffboard( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void offboard(String resourceGroupName, String testBaseAccountName); + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void offboard(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileUploadUrlResponseInner getFileUploadUrl(String resourceGroupName, String testBaseAccountName); + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Account GetFileUploadURL operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getFileUploadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, GetFileUploadUrlParameters parameters, Context context); + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkPackageNameAvailability( + String resourceGroupName, String testBaseAccountName, PackageCheckNameAvailabilityParameters parameters); + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkPackageNameAvailabilityWithResponse( + String resourceGroupName, + String testBaseAccountName, + PackageCheckNameAvailabilityParameters parameters, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestResultsClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestResultsClient.java new file mode 100644 index 000000000000..ccd16a63b4f5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestResultsClient.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.TestResultResourceInner; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** An instance of this class provides access to all the operations defined in TestResultsClient. */ +public interface TestResultsClient { + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType); + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter, + Context context); + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestResultResourceInner get( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName); + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context); + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlResponseInner getDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName); + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context); + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlResponseInner getVideoDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName); + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVideoDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestSummariesClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestSummariesClient.java new file mode 100644 index 000000000000..0ed6bd4beec3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestSummariesClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestSummaryResourceInner; + +/** An instance of this class provides access to all the operations defined in TestSummariesClient. */ +public interface TestSummariesClient { + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestSummaryResourceInner get(String resourceGroupName, String testBaseAccountName, String testSummaryName); + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testSummaryName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestTypesClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestTypesClient.java new file mode 100644 index 000000000000..2b415cf442ca --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/TestTypesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestTypeResourceInner; + +/** An instance of this class provides access to all the operations defined in TestTypesClient. */ +public interface TestTypesClient { + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestTypeResourceInner get(String resourceGroupName, String testBaseAccountName, String testTypeResourceName); + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/UsagesClient.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/UsagesClient.java new file mode 100644 index 000000000000..7a93b5e360ff --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/UsagesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUsageDataInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String filter, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceInner.java new file mode 100644 index 000000000000..b0409b6cc27d --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.models.Grade; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Analysis Result Singleton Resource. */ +@Fluent +public final class AnalysisResultSingletonResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of an Analysis Result. + */ + @JsonProperty(value = "properties") + private AnalysisResultSingletonResourceProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Properties of an Analysis Result. + * + * @return the innerProperties value. + */ + private AnalysisResultSingletonResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.innerProperties() == null ? null : this.innerProperties().grade(); + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the AnalysisResultSingletonResourceInner object itself. + */ + public AnalysisResultSingletonResourceInner withGrade(Grade grade) { + if (this.innerProperties() == null) { + this.innerProperties = new AnalysisResultSingletonResourceProperties(); + } + this.innerProperties().withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceProperties.java new file mode 100644 index 000000000000..402afc356466 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AnalysisResultSingletonResourceProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.CpuRegressionResultSingletonResourceProperties; +import com.azure.resourcemanager.testbase.models.CpuUtilizationResultSingletonResourceProperties; +import com.azure.resourcemanager.testbase.models.Grade; +import com.azure.resourcemanager.testbase.models.MemoryRegressionResultSingletonResourceProperties; +import com.azure.resourcemanager.testbase.models.MemoryUtilizationResultSingletonResourceProperties; +import com.azure.resourcemanager.testbase.models.ReliabilityResultSingletonResourceProperties; +import com.azure.resourcemanager.testbase.models.ScriptExecutionResultSingletonResourceProperties; +import com.azure.resourcemanager.testbase.models.TestAnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The properties of Analysis Result resource. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "analysisResultType", + defaultImpl = AnalysisResultSingletonResourceProperties.class) +@JsonTypeName("AnalysisResultSingletonResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ScriptExecution", value = ScriptExecutionResultSingletonResourceProperties.class), + @JsonSubTypes.Type(name = "Reliability", value = ReliabilityResultSingletonResourceProperties.class), + @JsonSubTypes.Type(name = "CPUUtilization", value = CpuUtilizationResultSingletonResourceProperties.class), + @JsonSubTypes.Type(name = "MemoryUtilization", value = MemoryUtilizationResultSingletonResourceProperties.class), + @JsonSubTypes.Type(name = "CPURegression", value = CpuRegressionResultSingletonResourceProperties.class), + @JsonSubTypes.Type(name = "MemoryRegression", value = MemoryRegressionResultSingletonResourceProperties.class), + @JsonSubTypes.Type(name = "TestAnalysis", value = TestAnalysisResultSingletonResourceProperties.class) +}) +@Fluent +public class AnalysisResultSingletonResourceProperties { + /* + * The grade of the test. + */ + @JsonProperty(value = "grade") + private Grade grade; + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.grade; + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the AnalysisResultSingletonResourceProperties object itself. + */ + public AnalysisResultSingletonResourceProperties withGrade(Grade grade) { + this.grade = grade; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSProperties.java new file mode 100644 index 000000000000..2a83a4f3c441 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Available OS properties. */ +@Fluent +public final class AvailableOSProperties { + /* + * The Id of an Available OS of a Test Base Account. + */ + @JsonProperty(value = "osId") + private String osId; + + /* + * The name of an Available OS of a Test Base Account. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The version of an Available OS of a Test Base Account. + */ + @JsonProperty(value = "osVersion") + private String osVersion; + + /* + * The insider channel of an Available OS of a Test Base Account. + */ + @JsonProperty(value = "insiderChannel") + private String insiderChannel; + + /* + * The OS update type of an Available OS of a Test Base Account. + */ + @JsonProperty(value = "osUpdateType") + private String osUpdateType; + + /* + * The Platform of an Available OS of a Test Base Account. + */ + @JsonProperty(value = "osPlatform") + private String osPlatform; + + /** + * Get the osId property: The Id of an Available OS of a Test Base Account. + * + * @return the osId value. + */ + public String osId() { + return this.osId; + } + + /** + * Set the osId property: The Id of an Available OS of a Test Base Account. + * + * @param osId the osId value to set. + * @return the AvailableOSProperties object itself. + */ + public AvailableOSProperties withOsId(String osId) { + this.osId = osId; + return this; + } + + /** + * Get the osName property: The name of an Available OS of a Test Base Account. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName property: The name of an Available OS of a Test Base Account. + * + * @param osName the osName value to set. + * @return the AvailableOSProperties object itself. + */ + public AvailableOSProperties withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the osVersion property: The version of an Available OS of a Test Base Account. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.osVersion; + } + + /** + * Set the osVersion property: The version of an Available OS of a Test Base Account. + * + * @param osVersion the osVersion value to set. + * @return the AvailableOSProperties object itself. + */ + public AvailableOSProperties withOsVersion(String osVersion) { + this.osVersion = osVersion; + return this; + } + + /** + * Get the insiderChannel property: The insider channel of an Available OS of a Test Base Account. + * + * @return the insiderChannel value. + */ + public String insiderChannel() { + return this.insiderChannel; + } + + /** + * Set the insiderChannel property: The insider channel of an Available OS of a Test Base Account. + * + * @param insiderChannel the insiderChannel value to set. + * @return the AvailableOSProperties object itself. + */ + public AvailableOSProperties withInsiderChannel(String insiderChannel) { + this.insiderChannel = insiderChannel; + return this; + } + + /** + * Get the osUpdateType property: The OS update type of an Available OS of a Test Base Account. + * + * @return the osUpdateType value. + */ + public String osUpdateType() { + return this.osUpdateType; + } + + /** + * Set the osUpdateType property: The OS update type of an Available OS of a Test Base Account. + * + * @param osUpdateType the osUpdateType value to set. + * @return the AvailableOSProperties object itself. + */ + public AvailableOSProperties withOsUpdateType(String osUpdateType) { + this.osUpdateType = osUpdateType; + return this; + } + + /** + * Get the osPlatform property: The Platform of an Available OS of a Test Base Account. + * + * @return the osPlatform value. + */ + public String osPlatform() { + return this.osPlatform; + } + + /** + * Set the osPlatform property: The Platform of an Available OS of a Test Base Account. + * + * @param osPlatform the osPlatform value to set. + * @return the AvailableOSProperties object itself. + */ + public AvailableOSProperties withOsPlatform(String osPlatform) { + this.osPlatform = osPlatform; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSResourceInner.java new file mode 100644 index 000000000000..b6a156dbbd79 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/AvailableOSResourceInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Available OS resource. */ +@Fluent +public final class AvailableOSResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Available OS properties. + */ + @JsonProperty(value = "properties") + private AvailableOSProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Available OS properties. + * + * @return the innerProperties value. + */ + private AvailableOSProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the osId property: The Id of an Available OS of a Test Base Account. + * + * @return the osId value. + */ + public String osId() { + return this.innerProperties() == null ? null : this.innerProperties().osId(); + } + + /** + * Set the osId property: The Id of an Available OS of a Test Base Account. + * + * @param osId the osId value to set. + * @return the AvailableOSResourceInner object itself. + */ + public AvailableOSResourceInner withOsId(String osId) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableOSProperties(); + } + this.innerProperties().withOsId(osId); + return this; + } + + /** + * Get the osName property: The name of an Available OS of a Test Base Account. + * + * @return the osName value. + */ + public String osName() { + return this.innerProperties() == null ? null : this.innerProperties().osName(); + } + + /** + * Set the osName property: The name of an Available OS of a Test Base Account. + * + * @param osName the osName value to set. + * @return the AvailableOSResourceInner object itself. + */ + public AvailableOSResourceInner withOsName(String osName) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableOSProperties(); + } + this.innerProperties().withOsName(osName); + return this; + } + + /** + * Get the osVersion property: The version of an Available OS of a Test Base Account. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.innerProperties() == null ? null : this.innerProperties().osVersion(); + } + + /** + * Set the osVersion property: The version of an Available OS of a Test Base Account. + * + * @param osVersion the osVersion value to set. + * @return the AvailableOSResourceInner object itself. + */ + public AvailableOSResourceInner withOsVersion(String osVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableOSProperties(); + } + this.innerProperties().withOsVersion(osVersion); + return this; + } + + /** + * Get the insiderChannel property: The insider channel of an Available OS of a Test Base Account. + * + * @return the insiderChannel value. + */ + public String insiderChannel() { + return this.innerProperties() == null ? null : this.innerProperties().insiderChannel(); + } + + /** + * Set the insiderChannel property: The insider channel of an Available OS of a Test Base Account. + * + * @param insiderChannel the insiderChannel value to set. + * @return the AvailableOSResourceInner object itself. + */ + public AvailableOSResourceInner withInsiderChannel(String insiderChannel) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableOSProperties(); + } + this.innerProperties().withInsiderChannel(insiderChannel); + return this; + } + + /** + * Get the osUpdateType property: The OS update type of an Available OS of a Test Base Account. + * + * @return the osUpdateType value. + */ + public String osUpdateType() { + return this.innerProperties() == null ? null : this.innerProperties().osUpdateType(); + } + + /** + * Set the osUpdateType property: The OS update type of an Available OS of a Test Base Account. + * + * @param osUpdateType the osUpdateType value to set. + * @return the AvailableOSResourceInner object itself. + */ + public AvailableOSResourceInner withOsUpdateType(String osUpdateType) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableOSProperties(); + } + this.innerProperties().withOsUpdateType(osUpdateType); + return this; + } + + /** + * Get the osPlatform property: The Platform of an Available OS of a Test Base Account. + * + * @return the osPlatform value. + */ + public String osPlatform() { + return this.innerProperties() == null ? null : this.innerProperties().osPlatform(); + } + + /** + * Set the osPlatform property: The Platform of an Available OS of a Test Base Account. + * + * @param osPlatform the osPlatform value to set. + * @return the AvailableOSResourceInner object itself. + */ + public AvailableOSResourceInner withOsPlatform(String osPlatform) { + if (this.innerProperties() == null) { + this.innerProperties = new AvailableOSProperties(); + } + this.innerProperties().withOsPlatform(osPlatform); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..dd2dc3098f68 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of a Check Name availability response properties. */ +@Fluent +public final class CheckNameAvailabilityResultInner { + /* + * Value indicating the availability of the name: true if the name is + * available; otherwise, false. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason for unavailability of a name. Required if nameAvailable == + * false. + */ + @JsonProperty(value = "reason") + private Reason reason; + + /* + * The detailed info regarding the reason associated with the name. + * Required if nameAvailable == false. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the nameAvailable property: Value indicating the availability of the name: true if the name is available; + * otherwise, false. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Value indicating the availability of the name: true if the name is available; + * otherwise, false. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason for unavailability of a name. Required if nameAvailable == false. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Set the reason property: The reason for unavailability of a name. Required if nameAvailable == false. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResultInner object itself. + */ + public CheckNameAvailabilityResultInner withReason(Reason reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: The detailed info regarding the reason associated with the name. Required if + * nameAvailable == false. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventProperties.java new file mode 100644 index 000000000000..e648a5662e45 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.models.NotificationEventReceiver; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A notification events subscribed to be received by customer. */ +@Fluent +public final class CustomerEventProperties { + /* + * The name of the event subscribed to. + */ + @JsonProperty(value = "eventName", required = true) + private String eventName; + + /* + * The notification event receivers. + */ + @JsonProperty(value = "receivers", required = true) + private List receivers; + + /** + * Get the eventName property: The name of the event subscribed to. + * + * @return the eventName value. + */ + public String eventName() { + return this.eventName; + } + + /** + * Set the eventName property: The name of the event subscribed to. + * + * @param eventName the eventName value to set. + * @return the CustomerEventProperties object itself. + */ + public CustomerEventProperties withEventName(String eventName) { + this.eventName = eventName; + return this; + } + + /** + * Get the receivers property: The notification event receivers. + * + * @return the receivers value. + */ + public List receivers() { + return this.receivers; + } + + /** + * Set the receivers property: The notification event receivers. + * + * @param receivers the receivers value to set. + * @return the CustomerEventProperties object itself. + */ + public CustomerEventProperties withReceivers(List receivers) { + this.receivers = receivers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (eventName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property eventName in model CustomerEventProperties")); + } + if (receivers() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property receivers in model CustomerEventProperties")); + } else { + receivers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomerEventProperties.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventResourceInner.java new file mode 100644 index 000000000000..6861961da423 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/CustomerEventResourceInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.models.NotificationEventReceiver; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Customer Notification Event resource. */ +@Fluent +public final class CustomerEventResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Customer Notification Event properties. + */ + @JsonProperty(value = "properties") + private CustomerEventProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Customer Notification Event properties. + * + * @return the innerProperties value. + */ + private CustomerEventProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the eventName property: The name of the event subscribed to. + * + * @return the eventName value. + */ + public String eventName() { + return this.innerProperties() == null ? null : this.innerProperties().eventName(); + } + + /** + * Set the eventName property: The name of the event subscribed to. + * + * @param eventName the eventName value to set. + * @return the CustomerEventResourceInner object itself. + */ + public CustomerEventResourceInner withEventName(String eventName) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomerEventProperties(); + } + this.innerProperties().withEventName(eventName); + return this; + } + + /** + * Get the receivers property: The notification event receivers. + * + * @return the receivers value. + */ + public List receivers() { + return this.innerProperties() == null ? null : this.innerProperties().receivers(); + } + + /** + * Set the receivers property: The notification event receivers. + * + * @param receivers the receivers value to set. + * @return the CustomerEventResourceInner object itself. + */ + public CustomerEventResourceInner withReceivers(List receivers) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomerEventProperties(); + } + this.innerProperties().withReceivers(receivers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/DownloadUrlResponseInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/DownloadUrlResponseInner.java new file mode 100644 index 000000000000..f80e867e7c19 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/DownloadUrlResponseInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The response of getting a download URL. */ +@Immutable +public final class DownloadUrlResponseInner { + /* + * The download URL. + */ + @JsonProperty(value = "downloadUrl", access = JsonProperty.Access.WRITE_ONLY) + private String downloadUrl; + + /* + * Expiry date of the download URL. + */ + @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime expirationTime; + + /** + * Get the downloadUrl property: The download URL. + * + * @return the downloadUrl value. + */ + public String downloadUrl() { + return this.downloadUrl; + } + + /** + * Get the expirationTime property: Expiry date of the download URL. + * + * @return the expirationTime value. + */ + public OffsetDateTime expirationTime() { + return this.expirationTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventProperties.java new file mode 100644 index 000000000000..72434598d0f9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventProperties.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Email Event properties. */ +@Fluent +public final class EmailEventProperties { + /* + * The identifier of the email event. + */ + @JsonProperty(value = "eventId") + private String eventId; + + /* + * The name of the email event. + */ + @JsonProperty(value = "eventName") + private String eventName; + + /* + * The display name of the email event. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the eventId property: The identifier of the email event. + * + * @return the eventId value. + */ + public String eventId() { + return this.eventId; + } + + /** + * Set the eventId property: The identifier of the email event. + * + * @param eventId the eventId value to set. + * @return the EmailEventProperties object itself. + */ + public EmailEventProperties withEventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * Get the eventName property: The name of the email event. + * + * @return the eventName value. + */ + public String eventName() { + return this.eventName; + } + + /** + * Set the eventName property: The name of the email event. + * + * @param eventName the eventName value to set. + * @return the EmailEventProperties object itself. + */ + public EmailEventProperties withEventName(String eventName) { + this.eventName = eventName; + return this; + } + + /** + * Get the displayName property: The display name of the email event. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the email event. + * + * @param displayName the displayName value to set. + * @return the EmailEventProperties object itself. + */ + public EmailEventProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventResourceInner.java new file mode 100644 index 000000000000..4e09dd97bfa1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/EmailEventResourceInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The email event resource. */ +@Fluent +public final class EmailEventResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Email Event properties. + */ + @JsonProperty(value = "properties") + private EmailEventProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Email Event properties. + * + * @return the innerProperties value. + */ + private EmailEventProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the eventId property: The identifier of the email event. + * + * @return the eventId value. + */ + public String eventId() { + return this.innerProperties() == null ? null : this.innerProperties().eventId(); + } + + /** + * Set the eventId property: The identifier of the email event. + * + * @param eventId the eventId value to set. + * @return the EmailEventResourceInner object itself. + */ + public EmailEventResourceInner withEventId(String eventId) { + if (this.innerProperties() == null) { + this.innerProperties = new EmailEventProperties(); + } + this.innerProperties().withEventId(eventId); + return this; + } + + /** + * Get the eventName property: The name of the email event. + * + * @return the eventName value. + */ + public String eventName() { + return this.innerProperties() == null ? null : this.innerProperties().eventName(); + } + + /** + * Set the eventName property: The name of the email event. + * + * @param eventName the eventName value to set. + * @return the EmailEventResourceInner object itself. + */ + public EmailEventResourceInner withEventName(String eventName) { + if (this.innerProperties() == null) { + this.innerProperties = new EmailEventProperties(); + } + this.innerProperties().withEventName(eventName); + return this; + } + + /** + * Get the displayName property: The display name of the email event. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the email event. + * + * @param displayName the displayName value to set. + * @return the EmailEventResourceInner object itself. + */ + public EmailEventResourceInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new EmailEventProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessProperties.java new file mode 100644 index 000000000000..d0aec5e76783 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a favorite process identifier. */ +@Fluent +public final class FavoriteProcessProperties { + /* + * The actual name of the favorite process. It will be equal to resource + * name except for the scenario that the process name contains characters + * that are not allowed in the resource name. + */ + @JsonProperty(value = "actualProcessName", required = true) + private String actualProcessName; + + /** + * Get the actualProcessName property: The actual name of the favorite process. It will be equal to resource name + * except for the scenario that the process name contains characters that are not allowed in the resource name. + * + * @return the actualProcessName value. + */ + public String actualProcessName() { + return this.actualProcessName; + } + + /** + * Set the actualProcessName property: The actual name of the favorite process. It will be equal to resource name + * except for the scenario that the process name contains characters that are not allowed in the resource name. + * + * @param actualProcessName the actualProcessName value to set. + * @return the FavoriteProcessProperties object itself. + */ + public FavoriteProcessProperties withActualProcessName(String actualProcessName) { + this.actualProcessName = actualProcessName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actualProcessName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actualProcessName in model FavoriteProcessProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FavoriteProcessProperties.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessResourceInner.java new file mode 100644 index 000000000000..f9d8fce7b1c1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FavoriteProcessResourceInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A favorite process identifier. */ +@Fluent +public final class FavoriteProcessResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of a favorite process identifier. + */ + @JsonProperty(value = "properties") + private FavoriteProcessProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Properties of a favorite process identifier. + * + * @return the innerProperties value. + */ + private FavoriteProcessProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the actualProcessName property: The actual name of the favorite process. It will be equal to resource name + * except for the scenario that the process name contains characters that are not allowed in the resource name. + * + * @return the actualProcessName value. + */ + public String actualProcessName() { + return this.innerProperties() == null ? null : this.innerProperties().actualProcessName(); + } + + /** + * Set the actualProcessName property: The actual name of the favorite process. It will be equal to resource name + * except for the scenario that the process name contains characters that are not allowed in the resource name. + * + * @param actualProcessName the actualProcessName value to set. + * @return the FavoriteProcessResourceInner object itself. + */ + public FavoriteProcessResourceInner withActualProcessName(String actualProcessName) { + if (this.innerProperties() == null) { + this.innerProperties = new FavoriteProcessProperties(); + } + this.innerProperties().withActualProcessName(actualProcessName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FileUploadUrlResponseInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FileUploadUrlResponseInner.java new file mode 100644 index 000000000000..71dec950c236 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FileUploadUrlResponseInner.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The URL response. */ +@Immutable +public final class FileUploadUrlResponseInner { + /* + * The URL used for uploading the package. + */ + @JsonProperty(value = "uploadUrl", access = JsonProperty.Access.WRITE_ONLY) + private String uploadUrl; + + /* + * The blob path of the uploaded package. It will be used as the 'blobPath' + * property of PackageResource. + */ + @JsonProperty(value = "blobPath", access = JsonProperty.Access.WRITE_ONLY) + private String blobPath; + + /** + * Get the uploadUrl property: The URL used for uploading the package. + * + * @return the uploadUrl value. + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Get the blobPath property: The blob path of the uploaded package. It will be used as the 'blobPath' property of + * PackageResource. + * + * @return the blobPath value. + */ + public String blobPath() { + return this.blobPath; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingProperties.java new file mode 100644 index 000000000000..d17cb7c5f2c4 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Flighting Ring properties. */ +@Fluent +public final class FlightingRingProperties { + /* + * The actual name of a flighting ring of a Test Base Account. + */ + @JsonProperty(value = "actualFlightingRingName") + private String actualFlightingRingName; + + /** + * Get the actualFlightingRingName property: The actual name of a flighting ring of a Test Base Account. + * + * @return the actualFlightingRingName value. + */ + public String actualFlightingRingName() { + return this.actualFlightingRingName; + } + + /** + * Set the actualFlightingRingName property: The actual name of a flighting ring of a Test Base Account. + * + * @param actualFlightingRingName the actualFlightingRingName value to set. + * @return the FlightingRingProperties object itself. + */ + public FlightingRingProperties withActualFlightingRingName(String actualFlightingRingName) { + this.actualFlightingRingName = actualFlightingRingName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingResourceInner.java new file mode 100644 index 000000000000..a41495baad80 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/FlightingRingResourceInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The flighting ring resource. */ +@Fluent +public final class FlightingRingResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Flighting Ring properties. + */ + @JsonProperty(value = "properties") + private FlightingRingProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Flighting Ring properties. + * + * @return the innerProperties value. + */ + private FlightingRingProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the actualFlightingRingName property: The actual name of a flighting ring of a Test Base Account. + * + * @return the actualFlightingRingName value. + */ + public String actualFlightingRingName() { + return this.innerProperties() == null ? null : this.innerProperties().actualFlightingRingName(); + } + + /** + * Set the actualFlightingRingName property: The actual name of a flighting ring of a Test Base Account. + * + * @param actualFlightingRingName the actualFlightingRingName value to set. + * @return the FlightingRingResourceInner object itself. + */ + public FlightingRingResourceInner withActualFlightingRingName(String actualFlightingRingName) { + if (this.innerProperties() == null) { + this.innerProperties = new FlightingRingProperties(); + } + this.innerProperties().withActualFlightingRingName(actualFlightingRingName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateProperties.java new file mode 100644 index 000000000000..a921df9ceeda --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateProperties.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.Type; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of an OS Update. */ +@Fluent +public final class OSUpdateProperties { + /* + * The name of the OS. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The name of tested release. + */ + @JsonProperty(value = "release") + private String release; + + /* + * The flighting ring, only for release of feature updates. + */ + @JsonProperty(value = "flightingRing") + private String flightingRing; + + /* + * The build version of the tested release (OS update). + */ + @JsonProperty(value = "buildVersion") + private String buildVersion; + + /* + * The build revision of the tested release (OS update) + */ + @JsonProperty(value = "buildRevision") + private String buildRevision; + + /* + * The type of this release (OS update). + */ + @JsonProperty(value = "type") + private Type type; + + /* + * The release version date the tested release (OS update) + */ + @JsonProperty(value = "releaseVersionDate") + private OffsetDateTime releaseVersionDate; + + /** + * Get the osName property: The name of the OS. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName property: The name of the OS. + * + * @param osName the osName value to set. + * @return the OSUpdateProperties object itself. + */ + public OSUpdateProperties withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the release property: The name of tested release. + * + * @return the release value. + */ + public String release() { + return this.release; + } + + /** + * Set the release property: The name of tested release. + * + * @param release the release value to set. + * @return the OSUpdateProperties object itself. + */ + public OSUpdateProperties withRelease(String release) { + this.release = release; + return this; + } + + /** + * Get the flightingRing property: The flighting ring, only for release of feature updates. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.flightingRing; + } + + /** + * Set the flightingRing property: The flighting ring, only for release of feature updates. + * + * @param flightingRing the flightingRing value to set. + * @return the OSUpdateProperties object itself. + */ + public OSUpdateProperties withFlightingRing(String flightingRing) { + this.flightingRing = flightingRing; + return this; + } + + /** + * Get the buildVersion property: The build version of the tested release (OS update). + * + * @return the buildVersion value. + */ + public String buildVersion() { + return this.buildVersion; + } + + /** + * Set the buildVersion property: The build version of the tested release (OS update). + * + * @param buildVersion the buildVersion value to set. + * @return the OSUpdateProperties object itself. + */ + public OSUpdateProperties withBuildVersion(String buildVersion) { + this.buildVersion = buildVersion; + return this; + } + + /** + * Get the buildRevision property: The build revision of the tested release (OS update). + * + * @return the buildRevision value. + */ + public String buildRevision() { + return this.buildRevision; + } + + /** + * Set the buildRevision property: The build revision of the tested release (OS update). + * + * @param buildRevision the buildRevision value to set. + * @return the OSUpdateProperties object itself. + */ + public OSUpdateProperties withBuildRevision(String buildRevision) { + this.buildRevision = buildRevision; + return this; + } + + /** + * Get the type property: The type of this release (OS update). + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of this release (OS update). + * + * @param type the type value to set. + * @return the OSUpdateProperties object itself. + */ + public OSUpdateProperties withType(Type type) { + this.type = type; + return this; + } + + /** + * Get the releaseVersionDate property: The release version date the tested release (OS update). + * + * @return the releaseVersionDate value. + */ + public OffsetDateTime releaseVersionDate() { + return this.releaseVersionDate; + } + + /** + * Set the releaseVersionDate property: The release version date the tested release (OS update). + * + * @param releaseVersionDate the releaseVersionDate value to set. + * @return the OSUpdateProperties object itself. + */ + public OSUpdateProperties withReleaseVersionDate(OffsetDateTime releaseVersionDate) { + this.releaseVersionDate = releaseVersionDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateResourceInner.java new file mode 100644 index 000000000000..4810cf898e6a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OSUpdateResourceInner.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.models.Type; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An OS Update. */ +@Fluent +public final class OSUpdateResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of an OS Update. + */ + @JsonProperty(value = "properties") + private OSUpdateProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Properties of an OS Update. + * + * @return the innerProperties value. + */ + private OSUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the osName property: The name of the OS. + * + * @return the osName value. + */ + public String osName() { + return this.innerProperties() == null ? null : this.innerProperties().osName(); + } + + /** + * Set the osName property: The name of the OS. + * + * @param osName the osName value to set. + * @return the OSUpdateResourceInner object itself. + */ + public OSUpdateResourceInner withOsName(String osName) { + if (this.innerProperties() == null) { + this.innerProperties = new OSUpdateProperties(); + } + this.innerProperties().withOsName(osName); + return this; + } + + /** + * Get the release property: The name of tested release. + * + * @return the release value. + */ + public String release() { + return this.innerProperties() == null ? null : this.innerProperties().release(); + } + + /** + * Set the release property: The name of tested release. + * + * @param release the release value to set. + * @return the OSUpdateResourceInner object itself. + */ + public OSUpdateResourceInner withRelease(String release) { + if (this.innerProperties() == null) { + this.innerProperties = new OSUpdateProperties(); + } + this.innerProperties().withRelease(release); + return this; + } + + /** + * Get the flightingRing property: The flighting ring, only for release of feature updates. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.innerProperties() == null ? null : this.innerProperties().flightingRing(); + } + + /** + * Set the flightingRing property: The flighting ring, only for release of feature updates. + * + * @param flightingRing the flightingRing value to set. + * @return the OSUpdateResourceInner object itself. + */ + public OSUpdateResourceInner withFlightingRing(String flightingRing) { + if (this.innerProperties() == null) { + this.innerProperties = new OSUpdateProperties(); + } + this.innerProperties().withFlightingRing(flightingRing); + return this; + } + + /** + * Get the buildVersion property: The build version of the tested release (OS update). + * + * @return the buildVersion value. + */ + public String buildVersion() { + return this.innerProperties() == null ? null : this.innerProperties().buildVersion(); + } + + /** + * Set the buildVersion property: The build version of the tested release (OS update). + * + * @param buildVersion the buildVersion value to set. + * @return the OSUpdateResourceInner object itself. + */ + public OSUpdateResourceInner withBuildVersion(String buildVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new OSUpdateProperties(); + } + this.innerProperties().withBuildVersion(buildVersion); + return this; + } + + /** + * Get the buildRevision property: The build revision of the tested release (OS update). + * + * @return the buildRevision value. + */ + public String buildRevision() { + return this.innerProperties() == null ? null : this.innerProperties().buildRevision(); + } + + /** + * Set the buildRevision property: The build revision of the tested release (OS update). + * + * @param buildRevision the buildRevision value to set. + * @return the OSUpdateResourceInner object itself. + */ + public OSUpdateResourceInner withBuildRevision(String buildRevision) { + if (this.innerProperties() == null) { + this.innerProperties = new OSUpdateProperties(); + } + this.innerProperties().withBuildRevision(buildRevision); + return this; + } + + /** + * Get the type property: The type of this release (OS update). + * + * @return the type value. + */ + public Type typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type of this release (OS update). + * + * @param type the type value to set. + * @return the OSUpdateResourceInner object itself. + */ + public OSUpdateResourceInner withTypePropertiesType(Type type) { + if (this.innerProperties() == null) { + this.innerProperties = new OSUpdateProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the releaseVersionDate property: The release version date the tested release (OS update). + * + * @return the releaseVersionDate value. + */ + public OffsetDateTime releaseVersionDate() { + return this.innerProperties() == null ? null : this.innerProperties().releaseVersionDate(); + } + + /** + * Set the releaseVersionDate property: The release version date the tested release (OS update). + * + * @param releaseVersionDate the releaseVersionDate value to set. + * @return the OSUpdateResourceInner object itself. + */ + public OSUpdateResourceInner withReleaseVersionDate(OffsetDateTime releaseVersionDate) { + if (this.innerProperties() == null) { + this.innerProperties = new OSUpdateProperties(); + } + this.innerProperties().withReleaseVersionDate(releaseVersionDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OperationInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OperationInner.java new file mode 100644 index 000000000000..c5c862f42c4a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/OperationInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API operation. */ +@Fluent +public final class OperationInner { + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Extra properties of the operation. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the display property: The object that describes the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that describes the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the properties property: Extra properties of the operation. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Extra properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageProperties.java new file mode 100644 index 000000000000..1480e21f10b0 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageProperties.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.models.PackageStatus; +import com.azure.resourcemanager.testbase.models.PackageValidationResult; +import com.azure.resourcemanager.testbase.models.ProvisioningState; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.azure.resourcemanager.testbase.models.TestType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of the Test Base Package. */ +@Fluent +public final class PackageProperties { + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Application name + */ + @JsonProperty(value = "applicationName", required = true) + private String applicationName; + + /* + * Application version + */ + @JsonProperty(value = "version", required = true) + private String version; + + /* + * OOB, functional or both. Mapped to the data in 'tests' property. + */ + @JsonProperty(value = "testTypes", access = JsonProperty.Access.WRITE_ONLY) + private List testTypes; + + /* + * Specifies the target OSs of specific OS Update types. + */ + @JsonProperty(value = "targetOSList", required = true) + private List targetOSList; + + /* + * The status of the package. + */ + @JsonProperty(value = "packageStatus", access = JsonProperty.Access.WRITE_ONLY) + private PackageStatus packageStatus; + + /* + * The UTC timestamp when the package was last modified. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The flighting ring for feature update. + */ + @JsonProperty(value = "flightingRing", required = true) + private String flightingRing; + + /* + * Flag showing that whether the package is enabled. It doesn't schedule + * test for package which is not enabled. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /* + * The file path of the package. + */ + @JsonProperty(value = "blobPath", required = true) + private String blobPath; + + /* + * The validation results. There's validation on package when it's created + * or updated. + */ + @JsonProperty(value = "validationResults", access = JsonProperty.Access.WRITE_ONLY) + private List validationResults; + + /* + * The detailed test information. + */ + @JsonProperty(value = "tests", required = true) + private List tests; + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the applicationName property: Application name. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: Application name. + * + * @param applicationName the applicationName value to set. + * @return the PackageProperties object itself. + */ + public PackageProperties withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the version property: Application version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Application version. + * + * @param version the version value to set. + * @return the PackageProperties object itself. + */ + public PackageProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the testTypes property: OOB, functional or both. Mapped to the data in 'tests' property. + * + * @return the testTypes value. + */ + public List testTypes() { + return this.testTypes; + } + + /** + * Get the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @return the targetOSList value. + */ + public List targetOSList() { + return this.targetOSList; + } + + /** + * Set the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @param targetOSList the targetOSList value to set. + * @return the PackageProperties object itself. + */ + public PackageProperties withTargetOSList(List targetOSList) { + this.targetOSList = targetOSList; + return this; + } + + /** + * Get the packageStatus property: The status of the package. + * + * @return the packageStatus value. + */ + public PackageStatus packageStatus() { + return this.packageStatus; + } + + /** + * Get the lastModifiedTime property: The UTC timestamp when the package was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the flightingRing property: The flighting ring for feature update. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.flightingRing; + } + + /** + * Set the flightingRing property: The flighting ring for feature update. + * + * @param flightingRing the flightingRing value to set. + * @return the PackageProperties object itself. + */ + public PackageProperties withFlightingRing(String flightingRing) { + this.flightingRing = flightingRing; + return this; + } + + /** + * Get the isEnabled property: Flag showing that whether the package is enabled. It doesn't schedule test for + * package which is not enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get the blobPath property: The file path of the package. + * + * @return the blobPath value. + */ + public String blobPath() { + return this.blobPath; + } + + /** + * Set the blobPath property: The file path of the package. + * + * @param blobPath the blobPath value to set. + * @return the PackageProperties object itself. + */ + public PackageProperties withBlobPath(String blobPath) { + this.blobPath = blobPath; + return this; + } + + /** + * Get the validationResults property: The validation results. There's validation on package when it's created or + * updated. + * + * @return the validationResults value. + */ + public List validationResults() { + return this.validationResults; + } + + /** + * Get the tests property: The detailed test information. + * + * @return the tests value. + */ + public List tests() { + return this.tests; + } + + /** + * Set the tests property: The detailed test information. + * + * @param tests the tests value to set. + * @return the PackageProperties object itself. + */ + public PackageProperties withTests(List tests) { + this.tests = tests; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationName in model PackageProperties")); + } + if (version() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property version in model PackageProperties")); + } + if (targetOSList() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property targetOSList in model PackageProperties")); + } else { + targetOSList().forEach(e -> e.validate()); + } + if (flightingRing() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property flightingRing in model PackageProperties")); + } + if (blobPath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property blobPath in model PackageProperties")); + } + if (validationResults() != null) { + validationResults().forEach(e -> e.validate()); + } + if (tests() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property tests in model PackageProperties")); + } else { + tests().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PackageProperties.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageResourceInner.java new file mode 100644 index 000000000000..a9fa15fec266 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageResourceInner.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.models.PackageStatus; +import com.azure.resourcemanager.testbase.models.PackageValidationResult; +import com.azure.resourcemanager.testbase.models.ProvisioningState; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.azure.resourcemanager.testbase.models.TestType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The Test Base Package resource. */ +@Fluent +public final class PackageResourceInner extends Resource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Test Base Package properties. + */ + @JsonProperty(value = "properties") + private PackageProperties innerProperties; + + /* + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Test Base Package properties. + * + * @return the innerProperties value. + */ + private PackageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public PackageResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PackageResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the applicationName property: Application name. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.innerProperties() == null ? null : this.innerProperties().applicationName(); + } + + /** + * Set the applicationName property: Application name. + * + * @param applicationName the applicationName value to set. + * @return the PackageResourceInner object itself. + */ + public PackageResourceInner withApplicationName(String applicationName) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withApplicationName(applicationName); + return this; + } + + /** + * Get the version property: Application version. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Application version. + * + * @param version the version value to set. + * @return the PackageResourceInner object itself. + */ + public PackageResourceInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the testTypes property: OOB, functional or both. Mapped to the data in 'tests' property. + * + * @return the testTypes value. + */ + public List testTypes() { + return this.innerProperties() == null ? null : this.innerProperties().testTypes(); + } + + /** + * Get the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @return the targetOSList value. + */ + public List targetOSList() { + return this.innerProperties() == null ? null : this.innerProperties().targetOSList(); + } + + /** + * Set the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @param targetOSList the targetOSList value to set. + * @return the PackageResourceInner object itself. + */ + public PackageResourceInner withTargetOSList(List targetOSList) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withTargetOSList(targetOSList); + return this; + } + + /** + * Get the packageStatus property: The status of the package. + * + * @return the packageStatus value. + */ + public PackageStatus packageStatus() { + return this.innerProperties() == null ? null : this.innerProperties().packageStatus(); + } + + /** + * Get the lastModifiedTime property: The UTC timestamp when the package was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the flightingRing property: The flighting ring for feature update. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.innerProperties() == null ? null : this.innerProperties().flightingRing(); + } + + /** + * Set the flightingRing property: The flighting ring for feature update. + * + * @param flightingRing the flightingRing value to set. + * @return the PackageResourceInner object itself. + */ + public PackageResourceInner withFlightingRing(String flightingRing) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withFlightingRing(flightingRing); + return this; + } + + /** + * Get the isEnabled property: Flag showing that whether the package is enabled. It doesn't schedule test for + * package which is not enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); + } + + /** + * Get the blobPath property: The file path of the package. + * + * @return the blobPath value. + */ + public String blobPath() { + return this.innerProperties() == null ? null : this.innerProperties().blobPath(); + } + + /** + * Set the blobPath property: The file path of the package. + * + * @param blobPath the blobPath value to set. + * @return the PackageResourceInner object itself. + */ + public PackageResourceInner withBlobPath(String blobPath) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withBlobPath(blobPath); + return this; + } + + /** + * Get the validationResults property: The validation results. There's validation on package when it's created or + * updated. + * + * @return the validationResults value. + */ + public List validationResults() { + return this.innerProperties() == null ? null : this.innerProperties().validationResults(); + } + + /** + * Get the tests property: The detailed test information. + * + * @return the tests value. + */ + public List tests() { + return this.innerProperties() == null ? null : this.innerProperties().tests(); + } + + /** + * Set the tests property: The detailed test information. + * + * @param tests the tests value to set. + * @return the PackageResourceInner object itself. + */ + public PackageResourceInner withTests(List tests) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withTests(tests); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageUpdateParameterProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageUpdateParameterProperties.java new file mode 100644 index 000000000000..b422983470bc --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/PackageUpdateParameterProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters supplied to update a Test Base Package. */ +@Fluent +public final class PackageUpdateParameterProperties { + /* + * Specifies the target OSs of specific OS Update types. + */ + @JsonProperty(value = "targetOSList") + private List targetOSList; + + /* + * The flighting ring for feature update. + */ + @JsonProperty(value = "flightingRing") + private String flightingRing; + + /* + * Specifies whether the package is enabled. It doesn't schedule test for + * package which is not enabled. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * The file name of the package. + */ + @JsonProperty(value = "blobPath") + private String blobPath; + + /* + * The detailed test information. + */ + @JsonProperty(value = "tests") + private List tests; + + /** + * Get the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @return the targetOSList value. + */ + public List targetOSList() { + return this.targetOSList; + } + + /** + * Set the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @param targetOSList the targetOSList value to set. + * @return the PackageUpdateParameterProperties object itself. + */ + public PackageUpdateParameterProperties withTargetOSList(List targetOSList) { + this.targetOSList = targetOSList; + return this; + } + + /** + * Get the flightingRing property: The flighting ring for feature update. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.flightingRing; + } + + /** + * Set the flightingRing property: The flighting ring for feature update. + * + * @param flightingRing the flightingRing value to set. + * @return the PackageUpdateParameterProperties object itself. + */ + public PackageUpdateParameterProperties withFlightingRing(String flightingRing) { + this.flightingRing = flightingRing; + return this; + } + + /** + * Get the isEnabled property: Specifies whether the package is enabled. It doesn't schedule test for package which + * is not enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Specifies whether the package is enabled. It doesn't schedule test for package which + * is not enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the PackageUpdateParameterProperties object itself. + */ + public PackageUpdateParameterProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the blobPath property: The file name of the package. + * + * @return the blobPath value. + */ + public String blobPath() { + return this.blobPath; + } + + /** + * Set the blobPath property: The file name of the package. + * + * @param blobPath the blobPath value to set. + * @return the PackageUpdateParameterProperties object itself. + */ + public PackageUpdateParameterProperties withBlobPath(String blobPath) { + this.blobPath = blobPath; + return this; + } + + /** + * Get the tests property: The detailed test information. + * + * @return the tests value. + */ + public List tests() { + return this.tests; + } + + /** + * Set the tests property: The detailed test information. + * + * @param tests the tests value to set. + * @return the PackageUpdateParameterProperties object itself. + */ + public PackageUpdateParameterProperties withTests(List tests) { + this.tests = tests; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetOSList() != null) { + targetOSList().forEach(e -> e.validate()); + } + if (tests() != null) { + tests().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourceInner.java new file mode 100644 index 000000000000..e326956a1ed7 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourceInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Test Base Account resource. */ +@Fluent +public final class TestBaseAccountResourceInner extends Resource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of a Test Base Account. + */ + @JsonProperty(value = "properties") + private TestBaseAccountResourcePropertiesInner innerProperties; + + /* + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Properties of a Test Base Account. + * + * @return the innerProperties value. + */ + private TestBaseAccountResourcePropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public TestBaseAccountResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public TestBaseAccountResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + public TestBaseAccountSkuInner sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the Test Base Account. + * + * @param sku the sku value to set. + * @return the TestBaseAccountResourceInner object itself. + */ + public TestBaseAccountResourceInner withSku(TestBaseAccountSkuInner sku) { + if (this.innerProperties() == null) { + this.innerProperties = new TestBaseAccountResourcePropertiesInner(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the accessLevel property: The access level of the Test Base Account. + * + * @return the accessLevel value. + */ + public String accessLevel() { + return this.innerProperties() == null ? null : this.innerProperties().accessLevel(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourcePropertiesInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourcePropertiesInner.java new file mode 100644 index 000000000000..426747532775 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountResourcePropertiesInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a Test Base Account resource. */ +@Fluent +public final class TestBaseAccountResourcePropertiesInner { + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The SKU of the Test Base Account. + */ + @JsonProperty(value = "sku", required = true) + private TestBaseAccountSkuInner sku; + + /* + * The access level of the Test Base Account. + */ + @JsonProperty(value = "accessLevel", access = JsonProperty.Access.WRITE_ONLY) + private String accessLevel; + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + public TestBaseAccountSkuInner sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the Test Base Account. + * + * @param sku the sku value to set. + * @return the TestBaseAccountResourcePropertiesInner object itself. + */ + public TestBaseAccountResourcePropertiesInner withSku(TestBaseAccountSkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Get the accessLevel property: The access level of the Test Base Account. + * + * @return the accessLevel value. + */ + public String accessLevel() { + return this.accessLevel; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sku in model TestBaseAccountResourcePropertiesInner")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestBaseAccountResourcePropertiesInner.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountSkuInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountSkuInner.java new file mode 100644 index 000000000000..3b587265744b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountSkuInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSkuCapability; +import com.azure.resourcemanager.testbase.models.Tier; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a Test Base Account SKU. */ +@Fluent +public final class TestBaseAccountSkuInner { + /* + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The name of the SKU. This is typically a letter + number code, such as + * B0 or S0. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The tier of this particular SKU. + */ + @JsonProperty(value = "tier", required = true) + private Tier tier; + + /* + * The capabilities of a SKU. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /* + * The locations that the SKU is available. + */ + @JsonProperty(value = "locations") + private List locations; + + /** + * Get the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The type of resource the SKU applies to. + * + * @param resourceType the resourceType value to set. + * @return the TestBaseAccountSkuInner object itself. + */ + public TestBaseAccountSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the name property: The name of the SKU. This is typically a letter + number code, such as B0 or S0. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. This is typically a letter + number code, such as B0 or S0. + * + * @param name the name value to set. + * @return the TestBaseAccountSkuInner object itself. + */ + public TestBaseAccountSkuInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier of this particular SKU. + * + * @return the tier value. + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of this particular SKU. + * + * @param tier the tier value to set. + * @return the TestBaseAccountSkuInner object itself. + */ + public TestBaseAccountSkuInner withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the capabilities property: The capabilities of a SKU. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the locations property: The locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: The locations that the SKU is available. + * + * @param locations the locations value to set. + * @return the TestBaseAccountSkuInner object itself. + */ + public TestBaseAccountSkuInner withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model TestBaseAccountSkuInner")); + } + if (tier() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property tier in model TestBaseAccountSkuInner")); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestBaseAccountSkuInner.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParameterPropertiesInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParameterPropertiesInner.java new file mode 100644 index 000000000000..1fb56f297468 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParameterPropertiesInner.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters supplied to update a Test Base Account. */ +@Fluent +public final class TestBaseAccountUpdateParameterPropertiesInner { + /* + * The SKU of the Test Base Account. + */ + @JsonProperty(value = "sku") + private TestBaseAccountSkuInner sku; + + /** + * Get the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + public TestBaseAccountSkuInner sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the Test Base Account. + * + * @param sku the sku value to set. + * @return the TestBaseAccountUpdateParameterPropertiesInner object itself. + */ + public TestBaseAccountUpdateParameterPropertiesInner withSku(TestBaseAccountSkuInner sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParametersInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParametersInner.java new file mode 100644 index 000000000000..7f4daa8f72f1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUpdateParametersInner.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters supplied to update a Test Base Account. */ +@Fluent +public final class TestBaseAccountUpdateParametersInner { + /* + * Test Base Account update parameters. + */ + @JsonProperty(value = "properties") + private TestBaseAccountUpdateParameterPropertiesInner innerProperties; + + /* + * The tags of the Test Base Account. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the innerProperties property: Test Base Account update parameters. + * + * @return the innerProperties value. + */ + private TestBaseAccountUpdateParameterPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The tags of the Test Base Account. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags of the Test Base Account. + * + * @param tags the tags value to set. + * @return the TestBaseAccountUpdateParametersInner object itself. + */ + public TestBaseAccountUpdateParametersInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + public TestBaseAccountSkuInner sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: The SKU of the Test Base Account. + * + * @param sku the sku value to set. + * @return the TestBaseAccountUpdateParametersInner object itself. + */ + public TestBaseAccountUpdateParametersInner withSku(TestBaseAccountSkuInner sku) { + if (this.innerProperties() == null) { + this.innerProperties = new TestBaseAccountUpdateParameterPropertiesInner(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUsageDataInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUsageDataInner.java new file mode 100644 index 000000000000..238619af0a6b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestBaseAccountUsageDataInner.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.TestBaseAccountUsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage data of a Test Base Account. */ +@Fluent +public final class TestBaseAccountUsageDataInner { + /* + * Fully qualified ARM resource id + */ + @JsonProperty(value = "id") + private String id; + + /* + * Localizable String object containing the name and a localized value. + */ + @JsonProperty(value = "name") + private TestBaseAccountUsageName name; + + /* + * Representing the units of the usage quota. Possible values are: Count, + * Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The maximum permitted value for the usage quota. If there is no limit, + * this value will be -1. + */ + @JsonProperty(value = "limit") + private Long limit; + + /* + * Current value for the usage quota. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * Get the id property: Fully qualified ARM resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ARM resource id. + * + * @param id the id value to set. + * @return the TestBaseAccountUsageDataInner object itself. + */ + public TestBaseAccountUsageDataInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Localizable String object containing the name and a localized value. + * + * @return the name value. + */ + public TestBaseAccountUsageName name() { + return this.name; + } + + /** + * Set the name property: Localizable String object containing the name and a localized value. + * + * @param name the name value to set. + * @return the TestBaseAccountUsageDataInner object itself. + */ + public TestBaseAccountUsageDataInner withName(TestBaseAccountUsageName name) { + this.name = name; + return this; + } + + /** + * Get the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, + * Percent, CountPerSecond, BytesPerSecond. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, + * Percent, CountPerSecond, BytesPerSecond. + * + * @param unit the unit value to set. + * @return the TestBaseAccountUsageDataInner object itself. + */ + public TestBaseAccountUsageDataInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the limit property: The maximum permitted value for the usage quota. If there is no limit, this value will be + * -1. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: The maximum permitted value for the usage quota. If there is no limit, this value will be + * -1. + * + * @param limit the limit value to set. + * @return the TestBaseAccountUsageDataInner object itself. + */ + public TestBaseAccountUsageDataInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the currentValue property: Current value for the usage quota. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: Current value for the usage quota. + * + * @param currentValue the currentValue value to set. + * @return the TestBaseAccountUsageDataInner object itself. + */ + public TestBaseAccountUsageDataInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultProperties.java new file mode 100644 index 000000000000..91da88eead33 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultProperties.java @@ -0,0 +1,549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.ExecutionStatus; +import com.azure.resourcemanager.testbase.models.Grade; +import com.azure.resourcemanager.testbase.models.TestResultAnalysisSummary; +import com.azure.resourcemanager.testbase.models.TestStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a Test Result. */ +@Fluent +public final class TestResultProperties { + /* + * Azure Id of the baseline test result. + */ + @JsonProperty(value = "baselineTestResultId") + private String baselineTestResultId; + + /* + * Resource Id of the package. + */ + @JsonProperty(value = "packageId") + private String packageId; + + /* + * Application name. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /* + * Application version. + */ + @JsonProperty(value = "applicationVersion") + private String applicationVersion; + + /* + * The operating system name, e.g. Windows 10 1809. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The name of the tested release (OS update). + */ + @JsonProperty(value = "releaseName") + private String releaseName; + + /* + * The release version date of the tested release. + */ + @JsonProperty(value = "releaseVersionDate") + private OffsetDateTime releaseVersionDate; + + /* + * The flighting ring, only for release of feature updates. + */ + @JsonProperty(value = "flightingRing") + private String flightingRing; + + /* + * The build version of the tested release (OS update). + */ + @JsonProperty(value = "buildVersion") + private String buildVersion; + + /* + * The build revision of the tested release (OS update). + */ + @JsonProperty(value = "buildRevision") + private String buildRevision; + + /* + * Test type. E.g. 'Out of box test' or 'Functional test'. + */ + @JsonProperty(value = "testType") + private String testType; + + /* + * The run time of the test. + */ + @JsonProperty(value = "testRunTime") + private String testRunTime; + + /* + * Whether download data is available. + */ + @JsonProperty(value = "isDownloadDataAvailable") + private Boolean isDownloadDataAvailable; + + /* + * Whether video data is available. + */ + @JsonProperty(value = "isVideoAvailable") + private Boolean isVideoAvailable; + + /* + * The execution status of the test. + */ + @JsonProperty(value = "executionStatus") + private ExecutionStatus executionStatus; + + /* + * The status of the test. + */ + @JsonProperty(value = "testStatus") + private TestStatus testStatus; + + /* + * The grade of the test. + */ + @JsonProperty(value = "grade") + private Grade grade; + + /* + * KB number. + */ + @JsonProperty(value = "kbNumber") + private String kbNumber; + + /* + * The version of the Windows update package. + */ + @JsonProperty(value = "packageVersion") + private String packageVersion; + + /* + * List of analysis summaries. + */ + @JsonProperty(value = "analysisSummaries") + private List analysisSummaries; + + /** + * Get the baselineTestResultId property: Azure Id of the baseline test result. + * + * @return the baselineTestResultId value. + */ + public String baselineTestResultId() { + return this.baselineTestResultId; + } + + /** + * Set the baselineTestResultId property: Azure Id of the baseline test result. + * + * @param baselineTestResultId the baselineTestResultId value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withBaselineTestResultId(String baselineTestResultId) { + this.baselineTestResultId = baselineTestResultId; + return this; + } + + /** + * Get the packageId property: Resource Id of the package. + * + * @return the packageId value. + */ + public String packageId() { + return this.packageId; + } + + /** + * Set the packageId property: Resource Id of the package. + * + * @param packageId the packageId value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withPackageId(String packageId) { + this.packageId = packageId; + return this; + } + + /** + * Get the applicationName property: Application name. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: Application name. + * + * @param applicationName the applicationName value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the applicationVersion property: Application version. + * + * @return the applicationVersion value. + */ + public String applicationVersion() { + return this.applicationVersion; + } + + /** + * Set the applicationVersion property: Application version. + * + * @param applicationVersion the applicationVersion value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withApplicationVersion(String applicationVersion) { + this.applicationVersion = applicationVersion; + return this; + } + + /** + * Get the osName property: The operating system name, e.g. Windows 10 1809. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName property: The operating system name, e.g. Windows 10 1809. + * + * @param osName the osName value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the releaseName property: The name of the tested release (OS update). + * + * @return the releaseName value. + */ + public String releaseName() { + return this.releaseName; + } + + /** + * Set the releaseName property: The name of the tested release (OS update). + * + * @param releaseName the releaseName value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withReleaseName(String releaseName) { + this.releaseName = releaseName; + return this; + } + + /** + * Get the releaseVersionDate property: The release version date of the tested release. + * + * @return the releaseVersionDate value. + */ + public OffsetDateTime releaseVersionDate() { + return this.releaseVersionDate; + } + + /** + * Set the releaseVersionDate property: The release version date of the tested release. + * + * @param releaseVersionDate the releaseVersionDate value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withReleaseVersionDate(OffsetDateTime releaseVersionDate) { + this.releaseVersionDate = releaseVersionDate; + return this; + } + + /** + * Get the flightingRing property: The flighting ring, only for release of feature updates. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.flightingRing; + } + + /** + * Set the flightingRing property: The flighting ring, only for release of feature updates. + * + * @param flightingRing the flightingRing value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withFlightingRing(String flightingRing) { + this.flightingRing = flightingRing; + return this; + } + + /** + * Get the buildVersion property: The build version of the tested release (OS update). + * + * @return the buildVersion value. + */ + public String buildVersion() { + return this.buildVersion; + } + + /** + * Set the buildVersion property: The build version of the tested release (OS update). + * + * @param buildVersion the buildVersion value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withBuildVersion(String buildVersion) { + this.buildVersion = buildVersion; + return this; + } + + /** + * Get the buildRevision property: The build revision of the tested release (OS update). + * + * @return the buildRevision value. + */ + public String buildRevision() { + return this.buildRevision; + } + + /** + * Set the buildRevision property: The build revision of the tested release (OS update). + * + * @param buildRevision the buildRevision value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withBuildRevision(String buildRevision) { + this.buildRevision = buildRevision; + return this; + } + + /** + * Get the testType property: Test type. E.g. 'Out of box test' or 'Functional test'. + * + * @return the testType value. + */ + public String testType() { + return this.testType; + } + + /** + * Set the testType property: Test type. E.g. 'Out of box test' or 'Functional test'. + * + * @param testType the testType value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withTestType(String testType) { + this.testType = testType; + return this; + } + + /** + * Get the testRunTime property: The run time of the test. + * + * @return the testRunTime value. + */ + public String testRunTime() { + return this.testRunTime; + } + + /** + * Set the testRunTime property: The run time of the test. + * + * @param testRunTime the testRunTime value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withTestRunTime(String testRunTime) { + this.testRunTime = testRunTime; + return this; + } + + /** + * Get the isDownloadDataAvailable property: Whether download data is available. + * + * @return the isDownloadDataAvailable value. + */ + public Boolean isDownloadDataAvailable() { + return this.isDownloadDataAvailable; + } + + /** + * Set the isDownloadDataAvailable property: Whether download data is available. + * + * @param isDownloadDataAvailable the isDownloadDataAvailable value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withIsDownloadDataAvailable(Boolean isDownloadDataAvailable) { + this.isDownloadDataAvailable = isDownloadDataAvailable; + return this; + } + + /** + * Get the isVideoAvailable property: Whether video data is available. + * + * @return the isVideoAvailable value. + */ + public Boolean isVideoAvailable() { + return this.isVideoAvailable; + } + + /** + * Set the isVideoAvailable property: Whether video data is available. + * + * @param isVideoAvailable the isVideoAvailable value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withIsVideoAvailable(Boolean isVideoAvailable) { + this.isVideoAvailable = isVideoAvailable; + return this; + } + + /** + * Get the executionStatus property: The execution status of the test. + * + * @return the executionStatus value. + */ + public ExecutionStatus executionStatus() { + return this.executionStatus; + } + + /** + * Set the executionStatus property: The execution status of the test. + * + * @param executionStatus the executionStatus value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withExecutionStatus(ExecutionStatus executionStatus) { + this.executionStatus = executionStatus; + return this; + } + + /** + * Get the testStatus property: The status of the test. + * + * @return the testStatus value. + */ + public TestStatus testStatus() { + return this.testStatus; + } + + /** + * Set the testStatus property: The status of the test. + * + * @param testStatus the testStatus value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withTestStatus(TestStatus testStatus) { + this.testStatus = testStatus; + return this; + } + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.grade; + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withGrade(Grade grade) { + this.grade = grade; + return this; + } + + /** + * Get the kbNumber property: KB number. + * + * @return the kbNumber value. + */ + public String kbNumber() { + return this.kbNumber; + } + + /** + * Set the kbNumber property: KB number. + * + * @param kbNumber the kbNumber value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withKbNumber(String kbNumber) { + this.kbNumber = kbNumber; + return this; + } + + /** + * Get the packageVersion property: The version of the Windows update package. + * + * @return the packageVersion value. + */ + public String packageVersion() { + return this.packageVersion; + } + + /** + * Set the packageVersion property: The version of the Windows update package. + * + * @param packageVersion the packageVersion value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + return this; + } + + /** + * Get the analysisSummaries property: List of analysis summaries. + * + * @return the analysisSummaries value. + */ + public List analysisSummaries() { + return this.analysisSummaries; + } + + /** + * Set the analysisSummaries property: List of analysis summaries. + * + * @param analysisSummaries the analysisSummaries value to set. + * @return the TestResultProperties object itself. + */ + public TestResultProperties withAnalysisSummaries(List analysisSummaries) { + this.analysisSummaries = analysisSummaries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (analysisSummaries() != null) { + analysisSummaries().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultResourceInner.java new file mode 100644 index 000000000000..e129b67d4418 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestResultResourceInner.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.models.ExecutionStatus; +import com.azure.resourcemanager.testbase.models.Grade; +import com.azure.resourcemanager.testbase.models.TestResultAnalysisSummary; +import com.azure.resourcemanager.testbase.models.TestStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The Test Result Resource. */ +@Fluent +public final class TestResultResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The properties of a Test Result. + */ + @JsonProperty(value = "properties") + private TestResultProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: The properties of a Test Result. + * + * @return the innerProperties value. + */ + private TestResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the baselineTestResultId property: Azure Id of the baseline test result. + * + * @return the baselineTestResultId value. + */ + public String baselineTestResultId() { + return this.innerProperties() == null ? null : this.innerProperties().baselineTestResultId(); + } + + /** + * Set the baselineTestResultId property: Azure Id of the baseline test result. + * + * @param baselineTestResultId the baselineTestResultId value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withBaselineTestResultId(String baselineTestResultId) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withBaselineTestResultId(baselineTestResultId); + return this; + } + + /** + * Get the packageId property: Resource Id of the package. + * + * @return the packageId value. + */ + public String packageId() { + return this.innerProperties() == null ? null : this.innerProperties().packageId(); + } + + /** + * Set the packageId property: Resource Id of the package. + * + * @param packageId the packageId value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withPackageId(String packageId) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withPackageId(packageId); + return this; + } + + /** + * Get the applicationName property: Application name. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.innerProperties() == null ? null : this.innerProperties().applicationName(); + } + + /** + * Set the applicationName property: Application name. + * + * @param applicationName the applicationName value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withApplicationName(String applicationName) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withApplicationName(applicationName); + return this; + } + + /** + * Get the applicationVersion property: Application version. + * + * @return the applicationVersion value. + */ + public String applicationVersion() { + return this.innerProperties() == null ? null : this.innerProperties().applicationVersion(); + } + + /** + * Set the applicationVersion property: Application version. + * + * @param applicationVersion the applicationVersion value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withApplicationVersion(String applicationVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withApplicationVersion(applicationVersion); + return this; + } + + /** + * Get the osName property: The operating system name, e.g. Windows 10 1809. + * + * @return the osName value. + */ + public String osName() { + return this.innerProperties() == null ? null : this.innerProperties().osName(); + } + + /** + * Set the osName property: The operating system name, e.g. Windows 10 1809. + * + * @param osName the osName value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withOsName(String osName) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withOsName(osName); + return this; + } + + /** + * Get the releaseName property: The name of the tested release (OS update). + * + * @return the releaseName value. + */ + public String releaseName() { + return this.innerProperties() == null ? null : this.innerProperties().releaseName(); + } + + /** + * Set the releaseName property: The name of the tested release (OS update). + * + * @param releaseName the releaseName value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withReleaseName(String releaseName) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withReleaseName(releaseName); + return this; + } + + /** + * Get the releaseVersionDate property: The release version date of the tested release. + * + * @return the releaseVersionDate value. + */ + public OffsetDateTime releaseVersionDate() { + return this.innerProperties() == null ? null : this.innerProperties().releaseVersionDate(); + } + + /** + * Set the releaseVersionDate property: The release version date of the tested release. + * + * @param releaseVersionDate the releaseVersionDate value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withReleaseVersionDate(OffsetDateTime releaseVersionDate) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withReleaseVersionDate(releaseVersionDate); + return this; + } + + /** + * Get the flightingRing property: The flighting ring, only for release of feature updates. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.innerProperties() == null ? null : this.innerProperties().flightingRing(); + } + + /** + * Set the flightingRing property: The flighting ring, only for release of feature updates. + * + * @param flightingRing the flightingRing value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withFlightingRing(String flightingRing) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withFlightingRing(flightingRing); + return this; + } + + /** + * Get the buildVersion property: The build version of the tested release (OS update). + * + * @return the buildVersion value. + */ + public String buildVersion() { + return this.innerProperties() == null ? null : this.innerProperties().buildVersion(); + } + + /** + * Set the buildVersion property: The build version of the tested release (OS update). + * + * @param buildVersion the buildVersion value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withBuildVersion(String buildVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withBuildVersion(buildVersion); + return this; + } + + /** + * Get the buildRevision property: The build revision of the tested release (OS update). + * + * @return the buildRevision value. + */ + public String buildRevision() { + return this.innerProperties() == null ? null : this.innerProperties().buildRevision(); + } + + /** + * Set the buildRevision property: The build revision of the tested release (OS update). + * + * @param buildRevision the buildRevision value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withBuildRevision(String buildRevision) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withBuildRevision(buildRevision); + return this; + } + + /** + * Get the testType property: Test type. E.g. 'Out of box test' or 'Functional test'. + * + * @return the testType value. + */ + public String testType() { + return this.innerProperties() == null ? null : this.innerProperties().testType(); + } + + /** + * Set the testType property: Test type. E.g. 'Out of box test' or 'Functional test'. + * + * @param testType the testType value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withTestType(String testType) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withTestType(testType); + return this; + } + + /** + * Get the testRunTime property: The run time of the test. + * + * @return the testRunTime value. + */ + public String testRunTime() { + return this.innerProperties() == null ? null : this.innerProperties().testRunTime(); + } + + /** + * Set the testRunTime property: The run time of the test. + * + * @param testRunTime the testRunTime value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withTestRunTime(String testRunTime) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withTestRunTime(testRunTime); + return this; + } + + /** + * Get the isDownloadDataAvailable property: Whether download data is available. + * + * @return the isDownloadDataAvailable value. + */ + public Boolean isDownloadDataAvailable() { + return this.innerProperties() == null ? null : this.innerProperties().isDownloadDataAvailable(); + } + + /** + * Set the isDownloadDataAvailable property: Whether download data is available. + * + * @param isDownloadDataAvailable the isDownloadDataAvailable value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withIsDownloadDataAvailable(Boolean isDownloadDataAvailable) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withIsDownloadDataAvailable(isDownloadDataAvailable); + return this; + } + + /** + * Get the isVideoAvailable property: Whether video data is available. + * + * @return the isVideoAvailable value. + */ + public Boolean isVideoAvailable() { + return this.innerProperties() == null ? null : this.innerProperties().isVideoAvailable(); + } + + /** + * Set the isVideoAvailable property: Whether video data is available. + * + * @param isVideoAvailable the isVideoAvailable value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withIsVideoAvailable(Boolean isVideoAvailable) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withIsVideoAvailable(isVideoAvailable); + return this; + } + + /** + * Get the executionStatus property: The execution status of the test. + * + * @return the executionStatus value. + */ + public ExecutionStatus executionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().executionStatus(); + } + + /** + * Set the executionStatus property: The execution status of the test. + * + * @param executionStatus the executionStatus value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withExecutionStatus(ExecutionStatus executionStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withExecutionStatus(executionStatus); + return this; + } + + /** + * Get the testStatus property: The status of the test. + * + * @return the testStatus value. + */ + public TestStatus testStatus() { + return this.innerProperties() == null ? null : this.innerProperties().testStatus(); + } + + /** + * Set the testStatus property: The status of the test. + * + * @param testStatus the testStatus value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withTestStatus(TestStatus testStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withTestStatus(testStatus); + return this; + } + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.innerProperties() == null ? null : this.innerProperties().grade(); + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withGrade(Grade grade) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withGrade(grade); + return this; + } + + /** + * Get the kbNumber property: KB number. + * + * @return the kbNumber value. + */ + public String kbNumber() { + return this.innerProperties() == null ? null : this.innerProperties().kbNumber(); + } + + /** + * Set the kbNumber property: KB number. + * + * @param kbNumber the kbNumber value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withKbNumber(String kbNumber) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withKbNumber(kbNumber); + return this; + } + + /** + * Get the packageVersion property: The version of the Windows update package. + * + * @return the packageVersion value. + */ + public String packageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().packageVersion(); + } + + /** + * Set the packageVersion property: The version of the Windows update package. + * + * @param packageVersion the packageVersion value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withPackageVersion(String packageVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withPackageVersion(packageVersion); + return this; + } + + /** + * Get the analysisSummaries property: List of analysis summaries. + * + * @return the analysisSummaries value. + */ + public List analysisSummaries() { + return this.innerProperties() == null ? null : this.innerProperties().analysisSummaries(); + } + + /** + * Set the analysisSummaries property: List of analysis summaries. + * + * @param analysisSummaries the analysisSummaries value to set. + * @return the TestResultResourceInner object itself. + */ + public TestResultResourceInner withAnalysisSummaries(List analysisSummaries) { + if (this.innerProperties() == null) { + this.innerProperties = new TestResultProperties(); + } + this.innerProperties().withAnalysisSummaries(analysisSummaries); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryProperties.java new file mode 100644 index 000000000000..597cba6fdad1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryProperties.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.models.ExecutionStatus; +import com.azure.resourcemanager.testbase.models.Grade; +import com.azure.resourcemanager.testbase.models.OSUpdatesTestSummary; +import com.azure.resourcemanager.testbase.models.TestStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a Test Summary. */ +@Fluent +public final class TestSummaryProperties { + /* + * The Id of the current Test Summary. + */ + @JsonProperty(value = "testSummaryId") + private String testSummaryId; + + /* + * The Azure resource Id of package. + */ + @JsonProperty(value = "packageId") + private String packageId; + + /* + * Application name. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /* + * Application version. + */ + @JsonProperty(value = "applicationVersion") + private String applicationVersion; + + /* + * The execution status of last test. + */ + @JsonProperty(value = "executionStatus") + private ExecutionStatus executionStatus; + + /* + * The status of last test. + */ + @JsonProperty(value = "testStatus") + private TestStatus testStatus; + + /* + * The grade of the test. + */ + @JsonProperty(value = "grade") + private Grade grade; + + /* + * The run time of the last test. + */ + @JsonProperty(value = "testRunTime") + private String testRunTime; + + /* + * The result summary of tests triggered by feature updates + */ + @JsonProperty(value = "featureUpdatesTestSummary") + private OSUpdatesTestSummary featureUpdatesTestSummary; + + /* + * The result summary of tests triggered by security updates + */ + @JsonProperty(value = "securityUpdatesTestSummary") + private OSUpdatesTestSummary securityUpdatesTestSummary; + + /** + * Get the testSummaryId property: The Id of the current Test Summary. + * + * @return the testSummaryId value. + */ + public String testSummaryId() { + return this.testSummaryId; + } + + /** + * Set the testSummaryId property: The Id of the current Test Summary. + * + * @param testSummaryId the testSummaryId value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withTestSummaryId(String testSummaryId) { + this.testSummaryId = testSummaryId; + return this; + } + + /** + * Get the packageId property: The Azure resource Id of package. + * + * @return the packageId value. + */ + public String packageId() { + return this.packageId; + } + + /** + * Set the packageId property: The Azure resource Id of package. + * + * @param packageId the packageId value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withPackageId(String packageId) { + this.packageId = packageId; + return this; + } + + /** + * Get the applicationName property: Application name. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: Application name. + * + * @param applicationName the applicationName value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the applicationVersion property: Application version. + * + * @return the applicationVersion value. + */ + public String applicationVersion() { + return this.applicationVersion; + } + + /** + * Set the applicationVersion property: Application version. + * + * @param applicationVersion the applicationVersion value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withApplicationVersion(String applicationVersion) { + this.applicationVersion = applicationVersion; + return this; + } + + /** + * Get the executionStatus property: The execution status of last test. + * + * @return the executionStatus value. + */ + public ExecutionStatus executionStatus() { + return this.executionStatus; + } + + /** + * Set the executionStatus property: The execution status of last test. + * + * @param executionStatus the executionStatus value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withExecutionStatus(ExecutionStatus executionStatus) { + this.executionStatus = executionStatus; + return this; + } + + /** + * Get the testStatus property: The status of last test. + * + * @return the testStatus value. + */ + public TestStatus testStatus() { + return this.testStatus; + } + + /** + * Set the testStatus property: The status of last test. + * + * @param testStatus the testStatus value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withTestStatus(TestStatus testStatus) { + this.testStatus = testStatus; + return this; + } + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.grade; + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withGrade(Grade grade) { + this.grade = grade; + return this; + } + + /** + * Get the testRunTime property: The run time of the last test. + * + * @return the testRunTime value. + */ + public String testRunTime() { + return this.testRunTime; + } + + /** + * Set the testRunTime property: The run time of the last test. + * + * @param testRunTime the testRunTime value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withTestRunTime(String testRunTime) { + this.testRunTime = testRunTime; + return this; + } + + /** + * Get the featureUpdatesTestSummary property: The result summary of tests triggered by feature updates. + * + * @return the featureUpdatesTestSummary value. + */ + public OSUpdatesTestSummary featureUpdatesTestSummary() { + return this.featureUpdatesTestSummary; + } + + /** + * Set the featureUpdatesTestSummary property: The result summary of tests triggered by feature updates. + * + * @param featureUpdatesTestSummary the featureUpdatesTestSummary value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withFeatureUpdatesTestSummary(OSUpdatesTestSummary featureUpdatesTestSummary) { + this.featureUpdatesTestSummary = featureUpdatesTestSummary; + return this; + } + + /** + * Get the securityUpdatesTestSummary property: The result summary of tests triggered by security updates. + * + * @return the securityUpdatesTestSummary value. + */ + public OSUpdatesTestSummary securityUpdatesTestSummary() { + return this.securityUpdatesTestSummary; + } + + /** + * Set the securityUpdatesTestSummary property: The result summary of tests triggered by security updates. + * + * @param securityUpdatesTestSummary the securityUpdatesTestSummary value to set. + * @return the TestSummaryProperties object itself. + */ + public TestSummaryProperties withSecurityUpdatesTestSummary(OSUpdatesTestSummary securityUpdatesTestSummary) { + this.securityUpdatesTestSummary = securityUpdatesTestSummary; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (featureUpdatesTestSummary() != null) { + featureUpdatesTestSummary().validate(); + } + if (securityUpdatesTestSummary() != null) { + securityUpdatesTestSummary().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryResourceInner.java new file mode 100644 index 000000000000..1b64ca5925e5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestSummaryResourceInner.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.models.ExecutionStatus; +import com.azure.resourcemanager.testbase.models.Grade; +import com.azure.resourcemanager.testbase.models.OSUpdatesTestSummary; +import com.azure.resourcemanager.testbase.models.TestStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Summary of a Test. */ +@Fluent +public final class TestSummaryResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of a Test Summary. + */ + @JsonProperty(value = "properties") + private TestSummaryProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Properties of a Test Summary. + * + * @return the innerProperties value. + */ + private TestSummaryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the testSummaryId property: The Id of the current Test Summary. + * + * @return the testSummaryId value. + */ + public String testSummaryId() { + return this.innerProperties() == null ? null : this.innerProperties().testSummaryId(); + } + + /** + * Set the testSummaryId property: The Id of the current Test Summary. + * + * @param testSummaryId the testSummaryId value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withTestSummaryId(String testSummaryId) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withTestSummaryId(testSummaryId); + return this; + } + + /** + * Get the packageId property: The Azure resource Id of package. + * + * @return the packageId value. + */ + public String packageId() { + return this.innerProperties() == null ? null : this.innerProperties().packageId(); + } + + /** + * Set the packageId property: The Azure resource Id of package. + * + * @param packageId the packageId value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withPackageId(String packageId) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withPackageId(packageId); + return this; + } + + /** + * Get the applicationName property: Application name. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.innerProperties() == null ? null : this.innerProperties().applicationName(); + } + + /** + * Set the applicationName property: Application name. + * + * @param applicationName the applicationName value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withApplicationName(String applicationName) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withApplicationName(applicationName); + return this; + } + + /** + * Get the applicationVersion property: Application version. + * + * @return the applicationVersion value. + */ + public String applicationVersion() { + return this.innerProperties() == null ? null : this.innerProperties().applicationVersion(); + } + + /** + * Set the applicationVersion property: Application version. + * + * @param applicationVersion the applicationVersion value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withApplicationVersion(String applicationVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withApplicationVersion(applicationVersion); + return this; + } + + /** + * Get the executionStatus property: The execution status of last test. + * + * @return the executionStatus value. + */ + public ExecutionStatus executionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().executionStatus(); + } + + /** + * Set the executionStatus property: The execution status of last test. + * + * @param executionStatus the executionStatus value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withExecutionStatus(ExecutionStatus executionStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withExecutionStatus(executionStatus); + return this; + } + + /** + * Get the testStatus property: The status of last test. + * + * @return the testStatus value. + */ + public TestStatus testStatus() { + return this.innerProperties() == null ? null : this.innerProperties().testStatus(); + } + + /** + * Set the testStatus property: The status of last test. + * + * @param testStatus the testStatus value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withTestStatus(TestStatus testStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withTestStatus(testStatus); + return this; + } + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.innerProperties() == null ? null : this.innerProperties().grade(); + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withGrade(Grade grade) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withGrade(grade); + return this; + } + + /** + * Get the testRunTime property: The run time of the last test. + * + * @return the testRunTime value. + */ + public String testRunTime() { + return this.innerProperties() == null ? null : this.innerProperties().testRunTime(); + } + + /** + * Set the testRunTime property: The run time of the last test. + * + * @param testRunTime the testRunTime value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withTestRunTime(String testRunTime) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withTestRunTime(testRunTime); + return this; + } + + /** + * Get the featureUpdatesTestSummary property: The result summary of tests triggered by feature updates. + * + * @return the featureUpdatesTestSummary value. + */ + public OSUpdatesTestSummary featureUpdatesTestSummary() { + return this.innerProperties() == null ? null : this.innerProperties().featureUpdatesTestSummary(); + } + + /** + * Set the featureUpdatesTestSummary property: The result summary of tests triggered by feature updates. + * + * @param featureUpdatesTestSummary the featureUpdatesTestSummary value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withFeatureUpdatesTestSummary(OSUpdatesTestSummary featureUpdatesTestSummary) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withFeatureUpdatesTestSummary(featureUpdatesTestSummary); + return this; + } + + /** + * Get the securityUpdatesTestSummary property: The result summary of tests triggered by security updates. + * + * @return the securityUpdatesTestSummary value. + */ + public OSUpdatesTestSummary securityUpdatesTestSummary() { + return this.innerProperties() == null ? null : this.innerProperties().securityUpdatesTestSummary(); + } + + /** + * Set the securityUpdatesTestSummary property: The result summary of tests triggered by security updates. + * + * @param securityUpdatesTestSummary the securityUpdatesTestSummary value to set. + * @return the TestSummaryResourceInner object itself. + */ + public TestSummaryResourceInner withSecurityUpdatesTestSummary(OSUpdatesTestSummary securityUpdatesTestSummary) { + if (this.innerProperties() == null) { + this.innerProperties = new TestSummaryProperties(); + } + this.innerProperties().withSecurityUpdatesTestSummary(securityUpdatesTestSummary); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeProperties.java new file mode 100644 index 000000000000..49dd73f11dca --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Test Type properties. */ +@Fluent +public final class TestTypeProperties { + /* + * The actual name of a test type of a Test Base Account. + */ + @JsonProperty(value = "actualTestTypeName") + private String actualTestTypeName; + + /** + * Get the actualTestTypeName property: The actual name of a test type of a Test Base Account. + * + * @return the actualTestTypeName value. + */ + public String actualTestTypeName() { + return this.actualTestTypeName; + } + + /** + * Set the actualTestTypeName property: The actual name of a test type of a Test Base Account. + * + * @param actualTestTypeName the actualTestTypeName value to set. + * @return the TestTypeProperties object itself. + */ + public TestTypeProperties withActualTestTypeName(String actualTestTypeName) { + this.actualTestTypeName = actualTestTypeName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeResourceInner.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeResourceInner.java new file mode 100644 index 000000000000..5723c615624e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/TestTypeResourceInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The test type resource. */ +@Fluent +public final class TestTypeResourceInner extends ProxyResource { + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Test Type properties. + */ + @JsonProperty(value = "properties") + private TestTypeProperties innerProperties; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: Test Type properties. + * + * @return the innerProperties value. + */ + private TestTypeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the actualTestTypeName property: The actual name of a test type of a Test Base Account. + * + * @return the actualTestTypeName value. + */ + public String actualTestTypeName() { + return this.innerProperties() == null ? null : this.innerProperties().actualTestTypeName(); + } + + /** + * Set the actualTestTypeName property: The actual name of a test type of a Test Base Account. + * + * @param actualTestTypeName the actualTestTypeName value to set. + * @return the TestTypeResourceInner object itself. + */ + public TestTypeResourceInner withActualTestTypeName(String actualTestTypeName) { + if (this.innerProperties() == null) { + this.innerProperties = new TestTypeProperties(); + } + this.innerProperties().withActualTestTypeName(actualTestTypeName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/package-info.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/package-info.java new file mode 100644 index 000000000000..f0d20e743c07 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for TestBase. Test Base. */ +package com.azure.resourcemanager.testbase.fluent.models; diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/package-info.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/package-info.java new file mode 100644 index 000000000000..efe6af017bcd --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for TestBase. Test Base. */ +package com.azure.resourcemanager.testbase.fluent; diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultSingletonResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultSingletonResourceImpl.java new file mode 100644 index 000000000000..486ff9d0b9ed --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultSingletonResourceImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceInner; +import com.azure.resourcemanager.testbase.models.AnalysisResultSingletonResource; +import com.azure.resourcemanager.testbase.models.Grade; + +public final class AnalysisResultSingletonResourceImpl implements AnalysisResultSingletonResource { + private AnalysisResultSingletonResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + AnalysisResultSingletonResourceImpl( + AnalysisResultSingletonResourceInner innerObject, + com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Grade grade() { + return this.innerModel().grade(); + } + + public AnalysisResultSingletonResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsClientImpl.java new file mode 100644 index 000000000000..4ffecf405fc1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsClientImpl.java @@ -0,0 +1,577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.AnalysisResultsClient; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceInner; +import com.azure.resourcemanager.testbase.models.AnalysisResultListResult; +import com.azure.resourcemanager.testbase.models.AnalysisResultName; +import com.azure.resourcemanager.testbase.models.AnalysisResultType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AnalysisResultsClient. */ +public final class AnalysisResultsClientImpl implements AnalysisResultsClient { + /** The proxy service used to perform REST calls. */ + private final AnalysisResultsService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of AnalysisResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AnalysisResultsClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(AnalysisResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseAnalysisResults to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseAnalysisResu") + private interface AnalysisResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}" + + "/analysisResults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("testResultName") String testResultName, + @QueryParam("analysisResultType") AnalysisResultType analysisResultType, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}" + + "/analysisResults/{analysisResultName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("testResultName") String testResultName, + @PathParam("analysisResultName") AnalysisResultName analysisResultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + if (analysisResultType == null) { + return Mono + .error(new IllegalArgumentException("Parameter analysisResultType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultType, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + if (analysisResultType == null) { + return Mono + .error(new IllegalArgumentException("Parameter analysisResultType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultType, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultType)); + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultType, context)); + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType) { + return new PagedIterable<>( + listAsync(resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultType)); + } + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType, + Context context) { + return new PagedIterable<>( + listAsync( + resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultType, context)); + } + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + if (analysisResultName == null) { + return Mono + .error(new IllegalArgumentException("Parameter analysisResultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + if (analysisResultName == null) { + return Mono + .error(new IllegalArgumentException("Parameter analysisResultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + analysisResultName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName) { + return getWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AnalysisResultSingletonResourceInner get( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName) { + return getAsync(resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultName) + .block(); + } + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName, + Context context) { + return getWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultName, context) + .block(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsImpl.java new file mode 100644 index 000000000000..9c00bf41b5d8 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AnalysisResultsImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.AnalysisResultsClient; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceInner; +import com.azure.resourcemanager.testbase.models.AnalysisResultName; +import com.azure.resourcemanager.testbase.models.AnalysisResultSingletonResource; +import com.azure.resourcemanager.testbase.models.AnalysisResultType; +import com.azure.resourcemanager.testbase.models.AnalysisResults; + +public final class AnalysisResultsImpl implements AnalysisResults { + private static final ClientLogger LOGGER = new ClientLogger(AnalysisResultsImpl.class); + + private final AnalysisResultsClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public AnalysisResultsImpl( + AnalysisResultsClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultType); + return Utils.mapPage(inner, inner1 -> new AnalysisResultSingletonResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultType, context); + return Utils.mapPage(inner, inner1 -> new AnalysisResultSingletonResourceImpl(inner1, this.manager())); + } + + public AnalysisResultSingletonResource get( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName) { + AnalysisResultSingletonResourceInner inner = + this + .serviceClient() + .get(resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultName); + if (inner != null) { + return new AnalysisResultSingletonResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, testBaseAccountName, packageName, testResultName, analysisResultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AnalysisResultSingletonResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AnalysisResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSClientImpl.java new file mode 100644 index 000000000000..fb54207a6dc9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSClientImpl.java @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.AvailableOSClient; +import com.azure.resourcemanager.testbase.fluent.models.AvailableOSResourceInner; +import com.azure.resourcemanager.testbase.models.AvailableOSListResult; +import com.azure.resourcemanager.testbase.models.OsUpdateType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableOSClient. */ +public final class AvailableOSClientImpl implements AvailableOSClient { + /** The proxy service used to perform REST calls. */ + private final AvailableOSService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of AvailableOSClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableOSClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(AvailableOSService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseAvailableOS to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseAvailableOS") + private interface AvailableOSService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/availableOSs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("osUpdateType") OsUpdateType osUpdateType, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/availableOSs/{availableOSResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("availableOSResourceName") String availableOSResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (osUpdateType == null) { + return Mono.error(new IllegalArgumentException("Parameter osUpdateType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + osUpdateType, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (osUpdateType == null) { + return Mono.error(new IllegalArgumentException("Parameter osUpdateType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + osUpdateType, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, osUpdateType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, osUpdateType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, osUpdateType)); + } + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, osUpdateType, context)); + } + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (availableOSResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availableOSResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + availableOSResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (availableOSResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availableOSResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + availableOSResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, availableOSResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AvailableOSResourceInner get( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName) { + return getAsync(resourceGroupName, testBaseAccountName, availableOSResourceName).block(); + } + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, availableOSResourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSImpl.java new file mode 100644 index 000000000000..cec14ada1542 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.AvailableOSClient; +import com.azure.resourcemanager.testbase.fluent.models.AvailableOSResourceInner; +import com.azure.resourcemanager.testbase.models.AvailableOS; +import com.azure.resourcemanager.testbase.models.AvailableOSResource; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +public final class AvailableOSImpl implements AvailableOS { + private static final ClientLogger LOGGER = new ClientLogger(AvailableOSImpl.class); + + private final AvailableOSClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public AvailableOSImpl( + AvailableOSClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, osUpdateType); + return Utils.mapPage(inner, inner1 -> new AvailableOSResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, osUpdateType, context); + return Utils.mapPage(inner, inner1 -> new AvailableOSResourceImpl(inner1, this.manager())); + } + + public AvailableOSResource get( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName) { + AvailableOSResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, availableOSResourceName); + if (inner != null) { + return new AvailableOSResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, testBaseAccountName, availableOSResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AvailableOSResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AvailableOSClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSResourceImpl.java new file mode 100644 index 000000000000..ba22f7a0f3ba --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/AvailableOSResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.AvailableOSResourceInner; +import com.azure.resourcemanager.testbase.models.AvailableOSResource; + +public final class AvailableOSResourceImpl implements AvailableOSResource { + private AvailableOSResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + AvailableOSResourceImpl( + AvailableOSResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String osId() { + return this.innerModel().osId(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String osVersion() { + return this.innerModel().osVersion(); + } + + public String insiderChannel() { + return this.innerModel().insiderChannel(); + } + + public String osUpdateType() { + return this.innerModel().osUpdateType(); + } + + public String osPlatform() { + return this.innerModel().osPlatform(); + } + + public AvailableOSResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CheckNameAvailabilityResultImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..9d8d566d3676 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.testbase.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.testbase.models.Reason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventResourceImpl.java new file mode 100644 index 000000000000..4ac45c5efb18 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventResourceImpl.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner; +import com.azure.resourcemanager.testbase.models.CustomerEventResource; +import com.azure.resourcemanager.testbase.models.NotificationEventReceiver; +import java.util.Collections; +import java.util.List; + +public final class CustomerEventResourceImpl implements CustomerEventResource, CustomerEventResource.Definition { + private CustomerEventResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + CustomerEventResourceImpl( + CustomerEventResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String eventName() { + return this.innerModel().eventName(); + } + + public List receivers() { + List inner = this.innerModel().receivers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CustomerEventResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String testBaseAccountName; + + private String customerEventName; + + public CustomerEventResourceImpl withExistingTestBaseAccount(String resourceGroupName, String testBaseAccountName) { + this.resourceGroupName = resourceGroupName; + this.testBaseAccountName = testBaseAccountName; + return this; + } + + public CustomerEventResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerEvents() + .create(resourceGroupName, testBaseAccountName, customerEventName, this.innerModel(), Context.NONE); + return this; + } + + public CustomerEventResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerEvents() + .create(resourceGroupName, testBaseAccountName, customerEventName, this.innerModel(), context); + return this; + } + + CustomerEventResourceImpl(String name, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = new CustomerEventResourceInner(); + this.serviceManager = serviceManager; + this.customerEventName = name; + } + + public CustomerEventResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerEvents() + .getWithResponse(resourceGroupName, testBaseAccountName, customerEventName, Context.NONE) + .getValue(); + return this; + } + + public CustomerEventResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomerEvents() + .getWithResponse(resourceGroupName, testBaseAccountName, customerEventName, context) + .getValue(); + return this; + } + + public CustomerEventResourceImpl withEventName(String eventName) { + this.innerModel().withEventName(eventName); + return this; + } + + public CustomerEventResourceImpl withReceivers(List receivers) { + this.innerModel().withReceivers(receivers); + return this; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsClientImpl.java new file mode 100644 index 000000000000..5dd573c90b35 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsClientImpl.java @@ -0,0 +1,1159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.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.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.testbase.fluent.CustomerEventsClient; +import com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner; +import com.azure.resourcemanager.testbase.models.CustomerEventListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomerEventsClient. */ +public final class CustomerEventsClientImpl implements CustomerEventsClient { + /** The proxy service used to perform REST calls. */ + private final CustomerEventsService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of CustomerEventsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomerEventsClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(CustomerEventsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseCustomerEvents to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseCustomerEven") + private interface CustomerEventsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/customerEvents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTestBaseAccount( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/customerEvents/{customerEventName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("customerEventName") String customerEventName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CustomerEventResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/customerEvents/{customerEventName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("customerEventName") String customerEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/customerEvents/{customerEventName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("customerEventName") String customerEventName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTestBaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountSinglePageAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTestBaseAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountSinglePageAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTestBaseAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTestBaseAccountAsync( + String resourceGroupName, String testBaseAccountName) { + return new PagedFlux<>( + () -> listByTestBaseAccountSinglePageAsync(resourceGroupName, testBaseAccountName), + nextLink -> listByTestBaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTestBaseAccountAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedFlux<>( + () -> listByTestBaseAccountSinglePageAsync(resourceGroupName, testBaseAccountName, context), + nextLink -> listByTestBaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName) { + return new PagedIterable<>(listByTestBaseAccountAsync(resourceGroupName, testBaseAccountName)); + } + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedIterable<>(listByTestBaseAccountAsync(resourceGroupName, testBaseAccountName, context)); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (customerEventName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customerEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + customerEventName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (customerEventName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customerEventName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + customerEventName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomerEventResourceInner> beginCreateAsync( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomerEventResourceInner.class, + CustomerEventResourceInner.class, + this.client.getContext()); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomerEventResourceInner> beginCreateAsync( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomerEventResourceInner.class, + CustomerEventResourceInner.class, + context); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomerEventResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters).getSyncPoller(); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomerEventResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomerEventResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters) { + return createAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters).block(); + } + + /** + * Create or replace a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param parameters Parameters supplied to create a Test Base CustomerEvent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Customer Notification Event resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomerEventResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String customerEventName, + CustomerEventResourceInner parameters, + Context context) { + return createAsync(resourceGroupName, testBaseAccountName, customerEventName, parameters, context).block(); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (customerEventName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customerEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + customerEventName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (customerEventName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customerEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + customerEventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, testBaseAccountName, customerEventName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, testBaseAccountName, customerEventName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String customerEventName) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, customerEventName).getSyncPoller(); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, customerEventName, context).getSyncPoller(); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String testBaseAccountName, String customerEventName) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, customerEventName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, customerEventName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String testBaseAccountName, String customerEventName) { + deleteAsync(resourceGroupName, testBaseAccountName, customerEventName).block(); + } + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + deleteAsync(resourceGroupName, testBaseAccountName, customerEventName, context).block(); + } + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (customerEventName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customerEventName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + customerEventName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (customerEventName == null) { + return Mono + .error(new IllegalArgumentException("Parameter customerEventName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + customerEventName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String customerEventName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, customerEventName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomerEventResourceInner get( + String resourceGroupName, String testBaseAccountName, String customerEventName) { + return getAsync(resourceGroupName, testBaseAccountName, customerEventName).block(); + } + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, customerEventName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByTestBaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTestBaseAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsImpl.java new file mode 100644 index 000000000000..c877690dea95 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/CustomerEventsImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.CustomerEventsClient; +import com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner; +import com.azure.resourcemanager.testbase.models.CustomerEventResource; +import com.azure.resourcemanager.testbase.models.CustomerEvents; + +public final class CustomerEventsImpl implements CustomerEvents { + private static final ClientLogger LOGGER = new ClientLogger(CustomerEventsImpl.class); + + private final CustomerEventsClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public CustomerEventsImpl( + CustomerEventsClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName) { + PagedIterable inner = + this.serviceClient().listByTestBaseAccount(resourceGroupName, testBaseAccountName); + return Utils.mapPage(inner, inner1 -> new CustomerEventResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context) { + PagedIterable inner = + this.serviceClient().listByTestBaseAccount(resourceGroupName, testBaseAccountName, context); + return Utils.mapPage(inner, inner1 -> new CustomerEventResourceImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String testBaseAccountName, String customerEventName) { + this.serviceClient().delete(resourceGroupName, testBaseAccountName, customerEventName); + } + + public void delete( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + this.serviceClient().delete(resourceGroupName, testBaseAccountName, customerEventName, context); + } + + public CustomerEventResource get(String resourceGroupName, String testBaseAccountName, String customerEventName) { + CustomerEventResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, customerEventName); + if (inner != null) { + return new CustomerEventResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, testBaseAccountName, customerEventName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomerEventResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomerEventResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String customerEventName = Utils.getValueFromIdByName(id, "customerEvents"); + if (customerEventName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'customerEvents'.", id))); + } + return this.getWithResponse(resourceGroupName, testBaseAccountName, customerEventName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String customerEventName = Utils.getValueFromIdByName(id, "customerEvents"); + if (customerEventName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'customerEvents'.", id))); + } + return this.getWithResponse(resourceGroupName, testBaseAccountName, customerEventName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String customerEventName = Utils.getValueFromIdByName(id, "customerEvents"); + if (customerEventName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'customerEvents'.", id))); + } + this.delete(resourceGroupName, testBaseAccountName, customerEventName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String customerEventName = Utils.getValueFromIdByName(id, "customerEvents"); + if (customerEventName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'customerEvents'.", id))); + } + this.delete(resourceGroupName, testBaseAccountName, customerEventName, context); + } + + private CustomerEventsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + public CustomerEventResourceImpl define(String name) { + return new CustomerEventResourceImpl(name, this.manager()); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/DownloadUrlResponseImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/DownloadUrlResponseImpl.java new file mode 100644 index 000000000000..2cf6c91680a3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/DownloadUrlResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import com.azure.resourcemanager.testbase.models.DownloadUrlResponse; +import java.time.OffsetDateTime; + +public final class DownloadUrlResponseImpl implements DownloadUrlResponse { + private DownloadUrlResponseInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + DownloadUrlResponseImpl( + DownloadUrlResponseInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String downloadUrl() { + return this.innerModel().downloadUrl(); + } + + public OffsetDateTime expirationTime() { + return this.innerModel().expirationTime(); + } + + public DownloadUrlResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventResourceImpl.java new file mode 100644 index 000000000000..f597cb5dd50d --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventResourceImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.EmailEventResourceInner; +import com.azure.resourcemanager.testbase.models.EmailEventResource; + +public final class EmailEventResourceImpl implements EmailEventResource { + private EmailEventResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + EmailEventResourceImpl( + EmailEventResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String eventId() { + return this.innerModel().eventId(); + } + + public String eventName() { + return this.innerModel().eventName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public EmailEventResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsClientImpl.java new file mode 100644 index 000000000000..f02977317ca9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsClientImpl.java @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.EmailEventsClient; +import com.azure.resourcemanager.testbase.fluent.models.EmailEventResourceInner; +import com.azure.resourcemanager.testbase.models.EmailEventListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EmailEventsClient. */ +public final class EmailEventsClientImpl implements EmailEventsClient { + /** The proxy service used to perform REST calls. */ + private final EmailEventsService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of EmailEventsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EmailEventsClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(EmailEventsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseEmailEvents to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseEmailEvents") + private interface EmailEventsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/emailEvents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/emailEvents/{emailEventResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("emailEventResourceName") String emailEventResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String testBaseAccountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName)); + } + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, context)); + } + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (emailEventResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter emailEventResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + emailEventResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (emailEventResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter emailEventResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + emailEventResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, emailEventResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EmailEventResourceInner get( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName) { + return getAsync(resourceGroupName, testBaseAccountName, emailEventResourceName).block(); + } + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, emailEventResourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsImpl.java new file mode 100644 index 000000000000..20ee26119869 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/EmailEventsImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.EmailEventsClient; +import com.azure.resourcemanager.testbase.fluent.models.EmailEventResourceInner; +import com.azure.resourcemanager.testbase.models.EmailEventResource; +import com.azure.resourcemanager.testbase.models.EmailEvents; + +public final class EmailEventsImpl implements EmailEvents { + private static final ClientLogger LOGGER = new ClientLogger(EmailEventsImpl.class); + + private final EmailEventsClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public EmailEventsImpl( + EmailEventsClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName); + return Utils.mapPage(inner, inner1 -> new EmailEventResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, context); + return Utils.mapPage(inner, inner1 -> new EmailEventResourceImpl(inner1, this.manager())); + } + + public EmailEventResource get(String resourceGroupName, String testBaseAccountName, String emailEventResourceName) { + EmailEventResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, emailEventResourceName); + if (inner != null) { + return new EmailEventResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, testBaseAccountName, emailEventResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EmailEventResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private EmailEventsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessResourceImpl.java new file mode 100644 index 000000000000..85349088eaa3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessResourceImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.FavoriteProcessResourceInner; +import com.azure.resourcemanager.testbase.models.FavoriteProcessResource; + +public final class FavoriteProcessResourceImpl implements FavoriteProcessResource, FavoriteProcessResource.Definition { + private FavoriteProcessResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + FavoriteProcessResourceImpl( + FavoriteProcessResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String actualProcessName() { + return this.innerModel().actualProcessName(); + } + + public FavoriteProcessResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String testBaseAccountName; + + private String packageName; + + private String favoriteProcessResourceName; + + public FavoriteProcessResourceImpl withExistingPackage( + String resourceGroupName, String testBaseAccountName, String packageName) { + this.resourceGroupName = resourceGroupName; + this.testBaseAccountName = testBaseAccountName; + this.packageName = packageName; + return this; + } + + public FavoriteProcessResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getFavoriteProcesses() + .createWithResponse( + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public FavoriteProcessResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFavoriteProcesses() + .createWithResponse( + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.innerModel(), + context) + .getValue(); + return this; + } + + FavoriteProcessResourceImpl(String name, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = new FavoriteProcessResourceInner(); + this.serviceManager = serviceManager; + this.favoriteProcessResourceName = name; + } + + public FavoriteProcessResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFavoriteProcesses() + .getWithResponse( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, Context.NONE) + .getValue(); + return this; + } + + public FavoriteProcessResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFavoriteProcesses() + .getWithResponse( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, context) + .getValue(); + return this; + } + + public FavoriteProcessResourceImpl withActualProcessName(String actualProcessName) { + this.innerModel().withActualProcessName(actualProcessName); + return this; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesClientImpl.java new file mode 100644 index 000000000000..5ada2085e489 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesClientImpl.java @@ -0,0 +1,1059 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.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.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.FavoriteProcessesClient; +import com.azure.resourcemanager.testbase.fluent.models.FavoriteProcessResourceInner; +import com.azure.resourcemanager.testbase.models.FavoriteProcessListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FavoriteProcessesClient. */ +public final class FavoriteProcessesClientImpl implements FavoriteProcessesClient { + /** The proxy service used to perform REST calls. */ + private final FavoriteProcessesService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of FavoriteProcessesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FavoriteProcessesClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(FavoriteProcessesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseFavoriteProcesses to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseFavoriteProc") + private interface FavoriteProcessesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses" + + "/{favoriteProcessResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("favoriteProcessResourceName") String favoriteProcessResourceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FavoriteProcessResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses" + + "/{favoriteProcessResourceName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("favoriteProcessResourceName") String favoriteProcessResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/favoriteProcesses" + + "/{favoriteProcessResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("favoriteProcessResourceName") String favoriteProcessResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, packageName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, packageName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, packageName)); + } + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, packageName, context)); + } + + /** + * Create or replace a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process identifier along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + FavoriteProcessResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (favoriteProcessResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter favoriteProcessResourceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process identifier along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + FavoriteProcessResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (favoriteProcessResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter favoriteProcessResourceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or replace a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process identifier on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + FavoriteProcessResourceInner parameters) { + return createWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or replace a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FavoriteProcessResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + FavoriteProcessResourceInner parameters) { + return createAsync(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, parameters) + .block(); + } + + /** + * Create or replace a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param parameters Parameters supplied to create a favorite process in a package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process identifier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + FavoriteProcessResourceInner parameters, + Context context) { + return createWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, parameters, context) + .block(); + } + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (favoriteProcessResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter favoriteProcessResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (favoriteProcessResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter favoriteProcessResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + return deleteWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + deleteAsync(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName).block(); + } + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context) { + return deleteWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, context) + .block(); + } + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (favoriteProcessResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter favoriteProcessResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (favoriteProcessResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter favoriteProcessResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + favoriteProcessResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FavoriteProcessResourceInner get( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + return getAsync(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName).block(); + } + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context) { + return getWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesImpl.java new file mode 100644 index 000000000000..d1c6e7357b59 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FavoriteProcessesImpl.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.FavoriteProcessesClient; +import com.azure.resourcemanager.testbase.fluent.models.FavoriteProcessResourceInner; +import com.azure.resourcemanager.testbase.models.FavoriteProcessResource; +import com.azure.resourcemanager.testbase.models.FavoriteProcesses; + +public final class FavoriteProcessesImpl implements FavoriteProcesses { + private static final ClientLogger LOGGER = new ClientLogger(FavoriteProcessesImpl.class); + + private final FavoriteProcessesClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public FavoriteProcessesImpl( + FavoriteProcessesClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, packageName); + return Utils.mapPage(inner, inner1 -> new FavoriteProcessResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, packageName, context); + return Utils.mapPage(inner, inner1 -> new FavoriteProcessResourceImpl(inner1, this.manager())); + } + + public void delete( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + this.serviceClient().delete(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context) { + return this + .serviceClient() + .deleteWithResponse( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, context); + } + + public FavoriteProcessResource get( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName) { + FavoriteProcessResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName); + if (inner != null) { + return new FavoriteProcessResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FavoriteProcessResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FavoriteProcessResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String favoriteProcessResourceName = Utils.getValueFromIdByName(id, "favoriteProcesses"); + if (favoriteProcessResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'favoriteProcesses'.", id))); + } + return this + .getWithResponse( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String favoriteProcessResourceName = Utils.getValueFromIdByName(id, "favoriteProcesses"); + if (favoriteProcessResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'favoriteProcesses'.", id))); + } + return this + .getWithResponse(resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String favoriteProcessResourceName = Utils.getValueFromIdByName(id, "favoriteProcesses"); + if (favoriteProcessResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'favoriteProcesses'.", id))); + } + this + .deleteWithResponse( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + String favoriteProcessResourceName = Utils.getValueFromIdByName(id, "favoriteProcesses"); + if (favoriteProcessResourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'favoriteProcesses'.", id))); + } + return this + .deleteWithResponse( + resourceGroupName, testBaseAccountName, packageName, favoriteProcessResourceName, context); + } + + private FavoriteProcessesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + public FavoriteProcessResourceImpl define(String name) { + return new FavoriteProcessResourceImpl(name, this.manager()); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FileUploadUrlResponseImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FileUploadUrlResponseImpl.java new file mode 100644 index 000000000000..c3d9bdd0421e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FileUploadUrlResponseImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.FileUploadUrlResponseInner; +import com.azure.resourcemanager.testbase.models.FileUploadUrlResponse; + +public final class FileUploadUrlResponseImpl implements FileUploadUrlResponse { + private FileUploadUrlResponseInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + FileUploadUrlResponseImpl( + FileUploadUrlResponseInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String uploadUrl() { + return this.innerModel().uploadUrl(); + } + + public String blobPath() { + return this.innerModel().blobPath(); + } + + public FileUploadUrlResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingResourceImpl.java new file mode 100644 index 000000000000..ceb712ee4f27 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingResourceImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.FlightingRingResourceInner; +import com.azure.resourcemanager.testbase.models.FlightingRingResource; + +public final class FlightingRingResourceImpl implements FlightingRingResource { + private FlightingRingResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + FlightingRingResourceImpl( + FlightingRingResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String actualFlightingRingName() { + return this.innerModel().actualFlightingRingName(); + } + + public FlightingRingResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsClientImpl.java new file mode 100644 index 000000000000..0337b8810723 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsClientImpl.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.FlightingRingsClient; +import com.azure.resourcemanager.testbase.fluent.models.FlightingRingResourceInner; +import com.azure.resourcemanager.testbase.models.FlightingRingListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FlightingRingsClient. */ +public final class FlightingRingsClientImpl implements FlightingRingsClient { + /** The proxy service used to perform REST calls. */ + private final FlightingRingsService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of FlightingRingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FlightingRingsClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(FlightingRingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseFlightingRings to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseFlightingRin") + private interface FlightingRingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/flightingRings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/flightingRings/{flightingRingResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("flightingRingResourceName") String flightingRingResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String testBaseAccountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName)); + } + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, context)); + } + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (flightingRingResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter flightingRingResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + flightingRingResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (flightingRingResourceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter flightingRingResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + flightingRingResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, flightingRingResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlightingRingResourceInner get( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName) { + return getAsync(resourceGroupName, testBaseAccountName, flightingRingResourceName).block(); + } + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, flightingRingResourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsImpl.java new file mode 100644 index 000000000000..1543824636bc --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/FlightingRingsImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.FlightingRingsClient; +import com.azure.resourcemanager.testbase.fluent.models.FlightingRingResourceInner; +import com.azure.resourcemanager.testbase.models.FlightingRingResource; +import com.azure.resourcemanager.testbase.models.FlightingRings; + +public final class FlightingRingsImpl implements FlightingRings { + private static final ClientLogger LOGGER = new ClientLogger(FlightingRingsImpl.class); + + private final FlightingRingsClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public FlightingRingsImpl( + FlightingRingsClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName); + return Utils.mapPage(inner, inner1 -> new FlightingRingResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, context); + return Utils.mapPage(inner, inner1 -> new FlightingRingResourceImpl(inner1, this.manager())); + } + + public FlightingRingResource get( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName) { + FlightingRingResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, flightingRingResourceName); + if (inner != null) { + return new FlightingRingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, testBaseAccountName, flightingRingResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FlightingRingResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private FlightingRingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdateResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdateResourceImpl.java new file mode 100644 index 000000000000..cadc31481311 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdateResourceImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.OSUpdateResourceInner; +import com.azure.resourcemanager.testbase.models.OSUpdateResource; +import com.azure.resourcemanager.testbase.models.Type; +import java.time.OffsetDateTime; + +public final class OSUpdateResourceImpl implements OSUpdateResource { + private OSUpdateResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + OSUpdateResourceImpl( + OSUpdateResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String release() { + return this.innerModel().release(); + } + + public String flightingRing() { + return this.innerModel().flightingRing(); + } + + public String buildVersion() { + return this.innerModel().buildVersion(); + } + + public String buildRevision() { + return this.innerModel().buildRevision(); + } + + public Type typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public OffsetDateTime releaseVersionDate() { + return this.innerModel().releaseVersionDate(); + } + + public OSUpdateResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesClientImpl.java new file mode 100644 index 000000000000..6874e2261dc8 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesClientImpl.java @@ -0,0 +1,592 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.OSUpdatesClient; +import com.azure.resourcemanager.testbase.fluent.models.OSUpdateResourceInner; +import com.azure.resourcemanager.testbase.models.OSUpdateListResult; +import com.azure.resourcemanager.testbase.models.OsUpdateType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OSUpdatesClient. */ +public final class OSUpdatesClientImpl implements OSUpdatesClient { + /** The proxy service used to perform REST calls. */ + private final OSUpdatesService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of OSUpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OSUpdatesClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(OSUpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseOSUpdates to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseOSUpdates") + private interface OSUpdatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/osUpdates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("osUpdateType") OsUpdateType osUpdateType, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/osUpdates/{osUpdateResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("osUpdateResourceName") String osUpdateResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (osUpdateType == null) { + return Mono.error(new IllegalArgumentException("Parameter osUpdateType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (osUpdateType == null) { + return Mono.error(new IllegalArgumentException("Parameter osUpdateType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType)); + } + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType, context)); + } + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String osUpdateResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (osUpdateResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter osUpdateResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String osUpdateResourceName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (osUpdateResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter osUpdateResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String osUpdateResourceName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OSUpdateResourceInner get( + String resourceGroupName, String testBaseAccountName, String packageName, String osUpdateResourceName) { + return getAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateResourceName).block(); + } + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String osUpdateResourceName, + Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateResourceName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesImpl.java new file mode 100644 index 000000000000..9553d20320c6 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OSUpdatesImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.OSUpdatesClient; +import com.azure.resourcemanager.testbase.fluent.models.OSUpdateResourceInner; +import com.azure.resourcemanager.testbase.models.OSUpdateResource; +import com.azure.resourcemanager.testbase.models.OSUpdates; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +public final class OSUpdatesImpl implements OSUpdates { + private static final ClientLogger LOGGER = new ClientLogger(OSUpdatesImpl.class); + + private final OSUpdatesClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public OSUpdatesImpl( + OSUpdatesClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, packageName, osUpdateType); + return Utils.mapPage(inner, inner1 -> new OSUpdateResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, packageName, osUpdateType, context); + return Utils.mapPage(inner, inner1 -> new OSUpdateResourceImpl(inner1, this.manager())); + } + + public OSUpdateResource get( + String resourceGroupName, String testBaseAccountName, String packageName, String osUpdateResourceName) { + OSUpdateResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, packageName, osUpdateResourceName); + if (inner != null) { + return new OSUpdateResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String osUpdateResourceName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, testBaseAccountName, packageName, osUpdateResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OSUpdateResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OSUpdatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationImpl.java new file mode 100644 index 000000000000..ebfa56628e2e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.OperationInner; +import com.azure.resourcemanager.testbase.models.Operation; +import com.azure.resourcemanager.testbase.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..3d1c919b5f25 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.OperationsClient; +import com.azure.resourcemanager.testbase.fluent.models.OperationInner; +import com.azure.resourcemanager.testbase.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseOperations to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseOperations") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.TestBase/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsImpl.java new file mode 100644 index 000000000000..0352409a0bb0 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.OperationsClient; +import com.azure.resourcemanager.testbase.fluent.models.OperationInner; +import com.azure.resourcemanager.testbase.models.Operation; +import com.azure.resourcemanager.testbase.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackageResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackageResourceImpl.java new file mode 100644 index 000000000000..ba90f0d1b803 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackageResourceImpl.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; +import com.azure.resourcemanager.testbase.models.DownloadUrlResponse; +import com.azure.resourcemanager.testbase.models.PackageResource; +import com.azure.resourcemanager.testbase.models.PackageStatus; +import com.azure.resourcemanager.testbase.models.PackageUpdateParameters; +import com.azure.resourcemanager.testbase.models.PackageValidationResult; +import com.azure.resourcemanager.testbase.models.ProvisioningState; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.azure.resourcemanager.testbase.models.TestType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PackageResourceImpl implements PackageResource, PackageResource.Definition, PackageResource.Update { + private PackageResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String applicationName() { + return this.innerModel().applicationName(); + } + + public String version() { + return this.innerModel().version(); + } + + public List testTypes() { + List inner = this.innerModel().testTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List targetOSList() { + List inner = this.innerModel().targetOSList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PackageStatus packageStatus() { + return this.innerModel().packageStatus(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public String flightingRing() { + return this.innerModel().flightingRing(); + } + + public Boolean isEnabled() { + return this.innerModel().isEnabled(); + } + + public String blobPath() { + return this.innerModel().blobPath(); + } + + public List validationResults() { + List inner = this.innerModel().validationResults(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List tests() { + List inner = this.innerModel().tests(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PackageResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String testBaseAccountName; + + private String packageName; + + private PackageUpdateParameters updateParameters; + + public PackageResourceImpl withExistingTestBaseAccount(String resourceGroupName, String testBaseAccountName) { + this.resourceGroupName = resourceGroupName; + this.testBaseAccountName = testBaseAccountName; + return this; + } + + public PackageResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getPackages() + .create(resourceGroupName, testBaseAccountName, packageName, this.innerModel(), Context.NONE); + return this; + } + + public PackageResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPackages() + .create(resourceGroupName, testBaseAccountName, packageName, this.innerModel(), context); + return this; + } + + PackageResourceImpl(String name, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = new PackageResourceInner(); + this.serviceManager = serviceManager; + this.packageName = name; + } + + public PackageResourceImpl update() { + this.updateParameters = new PackageUpdateParameters(); + return this; + } + + public PackageResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPackages() + .update(resourceGroupName, testBaseAccountName, packageName, updateParameters, Context.NONE); + return this; + } + + public PackageResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPackages() + .update(resourceGroupName, testBaseAccountName, packageName, updateParameters, context); + return this; + } + + PackageResourceImpl( + PackageResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.testBaseAccountName = Utils.getValueFromIdByName(innerObject.id(), "testBaseAccounts"); + this.packageName = Utils.getValueFromIdByName(innerObject.id(), "packages"); + } + + public PackageResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPackages() + .getWithResponse(resourceGroupName, testBaseAccountName, packageName, Context.NONE) + .getValue(); + return this; + } + + public PackageResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPackages() + .getWithResponse(resourceGroupName, testBaseAccountName, packageName, context) + .getValue(); + return this; + } + + public void hardDelete() { + serviceManager.packages().hardDelete(resourceGroupName, testBaseAccountName, packageName); + } + + public void hardDelete(Context context) { + serviceManager.packages().hardDelete(resourceGroupName, testBaseAccountName, packageName, context); + } + + public DownloadUrlResponse getDownloadUrl() { + return serviceManager.packages().getDownloadUrl(resourceGroupName, testBaseAccountName, packageName); + } + + public Response getDownloadUrlWithResponse(Context context) { + return serviceManager + .packages() + .getDownloadUrlWithResponse(resourceGroupName, testBaseAccountName, packageName, context); + } + + public PackageResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PackageResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PackageResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public PackageResourceImpl withApplicationName(String applicationName) { + this.innerModel().withApplicationName(applicationName); + return this; + } + + public PackageResourceImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public PackageResourceImpl withTargetOSList(List targetOSList) { + if (isInCreateMode()) { + this.innerModel().withTargetOSList(targetOSList); + return this; + } else { + this.updateParameters.withTargetOSList(targetOSList); + return this; + } + } + + public PackageResourceImpl withFlightingRing(String flightingRing) { + if (isInCreateMode()) { + this.innerModel().withFlightingRing(flightingRing); + return this; + } else { + this.updateParameters.withFlightingRing(flightingRing); + return this; + } + } + + public PackageResourceImpl withBlobPath(String blobPath) { + if (isInCreateMode()) { + this.innerModel().withBlobPath(blobPath); + return this; + } else { + this.updateParameters.withBlobPath(blobPath); + return this; + } + } + + public PackageResourceImpl withTests(List tests) { + if (isInCreateMode()) { + this.innerModel().withTests(tests); + return this; + } else { + this.updateParameters.withTests(tests); + return this; + } + } + + public PackageResourceImpl withIsEnabled(Boolean isEnabled) { + this.updateParameters.withIsEnabled(isEnabled); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesClientImpl.java new file mode 100644 index 000000000000..d4c45e552598 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesClientImpl.java @@ -0,0 +1,1907 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.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.Headers; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.testbase.fluent.PackagesClient; +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; +import com.azure.resourcemanager.testbase.models.PackageListResult; +import com.azure.resourcemanager.testbase.models.PackageUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PackagesClient. */ +public final class PackagesClientImpl implements PackagesClient { + /** The proxy service used to perform REST calls. */ + private final PackagesService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of PackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PackagesClientImpl(TestBaseImpl client) { + this.service = RestProxy.create(PackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBasePackages to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBasePackages") + private interface PackagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTestBaseAccount( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PackageResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PackageUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/hardDelete") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> hardDelete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/getDownloadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDownloadUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTestBaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountSinglePageAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTestBaseAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountSinglePageAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTestBaseAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTestBaseAccountAsync( + String resourceGroupName, String testBaseAccountName) { + return new PagedFlux<>( + () -> listByTestBaseAccountSinglePageAsync(resourceGroupName, testBaseAccountName), + nextLink -> listByTestBaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTestBaseAccountAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedFlux<>( + () -> listByTestBaseAccountSinglePageAsync(resourceGroupName, testBaseAccountName, context), + nextLink -> listByTestBaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName) { + return new PagedIterable<>(listByTestBaseAccountAsync(resourceGroupName, testBaseAccountName)); + } + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedIterable<>(listByTestBaseAccountAsync(resourceGroupName, testBaseAccountName, context)); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, PackageResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResourceInner> beginCreateAsync( + String resourceGroupName, String testBaseAccountName, String packageName, PackageResourceInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PackageResourceInner.class, + PackageResourceInner.class, + this.client.getContext()); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResourceInner> beginCreateAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PackageResourceInner.class, PackageResourceInner.class, context); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResourceInner> beginCreate( + String resourceGroupName, String testBaseAccountName, String packageName, PackageResourceInner parameters) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, packageName, parameters).getSyncPoller(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageResourceInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String testBaseAccountName, String packageName, PackageResourceInner parameters) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, packageName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageResourceInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResourceInner create( + String resourceGroupName, String testBaseAccountName, String packageName, PackageResourceInner parameters) { + return createAsync(resourceGroupName, testBaseAccountName, packageName, parameters).block(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to create a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResourceInner create( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageResourceInner parameters, + Context context) { + return createAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context).block(); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, PackageUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageUpdateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResourceInner> beginUpdateAsync( + String resourceGroupName, String testBaseAccountName, String packageName, PackageUpdateParameters parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PackageResourceInner.class, + PackageResourceInner.class, + this.client.getContext()); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PackageResourceInner> beginUpdateAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageUpdateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PackageResourceInner.class, PackageResourceInner.class, context); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResourceInner> beginUpdate( + String resourceGroupName, String testBaseAccountName, String packageName, PackageUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, packageName, parameters).getSyncPoller(); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PackageResourceInner> beginUpdate( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context) + .getSyncPoller(); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String testBaseAccountName, String packageName, PackageUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, packageName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResourceInner update( + String resourceGroupName, String testBaseAccountName, String packageName, PackageUpdateParameters parameters) { + return updateAsync(resourceGroupName, testBaseAccountName, packageName, parameters).block(); + } + + /** + * Update an existing Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param parameters Parameters supplied to update a Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Package resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResourceInner update( + String resourceGroupName, + String testBaseAccountName, + String packageName, + PackageUpdateParameters parameters, + Context context) { + return updateAsync(resourceGroupName, testBaseAccountName, packageName, parameters, context).block(); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, testBaseAccountName, packageName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String packageName) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, packageName).getSyncPoller(); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, packageName, context).getSyncPoller(); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String testBaseAccountName, String packageName) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, packageName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, packageName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String testBaseAccountName, String packageName) { + deleteAsync(resourceGroupName, testBaseAccountName, packageName).block(); + } + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + deleteAsync(resourceGroupName, testBaseAccountName, packageName, context).block(); + } + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, packageName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageResourceInner get(String resourceGroupName, String testBaseAccountName, String packageName) { + return getAsync(resourceGroupName, testBaseAccountName, packageName).block(); + } + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, context).block(); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> hardDeleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .hardDelete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> hardDeleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .hardDelete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginHardDeleteAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + Mono>> mono = + hardDeleteWithResponseAsync(resourceGroupName, testBaseAccountName, packageName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginHardDeleteAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + hardDeleteWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginHardDelete( + String resourceGroupName, String testBaseAccountName, String packageName) { + return beginHardDeleteAsync(resourceGroupName, testBaseAccountName, packageName).getSyncPoller(); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginHardDelete( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return beginHardDeleteAsync(resourceGroupName, testBaseAccountName, packageName, context).getSyncPoller(); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono hardDeleteAsync(String resourceGroupName, String testBaseAccountName, String packageName) { + return beginHardDeleteAsync(resourceGroupName, testBaseAccountName, packageName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono hardDeleteAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return beginHardDeleteAsync(resourceGroupName, testBaseAccountName, packageName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName) { + hardDeleteAsync(resourceGroupName, testBaseAccountName, packageName).block(); + } + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + hardDeleteAsync(resourceGroupName, testBaseAccountName, packageName, context).block(); + } + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDownloadUrlWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDownloadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDownloadUrlWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDownloadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDownloadUrlAsync( + String resourceGroupName, String testBaseAccountName, String packageName) { + return getDownloadUrlWithResponseAsync(resourceGroupName, testBaseAccountName, packageName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlResponseInner getDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName) { + return getDownloadUrlAsync(resourceGroupName, testBaseAccountName, packageName).block(); + } + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDownloadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + return getDownloadUrlWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByTestBaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTestBaseAccountNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTestBaseAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesImpl.java new file mode 100644 index 000000000000..be8f68b7f232 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/PackagesImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.PackagesClient; +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; +import com.azure.resourcemanager.testbase.models.DownloadUrlResponse; +import com.azure.resourcemanager.testbase.models.PackageResource; +import com.azure.resourcemanager.testbase.models.Packages; + +public final class PackagesImpl implements Packages { + private static final ClientLogger LOGGER = new ClientLogger(PackagesImpl.class); + + private final PackagesClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public PackagesImpl(PackagesClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByTestBaseAccount(String resourceGroupName, String testBaseAccountName) { + PagedIterable inner = + this.serviceClient().listByTestBaseAccount(resourceGroupName, testBaseAccountName); + return Utils.mapPage(inner, inner1 -> new PackageResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context) { + PagedIterable inner = + this.serviceClient().listByTestBaseAccount(resourceGroupName, testBaseAccountName, context); + return Utils.mapPage(inner, inner1 -> new PackageResourceImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String testBaseAccountName, String packageName) { + this.serviceClient().delete(resourceGroupName, testBaseAccountName, packageName); + } + + public void delete(String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + this.serviceClient().delete(resourceGroupName, testBaseAccountName, packageName, context); + } + + public PackageResource get(String resourceGroupName, String testBaseAccountName, String packageName) { + PackageResourceInner inner = this.serviceClient().get(resourceGroupName, testBaseAccountName, packageName); + if (inner != null) { + return new PackageResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, testBaseAccountName, packageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PackageResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName) { + this.serviceClient().hardDelete(resourceGroupName, testBaseAccountName, packageName); + } + + public void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + this.serviceClient().hardDelete(resourceGroupName, testBaseAccountName, packageName, context); + } + + public DownloadUrlResponse getDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName) { + DownloadUrlResponseInner inner = + this.serviceClient().getDownloadUrl(resourceGroupName, testBaseAccountName, packageName); + if (inner != null) { + return new DownloadUrlResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDownloadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context) { + Response inner = + this + .serviceClient() + .getDownloadUrlWithResponse(resourceGroupName, testBaseAccountName, packageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DownloadUrlResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PackageResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + return this.getWithResponse(resourceGroupName, testBaseAccountName, packageName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + return this.getWithResponse(resourceGroupName, testBaseAccountName, packageName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + this.delete(resourceGroupName, testBaseAccountName, packageName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + String packageName = Utils.getValueFromIdByName(id, "packages"); + if (packageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'packages'.", id))); + } + this.delete(resourceGroupName, testBaseAccountName, packageName, context); + } + + private PackagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + public PackageResourceImpl define(String name) { + return new PackageResourceImpl(name, this.manager()); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusClientImpl.java new file mode 100644 index 000000000000..5335ee7ebd07 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusClientImpl.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.SkusClient; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSkuListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(TestBaseImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseSkus to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseSkus") + private interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.TestBase/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusImpl.java new file mode 100644 index 000000000000..57d853e8f6c2 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/SkusImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.SkusClient; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.Skus; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSku; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountSkuImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourceImpl.java new file mode 100644 index 000000000000..940b37a38700 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourceImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParametersInner; +import com.azure.resourcemanager.testbase.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.testbase.models.FileUploadUrlResponse; +import com.azure.resourcemanager.testbase.models.GetFileUploadUrlParameters; +import com.azure.resourcemanager.testbase.models.PackageCheckNameAvailabilityParameters; +import com.azure.resourcemanager.testbase.models.ProvisioningState; +import com.azure.resourcemanager.testbase.models.TestBaseAccountResource; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSku; +import java.util.Collections; +import java.util.Map; + +public final class TestBaseAccountResourceImpl + implements TestBaseAccountResource, TestBaseAccountResource.Definition, TestBaseAccountResource.Update { + private TestBaseAccountResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public TestBaseAccountSku sku() { + TestBaseAccountSkuInner inner = this.innerModel().sku(); + if (inner != null) { + return new TestBaseAccountSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public String accessLevel() { + return this.innerModel().accessLevel(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public TestBaseAccountResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String testBaseAccountName; + + private Boolean createRestore; + + private TestBaseAccountUpdateParametersInner updateParameters; + + public TestBaseAccountResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public TestBaseAccountResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getTestBaseAccounts() + .create(resourceGroupName, testBaseAccountName, this.innerModel(), createRestore, Context.NONE); + return this; + } + + public TestBaseAccountResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTestBaseAccounts() + .create(resourceGroupName, testBaseAccountName, this.innerModel(), createRestore, context); + return this; + } + + TestBaseAccountResourceImpl(String name, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = new TestBaseAccountResourceInner(); + this.serviceManager = serviceManager; + this.testBaseAccountName = name; + this.createRestore = null; + } + + public TestBaseAccountResourceImpl update() { + this.updateParameters = new TestBaseAccountUpdateParametersInner(); + return this; + } + + public TestBaseAccountResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTestBaseAccounts() + .update(resourceGroupName, testBaseAccountName, updateParameters, Context.NONE); + return this; + } + + public TestBaseAccountResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTestBaseAccounts() + .update(resourceGroupName, testBaseAccountName, updateParameters, context); + return this; + } + + TestBaseAccountResourceImpl( + TestBaseAccountResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.testBaseAccountName = Utils.getValueFromIdByName(innerObject.id(), "testBaseAccounts"); + } + + public TestBaseAccountResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTestBaseAccounts() + .getByResourceGroupWithResponse(resourceGroupName, testBaseAccountName, Context.NONE) + .getValue(); + return this; + } + + public TestBaseAccountResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTestBaseAccounts() + .getByResourceGroupWithResponse(resourceGroupName, testBaseAccountName, context) + .getValue(); + return this; + } + + public void offboard() { + serviceManager.testBaseAccounts().offboard(resourceGroupName, testBaseAccountName); + } + + public void offboard(Context context) { + serviceManager.testBaseAccounts().offboard(resourceGroupName, testBaseAccountName, context); + } + + public FileUploadUrlResponse getFileUploadUrl() { + return serviceManager.testBaseAccounts().getFileUploadUrl(resourceGroupName, testBaseAccountName); + } + + public Response getFileUploadUrlWithResponse( + GetFileUploadUrlParameters parameters, Context context) { + return serviceManager + .testBaseAccounts() + .getFileUploadUrlWithResponse(resourceGroupName, testBaseAccountName, parameters, context); + } + + public CheckNameAvailabilityResult checkPackageNameAvailability(PackageCheckNameAvailabilityParameters parameters) { + return serviceManager + .testBaseAccounts() + .checkPackageNameAvailability(resourceGroupName, testBaseAccountName, parameters); + } + + public Response checkPackageNameAvailabilityWithResponse( + PackageCheckNameAvailabilityParameters parameters, Context context) { + return serviceManager + .testBaseAccounts() + .checkPackageNameAvailabilityWithResponse(resourceGroupName, testBaseAccountName, parameters, context); + } + + public TestBaseAccountResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public TestBaseAccountResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public TestBaseAccountResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public TestBaseAccountResourceImpl withSku(TestBaseAccountSkuInner sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public TestBaseAccountResourceImpl withRestore(Boolean restore) { + this.createRestore = restore; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourcePropertiesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourcePropertiesImpl.java new file mode 100644 index 000000000000..5b5fecb36b46 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountResourcePropertiesImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourcePropertiesInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.ProvisioningState; +import com.azure.resourcemanager.testbase.models.TestBaseAccountResourceProperties; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSku; + +public final class TestBaseAccountResourcePropertiesImpl implements TestBaseAccountResourceProperties { + private TestBaseAccountResourcePropertiesInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestBaseAccountResourcePropertiesImpl( + TestBaseAccountResourcePropertiesInner innerObject, + com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public TestBaseAccountSku sku() { + TestBaseAccountSkuInner inner = this.innerModel().sku(); + if (inner != null) { + return new TestBaseAccountSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public String accessLevel() { + return this.innerModel().accessLevel(); + } + + public TestBaseAccountResourcePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountSkuImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountSkuImpl.java new file mode 100644 index 000000000000..92b7feb1416a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountSkuImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSku; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSkuCapability; +import com.azure.resourcemanager.testbase.models.Tier; +import java.util.Collections; +import java.util.List; + +public final class TestBaseAccountSkuImpl implements TestBaseAccountSku { + private TestBaseAccountSkuInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestBaseAccountSkuImpl( + TestBaseAccountSkuInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public Tier tier() { + return this.innerModel().tier(); + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TestBaseAccountSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParameterPropertiesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParameterPropertiesImpl.java new file mode 100644 index 000000000000..512f37387b5a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParameterPropertiesImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParameterPropertiesInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSku; +import com.azure.resourcemanager.testbase.models.TestBaseAccountUpdateParameterProperties; + +public final class TestBaseAccountUpdateParameterPropertiesImpl implements TestBaseAccountUpdateParameterProperties { + private TestBaseAccountUpdateParameterPropertiesInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestBaseAccountUpdateParameterPropertiesImpl( + TestBaseAccountUpdateParameterPropertiesInner innerObject, + com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public TestBaseAccountSku sku() { + TestBaseAccountSkuInner inner = this.innerModel().sku(); + if (inner != null) { + return new TestBaseAccountSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public TestBaseAccountUpdateParameterPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParametersImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParametersImpl.java new file mode 100644 index 000000000000..a31a593fb434 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUpdateParametersImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParametersInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountSku; +import com.azure.resourcemanager.testbase.models.TestBaseAccountUpdateParameters; +import java.util.Collections; +import java.util.Map; + +public final class TestBaseAccountUpdateParametersImpl implements TestBaseAccountUpdateParameters { + private TestBaseAccountUpdateParametersInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestBaseAccountUpdateParametersImpl( + TestBaseAccountUpdateParametersInner innerObject, + com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public TestBaseAccountSku sku() { + TestBaseAccountSkuInner inner = this.innerModel().sku(); + if (inner != null) { + return new TestBaseAccountSkuImpl(inner, this.manager()); + } else { + return null; + } + } + + public TestBaseAccountUpdateParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUsageDataImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUsageDataImpl.java new file mode 100644 index 000000000000..4e6235d2f556 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountUsageDataImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUsageDataInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountUsageData; +import com.azure.resourcemanager.testbase.models.TestBaseAccountUsageName; + +public final class TestBaseAccountUsageDataImpl implements TestBaseAccountUsageData { + private TestBaseAccountUsageDataInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestBaseAccountUsageDataImpl( + TestBaseAccountUsageDataInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public TestBaseAccountUsageName name() { + return this.innerModel().name(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public Long limit() { + return this.innerModel().limit(); + } + + public Long currentValue() { + return this.innerModel().currentValue(); + } + + public TestBaseAccountUsageDataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsClientImpl.java new file mode 100644 index 000000000000..dca88f7715bd --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsClientImpl.java @@ -0,0 +1,2404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.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.Headers; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.testbase.fluent.TestBaseAccountsClient; +import com.azure.resourcemanager.testbase.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.testbase.fluent.models.FileUploadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParametersInner; +import com.azure.resourcemanager.testbase.models.GetFileUploadUrlParameters; +import com.azure.resourcemanager.testbase.models.PackageCheckNameAvailabilityParameters; +import com.azure.resourcemanager.testbase.models.TestBaseAccountListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TestBaseAccountsClient. */ +public final class TestBaseAccountsClientImpl implements TestBaseAccountsClient { + /** The proxy service used to perform REST calls. */ + private final TestBaseAccountsService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of TestBaseAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestBaseAccountsClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(TestBaseAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseTestBaseAccounts to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseTestBaseAcco") + private interface TestBaseAccountsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.TestBase/testBaseAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("getDeleted") Boolean getDeleted, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("getDeleted") Boolean getDeleted, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("restore") Boolean restore, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TestBaseAccountResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TestBaseAccountUpdateParametersInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/offboard") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> offboard( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/getFileUploadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getFileUploadUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GetFileUploadUrlParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/checkPackageNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkPackageNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PackageCheckNameAvailabilityParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Boolean getDeleted) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + getDeleted, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Boolean getDeleted, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + getDeleted, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Boolean getDeleted) { + return new PagedFlux<>( + () -> listSinglePageAsync(getDeleted), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Boolean getDeleted = null; + return new PagedFlux<>( + () -> listSinglePageAsync(getDeleted), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Boolean getDeleted, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(getDeleted, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Boolean getDeleted = null; + return new PagedIterable<>(listAsync(getDeleted)); + } + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Boolean getDeleted, Context context) { + return new PagedIterable<>(listAsync(getDeleted, context)); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Boolean getDeleted) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + getDeleted, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Boolean getDeleted, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + getDeleted, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Boolean getDeleted) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, getDeleted), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Boolean getDeleted = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, getDeleted), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Boolean getDeleted, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, getDeleted, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Boolean getDeleted = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, getDeleted)); + } + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Boolean getDeleted, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, getDeleted, context)); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + restore, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + restore, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TestBaseAccountResourceInner> beginCreateAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, testBaseAccountName, parameters, restore); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TestBaseAccountResourceInner.class, + TestBaseAccountResourceInner.class, + this.client.getContext()); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TestBaseAccountResourceInner> beginCreateAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, testBaseAccountName, parameters, restore, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TestBaseAccountResourceInner.class, + TestBaseAccountResourceInner.class, + context); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TestBaseAccountResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, parameters, restore).getSyncPoller(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TestBaseAccountResourceInner> beginCreate( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore, + Context context) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, parameters, restore, context).getSyncPoller(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, parameters, restore) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String testBaseAccountName, TestBaseAccountResourceInner parameters) { + final Boolean restore = null; + return beginCreateAsync(resourceGroupName, testBaseAccountName, parameters, restore) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore, + Context context) { + return beginCreateAsync(resourceGroupName, testBaseAccountName, parameters, restore, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestBaseAccountResourceInner create( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore) { + return createAsync(resourceGroupName, testBaseAccountName, parameters, restore).block(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestBaseAccountResourceInner create( + String resourceGroupName, String testBaseAccountName, TestBaseAccountResourceInner parameters) { + final Boolean restore = null; + return createAsync(resourceGroupName, testBaseAccountName, parameters, restore).block(); + } + + /** + * Create or replace (overwrite/recreate, with potential downtime) a Test Base Account in the specified + * subscription. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to create a Test Base Account. + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestBaseAccountResourceInner create( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountResourceInner parameters, + Boolean restore, + Context context) { + return createAsync(resourceGroupName, testBaseAccountName, parameters, restore, context).block(); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String testBaseAccountName, TestBaseAccountUpdateParametersInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountUpdateParametersInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TestBaseAccountResourceInner> beginUpdateAsync( + String resourceGroupName, String testBaseAccountName, TestBaseAccountUpdateParametersInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, testBaseAccountName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TestBaseAccountResourceInner.class, + TestBaseAccountResourceInner.class, + this.client.getContext()); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TestBaseAccountResourceInner> beginUpdateAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountUpdateParametersInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, testBaseAccountName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TestBaseAccountResourceInner.class, + TestBaseAccountResourceInner.class, + context); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TestBaseAccountResourceInner> beginUpdate( + String resourceGroupName, String testBaseAccountName, TestBaseAccountUpdateParametersInner parameters) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, parameters).getSyncPoller(); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TestBaseAccountResourceInner> beginUpdate( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountUpdateParametersInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, parameters, context).getSyncPoller(); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String testBaseAccountName, TestBaseAccountUpdateParametersInner parameters) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountUpdateParametersInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, testBaseAccountName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestBaseAccountResourceInner update( + String resourceGroupName, String testBaseAccountName, TestBaseAccountUpdateParametersInner parameters) { + return updateAsync(resourceGroupName, testBaseAccountName, parameters).block(); + } + + /** + * Update an existing Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to update a Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Base Account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestBaseAccountResourceInner update( + String resourceGroupName, + String testBaseAccountName, + TestBaseAccountUpdateParametersInner parameters, + Context context) { + return updateAsync(resourceGroupName, testBaseAccountName, parameters, context).block(); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String testBaseAccountName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, testBaseAccountName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, testBaseAccountName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String testBaseAccountName) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName).getSyncPoller(); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String testBaseAccountName, Context context) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, context).getSyncPoller(); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String testBaseAccountName) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String testBaseAccountName, Context context) { + return beginDeleteAsync(resourceGroupName, testBaseAccountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String testBaseAccountName) { + deleteAsync(resourceGroupName, testBaseAccountName).block(); + } + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String testBaseAccountName, Context context) { + deleteAsync(resourceGroupName, testBaseAccountName, context).block(); + } + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String testBaseAccountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, testBaseAccountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestBaseAccountResourceInner getByResourceGroup(String resourceGroupName, String testBaseAccountName) { + return getByResourceGroupAsync(resourceGroupName, testBaseAccountName).block(); + } + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String testBaseAccountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, testBaseAccountName, context).block(); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> offboardWithResponseAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .offboard( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> offboardWithResponseAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .offboard( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginOffboardAsync( + String resourceGroupName, String testBaseAccountName) { + Mono>> mono = offboardWithResponseAsync(resourceGroupName, testBaseAccountName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginOffboardAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + offboardWithResponseAsync(resourceGroupName, testBaseAccountName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginOffboard(String resourceGroupName, String testBaseAccountName) { + return beginOffboardAsync(resourceGroupName, testBaseAccountName).getSyncPoller(); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginOffboard( + String resourceGroupName, String testBaseAccountName, Context context) { + return beginOffboardAsync(resourceGroupName, testBaseAccountName, context).getSyncPoller(); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono offboardAsync(String resourceGroupName, String testBaseAccountName) { + return beginOffboardAsync(resourceGroupName, testBaseAccountName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono offboardAsync(String resourceGroupName, String testBaseAccountName, Context context) { + return beginOffboardAsync(resourceGroupName, testBaseAccountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void offboard(String resourceGroupName, String testBaseAccountName) { + offboardAsync(resourceGroupName, testBaseAccountName).block(); + } + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void offboard(String resourceGroupName, String testBaseAccountName, Context context) { + offboardAsync(resourceGroupName, testBaseAccountName, context).block(); + } + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Account GetFileUploadURL operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getFileUploadUrlWithResponseAsync( + String resourceGroupName, String testBaseAccountName, GetFileUploadUrlParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getFileUploadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Account GetFileUploadURL operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getFileUploadUrlWithResponseAsync( + String resourceGroupName, String testBaseAccountName, GetFileUploadUrlParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getFileUploadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Account GetFileUploadURL operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getFileUploadUrlAsync( + String resourceGroupName, String testBaseAccountName, GetFileUploadUrlParameters parameters) { + return getFileUploadUrlWithResponseAsync(resourceGroupName, testBaseAccountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getFileUploadUrlAsync( + String resourceGroupName, String testBaseAccountName) { + final GetFileUploadUrlParameters parameters = null; + return getFileUploadUrlWithResponseAsync(resourceGroupName, testBaseAccountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileUploadUrlResponseInner getFileUploadUrl(String resourceGroupName, String testBaseAccountName) { + final GetFileUploadUrlParameters parameters = null; + return getFileUploadUrlAsync(resourceGroupName, testBaseAccountName, parameters).block(); + } + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Account GetFileUploadURL operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileUploadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, GetFileUploadUrlParameters parameters, Context context) { + return getFileUploadUrlWithResponseAsync(resourceGroupName, testBaseAccountName, parameters, context).block(); + } + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkPackageNameAvailabilityWithResponseAsync( + String resourceGroupName, String testBaseAccountName, PackageCheckNameAvailabilityParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkPackageNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkPackageNameAvailabilityWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + PackageCheckNameAvailabilityParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkPackageNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkPackageNameAvailabilityAsync( + String resourceGroupName, String testBaseAccountName, PackageCheckNameAvailabilityParameters parameters) { + return checkPackageNameAvailabilityWithResponseAsync(resourceGroupName, testBaseAccountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkPackageNameAvailability( + String resourceGroupName, String testBaseAccountName, PackageCheckNameAvailabilityParameters parameters) { + return checkPackageNameAvailabilityAsync(resourceGroupName, testBaseAccountName, parameters).block(); + } + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkPackageNameAvailabilityWithResponse( + String resourceGroupName, + String testBaseAccountName, + PackageCheckNameAvailabilityParameters parameters, + Context context) { + return checkPackageNameAvailabilityWithResponseAsync( + resourceGroupName, testBaseAccountName, parameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsImpl.java new file mode 100644 index 000000000000..eb0fcce8bdea --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseAccountsImpl.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.TestBaseAccountsClient; +import com.azure.resourcemanager.testbase.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.testbase.fluent.models.FileUploadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; +import com.azure.resourcemanager.testbase.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.testbase.models.FileUploadUrlResponse; +import com.azure.resourcemanager.testbase.models.GetFileUploadUrlParameters; +import com.azure.resourcemanager.testbase.models.PackageCheckNameAvailabilityParameters; +import com.azure.resourcemanager.testbase.models.TestBaseAccountResource; +import com.azure.resourcemanager.testbase.models.TestBaseAccounts; + +public final class TestBaseAccountsImpl implements TestBaseAccounts { + private static final ClientLogger LOGGER = new ClientLogger(TestBaseAccountsImpl.class); + + private final TestBaseAccountsClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public TestBaseAccountsImpl( + TestBaseAccountsClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Boolean getDeleted, Context context) { + PagedIterable inner = this.serviceClient().list(getDeleted, context); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, Boolean getDeleted, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, getDeleted, context); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountResourceImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String testBaseAccountName) { + this.serviceClient().delete(resourceGroupName, testBaseAccountName); + } + + public void delete(String resourceGroupName, String testBaseAccountName, Context context) { + this.serviceClient().delete(resourceGroupName, testBaseAccountName, context); + } + + public TestBaseAccountResource getByResourceGroup(String resourceGroupName, String testBaseAccountName) { + TestBaseAccountResourceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, testBaseAccountName); + if (inner != null) { + return new TestBaseAccountResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String testBaseAccountName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, testBaseAccountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TestBaseAccountResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void offboard(String resourceGroupName, String testBaseAccountName) { + this.serviceClient().offboard(resourceGroupName, testBaseAccountName); + } + + public void offboard(String resourceGroupName, String testBaseAccountName, Context context) { + this.serviceClient().offboard(resourceGroupName, testBaseAccountName, context); + } + + public FileUploadUrlResponse getFileUploadUrl(String resourceGroupName, String testBaseAccountName) { + FileUploadUrlResponseInner inner = + this.serviceClient().getFileUploadUrl(resourceGroupName, testBaseAccountName); + if (inner != null) { + return new FileUploadUrlResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getFileUploadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, GetFileUploadUrlParameters parameters, Context context) { + Response inner = + this + .serviceClient() + .getFileUploadUrlWithResponse(resourceGroupName, testBaseAccountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileUploadUrlResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResult checkPackageNameAvailability( + String resourceGroupName, String testBaseAccountName, PackageCheckNameAvailabilityParameters parameters) { + CheckNameAvailabilityResultInner inner = + this.serviceClient().checkPackageNameAvailability(resourceGroupName, testBaseAccountName, parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkPackageNameAvailabilityWithResponse( + String resourceGroupName, + String testBaseAccountName, + PackageCheckNameAvailabilityParameters parameters, + Context context) { + Response inner = + this + .serviceClient() + .checkPackageNameAvailabilityWithResponse(resourceGroupName, testBaseAccountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TestBaseAccountResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, testBaseAccountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, testBaseAccountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + this.delete(resourceGroupName, testBaseAccountName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String testBaseAccountName = Utils.getValueFromIdByName(id, "testBaseAccounts"); + if (testBaseAccountName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'testBaseAccounts'.", id))); + } + this.delete(resourceGroupName, testBaseAccountName, context); + } + + private TestBaseAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } + + public TestBaseAccountResourceImpl define(String name) { + return new TestBaseAccountResourceImpl(name, this.manager()); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseBuilder.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseBuilder.java new file mode 100644 index 000000000000..6a30133560f0 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseBuilder.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the TestBaseImpl type. */ +@ServiceClientBuilder(serviceClients = {TestBaseImpl.class}) +public final class TestBaseBuilder { + /* + * The Azure subscription ID. This is a GUID-formatted string. + */ + private String subscriptionId; + + /** + * Sets The Azure subscription ID. This is a GUID-formatted string. + * + * @param subscriptionId the subscriptionId value. + * @return the TestBaseBuilder. + */ + public TestBaseBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the TestBaseBuilder. + */ + public TestBaseBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the TestBaseBuilder. + */ + public TestBaseBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the TestBaseBuilder. + */ + public TestBaseBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the TestBaseBuilder. + */ + public TestBaseBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the TestBaseBuilder. + */ + public TestBaseBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of TestBaseImpl with the provided parameters. + * + * @return an instance of TestBaseImpl. + */ + public TestBaseImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + TestBaseImpl client = + new TestBaseImpl(pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseImpl.java new file mode 100644 index 000000000000..1b13bfa51e73 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestBaseImpl.java @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.testbase.fluent.AnalysisResultsClient; +import com.azure.resourcemanager.testbase.fluent.AvailableOSClient; +import com.azure.resourcemanager.testbase.fluent.CustomerEventsClient; +import com.azure.resourcemanager.testbase.fluent.EmailEventsClient; +import com.azure.resourcemanager.testbase.fluent.FavoriteProcessesClient; +import com.azure.resourcemanager.testbase.fluent.FlightingRingsClient; +import com.azure.resourcemanager.testbase.fluent.OSUpdatesClient; +import com.azure.resourcemanager.testbase.fluent.OperationsClient; +import com.azure.resourcemanager.testbase.fluent.PackagesClient; +import com.azure.resourcemanager.testbase.fluent.SkusClient; +import com.azure.resourcemanager.testbase.fluent.TestBase; +import com.azure.resourcemanager.testbase.fluent.TestBaseAccountsClient; +import com.azure.resourcemanager.testbase.fluent.TestResultsClient; +import com.azure.resourcemanager.testbase.fluent.TestSummariesClient; +import com.azure.resourcemanager.testbase.fluent.TestTypesClient; +import com.azure.resourcemanager.testbase.fluent.UsagesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the TestBaseImpl type. */ +@ServiceClient(builder = TestBaseBuilder.class) +public final class TestBaseImpl implements TestBase { + /** The Azure subscription ID. This is a GUID-formatted string. */ + private final String subscriptionId; + + /** + * Gets The Azure subscription ID. This is a GUID-formatted string. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** 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. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** The TestBaseAccountsClient object to access its operations. */ + private final TestBaseAccountsClient testBaseAccounts; + + /** + * Gets the TestBaseAccountsClient object to access its operations. + * + * @return the TestBaseAccountsClient object. + */ + public TestBaseAccountsClient getTestBaseAccounts() { + return this.testBaseAccounts; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** The AvailableOSClient object to access its operations. */ + private final AvailableOSClient availableOS; + + /** + * Gets the AvailableOSClient object to access its operations. + * + * @return the AvailableOSClient object. + */ + public AvailableOSClient getAvailableOS() { + return this.availableOS; + } + + /** The FlightingRingsClient object to access its operations. */ + private final FlightingRingsClient flightingRings; + + /** + * Gets the FlightingRingsClient object to access its operations. + * + * @return the FlightingRingsClient object. + */ + public FlightingRingsClient getFlightingRings() { + return this.flightingRings; + } + + /** The TestTypesClient object to access its operations. */ + private final TestTypesClient testTypes; + + /** + * Gets the TestTypesClient object to access its operations. + * + * @return the TestTypesClient object. + */ + public TestTypesClient getTestTypes() { + return this.testTypes; + } + + /** The PackagesClient object to access its operations. */ + private final PackagesClient packages; + + /** + * Gets the PackagesClient object to access its operations. + * + * @return the PackagesClient object. + */ + public PackagesClient getPackages() { + return this.packages; + } + + /** The TestSummariesClient object to access its operations. */ + private final TestSummariesClient testSummaries; + + /** + * Gets the TestSummariesClient object to access its operations. + * + * @return the TestSummariesClient object. + */ + public TestSummariesClient getTestSummaries() { + return this.testSummaries; + } + + /** The TestResultsClient object to access its operations. */ + private final TestResultsClient testResults; + + /** + * Gets the TestResultsClient object to access its operations. + * + * @return the TestResultsClient object. + */ + public TestResultsClient getTestResults() { + return this.testResults; + } + + /** The OSUpdatesClient object to access its operations. */ + private final OSUpdatesClient oSUpdates; + + /** + * Gets the OSUpdatesClient object to access its operations. + * + * @return the OSUpdatesClient object. + */ + public OSUpdatesClient getOSUpdates() { + return this.oSUpdates; + } + + /** The FavoriteProcessesClient object to access its operations. */ + private final FavoriteProcessesClient favoriteProcesses; + + /** + * Gets the FavoriteProcessesClient object to access its operations. + * + * @return the FavoriteProcessesClient object. + */ + public FavoriteProcessesClient getFavoriteProcesses() { + return this.favoriteProcesses; + } + + /** The AnalysisResultsClient object to access its operations. */ + private final AnalysisResultsClient analysisResults; + + /** + * Gets the AnalysisResultsClient object to access its operations. + * + * @return the AnalysisResultsClient object. + */ + public AnalysisResultsClient getAnalysisResults() { + return this.analysisResults; + } + + /** The EmailEventsClient object to access its operations. */ + private final EmailEventsClient emailEvents; + + /** + * Gets the EmailEventsClient object to access its operations. + * + * @return the EmailEventsClient object. + */ + public EmailEventsClient getEmailEvents() { + return this.emailEvents; + } + + /** The CustomerEventsClient object to access its operations. */ + private final CustomerEventsClient customerEvents; + + /** + * Gets the CustomerEventsClient object to access its operations. + * + * @return the CustomerEventsClient object. + */ + public CustomerEventsClient getCustomerEvents() { + return this.customerEvents; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * Initializes an instance of TestBase client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string. + * @param endpoint server parameter. + */ + TestBaseImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-12-16-preview"; + this.skus = new SkusClientImpl(this); + this.testBaseAccounts = new TestBaseAccountsClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.availableOS = new AvailableOSClientImpl(this); + this.flightingRings = new FlightingRingsClientImpl(this); + this.testTypes = new TestTypesClientImpl(this); + this.packages = new PackagesClientImpl(this); + this.testSummaries = new TestSummariesClientImpl(this); + this.testResults = new TestResultsClientImpl(this); + this.oSUpdates = new OSUpdatesClientImpl(this); + this.favoriteProcesses = new FavoriteProcessesClientImpl(this); + this.analysisResults = new AnalysisResultsClientImpl(this); + this.emailEvents = new EmailEventsClientImpl(this); + this.customerEvents = new CustomerEventsClientImpl(this); + this.operations = new OperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestBaseImpl.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultResourceImpl.java new file mode 100644 index 000000000000..8659e64c073f --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultResourceImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.TestResultResourceInner; +import com.azure.resourcemanager.testbase.models.ExecutionStatus; +import com.azure.resourcemanager.testbase.models.Grade; +import com.azure.resourcemanager.testbase.models.TestResultAnalysisSummary; +import com.azure.resourcemanager.testbase.models.TestResultResource; +import com.azure.resourcemanager.testbase.models.TestStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class TestResultResourceImpl implements TestResultResource { + private TestResultResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestResultResourceImpl( + TestResultResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String baselineTestResultId() { + return this.innerModel().baselineTestResultId(); + } + + public String packageId() { + return this.innerModel().packageId(); + } + + public String applicationName() { + return this.innerModel().applicationName(); + } + + public String applicationVersion() { + return this.innerModel().applicationVersion(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String releaseName() { + return this.innerModel().releaseName(); + } + + public OffsetDateTime releaseVersionDate() { + return this.innerModel().releaseVersionDate(); + } + + public String flightingRing() { + return this.innerModel().flightingRing(); + } + + public String buildVersion() { + return this.innerModel().buildVersion(); + } + + public String buildRevision() { + return this.innerModel().buildRevision(); + } + + public String testType() { + return this.innerModel().testType(); + } + + public String testRunTime() { + return this.innerModel().testRunTime(); + } + + public Boolean isDownloadDataAvailable() { + return this.innerModel().isDownloadDataAvailable(); + } + + public Boolean isVideoAvailable() { + return this.innerModel().isVideoAvailable(); + } + + public ExecutionStatus executionStatus() { + return this.innerModel().executionStatus(); + } + + public TestStatus testStatus() { + return this.innerModel().testStatus(); + } + + public Grade grade() { + return this.innerModel().grade(); + } + + public String kbNumber() { + return this.innerModel().kbNumber(); + } + + public String packageVersion() { + return this.innerModel().packageVersion(); + } + + public List analysisSummaries() { + List inner = this.innerModel().analysisSummaries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TestResultResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsClientImpl.java new file mode 100644 index 000000000000..6ea71e8b4407 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsClientImpl.java @@ -0,0 +1,1059 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.TestResultsClient; +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.TestResultResourceInner; +import com.azure.resourcemanager.testbase.models.OsUpdateType; +import com.azure.resourcemanager.testbase.models.TestResultListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TestResultsClient. */ +public final class TestResultsClientImpl implements TestResultsClient { + /** The proxy service used to perform REST calls. */ + private final TestResultsService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of TestResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestResultsClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(TestResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseTestResults to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseTestResults") + private interface TestResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @QueryParam("osUpdateType") OsUpdateType osUpdateType, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("testResultName") String testResultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}" + + "/getDownloadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDownloadUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("testResultName") String testResultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/testResults/{testResultName}" + + "/getVideoDownloadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVideoDownloadUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("packageName") String packageName, + @PathParam("testResultName") String testResultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param filter Odata filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (osUpdateType == null) { + return Mono.error(new IllegalArgumentException("Parameter osUpdateType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + filter, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (osUpdateType == null) { + return Mono.error(new IllegalArgumentException("Parameter osUpdateType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + osUpdateType, + filter, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param filter Odata filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType) { + final String filter = null; + return new PagedIterable<>( + listAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType, filter)); + } + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, testBaseAccountName, packageName, osUpdateType, filter, context)); + } + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, testResultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestResultResourceInner get( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + return getAsync(resourceGroupName, testBaseAccountName, packageName, testResultName).block(); + } + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, testResultName, context) + .block(); + } + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDownloadUrlWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDownloadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDownloadUrlWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDownloadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDownloadUrlAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + return getDownloadUrlWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, testResultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlResponseInner getDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + return getDownloadUrlAsync(resourceGroupName, testBaseAccountName, packageName, testResultName).block(); + } + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + return getDownloadUrlWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, testResultName, context) + .block(); + } + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVideoDownloadUrlWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVideoDownloadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVideoDownloadUrlWithResponseAsync( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (packageName == null) { + return Mono.error(new IllegalArgumentException("Parameter packageName is required and cannot be null.")); + } + if (testResultName == null) { + return Mono.error(new IllegalArgumentException("Parameter testResultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVideoDownloadUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + packageName, + testResultName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVideoDownloadUrlAsync( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + return getVideoDownloadUrlWithResponseAsync(resourceGroupName, testBaseAccountName, packageName, testResultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlResponseInner getVideoDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + return getVideoDownloadUrlAsync(resourceGroupName, testBaseAccountName, packageName, testResultName).block(); + } + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVideoDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + return getVideoDownloadUrlWithResponseAsync( + resourceGroupName, testBaseAccountName, packageName, testResultName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsImpl.java new file mode 100644 index 000000000000..20bc45d241ab --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestResultsImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.TestResultsClient; +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import com.azure.resourcemanager.testbase.fluent.models.TestResultResourceInner; +import com.azure.resourcemanager.testbase.models.DownloadUrlResponse; +import com.azure.resourcemanager.testbase.models.OsUpdateType; +import com.azure.resourcemanager.testbase.models.TestResultResource; +import com.azure.resourcemanager.testbase.models.TestResults; + +public final class TestResultsImpl implements TestResults { + private static final ClientLogger LOGGER = new ClientLogger(TestResultsImpl.class); + + private final TestResultsClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public TestResultsImpl( + TestResultsClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, packageName, osUpdateType); + return Utils.mapPage(inner, inner1 -> new TestResultResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, testBaseAccountName, packageName, osUpdateType, filter, context); + return Utils.mapPage(inner, inner1 -> new TestResultResourceImpl(inner1, this.manager())); + } + + public TestResultResource get( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + TestResultResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, packageName, testResultName); + if (inner != null) { + return new TestResultResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, testBaseAccountName, packageName, testResultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TestResultResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DownloadUrlResponse getDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + DownloadUrlResponseInner inner = + this.serviceClient().getDownloadUrl(resourceGroupName, testBaseAccountName, packageName, testResultName); + if (inner != null) { + return new DownloadUrlResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + Response inner = + this + .serviceClient() + .getDownloadUrlWithResponse( + resourceGroupName, testBaseAccountName, packageName, testResultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DownloadUrlResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DownloadUrlResponse getVideoDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName) { + DownloadUrlResponseInner inner = + this + .serviceClient() + .getVideoDownloadUrl(resourceGroupName, testBaseAccountName, packageName, testResultName); + if (inner != null) { + return new DownloadUrlResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVideoDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context) { + Response inner = + this + .serviceClient() + .getVideoDownloadUrlWithResponse( + resourceGroupName, testBaseAccountName, packageName, testResultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DownloadUrlResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private TestResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesClientImpl.java new file mode 100644 index 000000000000..724a299b1873 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesClientImpl.java @@ -0,0 +1,525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.TestSummariesClient; +import com.azure.resourcemanager.testbase.fluent.models.TestSummaryResourceInner; +import com.azure.resourcemanager.testbase.models.TestSummaryListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TestSummariesClient. */ +public final class TestSummariesClientImpl implements TestSummariesClient { + /** The proxy service used to perform REST calls. */ + private final TestSummariesService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of TestSummariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestSummariesClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(TestSummariesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseTestSummaries to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseTestSummarie") + private interface TestSummariesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/testSummaries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/testSummaries/{testSummaryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("testSummaryName") String testSummaryName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String testBaseAccountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName)); + } + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, context)); + } + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String testSummaryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (testSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testSummaryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + testSummaryName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String testSummaryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (testSummaryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testSummaryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + testSummaryName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String testSummaryName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, testSummaryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestSummaryResourceInner get(String resourceGroupName, String testBaseAccountName, String testSummaryName) { + return getAsync(resourceGroupName, testBaseAccountName, testSummaryName).block(); + } + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testSummaryName, Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, testSummaryName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesImpl.java new file mode 100644 index 000000000000..10cb26394af5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummariesImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.TestSummariesClient; +import com.azure.resourcemanager.testbase.fluent.models.TestSummaryResourceInner; +import com.azure.resourcemanager.testbase.models.TestSummaries; +import com.azure.resourcemanager.testbase.models.TestSummaryResource; + +public final class TestSummariesImpl implements TestSummaries { + private static final ClientLogger LOGGER = new ClientLogger(TestSummariesImpl.class); + + private final TestSummariesClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public TestSummariesImpl( + TestSummariesClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName); + return Utils.mapPage(inner, inner1 -> new TestSummaryResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, context); + return Utils.mapPage(inner, inner1 -> new TestSummaryResourceImpl(inner1, this.manager())); + } + + public TestSummaryResource get(String resourceGroupName, String testBaseAccountName, String testSummaryName) { + TestSummaryResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, testSummaryName); + if (inner != null) { + return new TestSummaryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testSummaryName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, testBaseAccountName, testSummaryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TestSummaryResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private TestSummariesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummaryResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummaryResourceImpl.java new file mode 100644 index 000000000000..e981167fbe51 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestSummaryResourceImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.TestSummaryResourceInner; +import com.azure.resourcemanager.testbase.models.ExecutionStatus; +import com.azure.resourcemanager.testbase.models.Grade; +import com.azure.resourcemanager.testbase.models.OSUpdatesTestSummary; +import com.azure.resourcemanager.testbase.models.TestStatus; +import com.azure.resourcemanager.testbase.models.TestSummaryResource; + +public final class TestSummaryResourceImpl implements TestSummaryResource { + private TestSummaryResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestSummaryResourceImpl( + TestSummaryResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String testSummaryId() { + return this.innerModel().testSummaryId(); + } + + public String packageId() { + return this.innerModel().packageId(); + } + + public String applicationName() { + return this.innerModel().applicationName(); + } + + public String applicationVersion() { + return this.innerModel().applicationVersion(); + } + + public ExecutionStatus executionStatus() { + return this.innerModel().executionStatus(); + } + + public TestStatus testStatus() { + return this.innerModel().testStatus(); + } + + public Grade grade() { + return this.innerModel().grade(); + } + + public String testRunTime() { + return this.innerModel().testRunTime(); + } + + public OSUpdatesTestSummary featureUpdatesTestSummary() { + return this.innerModel().featureUpdatesTestSummary(); + } + + public OSUpdatesTestSummary securityUpdatesTestSummary() { + return this.innerModel().securityUpdatesTestSummary(); + } + + public TestSummaryResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypeResourceImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypeResourceImpl.java new file mode 100644 index 000000000000..724bf1cfcff9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypeResourceImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.TestTypeResourceInner; +import com.azure.resourcemanager.testbase.models.TestTypeResource; + +public final class TestTypeResourceImpl implements TestTypeResource { + private TestTypeResourceInner innerObject; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + TestTypeResourceImpl( + TestTypeResourceInner innerObject, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String actualTestTypeName() { + return this.innerModel().actualTestTypeName(); + } + + public TestTypeResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesClientImpl.java new file mode 100644 index 000000000000..c3b60fea3e45 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesClientImpl.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.TestTypesClient; +import com.azure.resourcemanager.testbase.fluent.models.TestTypeResourceInner; +import com.azure.resourcemanager.testbase.models.TestTypeListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TestTypesClient. */ +public final class TestTypesClientImpl implements TestTypesClient { + /** The proxy service used to perform REST calls. */ + private final TestTypesService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of TestTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestTypesClientImpl(TestBaseImpl client) { + this.service = + RestProxy.create(TestTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseTestTypes to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseTestTypes") + private interface TestTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/testTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/testTypes/{testTypeResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @PathParam("testTypeResourceName") String testTypeResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String testBaseAccountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName)); + } + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, context)); + } + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (testTypeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testTypeResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + testTypeResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + if (testTypeResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testTypeResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + testTypeResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, testTypeResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestTypeResourceInner get( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName) { + return getAsync(resourceGroupName, testBaseAccountName, testTypeResourceName).block(); + } + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, testBaseAccountName, testTypeResourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesImpl.java new file mode 100644 index 000000000000..280b1c15f3d9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/TestTypesImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.TestTypesClient; +import com.azure.resourcemanager.testbase.fluent.models.TestTypeResourceInner; +import com.azure.resourcemanager.testbase.models.TestTypeResource; +import com.azure.resourcemanager.testbase.models.TestTypes; + +public final class TestTypesImpl implements TestTypes { + private static final ClientLogger LOGGER = new ClientLogger(TestTypesImpl.class); + + private final TestTypesClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public TestTypesImpl( + TestTypesClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, testBaseAccountName); + return Utils.mapPage(inner, inner1 -> new TestTypeResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, context); + return Utils.mapPage(inner, inner1 -> new TestTypeResourceImpl(inner1, this.manager())); + } + + public TestTypeResource get(String resourceGroupName, String testBaseAccountName, String testTypeResourceName) { + TestTypeResourceInner inner = + this.serviceClient().get(resourceGroupName, testBaseAccountName, testTypeResourceName); + if (inner != null) { + return new TestTypeResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, testBaseAccountName, testTypeResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TestTypeResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private TestTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesClientImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesClientImpl.java new file mode 100644 index 000000000000..d1c78cefe0a7 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesClientImpl.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +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.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.testbase.fluent.UsagesClient; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUsageDataInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountUsageDataList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final TestBaseImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(TestBaseImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for TestBaseUsages to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "TestBaseUsages") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase" + + "/testBaseAccounts/{testBaseAccountName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("testBaseAccountName") String testBaseAccountName, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param filter Odata filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + filter, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String testBaseAccountName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (testBaseAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter testBaseAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + testBaseAccountName, + filter, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param filter Odata filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String testBaseAccountName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String testBaseAccountName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, testBaseAccountName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, filter)); + } + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, testBaseAccountName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesImpl.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesImpl.java new file mode 100644 index 000000000000..b28b5ae3f980 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/UsagesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.testbase.fluent.UsagesClient; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUsageDataInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountUsageData; +import com.azure.resourcemanager.testbase.models.Usages; + +public final class UsagesImpl implements Usages { + private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.testbase.TestBaseManager serviceManager; + + public UsagesImpl(UsagesClient innerClient, com.azure.resourcemanager.testbase.TestBaseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String testBaseAccountName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountUsageDataImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String testBaseAccountName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, testBaseAccountName, filter, context); + return Utils.mapPage(inner, inner1 -> new TestBaseAccountUsageDataImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.testbase.TestBaseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/Utils.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/Utils.java new file mode 100644 index 000000000000..aca91c34f6ea --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/package-info.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/package-info.java new file mode 100644 index 000000000000..be1bbb31aa39 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for TestBase. Test Base. */ +package com.azure.resourcemanager.testbase.implementation; diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Action.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Action.java new file mode 100644 index 000000000000..9512d56ad617 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Action.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Action. */ +public final class Action extends ExpandableStringEnum { + /** Static value Install for Action. */ + public static final Action INSTALL = fromString("Install"); + + /** Static value Launch for Action. */ + public static final Action LAUNCH = fromString("Launch"); + + /** Static value Close for Action. */ + public static final Action CLOSE = fromString("Close"); + + /** Static value Uninstall for Action. */ + public static final Action UNINSTALL = fromString("Uninstall"); + + /** Static value Custom for Action. */ + public static final Action CUSTOM = fromString("Custom"); + + /** + * Creates or finds a Action from its string representation. + * + * @param name a name to look for. + * @return the corresponding Action. + */ + @JsonCreator + public static Action fromString(String name) { + return fromString(name, Action.class); + } + + /** @return known Action values. */ + public static Collection values() { + return values(Action.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultListResult.java new file mode 100644 index 000000000000..54036b12e49c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of Analysis Results. It will only contain one element as all the data will be nested in a singleton object. + */ +@Fluent +public final class AnalysisResultListResult { + /* + * The list of Analysis Results. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Analysis Results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Analysis Results. + * + * @param value the value value to set. + * @return the AnalysisResultListResult object itself. + */ + public AnalysisResultListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultName.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultName.java new file mode 100644 index 000000000000..a3d46b1530cb --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultName.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AnalysisResultName. */ +public final class AnalysisResultName extends ExpandableStringEnum { + /** Static value scriptExecution for AnalysisResultName. */ + public static final AnalysisResultName SCRIPT_EXECUTION = fromString("scriptExecution"); + + /** Static value reliability for AnalysisResultName. */ + public static final AnalysisResultName RELIABILITY = fromString("reliability"); + + /** Static value memoryUtilization for AnalysisResultName. */ + public static final AnalysisResultName MEMORY_UTILIZATION = fromString("memoryUtilization"); + + /** Static value cpuUtilization for AnalysisResultName. */ + public static final AnalysisResultName CPU_UTILIZATION = fromString("cpuUtilization"); + + /** Static value memoryRegression for AnalysisResultName. */ + public static final AnalysisResultName MEMORY_REGRESSION = fromString("memoryRegression"); + + /** Static value cpuRegression for AnalysisResultName. */ + public static final AnalysisResultName CPU_REGRESSION = fromString("cpuRegression"); + + /** Static value testAnalysis for AnalysisResultName. */ + public static final AnalysisResultName TEST_ANALYSIS = fromString("testAnalysis"); + + /** + * Creates or finds a AnalysisResultName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AnalysisResultName. + */ + @JsonCreator + public static AnalysisResultName fromString(String name) { + return fromString(name, AnalysisResultName.class); + } + + /** @return known AnalysisResultName values. */ + public static Collection values() { + return values(AnalysisResultName.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultSingletonResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultSingletonResource.java new file mode 100644 index 000000000000..f5e9a1c3a0e7 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultSingletonResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceInner; + +/** An immutable client-side representation of AnalysisResultSingletonResource. */ +public interface AnalysisResultSingletonResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the grade property: The grade of the test. + * + * @return the grade value. + */ + Grade grade(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceInner object. + * + * @return the inner object. + */ + AnalysisResultSingletonResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultType.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultType.java new file mode 100644 index 000000000000..31dbef4bc5a0 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResultType.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AnalysisResultType. */ +public final class AnalysisResultType extends ExpandableStringEnum { + /** Static value ScriptExecution for AnalysisResultType. */ + public static final AnalysisResultType SCRIPT_EXECUTION = fromString("ScriptExecution"); + + /** Static value Reliability for AnalysisResultType. */ + public static final AnalysisResultType RELIABILITY = fromString("Reliability"); + + /** Static value CPUUtilization for AnalysisResultType. */ + public static final AnalysisResultType CPUUTILIZATION = fromString("CPUUtilization"); + + /** Static value MemoryUtilization for AnalysisResultType. */ + public static final AnalysisResultType MEMORY_UTILIZATION = fromString("MemoryUtilization"); + + /** Static value CPURegression for AnalysisResultType. */ + public static final AnalysisResultType CPUREGRESSION = fromString("CPURegression"); + + /** Static value MemoryRegression for AnalysisResultType. */ + public static final AnalysisResultType MEMORY_REGRESSION = fromString("MemoryRegression"); + + /** Static value TestAnalysis for AnalysisResultType. */ + public static final AnalysisResultType TEST_ANALYSIS = fromString("TestAnalysis"); + + /** + * Creates or finds a AnalysisResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AnalysisResultType. + */ + @JsonCreator + public static AnalysisResultType fromString(String name) { + return fromString(name, AnalysisResultType.class); + } + + /** @return known AnalysisResultType values. */ + public static Collection values() { + return values(AnalysisResultType.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResults.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResults.java new file mode 100644 index 000000000000..af57c80d58c5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisResults.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AnalysisResults. */ +public interface AnalysisResults { + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType); + + /** + * Lists the Analysis Results of a Test Result. The result collection will only contain one element as all the data + * will be nested in a singleton object. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultType The type of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Analysis Results as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultType analysisResultType, + Context context); + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name. + */ + AnalysisResultSingletonResource get( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName); + + /** + * Gets an Analysis Result of a Test Result by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param analysisResultName The name of the Analysis Result of a Test Result. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Analysis Result of a Test Result by name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + AnalysisResultName analysisResultName, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisStatus.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisStatus.java new file mode 100644 index 000000000000..20214b147f5a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AnalysisStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AnalysisStatus. */ +public final class AnalysisStatus extends ExpandableStringEnum { + /** Static value None for AnalysisStatus. */ + public static final AnalysisStatus NONE = fromString("None"); + + /** Static value Completed for AnalysisStatus. */ + public static final AnalysisStatus COMPLETED = fromString("Completed"); + + /** Static value InProgress for AnalysisStatus. */ + public static final AnalysisStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for AnalysisStatus. */ + public static final AnalysisStatus FAILED = fromString("Failed"); + + /** Static value Succeeded for AnalysisStatus. */ + public static final AnalysisStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Available for AnalysisStatus. */ + public static final AnalysisStatus AVAILABLE = fromString("Available"); + + /** Static value NotAvailable for AnalysisStatus. */ + public static final AnalysisStatus NOT_AVAILABLE = fromString("NotAvailable"); + + /** + * Creates or finds a AnalysisStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AnalysisStatus. + */ + @JsonCreator + public static AnalysisStatus fromString(String name) { + return fromString(name, AnalysisStatus.class); + } + + /** @return known AnalysisStatus values. */ + public static Collection values() { + return values(AnalysisStatus.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOS.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOS.java new file mode 100644 index 000000000000..92da0deb7ad0 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOS.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableOS. */ +public interface AvailableOS { + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType); + + /** + * Lists all the available OSs to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of available OSs as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String testBaseAccountName, OsUpdateType osUpdateType, Context context); + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account. + */ + AvailableOSResource get(String resourceGroupName, String testBaseAccountName, String availableOSResourceName); + + /** + * Gets an available OS to run a package under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param availableOSResourceName The resource name of an Available OS. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an available OS to run a package under a Test Base Account along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String availableOSResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSListResult.java new file mode 100644 index 000000000000..3f5f892c6e13 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AvailableOSResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of available OSs. */ +@Fluent +public final class AvailableOSListResult { + /* + * The list of available OSs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of available OSs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of available OSs. + * + * @param value the value value to set. + * @return the AvailableOSListResult object itself. + */ + public AvailableOSListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSResource.java new file mode 100644 index 000000000000..450ae3a728fb --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/AvailableOSResource.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.AvailableOSResourceInner; + +/** An immutable client-side representation of AvailableOSResource. */ +public interface AvailableOSResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the osId property: The Id of an Available OS of a Test Base Account. + * + * @return the osId value. + */ + String osId(); + + /** + * Gets the osName property: The name of an Available OS of a Test Base Account. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the osVersion property: The version of an Available OS of a Test Base Account. + * + * @return the osVersion value. + */ + String osVersion(); + + /** + * Gets the insiderChannel property: The insider channel of an Available OS of a Test Base Account. + * + * @return the insiderChannel value. + */ + String insiderChannel(); + + /** + * Gets the osUpdateType property: The OS update type of an Available OS of a Test Base Account. + * + * @return the osUpdateType value. + */ + String osUpdateType(); + + /** + * Gets the osPlatform property: The Platform of an Available OS of a Test Base Account. + * + * @return the osPlatform value. + */ + String osPlatform(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.AvailableOSResourceInner object. + * + * @return the inner object. + */ + AvailableOSResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Category.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Category.java new file mode 100644 index 000000000000..cb60dc837fd4 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Category.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Category. */ +public final class Category extends ExpandableStringEnum { + /** Static value None for Category. */ + public static final Category NONE = fromString("None"); + + /** Static value Unidentified for Category. */ + public static final Category UNIDENTIFIED = fromString("Unidentified"); + + /** Static value Package for Category. */ + public static final Category PACKAGE = fromString("Package"); + + /** Static value OSUpdate for Category. */ + public static final Category OSUPDATE = fromString("OSUpdate"); + + /** Static value Infrastructure for Category. */ + public static final Category INFRASTRUCTURE = fromString("Infrastructure"); + + /** + * Creates or finds a Category from its string representation. + * + * @param name a name to look for. + * @return the corresponding Category. + */ + @JsonCreator + public static Category fromString(String name) { + return fromString(name, Category.class); + } + + /** @return known Category values. */ + public static Collection values() { + return values(Category.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CheckNameAvailabilityResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..d83365a9e855 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CheckNameAvailabilityResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: Value indicating the availability of the name: true if the name is available; + * otherwise, false. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason for unavailability of a name. Required if nameAvailable == false. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the message property: The detailed info regarding the reason associated with the name. Required if + * nameAvailable == false. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.CheckNameAvailabilityResultInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Command.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Command.java new file mode 100644 index 000000000000..4bead3124bdf --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Command.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The command used in the test. */ +@Fluent +public final class Command { + /* + * The name of the command. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The action of the command. + */ + @JsonProperty(value = "action", required = true) + private Action action; + + /* + * The type of command content. + */ + @JsonProperty(value = "contentType", required = true) + private ContentType contentType; + + /* + * The content of the command. The content depends on source type. + */ + @JsonProperty(value = "content", required = true) + private String content; + + /* + * Specifies whether to run the command as administrator. + */ + @JsonProperty(value = "runElevated") + private Boolean runElevated; + + /* + * Specifies whether to restart the VM after the command executed. + */ + @JsonProperty(value = "restartAfter") + private Boolean restartAfter; + + /* + * Specifies the max run time of the command. + */ + @JsonProperty(value = "maxRunTime") + private Integer maxRunTime; + + /* + * Specifies whether to run the command in interactive mode. + */ + @JsonProperty(value = "runAsInteractive") + private Boolean runAsInteractive; + + /* + * Specifies whether to run the command even if a previous command is + * failed. + */ + @JsonProperty(value = "alwaysRun") + private Boolean alwaysRun; + + /* + * Specifies whether to apply update before the command. + */ + @JsonProperty(value = "applyUpdateBefore") + private Boolean applyUpdateBefore; + + /** + * Get the name property: The name of the command. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the command. + * + * @param name the name value to set. + * @return the Command object itself. + */ + public Command withName(String name) { + this.name = name; + return this; + } + + /** + * Get the action property: The action of the command. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of the command. + * + * @param action the action value to set. + * @return the Command object itself. + */ + public Command withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the contentType property: The type of command content. + * + * @return the contentType value. + */ + public ContentType contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The type of command content. + * + * @param contentType the contentType value to set. + * @return the Command object itself. + */ + public Command withContentType(ContentType contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the content property: The content of the command. The content depends on source type. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The content of the command. The content depends on source type. + * + * @param content the content value to set. + * @return the Command object itself. + */ + public Command withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the runElevated property: Specifies whether to run the command as administrator. + * + * @return the runElevated value. + */ + public Boolean runElevated() { + return this.runElevated; + } + + /** + * Set the runElevated property: Specifies whether to run the command as administrator. + * + * @param runElevated the runElevated value to set. + * @return the Command object itself. + */ + public Command withRunElevated(Boolean runElevated) { + this.runElevated = runElevated; + return this; + } + + /** + * Get the restartAfter property: Specifies whether to restart the VM after the command executed. + * + * @return the restartAfter value. + */ + public Boolean restartAfter() { + return this.restartAfter; + } + + /** + * Set the restartAfter property: Specifies whether to restart the VM after the command executed. + * + * @param restartAfter the restartAfter value to set. + * @return the Command object itself. + */ + public Command withRestartAfter(Boolean restartAfter) { + this.restartAfter = restartAfter; + return this; + } + + /** + * Get the maxRunTime property: Specifies the max run time of the command. + * + * @return the maxRunTime value. + */ + public Integer maxRunTime() { + return this.maxRunTime; + } + + /** + * Set the maxRunTime property: Specifies the max run time of the command. + * + * @param maxRunTime the maxRunTime value to set. + * @return the Command object itself. + */ + public Command withMaxRunTime(Integer maxRunTime) { + this.maxRunTime = maxRunTime; + return this; + } + + /** + * Get the runAsInteractive property: Specifies whether to run the command in interactive mode. + * + * @return the runAsInteractive value. + */ + public Boolean runAsInteractive() { + return this.runAsInteractive; + } + + /** + * Set the runAsInteractive property: Specifies whether to run the command in interactive mode. + * + * @param runAsInteractive the runAsInteractive value to set. + * @return the Command object itself. + */ + public Command withRunAsInteractive(Boolean runAsInteractive) { + this.runAsInteractive = runAsInteractive; + return this; + } + + /** + * Get the alwaysRun property: Specifies whether to run the command even if a previous command is failed. + * + * @return the alwaysRun value. + */ + public Boolean alwaysRun() { + return this.alwaysRun; + } + + /** + * Set the alwaysRun property: Specifies whether to run the command even if a previous command is failed. + * + * @param alwaysRun the alwaysRun value to set. + * @return the Command object itself. + */ + public Command withAlwaysRun(Boolean alwaysRun) { + this.alwaysRun = alwaysRun; + return this; + } + + /** + * Get the applyUpdateBefore property: Specifies whether to apply update before the command. + * + * @return the applyUpdateBefore value. + */ + public Boolean applyUpdateBefore() { + return this.applyUpdateBefore; + } + + /** + * Set the applyUpdateBefore property: Specifies whether to apply update before the command. + * + * @param applyUpdateBefore the applyUpdateBefore value to set. + * @return the Command object itself. + */ + public Command withApplyUpdateBefore(Boolean applyUpdateBefore) { + this.applyUpdateBefore = applyUpdateBefore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Command")); + } + if (action() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property action in model Command")); + } + if (contentType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property contentType in model Command")); + } + if (content() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property content in model Command")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Command.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ContentType.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ContentType.java new file mode 100644 index 000000000000..81003695c88e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ContentType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContentType. */ +public final class ContentType extends ExpandableStringEnum { + /** Static value Inline for ContentType. */ + public static final ContentType INLINE = fromString("Inline"); + + /** Static value File for ContentType. */ + public static final ContentType FILE = fromString("File"); + + /** Static value Path for ContentType. */ + public static final ContentType PATH = fromString("Path"); + + /** + * Creates or finds a ContentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentType. + */ + @JsonCreator + public static ContentType fromString(String name) { + return fromString(name, ContentType.class); + } + + /** @return known ContentType values. */ + public static Collection values() { + return values(ContentType.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuRegressionResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuRegressionResultSingletonResourceProperties.java new file mode 100644 index 000000000000..1254fc27b30c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuRegressionResultSingletonResourceProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of CPU Regression Result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "analysisResultType") +@JsonTypeName("CPURegression") +@Fluent +public final class CpuRegressionResultSingletonResourceProperties extends AnalysisResultSingletonResourceProperties { + /* + * The result array data. + */ + @JsonProperty(value = "cpuRegressionResults") + private List cpuRegressionResults; + + /** + * Get the cpuRegressionResults property: The result array data. + * + * @return the cpuRegressionResults value. + */ + public List cpuRegressionResults() { + return this.cpuRegressionResults; + } + + /** + * Set the cpuRegressionResults property: The result array data. + * + * @param cpuRegressionResults the cpuRegressionResults value to set. + * @return the CpuRegressionResultSingletonResourceProperties object itself. + */ + public CpuRegressionResultSingletonResourceProperties withCpuRegressionResults( + List cpuRegressionResults) { + this.cpuRegressionResults = cpuRegressionResults; + return this; + } + + /** {@inheritDoc} */ + @Override + public CpuRegressionResultSingletonResourceProperties withGrade(Grade grade) { + super.withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (cpuRegressionResults() != null) { + cpuRegressionResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuUtilizationResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuUtilizationResultSingletonResourceProperties.java new file mode 100644 index 000000000000..ad1422149e17 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CpuUtilizationResultSingletonResourceProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of CPU Utilization Result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "analysisResultType") +@JsonTypeName("CPUUtilization") +@Fluent +public final class CpuUtilizationResultSingletonResourceProperties extends AnalysisResultSingletonResourceProperties { + /* + * The result array data. + */ + @JsonProperty(value = "cpuUtilizationResults") + private List cpuUtilizationResults; + + /** + * Get the cpuUtilizationResults property: The result array data. + * + * @return the cpuUtilizationResults value. + */ + public List cpuUtilizationResults() { + return this.cpuUtilizationResults; + } + + /** + * Set the cpuUtilizationResults property: The result array data. + * + * @param cpuUtilizationResults the cpuUtilizationResults value to set. + * @return the CpuUtilizationResultSingletonResourceProperties object itself. + */ + public CpuUtilizationResultSingletonResourceProperties withCpuUtilizationResults( + List cpuUtilizationResults) { + this.cpuUtilizationResults = cpuUtilizationResults; + return this; + } + + /** {@inheritDoc} */ + @Override + public CpuUtilizationResultSingletonResourceProperties withGrade(Grade grade) { + super.withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (cpuUtilizationResults() != null) { + cpuUtilizationResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventListResult.java new file mode 100644 index 000000000000..b0ef4f70b084 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Test Base Customer Events. */ +@Fluent +public final class CustomerEventListResult { + /* + * The list of Test Base Customer Events. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Test Base Customer Events. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Test Base Customer Events. + * + * @param value the value value to set. + * @return the CustomerEventListResult object itself. + */ + public CustomerEventListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventResource.java new file mode 100644 index 000000000000..f769fa6c71e6 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventResource.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner; +import java.util.List; + +/** An immutable client-side representation of CustomerEventResource. */ +public interface CustomerEventResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the eventName property: The name of the event subscribed to. + * + * @return the eventName value. + */ + String eventName(); + + /** + * Gets the receivers property: The notification event receivers. + * + * @return the receivers value. + */ + List receivers(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner object. + * + * @return the inner object. + */ + CustomerEventResourceInner innerModel(); + + /** The entirety of the CustomerEventResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CustomerEventResource definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomerEventResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CustomerEventResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, testBaseAccountName. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @return the next definition stage. + */ + WithCreate withExistingTestBaseAccount(String resourceGroupName, String testBaseAccountName); + } + /** + * The stage of the CustomerEventResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithEventName, DefinitionStages.WithReceivers { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomerEventResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomerEventResource create(Context context); + } + /** The stage of the CustomerEventResource definition allowing to specify eventName. */ + interface WithEventName { + /** + * Specifies the eventName property: The name of the event subscribed to.. + * + * @param eventName The name of the event subscribed to. + * @return the next definition stage. + */ + WithCreate withEventName(String eventName); + } + /** The stage of the CustomerEventResource definition allowing to specify receivers. */ + interface WithReceivers { + /** + * Specifies the receivers property: The notification event receivers.. + * + * @param receivers The notification event receivers. + * @return the next definition stage. + */ + WithCreate withReceivers(List receivers); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomerEventResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomerEventResource refresh(Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEvents.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEvents.java new file mode 100644 index 000000000000..14bab0cfeb11 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEvents.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CustomerEvents. */ +public interface CustomerEvents { + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTestBaseAccount(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all notification events subscribed under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Customer Events as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String testBaseAccountName, String customerEventName); + + /** + * Deletes a Test Base Customer Event. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String testBaseAccountName, String customerEventName, Context context); + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent. + */ + CustomerEventResource get(String resourceGroupName, String testBaseAccountName, String customerEventName); + + /** + * Gets a Test Base CustomerEvent. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param customerEventName The resource name of the Test Base Customer event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String customerEventName, Context context); + + /** + * Gets a Test Base CustomerEvent. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent along with {@link Response}. + */ + CustomerEventResource getById(String id); + + /** + * Gets a Test Base CustomerEvent. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base CustomerEvent along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Test Base Customer Event. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Test Base Customer Event. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomerEventResource resource. + * + * @param name resource name. + * @return the first stage of the new CustomerEventResource definition. + */ + CustomerEventResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateHeaders.java new file mode 100644 index 000000000000..54c2c45310dd --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomerEventsCreateHeaders model. */ +@Fluent +public final class CustomerEventsCreateHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the CustomerEventsCreateHeaders object itself. + */ + public CustomerEventsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateResponse.java new file mode 100644 index 000000000000..bae45dc49b4f --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsCreateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.testbase.fluent.models.CustomerEventResourceInner; + +/** Contains all response data for the create operation. */ +public final class CustomerEventsCreateResponse + extends ResponseBase { + /** + * Creates an instance of CustomerEventsCreateResponse. + * + * @param request the request which resulted in this CustomerEventsCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CustomerEventsCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CustomerEventResourceInner value, + CustomerEventsCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CustomerEventResourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteHeaders.java new file mode 100644 index 000000000000..3f812dc9c773 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomerEventsDeleteHeaders model. */ +@Fluent +public final class CustomerEventsDeleteHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the CustomerEventsDeleteHeaders object itself. + */ + public CustomerEventsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CustomerEventsDeleteHeaders object itself. + */ + public CustomerEventsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteResponse.java new file mode 100644 index 000000000000..d26f8519f956 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/CustomerEventsDeleteResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class CustomerEventsDeleteResponse extends ResponseBase { + /** + * Creates an instance of CustomerEventsDeleteResponse. + * + * @param request the request which resulted in this CustomerEventsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CustomerEventsDeleteResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, CustomerEventsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DistributionGroupListReceiverValue.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DistributionGroupListReceiverValue.java new file mode 100644 index 000000000000..405f15c5e35c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DistributionGroupListReceiverValue.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The user object receiver value. */ +@Fluent +public final class DistributionGroupListReceiverValue { + /* + * The list of distribution groups. + */ + @JsonProperty(value = "distributionGroups") + private List distributionGroups; + + /** + * Get the distributionGroups property: The list of distribution groups. + * + * @return the distributionGroups value. + */ + public List distributionGroups() { + return this.distributionGroups; + } + + /** + * Set the distributionGroups property: The list of distribution groups. + * + * @param distributionGroups the distributionGroups value to set. + * @return the DistributionGroupListReceiverValue object itself. + */ + public DistributionGroupListReceiverValue withDistributionGroups(List distributionGroups) { + this.distributionGroups = distributionGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DownloadUrlResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DownloadUrlResponse.java new file mode 100644 index 000000000000..00d48023f887 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/DownloadUrlResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of DownloadUrlResponse. */ +public interface DownloadUrlResponse { + /** + * Gets the downloadUrl property: The download URL. + * + * @return the downloadUrl value. + */ + String downloadUrl(); + + /** + * Gets the expirationTime property: Expiry date of the download URL. + * + * @return the expirationTime value. + */ + OffsetDateTime expirationTime(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.DownloadUrlResponseInner object. + * + * @return the inner object. + */ + DownloadUrlResponseInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventListResult.java new file mode 100644 index 000000000000..ac3b4b1b115c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.EmailEventResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of email events. */ +@Fluent +public final class EmailEventListResult { + /* + * The list of email events. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of email events. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of email events. + * + * @param value the value value to set. + * @return the EmailEventListResult object itself. + */ + public EmailEventListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventResource.java new file mode 100644 index 000000000000..bb0c138ff3d3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEventResource.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.EmailEventResourceInner; + +/** An immutable client-side representation of EmailEventResource. */ +public interface EmailEventResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the eventId property: The identifier of the email event. + * + * @return the eventId value. + */ + String eventId(); + + /** + * Gets the eventName property: The name of the email event. + * + * @return the eventName value. + */ + String eventName(); + + /** + * Gets the displayName property: The display name of the email event. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.EmailEventResourceInner object. + * + * @return the inner object. + */ + EmailEventResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEvents.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEvents.java new file mode 100644 index 000000000000..b7a29bb20948 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/EmailEvents.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of EmailEvents. */ +public interface EmailEvents { + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the email events of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of email events as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account. + */ + EmailEventResource get(String resourceGroupName, String testBaseAccountName, String emailEventResourceName); + + /** + * Gets a email event of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param emailEventResourceName The resource name of an email event. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a email event of a Test Base Account along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String emailEventResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ExecutionStatus.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ExecutionStatus.java new file mode 100644 index 000000000000..5da0d4a80cd1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ExecutionStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExecutionStatus. */ +public final class ExecutionStatus extends ExpandableStringEnum { + /** Static value None for ExecutionStatus. */ + public static final ExecutionStatus NONE = fromString("None"); + + /** Static value InProgress for ExecutionStatus. */ + public static final ExecutionStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Processing for ExecutionStatus. */ + public static final ExecutionStatus PROCESSING = fromString("Processing"); + + /** Static value Completed for ExecutionStatus. */ + public static final ExecutionStatus COMPLETED = fromString("Completed"); + + /** Static value NotExecuted for ExecutionStatus. */ + public static final ExecutionStatus NOT_EXECUTED = fromString("NotExecuted"); + + /** Static value Incomplete for ExecutionStatus. */ + public static final ExecutionStatus INCOMPLETE = fromString("Incomplete"); + + /** Static value Failed for ExecutionStatus. */ + public static final ExecutionStatus FAILED = fromString("Failed"); + + /** Static value Succeeded for ExecutionStatus. */ + public static final ExecutionStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Creates or finds a ExecutionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionStatus. + */ + @JsonCreator + public static ExecutionStatus fromString(String name) { + return fromString(name, ExecutionStatus.class); + } + + /** @return known ExecutionStatus values. */ + public static Collection values() { + return values(ExecutionStatus.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessListResult.java new file mode 100644 index 000000000000..5ea1d601ff8b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.FavoriteProcessResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of favorite processes for a package. */ +@Fluent +public final class FavoriteProcessListResult { + /* + * The list of favorite processes for a package. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of favorite processes for a package. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of favorite processes for a package. + * + * @param value the value value to set. + * @return the FavoriteProcessListResult object itself. + */ + public FavoriteProcessListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessResource.java new file mode 100644 index 000000000000..f1e6e16b268f --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcessResource.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.FavoriteProcessResourceInner; + +/** An immutable client-side representation of FavoriteProcessResource. */ +public interface FavoriteProcessResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the actualProcessName property: The actual name of the favorite process. It will be equal to resource name + * except for the scenario that the process name contains characters that are not allowed in the resource name. + * + * @return the actualProcessName value. + */ + String actualProcessName(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.FavoriteProcessResourceInner object. + * + * @return the inner object. + */ + FavoriteProcessResourceInner innerModel(); + + /** The entirety of the FavoriteProcessResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The FavoriteProcessResource definition stages. */ + interface DefinitionStages { + /** The first stage of the FavoriteProcessResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the FavoriteProcessResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, testBaseAccountName, packageName. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @return the next definition stage. + */ + WithCreate withExistingPackage(String resourceGroupName, String testBaseAccountName, String packageName); + } + /** + * The stage of the FavoriteProcessResource definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithActualProcessName { + /** + * Executes the create request. + * + * @return the created resource. + */ + FavoriteProcessResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FavoriteProcessResource create(Context context); + } + /** The stage of the FavoriteProcessResource definition allowing to specify actualProcessName. */ + interface WithActualProcessName { + /** + * Specifies the actualProcessName property: The actual name of the favorite process. It will be equal to + * resource name except for the scenario that the process name contains characters that are not allowed in + * the resource name.. + * + * @param actualProcessName The actual name of the favorite process. It will be equal to resource name + * except for the scenario that the process name contains characters that are not allowed in the + * resource name. + * @return the next definition stage. + */ + WithCreate withActualProcessName(String actualProcessName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FavoriteProcessResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FavoriteProcessResource refresh(Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcesses.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcesses.java new file mode 100644 index 000000000000..2c85b32a16f2 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FavoriteProcesses.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FavoriteProcesses. */ +public interface FavoriteProcesses { + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Lists the favorite processes for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of favorite processes for a package as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName); + + /** + * Deletes a favorite process for a specific package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context); + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package. + */ + FavoriteProcessResource get( + String resourceGroupName, String testBaseAccountName, String packageName, String favoriteProcessResourceName); + + /** + * Gets a favorite process for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param favoriteProcessResourceName The resource name of a favorite process in a package. If the process name + * contains characters that are not allowed in Azure Resource Name, we use 'actualProcessName' in request body + * to submit the name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String favoriteProcessResourceName, + Context context); + + /** + * Gets a favorite process for a Test Base Package. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package along with {@link Response}. + */ + FavoriteProcessResource getById(String id); + + /** + * Gets a favorite process for a Test Base Package. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a favorite process for a Test Base Package along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a favorite process for a specific package. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a favorite process for a specific package. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FavoriteProcessResource resource. + * + * @param name resource name. + * @return the first stage of the new FavoriteProcessResource definition. + */ + FavoriteProcessResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FileUploadUrlResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FileUploadUrlResponse.java new file mode 100644 index 000000000000..07489ddc6205 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FileUploadUrlResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.FileUploadUrlResponseInner; + +/** An immutable client-side representation of FileUploadUrlResponse. */ +public interface FileUploadUrlResponse { + /** + * Gets the uploadUrl property: The URL used for uploading the package. + * + * @return the uploadUrl value. + */ + String uploadUrl(); + + /** + * Gets the blobPath property: The blob path of the uploaded package. It will be used as the 'blobPath' property of + * PackageResource. + * + * @return the blobPath value. + */ + String blobPath(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.FileUploadUrlResponseInner object. + * + * @return the inner object. + */ + FileUploadUrlResponseInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingListResult.java new file mode 100644 index 000000000000..764b96438b2b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.FlightingRingResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of flighting rings. */ +@Fluent +public final class FlightingRingListResult { + /* + * The list of flighting rings. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of flighting rings. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of flighting rings. + * + * @param value the value value to set. + * @return the FlightingRingListResult object itself. + */ + public FlightingRingListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingResource.java new file mode 100644 index 000000000000..a814a332b367 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRingResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.FlightingRingResourceInner; + +/** An immutable client-side representation of FlightingRingResource. */ +public interface FlightingRingResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the actualFlightingRingName property: The actual name of a flighting ring of a Test Base Account. + * + * @return the actualFlightingRingName value. + */ + String actualFlightingRingName(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.FlightingRingResourceInner object. + * + * @return the inner object. + */ + FlightingRingResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRings.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRings.java new file mode 100644 index 000000000000..34f62d6097d6 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/FlightingRings.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of FlightingRings. */ +public interface FlightingRings { + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the flighting rings of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of flighting rings as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account. + */ + FlightingRingResource get(String resourceGroupName, String testBaseAccountName, String flightingRingResourceName); + + /** + * Gets a flighting ring of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param flightingRingResourceName The resource name of a flighting ring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a flighting ring of a Test Base Account along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String flightingRingResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/GetFileUploadUrlParameters.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/GetFileUploadUrlParameters.java new file mode 100644 index 000000000000..83541773839b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/GetFileUploadUrlParameters.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters supplied to the Test Base Account GetFileUploadURL action. */ +@Fluent +public final class GetFileUploadUrlParameters { + /* + * The custom file name of the uploaded blob. + */ + @JsonProperty(value = "blobName") + private String blobName; + + /** + * Get the blobName property: The custom file name of the uploaded blob. + * + * @return the blobName value. + */ + public String blobName() { + return this.blobName; + } + + /** + * Set the blobName property: The custom file name of the uploaded blob. + * + * @param blobName the blobName value to set. + * @return the GetFileUploadUrlParameters object itself. + */ + public GetFileUploadUrlParameters withBlobName(String blobName) { + this.blobName = blobName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Grade.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Grade.java new file mode 100644 index 000000000000..1e355ecc6f7a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Grade.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Grade. */ +public final class Grade extends ExpandableStringEnum { + /** Static value None for Grade. */ + public static final Grade NONE = fromString("None"); + + /** Static value NotAvailable for Grade. */ + public static final Grade NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Pass for Grade. */ + public static final Grade PASS = fromString("Pass"); + + /** Static value Fail for Grade. */ + public static final Grade FAIL = fromString("Fail"); + + /** + * Creates or finds a Grade from its string representation. + * + * @param name a name to look for. + * @return the corresponding Grade. + */ + @JsonCreator + public static Grade fromString(String name) { + return fromString(name, Grade.class); + } + + /** @return known Grade values. */ + public static Collection values() { + return values(Grade.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/IdentifiedFailure.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/IdentifiedFailure.java new file mode 100644 index 000000000000..b49663335443 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/IdentifiedFailure.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The failure identified. */ +@Fluent +public final class IdentifiedFailure { + /* + * The Failure Id. + */ + @JsonProperty(value = "failureId") + private String failureId; + + /* + * The category of the failure. + */ + @JsonProperty(value = "category") + private Category category; + + /* + * Message that shows information about the failure. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * Guidance that shows what the customer needs to do for this failure. + */ + @JsonProperty(value = "guidance") + private String guidance; + + /** + * Get the failureId property: The Failure Id. + * + * @return the failureId value. + */ + public String failureId() { + return this.failureId; + } + + /** + * Set the failureId property: The Failure Id. + * + * @param failureId the failureId value to set. + * @return the IdentifiedFailure object itself. + */ + public IdentifiedFailure withFailureId(String failureId) { + this.failureId = failureId; + return this; + } + + /** + * Get the category property: The category of the failure. + * + * @return the category value. + */ + public Category category() { + return this.category; + } + + /** + * Set the category property: The category of the failure. + * + * @param category the category value to set. + * @return the IdentifiedFailure object itself. + */ + public IdentifiedFailure withCategory(Category category) { + this.category = category; + return this; + } + + /** + * Get the errorMessage property: Message that shows information about the failure. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Message that shows information about the failure. + * + * @param errorMessage the errorMessage value to set. + * @return the IdentifiedFailure object itself. + */ + public IdentifiedFailure withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the guidance property: Guidance that shows what the customer needs to do for this failure. + * + * @return the guidance value. + */ + public String guidance() { + return this.guidance; + } + + /** + * Set the guidance property: Guidance that shows what the customer needs to do for this failure. + * + * @param guidance the guidance value to set. + * @return the IdentifiedFailure object itself. + */ + public IdentifiedFailure withGuidance(String guidance) { + this.guidance = guidance; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryRegressionResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryRegressionResultSingletonResourceProperties.java new file mode 100644 index 000000000000..ce032d648845 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryRegressionResultSingletonResourceProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of Memory Regression Result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "analysisResultType") +@JsonTypeName("MemoryRegression") +@Fluent +public final class MemoryRegressionResultSingletonResourceProperties extends AnalysisResultSingletonResourceProperties { + /* + * The result array data. + */ + @JsonProperty(value = "memoryRegressionResults") + private List memoryRegressionResults; + + /** + * Get the memoryRegressionResults property: The result array data. + * + * @return the memoryRegressionResults value. + */ + public List memoryRegressionResults() { + return this.memoryRegressionResults; + } + + /** + * Set the memoryRegressionResults property: The result array data. + * + * @param memoryRegressionResults the memoryRegressionResults value to set. + * @return the MemoryRegressionResultSingletonResourceProperties object itself. + */ + public MemoryRegressionResultSingletonResourceProperties withMemoryRegressionResults( + List memoryRegressionResults) { + this.memoryRegressionResults = memoryRegressionResults; + return this; + } + + /** {@inheritDoc} */ + @Override + public MemoryRegressionResultSingletonResourceProperties withGrade(Grade grade) { + super.withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (memoryRegressionResults() != null) { + memoryRegressionResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryUtilizationResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryUtilizationResultSingletonResourceProperties.java new file mode 100644 index 000000000000..773de235767a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/MemoryUtilizationResultSingletonResourceProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of Memory Utilization Result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "analysisResultType") +@JsonTypeName("MemoryUtilization") +@Fluent +public final class MemoryUtilizationResultSingletonResourceProperties + extends AnalysisResultSingletonResourceProperties { + /* + * The result array data. + */ + @JsonProperty(value = "memoryUtilizationResults") + private List memoryUtilizationResults; + + /** + * Get the memoryUtilizationResults property: The result array data. + * + * @return the memoryUtilizationResults value. + */ + public List memoryUtilizationResults() { + return this.memoryUtilizationResults; + } + + /** + * Set the memoryUtilizationResults property: The result array data. + * + * @param memoryUtilizationResults the memoryUtilizationResults value to set. + * @return the MemoryUtilizationResultSingletonResourceProperties object itself. + */ + public MemoryUtilizationResultSingletonResourceProperties withMemoryUtilizationResults( + List memoryUtilizationResults) { + this.memoryUtilizationResults = memoryUtilizationResults; + return this; + } + + /** {@inheritDoc} */ + @Override + public MemoryUtilizationResultSingletonResourceProperties withGrade(Grade grade) { + super.withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (memoryUtilizationResults() != null) { + memoryUtilizationResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationEventReceiver.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationEventReceiver.java new file mode 100644 index 000000000000..61ddeac0a689 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationEventReceiver.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A notification event receivers. */ +@Fluent +public final class NotificationEventReceiver { + /* + * The type of the notification event receiver. + */ + @JsonProperty(value = "receiverType") + private String receiverType; + + /* + * The notification event receiver value. + */ + @JsonProperty(value = "receiverValue") + private NotificationReceiverValue receiverValue; + + /** + * Get the receiverType property: The type of the notification event receiver. + * + * @return the receiverType value. + */ + public String receiverType() { + return this.receiverType; + } + + /** + * Set the receiverType property: The type of the notification event receiver. + * + * @param receiverType the receiverType value to set. + * @return the NotificationEventReceiver object itself. + */ + public NotificationEventReceiver withReceiverType(String receiverType) { + this.receiverType = receiverType; + return this; + } + + /** + * Get the receiverValue property: The notification event receiver value. + * + * @return the receiverValue value. + */ + public NotificationReceiverValue receiverValue() { + return this.receiverValue; + } + + /** + * Set the receiverValue property: The notification event receiver value. + * + * @param receiverValue the receiverValue value to set. + * @return the NotificationEventReceiver object itself. + */ + public NotificationEventReceiver withReceiverValue(NotificationReceiverValue receiverValue) { + this.receiverValue = receiverValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (receiverValue() != null) { + receiverValue().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationReceiverValue.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationReceiverValue.java new file mode 100644 index 000000000000..b2c074ee147c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/NotificationReceiverValue.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A notification event receiver value. */ +@Fluent +public final class NotificationReceiverValue { + /* + * The user object receiver value. + */ + @JsonProperty(value = "userObjectReceiverValue") + private UserObjectReceiverValue userObjectReceiverValue; + + /* + * The user object receiver value. + */ + @JsonProperty(value = "subscriptionReceiverValue") + private SubscriptionReceiverValue subscriptionReceiverValue; + + /* + * The user object receiver value. + */ + @JsonProperty(value = "distributionGroupListReceiverValue") + private DistributionGroupListReceiverValue distributionGroupListReceiverValue; + + /** + * Get the userObjectReceiverValue property: The user object receiver value. + * + * @return the userObjectReceiverValue value. + */ + public UserObjectReceiverValue userObjectReceiverValue() { + return this.userObjectReceiverValue; + } + + /** + * Set the userObjectReceiverValue property: The user object receiver value. + * + * @param userObjectReceiverValue the userObjectReceiverValue value to set. + * @return the NotificationReceiverValue object itself. + */ + public NotificationReceiverValue withUserObjectReceiverValue(UserObjectReceiverValue userObjectReceiverValue) { + this.userObjectReceiverValue = userObjectReceiverValue; + return this; + } + + /** + * Get the subscriptionReceiverValue property: The user object receiver value. + * + * @return the subscriptionReceiverValue value. + */ + public SubscriptionReceiverValue subscriptionReceiverValue() { + return this.subscriptionReceiverValue; + } + + /** + * Set the subscriptionReceiverValue property: The user object receiver value. + * + * @param subscriptionReceiverValue the subscriptionReceiverValue value to set. + * @return the NotificationReceiverValue object itself. + */ + public NotificationReceiverValue withSubscriptionReceiverValue( + SubscriptionReceiverValue subscriptionReceiverValue) { + this.subscriptionReceiverValue = subscriptionReceiverValue; + return this; + } + + /** + * Get the distributionGroupListReceiverValue property: The user object receiver value. + * + * @return the distributionGroupListReceiverValue value. + */ + public DistributionGroupListReceiverValue distributionGroupListReceiverValue() { + return this.distributionGroupListReceiverValue; + } + + /** + * Set the distributionGroupListReceiverValue property: The user object receiver value. + * + * @param distributionGroupListReceiverValue the distributionGroupListReceiverValue value to set. + * @return the NotificationReceiverValue object itself. + */ + public NotificationReceiverValue withDistributionGroupListReceiverValue( + DistributionGroupListReceiverValue distributionGroupListReceiverValue) { + this.distributionGroupListReceiverValue = distributionGroupListReceiverValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userObjectReceiverValue() != null) { + userObjectReceiverValue().validate(); + } + if (subscriptionReceiverValue() != null) { + subscriptionReceiverValue().validate(); + } + if (distributionGroupListReceiverValue() != null) { + distributionGroupListReceiverValue().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateListResult.java new file mode 100644 index 000000000000..b157175761bf --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.OSUpdateResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of OS Updates. */ +@Fluent +public final class OSUpdateListResult { + /* + * The list of OS Updates. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of OS Updates. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of OS Updates. + * + * @param value the value value to set. + * @return the OSUpdateListResult object itself. + */ + public OSUpdateListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateResource.java new file mode 100644 index 000000000000..5576f64a1479 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateResource.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.OSUpdateResourceInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OSUpdateResource. */ +public interface OSUpdateResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the osName property: The name of the OS. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the release property: The name of tested release. + * + * @return the release value. + */ + String release(); + + /** + * Gets the flightingRing property: The flighting ring, only for release of feature updates. + * + * @return the flightingRing value. + */ + String flightingRing(); + + /** + * Gets the buildVersion property: The build version of the tested release (OS update). + * + * @return the buildVersion value. + */ + String buildVersion(); + + /** + * Gets the buildRevision property: The build revision of the tested release (OS update). + * + * @return the buildRevision value. + */ + String buildRevision(); + + /** + * Gets the typePropertiesType property: The type of this release (OS update). + * + * @return the typePropertiesType value. + */ + Type typePropertiesType(); + + /** + * Gets the releaseVersionDate property: The release version date the tested release (OS update). + * + * @return the releaseVersionDate value. + */ + OffsetDateTime releaseVersionDate(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.OSUpdateResourceInner object. + * + * @return the inner object. + */ + OSUpdateResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateTestSummary.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateTestSummary.java new file mode 100644 index 000000000000..9bbc1d6a27e5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdateTestSummary.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The summary of a test. */ +@Fluent +public final class OSUpdateTestSummary { + /* + * The operating system name. e.g. Windows 10 1809. + */ + @JsonProperty(value = "osName") + private String osName; + + /* + * The name of the tested release (OS update). + */ + @JsonProperty(value = "releaseName") + private String releaseName; + + /* + * The build version of the tested release (OS update) + */ + @JsonProperty(value = "buildVersion") + private String buildVersion; + + /* + * The build revision of the tested release (OS update) + */ + @JsonProperty(value = "buildRevision") + private String buildRevision; + + /* + * The release version date. + */ + @JsonProperty(value = "releaseVersionDate") + private OffsetDateTime releaseVersionDate; + + /* + * The flighting ring, only for release of feature updates. + */ + @JsonProperty(value = "flightingRing") + private String flightingRing; + + /* + * The execution status of the test. + */ + @JsonProperty(value = "executionStatus") + private ExecutionStatus executionStatus; + + /* + * The status of the test. + */ + @JsonProperty(value = "testStatus") + private TestStatus testStatus; + + /* + * The grade of the test. + */ + @JsonProperty(value = "grade") + private Grade grade; + + /* + * The run time of the test. + */ + @JsonProperty(value = "testRunTime") + private String testRunTime; + + /* + * The test type of the package + */ + @JsonProperty(value = "testType") + private String testType; + + /** + * Get the osName property: The operating system name. e.g. Windows 10 1809. + * + * @return the osName value. + */ + public String osName() { + return this.osName; + } + + /** + * Set the osName property: The operating system name. e.g. Windows 10 1809. + * + * @param osName the osName value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withOsName(String osName) { + this.osName = osName; + return this; + } + + /** + * Get the releaseName property: The name of the tested release (OS update). + * + * @return the releaseName value. + */ + public String releaseName() { + return this.releaseName; + } + + /** + * Set the releaseName property: The name of the tested release (OS update). + * + * @param releaseName the releaseName value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withReleaseName(String releaseName) { + this.releaseName = releaseName; + return this; + } + + /** + * Get the buildVersion property: The build version of the tested release (OS update). + * + * @return the buildVersion value. + */ + public String buildVersion() { + return this.buildVersion; + } + + /** + * Set the buildVersion property: The build version of the tested release (OS update). + * + * @param buildVersion the buildVersion value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withBuildVersion(String buildVersion) { + this.buildVersion = buildVersion; + return this; + } + + /** + * Get the buildRevision property: The build revision of the tested release (OS update). + * + * @return the buildRevision value. + */ + public String buildRevision() { + return this.buildRevision; + } + + /** + * Set the buildRevision property: The build revision of the tested release (OS update). + * + * @param buildRevision the buildRevision value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withBuildRevision(String buildRevision) { + this.buildRevision = buildRevision; + return this; + } + + /** + * Get the releaseVersionDate property: The release version date. + * + * @return the releaseVersionDate value. + */ + public OffsetDateTime releaseVersionDate() { + return this.releaseVersionDate; + } + + /** + * Set the releaseVersionDate property: The release version date. + * + * @param releaseVersionDate the releaseVersionDate value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withReleaseVersionDate(OffsetDateTime releaseVersionDate) { + this.releaseVersionDate = releaseVersionDate; + return this; + } + + /** + * Get the flightingRing property: The flighting ring, only for release of feature updates. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.flightingRing; + } + + /** + * Set the flightingRing property: The flighting ring, only for release of feature updates. + * + * @param flightingRing the flightingRing value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withFlightingRing(String flightingRing) { + this.flightingRing = flightingRing; + return this; + } + + /** + * Get the executionStatus property: The execution status of the test. + * + * @return the executionStatus value. + */ + public ExecutionStatus executionStatus() { + return this.executionStatus; + } + + /** + * Set the executionStatus property: The execution status of the test. + * + * @param executionStatus the executionStatus value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withExecutionStatus(ExecutionStatus executionStatus) { + this.executionStatus = executionStatus; + return this; + } + + /** + * Get the testStatus property: The status of the test. + * + * @return the testStatus value. + */ + public TestStatus testStatus() { + return this.testStatus; + } + + /** + * Set the testStatus property: The status of the test. + * + * @param testStatus the testStatus value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withTestStatus(TestStatus testStatus) { + this.testStatus = testStatus; + return this; + } + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.grade; + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withGrade(Grade grade) { + this.grade = grade; + return this; + } + + /** + * Get the testRunTime property: The run time of the test. + * + * @return the testRunTime value. + */ + public String testRunTime() { + return this.testRunTime; + } + + /** + * Set the testRunTime property: The run time of the test. + * + * @param testRunTime the testRunTime value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withTestRunTime(String testRunTime) { + this.testRunTime = testRunTime; + return this; + } + + /** + * Get the testType property: The test type of the package. + * + * @return the testType value. + */ + public String testType() { + return this.testType; + } + + /** + * Set the testType property: The test type of the package. + * + * @param testType the testType value to set. + * @return the OSUpdateTestSummary object itself. + */ + public OSUpdateTestSummary withTestType(String testType) { + this.testType = testType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdates.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdates.java new file mode 100644 index 000000000000..09d75a305378 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdates.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OSUpdates. */ +public interface OSUpdates { + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType); + + /** + * Lists the OS Updates in which the package were tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of OS Updates as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + Context context); + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before. + */ + OSUpdateResource get( + String resourceGroupName, String testBaseAccountName, String packageName, String osUpdateResourceName); + + /** + * Gets an OS Update by name in which the package was tested before. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateResourceName The resource name of an OS Update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an OS Update by name in which the package was tested before along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String osUpdateResourceName, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdatesTestSummary.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdatesTestSummary.java new file mode 100644 index 000000000000..2dcb4229caae --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OSUpdatesTestSummary.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The summary of some tests. */ +@Fluent +public final class OSUpdatesTestSummary { + /* + * The status of the last test. + */ + @JsonProperty(value = "executionStatus") + private ExecutionStatus executionStatus; + + /* + * The status of last test. + */ + @JsonProperty(value = "testStatus") + private TestStatus testStatus; + + /* + * The grade of last test. + */ + @JsonProperty(value = "grade") + private Grade grade; + + /* + * The run time of the last test. + */ + @JsonProperty(value = "testRunTime") + private String testRunTime; + + /* + * Detailed summary for each OS update + */ + @JsonProperty(value = "osUpdateTestSummaries") + private List osUpdateTestSummaries; + + /** + * Get the executionStatus property: The status of the last test. + * + * @return the executionStatus value. + */ + public ExecutionStatus executionStatus() { + return this.executionStatus; + } + + /** + * Set the executionStatus property: The status of the last test. + * + * @param executionStatus the executionStatus value to set. + * @return the OSUpdatesTestSummary object itself. + */ + public OSUpdatesTestSummary withExecutionStatus(ExecutionStatus executionStatus) { + this.executionStatus = executionStatus; + return this; + } + + /** + * Get the testStatus property: The status of last test. + * + * @return the testStatus value. + */ + public TestStatus testStatus() { + return this.testStatus; + } + + /** + * Set the testStatus property: The status of last test. + * + * @param testStatus the testStatus value to set. + * @return the OSUpdatesTestSummary object itself. + */ + public OSUpdatesTestSummary withTestStatus(TestStatus testStatus) { + this.testStatus = testStatus; + return this; + } + + /** + * Get the grade property: The grade of last test. + * + * @return the grade value. + */ + public Grade grade() { + return this.grade; + } + + /** + * Set the grade property: The grade of last test. + * + * @param grade the grade value to set. + * @return the OSUpdatesTestSummary object itself. + */ + public OSUpdatesTestSummary withGrade(Grade grade) { + this.grade = grade; + return this; + } + + /** + * Get the testRunTime property: The run time of the last test. + * + * @return the testRunTime value. + */ + public String testRunTime() { + return this.testRunTime; + } + + /** + * Set the testRunTime property: The run time of the last test. + * + * @param testRunTime the testRunTime value to set. + * @return the OSUpdatesTestSummary object itself. + */ + public OSUpdatesTestSummary withTestRunTime(String testRunTime) { + this.testRunTime = testRunTime; + return this; + } + + /** + * Get the osUpdateTestSummaries property: Detailed summary for each OS update. + * + * @return the osUpdateTestSummaries value. + */ + public List osUpdateTestSummaries() { + return this.osUpdateTestSummaries; + } + + /** + * Set the osUpdateTestSummaries property: Detailed summary for each OS update. + * + * @param osUpdateTestSummaries the osUpdateTestSummaries value to set. + * @return the OSUpdatesTestSummary object itself. + */ + public OSUpdatesTestSummary withOsUpdateTestSummaries(List osUpdateTestSummaries) { + this.osUpdateTestSummaries = osUpdateTestSummaries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osUpdateTestSummaries() != null) { + osUpdateTestSummaries().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operation.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operation.java new file mode 100644 index 000000000000..0346516305e1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the display property: The object that describes the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the properties property: Extra properties of the operation. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationDisplay.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationDisplay.java new file mode 100644 index 000000000000..ce2e3e3ddeeb --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationDisplay.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that describes the operation. */ +@Immutable +public final class OperationDisplay { + /* + * The resource provider name: Microsoft.TestBase. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * Operation type: read, write, delete, listPackages, etc. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * Resource type on which the operation is performed. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * Friendly name of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The resource provider name: Microsoft.TestBase. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the operation property: Operation type: read, write, delete, listPackages, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the resource property: Resource type on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the description property: Friendly name of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationListResult.java new file mode 100644 index 000000000000..a89295b0c2a4 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OperationListResult.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of operations supported by the resource provider. */ +@Fluent +public final class OperationListResult { + /* + * List of operations supported by the Test Base resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations supported by the Test Base resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of operations supported by the Test Base resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operations.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operations.java new file mode 100644 index 000000000000..efc113f38669 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.TestBase provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations supported by the resource provider as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OsUpdateType.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OsUpdateType.java new file mode 100644 index 000000000000..c28b2d6b570b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/OsUpdateType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OsUpdateType. */ +public final class OsUpdateType extends ExpandableStringEnum { + /** Static value SecurityUpdate for OsUpdateType. */ + public static final OsUpdateType SECURITY_UPDATE = fromString("SecurityUpdate"); + + /** Static value FeatureUpdate for OsUpdateType. */ + public static final OsUpdateType FEATURE_UPDATE = fromString("FeatureUpdate"); + + /** + * Creates or finds a OsUpdateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OsUpdateType. + */ + @JsonCreator + public static OsUpdateType fromString(String name) { + return fromString(name, OsUpdateType.class); + } + + /** @return known OsUpdateType values. */ + public static Collection values() { + return values(OsUpdateType.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageCheckNameAvailabilityParameters.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageCheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..dfad96046f9d --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageCheckNameAvailabilityParameters.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters body to pass for Test Base Package name availability check. */ +@Fluent +public final class PackageCheckNameAvailabilityParameters { + /* + * Resource name to verify. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Application name to verify. + */ + @JsonProperty(value = "applicationName", required = true) + private String applicationName; + + /* + * Version name to verify. + */ + @JsonProperty(value = "version", required = true) + private String version; + + /* + * fully qualified resource type which includes provider namespace. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Get the name property: Resource name to verify. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Resource name to verify. + * + * @param name the name value to set. + * @return the PackageCheckNameAvailabilityParameters object itself. + */ + public PackageCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the applicationName property: Application name to verify. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: Application name to verify. + * + * @param applicationName the applicationName value to set. + * @return the PackageCheckNameAvailabilityParameters object itself. + */ + public PackageCheckNameAvailabilityParameters withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the version property: Version name to verify. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version name to verify. + * + * @param version the version value to set. + * @return the PackageCheckNameAvailabilityParameters object itself. + */ + public PackageCheckNameAvailabilityParameters withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the type property: fully qualified resource type which includes provider namespace. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: fully qualified resource type which includes provider namespace. + * + * @param type the type value to set. + * @return the PackageCheckNameAvailabilityParameters object itself. + */ + public PackageCheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model PackageCheckNameAvailabilityParameters")); + } + if (applicationName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationName in model PackageCheckNameAvailabilityParameters")); + } + if (version() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property version in model PackageCheckNameAvailabilityParameters")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model PackageCheckNameAvailabilityParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PackageCheckNameAvailabilityParameters.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageListResult.java new file mode 100644 index 000000000000..3062a78c63c2 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Test Base Packages. */ +@Fluent +public final class PackageListResult { + /* + * The list of Test Base Packages. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Test Base Packages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Test Base Packages. + * + * @param value the value value to set. + * @return the PackageListResult object itself. + */ + public PackageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageResource.java new file mode 100644 index 000000000000..d00f0859c97c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageResource.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PackageResource. */ +public interface PackageResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the applicationName property: Application name. + * + * @return the applicationName value. + */ + String applicationName(); + + /** + * Gets the version property: Application version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the testTypes property: OOB, functional or both. Mapped to the data in 'tests' property. + * + * @return the testTypes value. + */ + List testTypes(); + + /** + * Gets the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @return the targetOSList value. + */ + List targetOSList(); + + /** + * Gets the packageStatus property: The status of the package. + * + * @return the packageStatus value. + */ + PackageStatus packageStatus(); + + /** + * Gets the lastModifiedTime property: The UTC timestamp when the package was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the flightingRing property: The flighting ring for feature update. + * + * @return the flightingRing value. + */ + String flightingRing(); + + /** + * Gets the isEnabled property: Flag showing that whether the package is enabled. It doesn't schedule test for + * package which is not enabled. + * + * @return the isEnabled value. + */ + Boolean isEnabled(); + + /** + * Gets the blobPath property: The file path of the package. + * + * @return the blobPath value. + */ + String blobPath(); + + /** + * Gets the validationResults property: The validation results. There's validation on package when it's created or + * updated. + * + * @return the validationResults value. + */ + List validationResults(); + + /** + * Gets the tests property: The detailed test information. + * + * @return the tests value. + */ + List tests(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner object. + * + * @return the inner object. + */ + PackageResourceInner innerModel(); + + /** The entirety of the PackageResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The PackageResource definition stages. */ + interface DefinitionStages { + /** The first stage of the PackageResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PackageResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the PackageResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, testBaseAccountName. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @return the next definition stage. + */ + WithCreate withExistingTestBaseAccount(String resourceGroupName, String testBaseAccountName); + } + /** + * The stage of the PackageResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithApplicationName, + DefinitionStages.WithVersion, + DefinitionStages.WithTargetOSList, + DefinitionStages.WithFlightingRing, + DefinitionStages.WithBlobPath, + DefinitionStages.WithTests { + /** + * Executes the create request. + * + * @return the created resource. + */ + PackageResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PackageResource create(Context context); + } + /** The stage of the PackageResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PackageResource definition allowing to specify applicationName. */ + interface WithApplicationName { + /** + * Specifies the applicationName property: Application name. + * + * @param applicationName Application name. + * @return the next definition stage. + */ + WithCreate withApplicationName(String applicationName); + } + /** The stage of the PackageResource definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Application version. + * + * @param version Application version. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + /** The stage of the PackageResource definition allowing to specify targetOSList. */ + interface WithTargetOSList { + /** + * Specifies the targetOSList property: Specifies the target OSs of specific OS Update types.. + * + * @param targetOSList Specifies the target OSs of specific OS Update types. + * @return the next definition stage. + */ + WithCreate withTargetOSList(List targetOSList); + } + /** The stage of the PackageResource definition allowing to specify flightingRing. */ + interface WithFlightingRing { + /** + * Specifies the flightingRing property: The flighting ring for feature update.. + * + * @param flightingRing The flighting ring for feature update. + * @return the next definition stage. + */ + WithCreate withFlightingRing(String flightingRing); + } + /** The stage of the PackageResource definition allowing to specify blobPath. */ + interface WithBlobPath { + /** + * Specifies the blobPath property: The file path of the package.. + * + * @param blobPath The file path of the package. + * @return the next definition stage. + */ + WithCreate withBlobPath(String blobPath); + } + /** The stage of the PackageResource definition allowing to specify tests. */ + interface WithTests { + /** + * Specifies the tests property: The detailed test information.. + * + * @param tests The detailed test information. + * @return the next definition stage. + */ + WithCreate withTests(List tests); + } + } + /** + * Begins update for the PackageResource resource. + * + * @return the stage of resource update. + */ + PackageResource.Update update(); + + /** The template for PackageResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithTargetOSList, + UpdateStages.WithFlightingRing, + UpdateStages.WithIsEnabled, + UpdateStages.WithBlobPath, + UpdateStages.WithTests { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PackageResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PackageResource apply(Context context); + } + /** The PackageResource update stages. */ + interface UpdateStages { + /** The stage of the PackageResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags of the Package.. + * + * @param tags The tags of the Package. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PackageResource update allowing to specify targetOSList. */ + interface WithTargetOSList { + /** + * Specifies the targetOSList property: Specifies the target OSs of specific OS Update types.. + * + * @param targetOSList Specifies the target OSs of specific OS Update types. + * @return the next definition stage. + */ + Update withTargetOSList(List targetOSList); + } + /** The stage of the PackageResource update allowing to specify flightingRing. */ + interface WithFlightingRing { + /** + * Specifies the flightingRing property: The flighting ring for feature update.. + * + * @param flightingRing The flighting ring for feature update. + * @return the next definition stage. + */ + Update withFlightingRing(String flightingRing); + } + /** The stage of the PackageResource update allowing to specify isEnabled. */ + interface WithIsEnabled { + /** + * Specifies the isEnabled property: Specifies whether the package is enabled. It doesn't schedule test for + * package which is not enabled.. + * + * @param isEnabled Specifies whether the package is enabled. It doesn't schedule test for package which is + * not enabled. + * @return the next definition stage. + */ + Update withIsEnabled(Boolean isEnabled); + } + /** The stage of the PackageResource update allowing to specify blobPath. */ + interface WithBlobPath { + /** + * Specifies the blobPath property: The file name of the package.. + * + * @param blobPath The file name of the package. + * @return the next definition stage. + */ + Update withBlobPath(String blobPath); + } + /** The stage of the PackageResource update allowing to specify tests. */ + interface WithTests { + /** + * Specifies the tests property: The detailed test information.. + * + * @param tests The detailed test information. + * @return the next definition stage. + */ + Update withTests(List tests); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PackageResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PackageResource refresh(Context context); + + /** + * Hard Delete a Test Base Package. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hardDelete(); + + /** + * Hard Delete a Test Base Package. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hardDelete(Context context); + + /** + * Gets the download URL of a package. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package. + */ + DownloadUrlResponse getDownloadUrl(); + + /** + * Gets the download URL of a package. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package along with {@link Response}. + */ + Response getDownloadUrlWithResponse(Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageStatus.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageStatus.java new file mode 100644 index 000000000000..2b91067ac15a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageStatus.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PackageStatus. */ +public final class PackageStatus extends ExpandableStringEnum { + /** Static value Unknown for PackageStatus. */ + public static final PackageStatus UNKNOWN = fromString("Unknown"); + + /** Static value Registered for PackageStatus. */ + public static final PackageStatus REGISTERED = fromString("Registered"); + + /** Static value Ready for PackageStatus. */ + public static final PackageStatus READY = fromString("Ready"); + + /** Static value Error for PackageStatus. */ + public static final PackageStatus ERROR = fromString("Error"); + + /** Static value ValidatingPackage for PackageStatus. */ + public static final PackageStatus VALIDATING_PACKAGE = fromString("ValidatingPackage"); + + /** Static value PreValidationCheckPass for PackageStatus. */ + public static final PackageStatus PRE_VALIDATION_CHECK_PASS = fromString("PreValidationCheckPass"); + + /** Static value Deleted for PackageStatus. */ + public static final PackageStatus DELETED = fromString("Deleted"); + + /** Static value ValidationLongerThanUsual for PackageStatus. */ + public static final PackageStatus VALIDATION_LONGER_THAN_USUAL = fromString("ValidationLongerThanUsual"); + + /** Static value VerifyingPackage for PackageStatus. */ + public static final PackageStatus VERIFYING_PACKAGE = fromString("VerifyingPackage"); + + /** + * Creates or finds a PackageStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageStatus. + */ + @JsonCreator + public static PackageStatus fromString(String name) { + return fromString(name, PackageStatus.class); + } + + /** @return known PackageStatus values. */ + public static Collection values() { + return values(PackageStatus.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageUpdateParameters.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageUpdateParameters.java new file mode 100644 index 000000000000..fa8007bb4b86 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageUpdateParameters.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.PackageUpdateParameterProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Parameters supplied to update a Test Base Package. */ +@Fluent +public final class PackageUpdateParameters { + /* + * Test Base Package update parameters. + */ + @JsonProperty(value = "properties") + private PackageUpdateParameterProperties innerProperties; + + /* + * The tags of the Package. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the innerProperties property: Test Base Package update parameters. + * + * @return the innerProperties value. + */ + private PackageUpdateParameterProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: The tags of the Package. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags of the Package. + * + * @param tags the tags value to set. + * @return the PackageUpdateParameters object itself. + */ + public PackageUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @return the targetOSList value. + */ + public List targetOSList() { + return this.innerProperties() == null ? null : this.innerProperties().targetOSList(); + } + + /** + * Set the targetOSList property: Specifies the target OSs of specific OS Update types. + * + * @param targetOSList the targetOSList value to set. + * @return the PackageUpdateParameters object itself. + */ + public PackageUpdateParameters withTargetOSList(List targetOSList) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageUpdateParameterProperties(); + } + this.innerProperties().withTargetOSList(targetOSList); + return this; + } + + /** + * Get the flightingRing property: The flighting ring for feature update. + * + * @return the flightingRing value. + */ + public String flightingRing() { + return this.innerProperties() == null ? null : this.innerProperties().flightingRing(); + } + + /** + * Set the flightingRing property: The flighting ring for feature update. + * + * @param flightingRing the flightingRing value to set. + * @return the PackageUpdateParameters object itself. + */ + public PackageUpdateParameters withFlightingRing(String flightingRing) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageUpdateParameterProperties(); + } + this.innerProperties().withFlightingRing(flightingRing); + return this; + } + + /** + * Get the isEnabled property: Specifies whether the package is enabled. It doesn't schedule test for package which + * is not enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); + } + + /** + * Set the isEnabled property: Specifies whether the package is enabled. It doesn't schedule test for package which + * is not enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the PackageUpdateParameters object itself. + */ + public PackageUpdateParameters withIsEnabled(Boolean isEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageUpdateParameterProperties(); + } + this.innerProperties().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the blobPath property: The file name of the package. + * + * @return the blobPath value. + */ + public String blobPath() { + return this.innerProperties() == null ? null : this.innerProperties().blobPath(); + } + + /** + * Set the blobPath property: The file name of the package. + * + * @param blobPath the blobPath value to set. + * @return the PackageUpdateParameters object itself. + */ + public PackageUpdateParameters withBlobPath(String blobPath) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageUpdateParameterProperties(); + } + this.innerProperties().withBlobPath(blobPath); + return this; + } + + /** + * Get the tests property: The detailed test information. + * + * @return the tests value. + */ + public List tests() { + return this.innerProperties() == null ? null : this.innerProperties().tests(); + } + + /** + * Set the tests property: The detailed test information. + * + * @param tests the tests value to set. + * @return the PackageUpdateParameters object itself. + */ + public PackageUpdateParameters withTests(List tests) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageUpdateParameterProperties(); + } + this.innerProperties().withTests(tests); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageValidationResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageValidationResult.java new file mode 100644 index 000000000000..a2346b29c658 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackageValidationResult.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The validation results. There's validation on package when it's created or updated. */ +@Immutable +public final class PackageValidationResult { + /* + * Validation name. + */ + @JsonProperty(value = "validationName", access = JsonProperty.Access.WRITE_ONLY) + private String validationName; + + /* + * Indicates whether the package passed the validation. + */ + @JsonProperty(value = "isValid", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isValid; + + /* + * Error information. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * Get the validationName property: Validation name. + * + * @return the validationName value. + */ + public String validationName() { + return this.validationName; + } + + /** + * Get the isValid property: Indicates whether the package passed the validation. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Get the errors property: Error information. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Packages.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Packages.java new file mode 100644 index 000000000000..5b5c550b4651 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Packages.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Packages. */ +public interface Packages { + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTestBaseAccount(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Packages as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTestBaseAccount( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Deletes a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package. + */ + PackageResource get(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Gets a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Hard Delete a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hardDelete(String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package. + */ + DownloadUrlResponse getDownloadUrl(String resourceGroupName, String testBaseAccountName, String packageName); + + /** + * Gets the download URL of a package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of a package along with {@link Response}. + */ + Response getDownloadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, String packageName, Context context); + + /** + * Gets a Test Base Package. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package along with {@link Response}. + */ + PackageResource getById(String id); + + /** + * Gets a Test Base Package. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Package along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Test Base Package. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Test Base Package. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PackageResource resource. + * + * @param name resource name. + * @return the first stage of the new PackageResource definition. + */ + PackageResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateHeaders.java new file mode 100644 index 000000000000..ff21238cd5ef --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PackagesCreateHeaders model. */ +@Fluent +public final class PackagesCreateHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PackagesCreateHeaders object itself. + */ + public PackagesCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateResponse.java new file mode 100644 index 000000000000..f545119a5e0c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesCreateResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; + +/** Contains all response data for the create operation. */ +public final class PackagesCreateResponse extends ResponseBase { + /** + * Creates an instance of PackagesCreateResponse. + * + * @param request the request which resulted in this PackagesCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PackagesCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PackageResourceInner value, + PackagesCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PackageResourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteHeaders.java new file mode 100644 index 000000000000..b7c4e9224cd9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PackagesDeleteHeaders model. */ +@Fluent +public final class PackagesDeleteHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PackagesDeleteHeaders object itself. + */ + public PackagesDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the PackagesDeleteHeaders object itself. + */ + public PackagesDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteResponse.java new file mode 100644 index 000000000000..9597bd54ae7d --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesDeleteResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class PackagesDeleteResponse extends ResponseBase { + /** + * Creates an instance of PackagesDeleteResponse. + * + * @param request the request which resulted in this PackagesDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PackagesDeleteResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, PackagesDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteHeaders.java new file mode 100644 index 000000000000..c5c001f61ef3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PackagesHardDeleteHeaders model. */ +@Fluent +public final class PackagesHardDeleteHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PackagesHardDeleteHeaders object itself. + */ + public PackagesHardDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the PackagesHardDeleteHeaders object itself. + */ + public PackagesHardDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteResponse.java new file mode 100644 index 000000000000..ca326ea8a367 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesHardDeleteResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the hardDelete operation. */ +public final class PackagesHardDeleteResponse extends ResponseBase { + /** + * Creates an instance of PackagesHardDeleteResponse. + * + * @param request the request which resulted in this PackagesHardDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PackagesHardDeleteResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, PackagesHardDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateHeaders.java new file mode 100644 index 000000000000..8a82a32eaae0 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PackagesUpdateHeaders model. */ +@Fluent +public final class PackagesUpdateHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PackagesUpdateHeaders object itself. + */ + public PackagesUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the PackagesUpdateHeaders object itself. + */ + public PackagesUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateResponse.java new file mode 100644 index 000000000000..9ad97839c796 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/PackagesUpdateResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.testbase.fluent.models.PackageResourceInner; + +/** Contains all response data for the update operation. */ +public final class PackagesUpdateResponse extends ResponseBase { + /** + * Creates an instance of PackagesUpdateResponse. + * + * @param request the request which resulted in this PackagesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PackagesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PackageResourceInner value, + PackagesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PackageResourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ProvisioningState.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ProvisioningState.java new file mode 100644 index 000000000000..2297fd9b04e3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for ProvisioningState. */ + public static final ProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Reason.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Reason.java new file mode 100644 index 000000000000..48f71518f49c --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Reason.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Reason. */ +public final class Reason extends ExpandableStringEnum { + /** Static value Invalid for Reason. */ + public static final Reason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for Reason. */ + public static final Reason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a Reason from its string representation. + * + * @param name a name to look for. + * @return the corresponding Reason. + */ + @JsonCreator + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** @return known Reason values. */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionResult.java new file mode 100644 index 000000000000..7acaeb252b10 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionResult.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The regression result. */ +@Fluent +public final class RegressionResult { + /* + * FileName of the binary being analyzed. + */ + @JsonProperty(value = "fileName") + private String fileName; + + /* + * The grade of the test. + */ + @JsonProperty(value = "grade") + private Grade grade; + + /* + * Message that facilitates debugging a particular regression, if any was + * inferred. + */ + @JsonProperty(value = "details") + private String details; + + /* + * Difference between the two datasets being analyzed. + */ + @JsonProperty(value = "diff") + private Double diff; + + /* + * Indicates if a regression was inferred. + */ + @JsonProperty(value = "isRegressed") + private Boolean isRegressed; + + /** + * Get the fileName property: FileName of the binary being analyzed. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: FileName of the binary being analyzed. + * + * @param fileName the fileName value to set. + * @return the RegressionResult object itself. + */ + public RegressionResult withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the grade property: The grade of the test. + * + * @return the grade value. + */ + public Grade grade() { + return this.grade; + } + + /** + * Set the grade property: The grade of the test. + * + * @param grade the grade value to set. + * @return the RegressionResult object itself. + */ + public RegressionResult withGrade(Grade grade) { + this.grade = grade; + return this; + } + + /** + * Get the details property: Message that facilitates debugging a particular regression, if any was inferred. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Set the details property: Message that facilitates debugging a particular regression, if any was inferred. + * + * @param details the details value to set. + * @return the RegressionResult object itself. + */ + public RegressionResult withDetails(String details) { + this.details = details; + return this; + } + + /** + * Get the diff property: Difference between the two datasets being analyzed. + * + * @return the diff value. + */ + public Double diff() { + return this.diff; + } + + /** + * Set the diff property: Difference between the two datasets being analyzed. + * + * @param diff the diff value to set. + * @return the RegressionResult object itself. + */ + public RegressionResult withDiff(Double diff) { + this.diff = diff; + return this; + } + + /** + * Get the isRegressed property: Indicates if a regression was inferred. + * + * @return the isRegressed value. + */ + public Boolean isRegressed() { + return this.isRegressed; + } + + /** + * Set the isRegressed property: Indicates if a regression was inferred. + * + * @param isRegressed the isRegressed value to set. + * @return the RegressionResult object itself. + */ + public RegressionResult withIsRegressed(Boolean isRegressed) { + this.isRegressed = isRegressed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionTestDetails.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionTestDetails.java new file mode 100644 index 000000000000..b780055a1e39 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/RegressionTestDetails.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The details of a regression test. */ +@Fluent +public final class RegressionTestDetails { + /* + * Difference between the two datasets being analyzed. + */ + @JsonProperty(value = "diff") + private Double diff; + + /* + * Indicates if a regression was inferred. + */ + @JsonProperty(value = "isRegressed") + private Boolean isRegressed; + + /** + * Get the diff property: Difference between the two datasets being analyzed. + * + * @return the diff value. + */ + public Double diff() { + return this.diff; + } + + /** + * Set the diff property: Difference between the two datasets being analyzed. + * + * @param diff the diff value to set. + * @return the RegressionTestDetails object itself. + */ + public RegressionTestDetails withDiff(Double diff) { + this.diff = diff; + return this; + } + + /** + * Get the isRegressed property: Indicates if a regression was inferred. + * + * @return the isRegressed value. + */ + public Boolean isRegressed() { + return this.isRegressed; + } + + /** + * Set the isRegressed property: Indicates if a regression was inferred. + * + * @param isRegressed the isRegressed value to set. + * @return the RegressionTestDetails object itself. + */ + public RegressionTestDetails withIsRegressed(Boolean isRegressed) { + this.isRegressed = isRegressed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResult.java new file mode 100644 index 000000000000..56c377e5c698 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResult.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Reliability Result. */ +@Fluent +public final class ReliabilityResult { + /* + * File name. + */ + @JsonProperty(value = "fileName") + private String fileName; + + /* + * Count of number of launches. + */ + @JsonProperty(value = "launchCount") + private Integer launchCount; + + /* + * Count of number of crashes. + */ + @JsonProperty(value = "crashCount") + private Integer crashCount; + + /* + * Count of number of hangs. + */ + @JsonProperty(value = "hangCount") + private Integer hangCount; + + /* + * The regression grade. + */ + @JsonProperty(value = "regressionGrade") + private Grade regressionGrade; + + /* + * The statistic regression grade for crash signal. + */ + @JsonProperty(value = "crashRegressionGrade") + private Grade crashRegressionGrade; + + /* + * Details related to the crash regression analysis. + */ + @JsonProperty(value = "crashRegressionTestDetails") + private RegressionTestDetails crashRegressionTestDetails; + + /* + * The statistic regression grade for hang signal. + */ + @JsonProperty(value = "hangRegressionGrade") + private Grade hangRegressionGrade; + + /* + * Details related to the hang regression analysis. + */ + @JsonProperty(value = "hangRegressionTestDetails") + private RegressionTestDetails hangRegressionTestDetails; + + /** + * Get the fileName property: File name. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: File name. + * + * @param fileName the fileName value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the launchCount property: Count of number of launches. + * + * @return the launchCount value. + */ + public Integer launchCount() { + return this.launchCount; + } + + /** + * Set the launchCount property: Count of number of launches. + * + * @param launchCount the launchCount value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withLaunchCount(Integer launchCount) { + this.launchCount = launchCount; + return this; + } + + /** + * Get the crashCount property: Count of number of crashes. + * + * @return the crashCount value. + */ + public Integer crashCount() { + return this.crashCount; + } + + /** + * Set the crashCount property: Count of number of crashes. + * + * @param crashCount the crashCount value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withCrashCount(Integer crashCount) { + this.crashCount = crashCount; + return this; + } + + /** + * Get the hangCount property: Count of number of hangs. + * + * @return the hangCount value. + */ + public Integer hangCount() { + return this.hangCount; + } + + /** + * Set the hangCount property: Count of number of hangs. + * + * @param hangCount the hangCount value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withHangCount(Integer hangCount) { + this.hangCount = hangCount; + return this; + } + + /** + * Get the regressionGrade property: The regression grade. + * + * @return the regressionGrade value. + */ + public Grade regressionGrade() { + return this.regressionGrade; + } + + /** + * Set the regressionGrade property: The regression grade. + * + * @param regressionGrade the regressionGrade value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withRegressionGrade(Grade regressionGrade) { + this.regressionGrade = regressionGrade; + return this; + } + + /** + * Get the crashRegressionGrade property: The statistic regression grade for crash signal. + * + * @return the crashRegressionGrade value. + */ + public Grade crashRegressionGrade() { + return this.crashRegressionGrade; + } + + /** + * Set the crashRegressionGrade property: The statistic regression grade for crash signal. + * + * @param crashRegressionGrade the crashRegressionGrade value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withCrashRegressionGrade(Grade crashRegressionGrade) { + this.crashRegressionGrade = crashRegressionGrade; + return this; + } + + /** + * Get the crashRegressionTestDetails property: Details related to the crash regression analysis. + * + * @return the crashRegressionTestDetails value. + */ + public RegressionTestDetails crashRegressionTestDetails() { + return this.crashRegressionTestDetails; + } + + /** + * Set the crashRegressionTestDetails property: Details related to the crash regression analysis. + * + * @param crashRegressionTestDetails the crashRegressionTestDetails value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withCrashRegressionTestDetails(RegressionTestDetails crashRegressionTestDetails) { + this.crashRegressionTestDetails = crashRegressionTestDetails; + return this; + } + + /** + * Get the hangRegressionGrade property: The statistic regression grade for hang signal. + * + * @return the hangRegressionGrade value. + */ + public Grade hangRegressionGrade() { + return this.hangRegressionGrade; + } + + /** + * Set the hangRegressionGrade property: The statistic regression grade for hang signal. + * + * @param hangRegressionGrade the hangRegressionGrade value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withHangRegressionGrade(Grade hangRegressionGrade) { + this.hangRegressionGrade = hangRegressionGrade; + return this; + } + + /** + * Get the hangRegressionTestDetails property: Details related to the hang regression analysis. + * + * @return the hangRegressionTestDetails value. + */ + public RegressionTestDetails hangRegressionTestDetails() { + return this.hangRegressionTestDetails; + } + + /** + * Set the hangRegressionTestDetails property: Details related to the hang regression analysis. + * + * @param hangRegressionTestDetails the hangRegressionTestDetails value to set. + * @return the ReliabilityResult object itself. + */ + public ReliabilityResult withHangRegressionTestDetails(RegressionTestDetails hangRegressionTestDetails) { + this.hangRegressionTestDetails = hangRegressionTestDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (crashRegressionTestDetails() != null) { + crashRegressionTestDetails().validate(); + } + if (hangRegressionTestDetails() != null) { + hangRegressionTestDetails().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResultSingletonResourceProperties.java new file mode 100644 index 000000000000..3660d50a9e8f --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ReliabilityResultSingletonResourceProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of Reliability Result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "analysisResultType") +@JsonTypeName("Reliability") +@Fluent +public final class ReliabilityResultSingletonResourceProperties extends AnalysisResultSingletonResourceProperties { + /* + * The result array data. + */ + @JsonProperty(value = "reliabilityResults") + private List reliabilityResults; + + /** + * Get the reliabilityResults property: The result array data. + * + * @return the reliabilityResults value. + */ + public List reliabilityResults() { + return this.reliabilityResults; + } + + /** + * Set the reliabilityResults property: The result array data. + * + * @param reliabilityResults the reliabilityResults value to set. + * @return the ReliabilityResultSingletonResourceProperties object itself. + */ + public ReliabilityResultSingletonResourceProperties withReliabilityResults( + List reliabilityResults) { + this.reliabilityResults = reliabilityResults; + return this; + } + + /** {@inheritDoc} */ + @Override + public ReliabilityResultSingletonResourceProperties withGrade(Grade grade) { + super.withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (reliabilityResults() != null) { + reliabilityResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResult.java new file mode 100644 index 000000000000..e65b7ceff36a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResult.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Script Execution Result. */ +@Fluent +public final class ScriptExecutionResult { + /* + * Name of script. + */ + @JsonProperty(value = "scriptName") + private String scriptName; + + /* + * Start time of script execution. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * End time of script execution. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Exit code. + */ + @JsonProperty(value = "exitCode") + private Integer exitCode; + + /* + * Whether the script execution is timed out. + */ + @JsonProperty(value = "timedOut") + private Boolean timedOut; + + /** + * Get the scriptName property: Name of script. + * + * @return the scriptName value. + */ + public String scriptName() { + return this.scriptName; + } + + /** + * Set the scriptName property: Name of script. + * + * @param scriptName the scriptName value to set. + * @return the ScriptExecutionResult object itself. + */ + public ScriptExecutionResult withScriptName(String scriptName) { + this.scriptName = scriptName; + return this; + } + + /** + * Get the startTime property: Start time of script execution. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of script execution. + * + * @param startTime the startTime value to set. + * @return the ScriptExecutionResult object itself. + */ + public ScriptExecutionResult withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: End time of script execution. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: End time of script execution. + * + * @param endTime the endTime value to set. + * @return the ScriptExecutionResult object itself. + */ + public ScriptExecutionResult withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the exitCode property: Exit code. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Set the exitCode property: Exit code. + * + * @param exitCode the exitCode value to set. + * @return the ScriptExecutionResult object itself. + */ + public ScriptExecutionResult withExitCode(Integer exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get the timedOut property: Whether the script execution is timed out. + * + * @return the timedOut value. + */ + public Boolean timedOut() { + return this.timedOut; + } + + /** + * Set the timedOut property: Whether the script execution is timed out. + * + * @param timedOut the timedOut value to set. + * @return the ScriptExecutionResult object itself. + */ + public ScriptExecutionResult withTimedOut(Boolean timedOut) { + this.timedOut = timedOut; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResultSingletonResourceProperties.java new file mode 100644 index 000000000000..22c9ae56e8fc --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ScriptExecutionResultSingletonResourceProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of Script Execution Result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "analysisResultType") +@JsonTypeName("ScriptExecution") +@Fluent +public final class ScriptExecutionResultSingletonResourceProperties extends AnalysisResultSingletonResourceProperties { + /* + * The result array data. + */ + @JsonProperty(value = "scriptExecutionResults") + private List scriptExecutionResults; + + /** + * Get the scriptExecutionResults property: The result array data. + * + * @return the scriptExecutionResults value. + */ + public List scriptExecutionResults() { + return this.scriptExecutionResults; + } + + /** + * Set the scriptExecutionResults property: The result array data. + * + * @param scriptExecutionResults the scriptExecutionResults value to set. + * @return the ScriptExecutionResultSingletonResourceProperties object itself. + */ + public ScriptExecutionResultSingletonResourceProperties withScriptExecutionResults( + List scriptExecutionResults) { + this.scriptExecutionResults = scriptExecutionResults; + return this; + } + + /** {@inheritDoc} */ + @Override + public ScriptExecutionResultSingletonResourceProperties withGrade(Grade grade) { + super.withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (scriptExecutionResults() != null) { + scriptExecutionResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Skus.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Skus.java new file mode 100644 index 000000000000..1fe844646673 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Skus.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the available SKUs of Test Base Account in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account SKUs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/SubscriptionReceiverValue.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/SubscriptionReceiverValue.java new file mode 100644 index 000000000000..d58ed41fda9a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/SubscriptionReceiverValue.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The subscription role receiver value. */ +@Fluent +public final class SubscriptionReceiverValue { + /* + * The subscription id of the notification receiver. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /* + * The subscription name of the notification receiver. + */ + @JsonProperty(value = "subscriptionName") + private String subscriptionName; + + /* + * The role of the notification receiver. + */ + @JsonProperty(value = "role") + private String role; + + /** + * Get the subscriptionId property: The subscription id of the notification receiver. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: The subscription id of the notification receiver. + * + * @param subscriptionId the subscriptionId value to set. + * @return the SubscriptionReceiverValue object itself. + */ + public SubscriptionReceiverValue withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the subscriptionName property: The subscription name of the notification receiver. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; + } + + /** + * Set the subscriptionName property: The subscription name of the notification receiver. + * + * @param subscriptionName the subscriptionName value to set. + * @return the SubscriptionReceiverValue object itself. + */ + public SubscriptionReceiverValue withSubscriptionName(String subscriptionName) { + this.subscriptionName = subscriptionName; + return this; + } + + /** + * Get the role property: The role of the notification receiver. + * + * @return the role value. + */ + public String role() { + return this.role; + } + + /** + * Set the role property: The role of the notification receiver. + * + * @param role the role value to set. + * @return the SubscriptionReceiverValue object itself. + */ + public SubscriptionReceiverValue withRole(String role) { + this.role = role; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TargetOSInfo.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TargetOSInfo.java new file mode 100644 index 000000000000..d8f677212d42 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TargetOSInfo.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The information of the target OS to be tested. */ +@Fluent +public final class TargetOSInfo { + /* + * Specifies the OS update type to test against, e.g., 'Security updates' + * or 'Feature updates'. + */ + @JsonProperty(value = "osUpdateType", required = true) + private String osUpdateType; + + /* + * Specifies the target OSs to be tested. + */ + @JsonProperty(value = "targetOSs", required = true) + private List targetOSs; + + /** + * Get the osUpdateType property: Specifies the OS update type to test against, e.g., 'Security updates' or 'Feature + * updates'. + * + * @return the osUpdateType value. + */ + public String osUpdateType() { + return this.osUpdateType; + } + + /** + * Set the osUpdateType property: Specifies the OS update type to test against, e.g., 'Security updates' or 'Feature + * updates'. + * + * @param osUpdateType the osUpdateType value to set. + * @return the TargetOSInfo object itself. + */ + public TargetOSInfo withOsUpdateType(String osUpdateType) { + this.osUpdateType = osUpdateType; + return this; + } + + /** + * Get the targetOSs property: Specifies the target OSs to be tested. + * + * @return the targetOSs value. + */ + public List targetOSs() { + return this.targetOSs; + } + + /** + * Set the targetOSs property: Specifies the target OSs to be tested. + * + * @param targetOSs the targetOSs value to set. + * @return the TargetOSInfo object itself. + */ + public TargetOSInfo withTargetOSs(List targetOSs) { + this.targetOSs = targetOSs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osUpdateType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property osUpdateType in model TargetOSInfo")); + } + if (targetOSs() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property targetOSs in model TargetOSInfo")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TargetOSInfo.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Test.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Test.java new file mode 100644 index 000000000000..a41b544e0e58 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Test.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The definition of a Test. */ +@Fluent +public final class Test { + /* + * The type of the test. + */ + @JsonProperty(value = "testType", required = true) + private TestType testType; + + /* + * The status of the validation run of the package. + */ + @JsonProperty(value = "validationRunStatus", access = JsonProperty.Access.WRITE_ONLY) + private ValidationRunStatus validationRunStatus; + + /* + * Indicates if this test is active.It doesn't schedule test for not active + * Test. + */ + @JsonProperty(value = "isActive") + private Boolean isActive; + + /* + * The commands used in the test. + */ + @JsonProperty(value = "commands", required = true) + private List commands; + + /** + * Get the testType property: The type of the test. + * + * @return the testType value. + */ + public TestType testType() { + return this.testType; + } + + /** + * Set the testType property: The type of the test. + * + * @param testType the testType value to set. + * @return the Test object itself. + */ + public Test withTestType(TestType testType) { + this.testType = testType; + return this; + } + + /** + * Get the validationRunStatus property: The status of the validation run of the package. + * + * @return the validationRunStatus value. + */ + public ValidationRunStatus validationRunStatus() { + return this.validationRunStatus; + } + + /** + * Get the isActive property: Indicates if this test is active.It doesn't schedule test for not active Test. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Set the isActive property: Indicates if this test is active.It doesn't schedule test for not active Test. + * + * @param isActive the isActive value to set. + * @return the Test object itself. + */ + public Test withIsActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get the commands property: The commands used in the test. + * + * @return the commands value. + */ + public List commands() { + return this.commands; + } + + /** + * Set the commands property: The commands used in the test. + * + * @param commands the commands value to set. + * @return the Test object itself. + */ + public Test withCommands(List commands) { + this.commands = commands; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (testType() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property testType in model Test")); + } + if (commands() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property commands in model Test")); + } else { + commands().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Test.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResult.java new file mode 100644 index 000000000000..6f1b8934ba53 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResult.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The test analysis result. */ +@Fluent +public final class TestAnalysisResult { + /* + * The data to provide more failure analysis information. + */ + @JsonProperty(value = "blobData") + private String blobData; + + /* + * The status of the analysis. + */ + @JsonProperty(value = "testAnalysisStatus") + private TestAnalysisStatus testAnalysisStatus; + + /* + * The array of identified failures. + */ + @JsonProperty(value = "identifiedFailures") + private List identifiedFailures; + + /** + * Get the blobData property: The data to provide more failure analysis information. + * + * @return the blobData value. + */ + public String blobData() { + return this.blobData; + } + + /** + * Set the blobData property: The data to provide more failure analysis information. + * + * @param blobData the blobData value to set. + * @return the TestAnalysisResult object itself. + */ + public TestAnalysisResult withBlobData(String blobData) { + this.blobData = blobData; + return this; + } + + /** + * Get the testAnalysisStatus property: The status of the analysis. + * + * @return the testAnalysisStatus value. + */ + public TestAnalysisStatus testAnalysisStatus() { + return this.testAnalysisStatus; + } + + /** + * Set the testAnalysisStatus property: The status of the analysis. + * + * @param testAnalysisStatus the testAnalysisStatus value to set. + * @return the TestAnalysisResult object itself. + */ + public TestAnalysisResult withTestAnalysisStatus(TestAnalysisStatus testAnalysisStatus) { + this.testAnalysisStatus = testAnalysisStatus; + return this; + } + + /** + * Get the identifiedFailures property: The array of identified failures. + * + * @return the identifiedFailures value. + */ + public List identifiedFailures() { + return this.identifiedFailures; + } + + /** + * Set the identifiedFailures property: The array of identified failures. + * + * @param identifiedFailures the identifiedFailures value to set. + * @return the TestAnalysisResult object itself. + */ + public TestAnalysisResult withIdentifiedFailures(List identifiedFailures) { + this.identifiedFailures = identifiedFailures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identifiedFailures() != null) { + identifiedFailures().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResultSingletonResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResultSingletonResourceProperties.java new file mode 100644 index 000000000000..ed298c0c8d96 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisResultSingletonResourceProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.AnalysisResultSingletonResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The properties of Test Analysis Result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "analysisResultType") +@JsonTypeName("TestAnalysis") +@Fluent +public final class TestAnalysisResultSingletonResourceProperties extends AnalysisResultSingletonResourceProperties { + /* + * The result of test analysis. + */ + @JsonProperty(value = "testAnalysisResult") + private TestAnalysisResult testAnalysisResult; + + /** + * Get the testAnalysisResult property: The result of test analysis. + * + * @return the testAnalysisResult value. + */ + public TestAnalysisResult testAnalysisResult() { + return this.testAnalysisResult; + } + + /** + * Set the testAnalysisResult property: The result of test analysis. + * + * @param testAnalysisResult the testAnalysisResult value to set. + * @return the TestAnalysisResultSingletonResourceProperties object itself. + */ + public TestAnalysisResultSingletonResourceProperties withTestAnalysisResult(TestAnalysisResult testAnalysisResult) { + this.testAnalysisResult = testAnalysisResult; + return this; + } + + /** {@inheritDoc} */ + @Override + public TestAnalysisResultSingletonResourceProperties withGrade(Grade grade) { + super.withGrade(grade); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (testAnalysisResult() != null) { + testAnalysisResult().validate(); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisStatus.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisStatus.java new file mode 100644 index 000000000000..770411140d57 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestAnalysisStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TestAnalysisStatus. */ +public final class TestAnalysisStatus extends ExpandableStringEnum { + /** Static value None for TestAnalysisStatus. */ + public static final TestAnalysisStatus NONE = fromString("None"); + + /** Static value Analyzing for TestAnalysisStatus. */ + public static final TestAnalysisStatus ANALYZING = fromString("Analyzing"); + + /** Static value Completed for TestAnalysisStatus. */ + public static final TestAnalysisStatus COMPLETED = fromString("Completed"); + + /** Static value Failed for TestAnalysisStatus. */ + public static final TestAnalysisStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a TestAnalysisStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestAnalysisStatus. + */ + @JsonCreator + public static TestAnalysisStatus fromString(String name) { + return fromString(name, TestAnalysisStatus.class); + } + + /** @return known TestAnalysisStatus values. */ + public static Collection values() { + return values(TestAnalysisStatus.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountListResult.java new file mode 100644 index 000000000000..0d411b6be461 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Test Base Accounts. */ +@Fluent +public final class TestBaseAccountListResult { + /* + * The list of Test Base Accounts. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Test Base Accounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Test Base Accounts. + * + * @param value the value value to set. + * @return the TestBaseAccountListResult object itself. + */ + public TestBaseAccountListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResource.java new file mode 100644 index 000000000000..7e339482a92a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResource.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import java.util.Map; + +/** An immutable client-side representation of TestBaseAccountResource. */ +public interface TestBaseAccountResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + TestBaseAccountSku sku(); + + /** + * Gets the accessLevel property: The access level of the Test Base Account. + * + * @return the accessLevel value. + */ + String accessLevel(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner object. + * + * @return the inner object. + */ + TestBaseAccountResourceInner innerModel(); + + /** The entirety of the TestBaseAccountResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The TestBaseAccountResource definition stages. */ + interface DefinitionStages { + /** The first stage of the TestBaseAccountResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the TestBaseAccountResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the TestBaseAccountResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the TestBaseAccountResource definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku, DefinitionStages.WithRestore { + /** + * Executes the create request. + * + * @return the created resource. + */ + TestBaseAccountResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TestBaseAccountResource create(Context context); + } + /** The stage of the TestBaseAccountResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the TestBaseAccountResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the Test Base Account.. + * + * @param sku The SKU of the Test Base Account. + * @return the next definition stage. + */ + WithCreate withSku(TestBaseAccountSkuInner sku); + } + /** The stage of the TestBaseAccountResource definition allowing to specify restore. */ + interface WithRestore { + /** + * Specifies the restore property: The flag indicating if we would like to restore the Test Base Accounts + * which were soft deleted before.. + * + * @param restore The flag indicating if we would like to restore the Test Base Accounts which were soft + * deleted before. + * @return the next definition stage. + */ + WithCreate withRestore(Boolean restore); + } + } + /** + * Begins update for the TestBaseAccountResource resource. + * + * @return the stage of resource update. + */ + TestBaseAccountResource.Update update(); + + /** The template for TestBaseAccountResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TestBaseAccountResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TestBaseAccountResource apply(Context context); + } + /** The TestBaseAccountResource update stages. */ + interface UpdateStages { + /** The stage of the TestBaseAccountResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags of the Test Base Account.. + * + * @param tags The tags of the Test Base Account. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the TestBaseAccountResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the Test Base Account.. + * + * @param sku The SKU of the Test Base Account. + * @return the next definition stage. + */ + Update withSku(TestBaseAccountSkuInner sku); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TestBaseAccountResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TestBaseAccountResource refresh(Context context); + + /** + * Offboard a Test Base Account. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void offboard(); + + /** + * Offboard a Test Base Account. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void offboard(Context context); + + /** + * Gets the file upload URL of a Test Base Account. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account. + */ + FileUploadUrlResponse getFileUploadUrl(); + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param parameters Parameters supplied to the Test Base Account GetFileUploadURL operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account along with {@link Response}. + */ + Response getFileUploadUrlWithResponse( + GetFileUploadUrlParameters parameters, Context context); + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties. + */ + CheckNameAvailabilityResult checkPackageNameAvailability(PackageCheckNameAvailabilityParameters parameters); + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties along with {@link Response}. + */ + Response checkPackageNameAvailabilityWithResponse( + PackageCheckNameAvailabilityParameters parameters, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResourceProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResourceProperties.java new file mode 100644 index 000000000000..7c3301f1e017 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountResourceProperties.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourcePropertiesInner; + +/** An immutable client-side representation of TestBaseAccountResourceProperties. */ +public interface TestBaseAccountResourceProperties { + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + TestBaseAccountSku sku(); + + /** + * Gets the accessLevel property: The access level of the Test Base Account. + * + * @return the accessLevel value. + */ + String accessLevel(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourcePropertiesInner object. + * + * @return the inner object. + */ + TestBaseAccountResourcePropertiesInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSku.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSku.java new file mode 100644 index 000000000000..62b13d9caa0b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSku.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import java.util.List; + +/** An immutable client-side representation of TestBaseAccountSku. */ +public interface TestBaseAccountSku { + /** + * Gets the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of the SKU. This is typically a letter + number code, such as B0 or S0. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: The tier of this particular SKU. + * + * @return the tier value. + */ + Tier tier(); + + /** + * Gets the capabilities property: The capabilities of a SKU. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the locations property: The locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner object. + * + * @return the inner object. + */ + TestBaseAccountSkuInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuCapability.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuCapability.java new file mode 100644 index 000000000000..9f55ad6867a5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuCapability.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Test Base Account SKU Capability. */ +@Fluent +public final class TestBaseAccountSkuCapability { + /* + * An invariant to describe the feature, such as 'SLA'. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * An invariant if the feature is measured by quantity, such as 99.9%. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name property: An invariant to describe the feature, such as 'SLA'. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: An invariant to describe the feature, such as 'SLA'. + * + * @param name the name value to set. + * @return the TestBaseAccountSkuCapability object itself. + */ + public TestBaseAccountSkuCapability withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: An invariant if the feature is measured by quantity, such as 99.9%. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: An invariant if the feature is measured by quantity, such as 99.9%. + * + * @param value the value value to set. + * @return the TestBaseAccountSkuCapability object itself. + */ + public TestBaseAccountSkuCapability withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model TestBaseAccountSkuCapability")); + } + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model TestBaseAccountSkuCapability")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TestBaseAccountSkuCapability.class); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuListResult.java new file mode 100644 index 000000000000..567279ea9bd8 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountSkuListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Test Base Account SKUs. */ +@Fluent +public final class TestBaseAccountSkuListResult { + /* + * The list of Test Base Account SKUs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Test Base Account SKUs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Test Base Account SKUs. + * + * @param value the value value to set. + * @return the TestBaseAccountSkuListResult object itself. + */ + public TestBaseAccountSkuListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameterProperties.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameterProperties.java new file mode 100644 index 000000000000..57502aff89fb --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameterProperties.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParameterPropertiesInner; + +/** An immutable client-side representation of TestBaseAccountUpdateParameterProperties. */ +public interface TestBaseAccountUpdateParameterProperties { + /** + * Gets the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + TestBaseAccountSku sku(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParameterPropertiesInner + * object. + * + * @return the inner object. + */ + TestBaseAccountUpdateParameterPropertiesInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameters.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameters.java new file mode 100644 index 000000000000..5d2d48c9988a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUpdateParameters.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParametersInner; +import java.util.Map; + +/** An immutable client-side representation of TestBaseAccountUpdateParameters. */ +public interface TestBaseAccountUpdateParameters { + /** + * Gets the tags property: The tags of the Test Base Account. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The SKU of the Test Base Account. + * + * @return the sku value. + */ + TestBaseAccountSku sku(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUpdateParametersInner object. + * + * @return the inner object. + */ + TestBaseAccountUpdateParametersInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageData.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageData.java new file mode 100644 index 000000000000..1afb7d4abb0e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageData.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUsageDataInner; + +/** An immutable client-side representation of TestBaseAccountUsageData. */ +public interface TestBaseAccountUsageData { + /** + * Gets the id property: Fully qualified ARM resource id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Localizable String object containing the name and a localized value. + * + * @return the name value. + */ + TestBaseAccountUsageName name(); + + /** + * Gets the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, + * Percent, CountPerSecond, BytesPerSecond. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the limit property: The maximum permitted value for the usage quota. If there is no limit, this value will + * be -1. + * + * @return the limit value. + */ + Long limit(); + + /** + * Gets the currentValue property: Current value for the usage quota. + * + * @return the currentValue value. + */ + Long currentValue(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUsageDataInner object. + * + * @return the inner object. + */ + TestBaseAccountUsageDataInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageDataList.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageDataList.java new file mode 100644 index 000000000000..ee55b4d850da --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageDataList.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountUsageDataInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Test Base Account usage data. */ +@Fluent +public final class TestBaseAccountUsageDataList { + /* + * The list of Test Base Account usage data. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Test Base Account usage data. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Test Base Account usage data. + * + * @param value the value value to set. + * @return the TestBaseAccountUsageDataList object itself. + */ + public TestBaseAccountUsageDataList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageName.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageName.java new file mode 100644 index 000000000000..44e2328667f9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountUsageName.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localizable String object containing the name and a localized value. */ +@Fluent +public final class TestBaseAccountUsageName { + /* + * The identifier of the usage. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Localized name of the usage. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: The identifier of the usage. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The identifier of the usage. + * + * @param value the value value to set. + * @return the TestBaseAccountUsageName object itself. + */ + public TestBaseAccountUsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: Localized name of the usage. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: Localized name of the usage. + * + * @param localizedValue the localizedValue value to set. + * @return the TestBaseAccountUsageName object itself. + */ + public TestBaseAccountUsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccounts.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccounts.java new file mode 100644 index 000000000000..57512c423b64 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccounts.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TestBaseAccounts. */ +public interface TestBaseAccounts { + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the Test Base Accounts in a subscription. This API is required by ARM guidelines. + * + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Boolean getDeleted, Context context); + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the Test Base Accounts in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param getDeleted The flag indicating if we need to include the Test Base Accounts which were soft deleted + * before. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Accounts as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, Boolean getDeleted, Context context); + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String testBaseAccountName); + + /** + * Deletes a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account. + */ + TestBaseAccountResource getByResourceGroup(String resourceGroupName, String testBaseAccountName); + + /** + * Gets a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void offboard(String resourceGroupName, String testBaseAccountName); + + /** + * Offboard a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void offboard(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account. + */ + FileUploadUrlResponse getFileUploadUrl(String resourceGroupName, String testBaseAccountName); + + /** + * Gets the file upload URL of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Account GetFileUploadURL operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the file upload URL of a Test Base Account along with {@link Response}. + */ + Response getFileUploadUrlWithResponse( + String resourceGroupName, String testBaseAccountName, GetFileUploadUrlParameters parameters, Context context); + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties. + */ + CheckNameAvailabilityResult checkPackageNameAvailability( + String resourceGroupName, String testBaseAccountName, PackageCheckNameAvailabilityParameters parameters); + + /** + * Checks that the Test Base Package name and version is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param parameters Parameters supplied to the Test Base Package CheckNameAvailability operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return description of a Check Name availability response properties along with {@link Response}. + */ + Response checkPackageNameAvailabilityWithResponse( + String resourceGroupName, + String testBaseAccountName, + PackageCheckNameAvailabilityParameters parameters, + Context context); + + /** + * Gets a Test Base Account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account along with {@link Response}. + */ + TestBaseAccountResource getById(String id); + + /** + * Gets a Test Base Account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Base Account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Test Base Account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a Test Base Account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TestBaseAccountResource resource. + * + * @param name resource name. + * @return the first stage of the new TestBaseAccountResource definition. + */ + TestBaseAccountResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateHeaders.java new file mode 100644 index 000000000000..141c220a3050 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateHeaders.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TestBaseAccountsCreateHeaders model. */ +@Fluent +public final class TestBaseAccountsCreateHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the TestBaseAccountsCreateHeaders object itself. + */ + public TestBaseAccountsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateResponse.java new file mode 100644 index 000000000000..a9a3a61e3469 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsCreateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; + +/** Contains all response data for the create operation. */ +public final class TestBaseAccountsCreateResponse + extends ResponseBase { + /** + * Creates an instance of TestBaseAccountsCreateResponse. + * + * @param request the request which resulted in this TestBaseAccountsCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TestBaseAccountsCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TestBaseAccountResourceInner value, + TestBaseAccountsCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TestBaseAccountResourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteHeaders.java new file mode 100644 index 000000000000..483bfa1d0ee9 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TestBaseAccountsDeleteHeaders model. */ +@Fluent +public final class TestBaseAccountsDeleteHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the TestBaseAccountsDeleteHeaders object itself. + */ + public TestBaseAccountsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the TestBaseAccountsDeleteHeaders object itself. + */ + public TestBaseAccountsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteResponse.java new file mode 100644 index 000000000000..d88f6fcbb1f6 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsDeleteResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class TestBaseAccountsDeleteResponse extends ResponseBase { + /** + * Creates an instance of TestBaseAccountsDeleteResponse. + * + * @param request the request which resulted in this TestBaseAccountsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TestBaseAccountsDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + TestBaseAccountsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardHeaders.java new file mode 100644 index 000000000000..b5f78cd33ca8 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TestBaseAccountsOffboardHeaders model. */ +@Fluent +public final class TestBaseAccountsOffboardHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the TestBaseAccountsOffboardHeaders object itself. + */ + public TestBaseAccountsOffboardHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the TestBaseAccountsOffboardHeaders object itself. + */ + public TestBaseAccountsOffboardHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardResponse.java new file mode 100644 index 000000000000..94e6f42cc466 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsOffboardResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the offboard operation. */ +public final class TestBaseAccountsOffboardResponse extends ResponseBase { + /** + * Creates an instance of TestBaseAccountsOffboardResponse. + * + * @param request the request which resulted in this TestBaseAccountsOffboardResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TestBaseAccountsOffboardResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + TestBaseAccountsOffboardHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateHeaders.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateHeaders.java new file mode 100644 index 000000000000..ef42a24e2d0f --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TestBaseAccountsUpdateHeaders model. */ +@Fluent +public final class TestBaseAccountsUpdateHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the TestBaseAccountsUpdateHeaders object itself. + */ + public TestBaseAccountsUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the TestBaseAccountsUpdateHeaders object itself. + */ + public TestBaseAccountsUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateResponse.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateResponse.java new file mode 100644 index 000000000000..21181780780e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestBaseAccountsUpdateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountResourceInner; + +/** Contains all response data for the update operation. */ +public final class TestBaseAccountsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of TestBaseAccountsUpdateResponse. + * + * @param request the request which resulted in this TestBaseAccountsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public TestBaseAccountsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + TestBaseAccountResourceInner value, + TestBaseAccountsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public TestBaseAccountResourceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultAnalysisSummary.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultAnalysisSummary.java new file mode 100644 index 000000000000..06d36efa2da0 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultAnalysisSummary.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The summary of a Test Analysis Result. */ +@Fluent +public final class TestResultAnalysisSummary { + /* + * Metric name + */ + @JsonProperty(value = "name") + private String name; + + /* + * The analysis status. + */ + @JsonProperty(value = "analysisStatus") + private AnalysisStatus analysisStatus; + + /* + * The grade of the test result. + */ + @JsonProperty(value = "grade") + private Grade grade; + + /** + * Get the name property: Metric name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Metric name. + * + * @param name the name value to set. + * @return the TestResultAnalysisSummary object itself. + */ + public TestResultAnalysisSummary withName(String name) { + this.name = name; + return this; + } + + /** + * Get the analysisStatus property: The analysis status. + * + * @return the analysisStatus value. + */ + public AnalysisStatus analysisStatus() { + return this.analysisStatus; + } + + /** + * Set the analysisStatus property: The analysis status. + * + * @param analysisStatus the analysisStatus value to set. + * @return the TestResultAnalysisSummary object itself. + */ + public TestResultAnalysisSummary withAnalysisStatus(AnalysisStatus analysisStatus) { + this.analysisStatus = analysisStatus; + return this; + } + + /** + * Get the grade property: The grade of the test result. + * + * @return the grade value. + */ + public Grade grade() { + return this.grade; + } + + /** + * Set the grade property: The grade of the test result. + * + * @param grade the grade value to set. + * @return the TestResultAnalysisSummary object itself. + */ + public TestResultAnalysisSummary withGrade(Grade grade) { + this.grade = grade; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultListResult.java new file mode 100644 index 000000000000..6721bac574bb --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.TestResultResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Test Results. */ +@Fluent +public final class TestResultListResult { + /* + * The list of Test Results. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Test Results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Test Results. + * + * @param value the value value to set. + * @return the TestResultListResult object itself. + */ + public TestResultListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultResource.java new file mode 100644 index 000000000000..0e4a96420021 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResultResource.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.TestResultResourceInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of TestResultResource. */ +public interface TestResultResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the baselineTestResultId property: Azure Id of the baseline test result. + * + * @return the baselineTestResultId value. + */ + String baselineTestResultId(); + + /** + * Gets the packageId property: Resource Id of the package. + * + * @return the packageId value. + */ + String packageId(); + + /** + * Gets the applicationName property: Application name. + * + * @return the applicationName value. + */ + String applicationName(); + + /** + * Gets the applicationVersion property: Application version. + * + * @return the applicationVersion value. + */ + String applicationVersion(); + + /** + * Gets the osName property: The operating system name, e.g. Windows 10 1809. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the releaseName property: The name of the tested release (OS update). + * + * @return the releaseName value. + */ + String releaseName(); + + /** + * Gets the releaseVersionDate property: The release version date of the tested release. + * + * @return the releaseVersionDate value. + */ + OffsetDateTime releaseVersionDate(); + + /** + * Gets the flightingRing property: The flighting ring, only for release of feature updates. + * + * @return the flightingRing value. + */ + String flightingRing(); + + /** + * Gets the buildVersion property: The build version of the tested release (OS update). + * + * @return the buildVersion value. + */ + String buildVersion(); + + /** + * Gets the buildRevision property: The build revision of the tested release (OS update). + * + * @return the buildRevision value. + */ + String buildRevision(); + + /** + * Gets the testType property: Test type. E.g. 'Out of box test' or 'Functional test'. + * + * @return the testType value. + */ + String testType(); + + /** + * Gets the testRunTime property: The run time of the test. + * + * @return the testRunTime value. + */ + String testRunTime(); + + /** + * Gets the isDownloadDataAvailable property: Whether download data is available. + * + * @return the isDownloadDataAvailable value. + */ + Boolean isDownloadDataAvailable(); + + /** + * Gets the isVideoAvailable property: Whether video data is available. + * + * @return the isVideoAvailable value. + */ + Boolean isVideoAvailable(); + + /** + * Gets the executionStatus property: The execution status of the test. + * + * @return the executionStatus value. + */ + ExecutionStatus executionStatus(); + + /** + * Gets the testStatus property: The status of the test. + * + * @return the testStatus value. + */ + TestStatus testStatus(); + + /** + * Gets the grade property: The grade of the test. + * + * @return the grade value. + */ + Grade grade(); + + /** + * Gets the kbNumber property: KB number. + * + * @return the kbNumber value. + */ + String kbNumber(); + + /** + * Gets the packageVersion property: The version of the Windows update package. + * + * @return the packageVersion value. + */ + String packageVersion(); + + /** + * Gets the analysisSummaries property: List of analysis summaries. + * + * @return the analysisSummaries value. + */ + List analysisSummaries(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestResultResourceInner object. + * + * @return the inner object. + */ + TestResultResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResults.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResults.java new file mode 100644 index 000000000000..ebb88ea6a774 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestResults.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TestResults. */ +public interface TestResults { + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String packageName, OsUpdateType osUpdateType); + + /** + * Lists all the Test Results with specified OS Update type for a Test Base Package. Can be filtered by osName, + * releaseName, flightingRing, buildVersion, buildRevision. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param osUpdateType The type of the OS Update. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Results as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String testBaseAccountName, + String packageName, + OsUpdateType osUpdateType, + String filter, + Context context); + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package. + */ + TestResultResource get( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName); + + /** + * Get the Test Result by Id with specified OS Update type for a Test Base Package. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Test Result by Id with specified OS Update type for a Test Base Package along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context); + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result. + */ + DownloadUrlResponse getDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName); + + /** + * Gets the download URL of the test result. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test result along with {@link Response}. + */ + Response getDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context); + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording. + */ + DownloadUrlResponse getVideoDownloadUrl( + String resourceGroupName, String testBaseAccountName, String packageName, String testResultName); + + /** + * Gets the download URL of the test execution screen recording. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param packageName The resource name of the Test Base Package. + * @param testResultName The Test Result Name. It equals to {osName}-{TestResultId} string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the download URL of the test execution screen recording along with {@link Response}. + */ + Response getVideoDownloadUrlWithResponse( + String resourceGroupName, + String testBaseAccountName, + String packageName, + String testResultName, + Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestStatus.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestStatus.java new file mode 100644 index 000000000000..3eb843dc3791 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestStatus.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TestStatus. */ +public final class TestStatus extends ExpandableStringEnum { + /** Static value None for TestStatus. */ + public static final TestStatus NONE = fromString("None"); + + /** Static value TestExecutionInProgress for TestStatus. */ + public static final TestStatus TEST_EXECUTION_IN_PROGRESS = fromString("TestExecutionInProgress"); + + /** Static value DataProcessing for TestStatus. */ + public static final TestStatus DATA_PROCESSING = fromString("DataProcessing"); + + /** Static value TestFailure for TestStatus. */ + public static final TestStatus TEST_FAILURE = fromString("TestFailure"); + + /** Static value UpdateFailure for TestStatus. */ + public static final TestStatus UPDATE_FAILURE = fromString("UpdateFailure"); + + /** Static value TestAndUpdateFailure for TestStatus. */ + public static final TestStatus TEST_AND_UPDATE_FAILURE = fromString("TestAndUpdateFailure"); + + /** Static value InfrastructureFailure for TestStatus. */ + public static final TestStatus INFRASTRUCTURE_FAILURE = fromString("InfrastructureFailure"); + + /** Static value Completed for TestStatus. */ + public static final TestStatus COMPLETED = fromString("Completed"); + + /** + * Creates or finds a TestStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestStatus. + */ + @JsonCreator + public static TestStatus fromString(String name) { + return fromString(name, TestStatus.class); + } + + /** @return known TestStatus values. */ + public static Collection values() { + return values(TestStatus.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaries.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaries.java new file mode 100644 index 000000000000..a4636022ac95 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaries.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TestSummaries. */ +public interface TestSummaries { + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Summaries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account. + */ + TestSummaryResource get(String resourceGroupName, String testBaseAccountName, String testSummaryName); + + /** + * Gets a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testSummaryName The name of the Test Summary. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Test Summary with specific name from all the Test Summaries of all the packages under a Test Base + * Account along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testSummaryName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryListResult.java new file mode 100644 index 000000000000..d0c9a09b5737 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.TestSummaryResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Test Summaries. */ +@Fluent +public final class TestSummaryListResult { + /* + * The list of Test Summaries. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Test Summaries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Test Summaries. + * + * @param value the value value to set. + * @return the TestSummaryListResult object itself. + */ + public TestSummaryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryResource.java new file mode 100644 index 000000000000..64c44215bccf --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestSummaryResource.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.TestSummaryResourceInner; + +/** An immutable client-side representation of TestSummaryResource. */ +public interface TestSummaryResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the testSummaryId property: The Id of the current Test Summary. + * + * @return the testSummaryId value. + */ + String testSummaryId(); + + /** + * Gets the packageId property: The Azure resource Id of package. + * + * @return the packageId value. + */ + String packageId(); + + /** + * Gets the applicationName property: Application name. + * + * @return the applicationName value. + */ + String applicationName(); + + /** + * Gets the applicationVersion property: Application version. + * + * @return the applicationVersion value. + */ + String applicationVersion(); + + /** + * Gets the executionStatus property: The execution status of last test. + * + * @return the executionStatus value. + */ + ExecutionStatus executionStatus(); + + /** + * Gets the testStatus property: The status of last test. + * + * @return the testStatus value. + */ + TestStatus testStatus(); + + /** + * Gets the grade property: The grade of the test. + * + * @return the grade value. + */ + Grade grade(); + + /** + * Gets the testRunTime property: The run time of the last test. + * + * @return the testRunTime value. + */ + String testRunTime(); + + /** + * Gets the featureUpdatesTestSummary property: The result summary of tests triggered by feature updates. + * + * @return the featureUpdatesTestSummary value. + */ + OSUpdatesTestSummary featureUpdatesTestSummary(); + + /** + * Gets the securityUpdatesTestSummary property: The result summary of tests triggered by security updates. + * + * @return the securityUpdatesTestSummary value. + */ + OSUpdatesTestSummary securityUpdatesTestSummary(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestSummaryResourceInner object. + * + * @return the inner object. + */ + TestSummaryResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestType.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestType.java new file mode 100644 index 000000000000..dbff09b7aa53 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TestType. */ +public final class TestType extends ExpandableStringEnum { + /** Static value OutOfBoxTest for TestType. */ + public static final TestType OUT_OF_BOX_TEST = fromString("OutOfBoxTest"); + + /** Static value FunctionalTest for TestType. */ + public static final TestType FUNCTIONAL_TEST = fromString("FunctionalTest"); + + /** + * Creates or finds a TestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestType. + */ + @JsonCreator + public static TestType fromString(String name) { + return fromString(name, TestType.class); + } + + /** @return known TestType values. */ + public static Collection values() { + return values(TestType.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeListResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeListResult.java new file mode 100644 index 000000000000..ffd20c8c77c3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeListResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.testbase.fluent.models.TestTypeResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of test types. */ +@Fluent +public final class TestTypeListResult { + /* + * The list of test types. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to the next set of results. Not empty if value contains incomplete + * list of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of test types. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of test types. + * + * @param value the value value to set. + * @return the TestTypeListResult object itself. + */ + public TestTypeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. Not empty if value contains incomplete list of + * results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeResource.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeResource.java new file mode 100644 index 000000000000..09e8e96fcd19 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypeResource.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.testbase.fluent.models.TestTypeResourceInner; + +/** An immutable client-side representation of TestTypeResource. */ +public interface TestTypeResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the actualTestTypeName property: The actual name of a test type of a Test Base Account. + * + * @return the actualTestTypeName value. + */ + String actualTestTypeName(); + + /** + * Gets the inner com.azure.resourcemanager.testbase.fluent.models.TestTypeResourceInner object. + * + * @return the inner object. + */ + TestTypeResourceInner innerModel(); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypes.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypes.java new file mode 100644 index 000000000000..b1c596c410c7 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/TestTypes.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of TestTypes. */ +public interface TestTypes { + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists all the test types of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of test types as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName, Context context); + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account. + */ + TestTypeResource get(String resourceGroupName, String testBaseAccountName, String testTypeResourceName); + + /** + * Gets a test type of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param testTypeResourceName The resource name of a test type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a test type of a Test Base Account along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String testBaseAccountName, String testTypeResourceName, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Tier.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Tier.java new file mode 100644 index 000000000000..cedbf1f873c4 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Tier.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Tier. */ +public final class Tier extends ExpandableStringEnum { + /** Static value Standard for Tier. */ + public static final Tier STANDARD = fromString("Standard"); + + /** + * Creates or finds a Tier from its string representation. + * + * @param name a name to look for. + * @return the corresponding Tier. + */ + @JsonCreator + public static Tier fromString(String name) { + return fromString(name, Tier.class); + } + + /** @return known Tier values. */ + public static Collection values() { + return values(Tier.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Type.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Type.java new file mode 100644 index 000000000000..53cb33a647fd --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Type.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Type. */ +public final class Type extends ExpandableStringEnum { + /** Static value SecurityUpdate for Type. */ + public static final Type SECURITY_UPDATE = fromString("SecurityUpdate"); + + /** Static value FeatureUpdate for Type. */ + public static final Type FEATURE_UPDATE = fromString("FeatureUpdate"); + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** @return known Type values. */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Usages.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Usages.java new file mode 100644 index 000000000000..1d316527c3bc --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/Usages.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String testBaseAccountName); + + /** + * Lists the usage data of a Test Base Account. + * + * @param resourceGroupName The name of the resource group that contains the resource. + * @param testBaseAccountName The resource name of the Test Base Account. + * @param filter Odata filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Test Base Account usage data as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String testBaseAccountName, String filter, Context context); +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UserObjectReceiverValue.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UserObjectReceiverValue.java new file mode 100644 index 000000000000..fb79d0ffc612 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UserObjectReceiverValue.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The user object receiver value. */ +@Fluent +public final class UserObjectReceiverValue { + /* + * user object ids. + */ + @JsonProperty(value = "userObjectIds") + private List userObjectIds; + + /** + * Get the userObjectIds property: user object ids. + * + * @return the userObjectIds value. + */ + public List userObjectIds() { + return this.userObjectIds; + } + + /** + * Set the userObjectIds property: user object ids. + * + * @param userObjectIds the userObjectIds value to set. + * @return the UserObjectReceiverValue object itself. + */ + public UserObjectReceiverValue withUserObjectIds(List userObjectIds) { + this.userObjectIds = userObjectIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationBound.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationBound.java new file mode 100644 index 000000000000..2a4315a3757e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationBound.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The bound of a utilization result. */ +@Fluent +public final class UtilizationBound { + /* + * The percentile of the bound. + */ + @JsonProperty(value = "percentile") + private Double percentile; + + /* + * The value of the bound. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the percentile property: The percentile of the bound. + * + * @return the percentile value. + */ + public Double percentile() { + return this.percentile; + } + + /** + * Set the percentile property: The percentile of the bound. + * + * @param percentile the percentile value to set. + * @return the UtilizationBound object itself. + */ + public UtilizationBound withPercentile(Double percentile) { + this.percentile = percentile; + return this; + } + + /** + * Get the value property: The value of the bound. + * + * @return the value value. + */ + public Double value() { + return this.value; + } + + /** + * Set the value property: The value of the bound. + * + * @param value the value value to set. + * @return the UtilizationBound object itself. + */ + public UtilizationBound withValue(Double value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationEntry.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationEntry.java new file mode 100644 index 000000000000..71c13ad33d73 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationEntry.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The utilization entry. */ +@Fluent +public final class UtilizationEntry { + /* + * The timestamp. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * The value. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the timestamp property: The timestamp. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The timestamp. + * + * @param timestamp the timestamp value to set. + * @return the UtilizationEntry object itself. + */ + public UtilizationEntry withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public Double value() { + return this.value; + } + + /** + * Set the value property: The value. + * + * @param value the value value to set. + * @return the UtilizationEntry object itself. + */ + public UtilizationEntry withValue(Double value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationResult.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationResult.java new file mode 100644 index 000000000000..504181d43923 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/UtilizationResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Utilization Result. */ +@Fluent +public final class UtilizationResult { + /* + * Process name, or '_total' for all processes + */ + @JsonProperty(value = "process") + private String process; + + /* + * Upper bound + */ + @JsonProperty(value = "upperBound") + private UtilizationBound upperBound; + + /* + * Lower bound + */ + @JsonProperty(value = "lowerBound") + private UtilizationBound lowerBound; + + /* + * Utilization data + */ + @JsonProperty(value = "utilization") + private List utilization; + + /** + * Get the process property: Process name, or '_total' for all processes. + * + * @return the process value. + */ + public String process() { + return this.process; + } + + /** + * Set the process property: Process name, or '_total' for all processes. + * + * @param process the process value to set. + * @return the UtilizationResult object itself. + */ + public UtilizationResult withProcess(String process) { + this.process = process; + return this; + } + + /** + * Get the upperBound property: Upper bound. + * + * @return the upperBound value. + */ + public UtilizationBound upperBound() { + return this.upperBound; + } + + /** + * Set the upperBound property: Upper bound. + * + * @param upperBound the upperBound value to set. + * @return the UtilizationResult object itself. + */ + public UtilizationResult withUpperBound(UtilizationBound upperBound) { + this.upperBound = upperBound; + return this; + } + + /** + * Get the lowerBound property: Lower bound. + * + * @return the lowerBound value. + */ + public UtilizationBound lowerBound() { + return this.lowerBound; + } + + /** + * Set the lowerBound property: Lower bound. + * + * @param lowerBound the lowerBound value to set. + * @return the UtilizationResult object itself. + */ + public UtilizationResult withLowerBound(UtilizationBound lowerBound) { + this.lowerBound = lowerBound; + return this; + } + + /** + * Get the utilization property: Utilization data. + * + * @return the utilization value. + */ + public List utilization() { + return this.utilization; + } + + /** + * Set the utilization property: Utilization data. + * + * @param utilization the utilization value to set. + * @return the UtilizationResult object itself. + */ + public UtilizationResult withUtilization(List utilization) { + this.utilization = utilization; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upperBound() != null) { + upperBound().validate(); + } + if (lowerBound() != null) { + lowerBound().validate(); + } + if (utilization() != null) { + utilization().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ValidationRunStatus.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ValidationRunStatus.java new file mode 100644 index 000000000000..3a8ee878deed --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/ValidationRunStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ValidationRunStatus. */ +public final class ValidationRunStatus extends ExpandableStringEnum { + /** Static value Unknown for ValidationRunStatus. */ + public static final ValidationRunStatus UNKNOWN = fromString("Unknown"); + + /** Static value Pending for ValidationRunStatus. */ + public static final ValidationRunStatus PENDING = fromString("Pending"); + + /** Static value Passed for ValidationRunStatus. */ + public static final ValidationRunStatus PASSED = fromString("Passed"); + + /** Static value Failed for ValidationRunStatus. */ + public static final ValidationRunStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ValidationRunStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationRunStatus. + */ + @JsonCreator + public static ValidationRunStatus fromString(String name) { + return fromString(name, ValidationRunStatus.class); + } + + /** @return known ValidationRunStatus values. */ + public static Collection values() { + return values(ValidationRunStatus.class); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/package-info.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/package-info.java new file mode 100644 index 000000000000..7c753e7d8cf1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for TestBase. Test Base. */ +package com.azure.resourcemanager.testbase.models; diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/package-info.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/package-info.java new file mode 100644 index 000000000000..8b0b4380ec98 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/com/azure/resourcemanager/testbase/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for TestBase. Test Base. */ +package com.azure.resourcemanager.testbase; diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/main/java/module-info.java b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/module-info.java new file mode 100644 index 000000000000..9a6f2ddc70be --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.testbase { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.testbase; + exports com.azure.resourcemanager.testbase.fluent; + exports com.azure.resourcemanager.testbase.fluent.models; + exports com.azure.resourcemanager.testbase.models; + + opens com.azure.resourcemanager.testbase.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.testbase.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsGetSamples.java new file mode 100644 index 000000000000..6572572fe7a7 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsGetSamples.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.AnalysisResultName; + +/** Samples for AnalysisResults Get. */ +public final class AnalysisResultsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryUtilizationAnalysisResultGet.json + */ + /** + * Sample code: MemoryUtilizationAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryUtilizationAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.MEMORY_UTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPURegressionAnalysisResultGet.json + */ + /** + * Sample code: CPURegressionAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPURegressionAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.CPU_REGRESSION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPUUtilizationAnalysisResultGet.json + */ + /** + * Sample code: CPUUtilizationAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPUUtilizationAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.CPU_UTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryRegressionAnalysisResultGet.json + */ + /** + * Sample code: MemoryRegressionAnalysisResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryRegressionAnalysisResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultName.MEMORY_REGRESSION, + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsListSamples.java new file mode 100644 index 000000000000..3a11a7af96fc --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AnalysisResultsListSamples.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.AnalysisResultType; + +/** Samples for AnalysisResults List. */ +public final class AnalysisResultsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryRegressionAnalysisResultsList.json + */ + /** + * Sample code: MemoryRegressionAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryRegressionAnalysisResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.MEMORY_REGRESSION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPUUtilizationAnalysisResultsList.json + */ + /** + * Sample code: CPUUtilizationAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPUUtilizationAnalysisResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.CPUUTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/MemoryUtilizationAnalysisResultsList.json + */ + /** + * Sample code: MemoryUtilizationAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void memoryUtilizationAnalysisResultsList( + com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.MEMORY_UTILIZATION, + Context.NONE); + } + + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CPURegressionAnalysisResultsList.json + */ + /** + * Sample code: CPURegressionAnalysisResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void cPURegressionAnalysisResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .analysisResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-Test-Id", + AnalysisResultType.CPUREGRESSION, + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSGetSamples.java new file mode 100644 index 000000000000..1c9b99e2e275 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for AvailableOS Get. */ +public final class AvailableOSGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/AvailableOSGet.json + */ + /** + * Sample code: AvailableOSGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void availableOSGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.availableOS().getWithResponse("contoso-rg", "contoso-testBaseAccount", "Windows-10-2004", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSListSamples.java new file mode 100644 index 000000000000..6b08bcaa2049 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/AvailableOSListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** Samples for AvailableOS List. */ +public final class AvailableOSListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/AvailableOSsList.json + */ + /** + * Sample code: AvailableOSsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void availableOSsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.availableOS().list("contoso-rg", "contoso-testBaseAccount", OsUpdateType.SECURITY_UPDATE, Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsCreateSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsCreateSamples.java new file mode 100644 index 000000000000..ba46f7b4c4b7 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsCreateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.resourcemanager.testbase.models.DistributionGroupListReceiverValue; +import com.azure.resourcemanager.testbase.models.NotificationEventReceiver; +import com.azure.resourcemanager.testbase.models.NotificationReceiverValue; +import com.azure.resourcemanager.testbase.models.UserObjectReceiverValue; +import java.util.Arrays; + +/** Samples for CustomerEvents Create. */ +public final class CustomerEventsCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventCreate.json + */ + /** + * Sample code: CustomerEventCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .customerEvents() + .define("WeeklySummary") + .withExistingTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1") + .withEventName("WeeklySummary") + .withReceivers( + Arrays + .asList( + new NotificationEventReceiver() + .withReceiverType("UserObjects") + .withReceiverValue( + new NotificationReceiverValue() + .withUserObjectReceiverValue( + new UserObjectReceiverValue() + .withUserObjectIds(Arrays.asList("245245245245325", "365365365363565")))), + new NotificationEventReceiver() + .withReceiverType("DistributionGroup") + .withReceiverValue( + new NotificationReceiverValue() + .withDistributionGroupListReceiverValue( + new DistributionGroupListReceiverValue() + .withDistributionGroups(Arrays.asList("test@microsoft.com")))))) + .create(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsDeleteSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsDeleteSamples.java new file mode 100644 index 000000000000..09c0d5bda808 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomerEvents Delete. */ +public final class CustomerEventsDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventDelete.json + */ + /** + * Sample code: CustomerEventDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.customerEvents().delete("contoso-rg1", "contoso-testBaseAccount1", "WeeklySummary", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsGetSamples.java new file mode 100644 index 000000000000..7e3fbb382767 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomerEvents Get. */ +public final class CustomerEventsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventGet.json + */ + /** + * Sample code: CustomerEventGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .customerEvents() + .getWithResponse("contoso-rg1", "contoso-testBaseAccount1", "WeeklySummary", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsListByTestBaseAccountSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsListByTestBaseAccountSamples.java new file mode 100644 index 000000000000..1e54a492e615 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/CustomerEventsListByTestBaseAccountSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for CustomerEvents ListByTestBaseAccount. */ +public final class CustomerEventsListByTestBaseAccountSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CustomerEventsList.json + */ + /** + * Sample code: CustomerEventsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void customerEventsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.customerEvents().listByTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsGetSamples.java new file mode 100644 index 000000000000..3b428cb5c433 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for EmailEvents Get. */ +public final class EmailEventsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/EmailEventGet.json + */ + /** + * Sample code: EmailEventGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void emailEventGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.emailEvents().getWithResponse("contoso-rg", "contoso-testBaseAccount", "weekly-summary", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsListSamples.java new file mode 100644 index 000000000000..df58307f7643 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/EmailEventsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for EmailEvents List. */ +public final class EmailEventsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/EmailEventsList.json + */ + /** + * Sample code: EmailEventsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void emailEventsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.emailEvents().list("contoso-rg", "contoso-testBaseAccount", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesCreateSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesCreateSamples.java new file mode 100644 index 000000000000..9a92fbed4821 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesCreateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +/** Samples for FavoriteProcesses Create. */ +public final class FavoriteProcessesCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessCreate.json + */ + /** + * Sample code: FavoriteProcessCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .favoriteProcesses() + .define("testAppProcess") + .withExistingPackage("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2") + .withActualProcessName("testApp&.exe") + .create(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesDeleteSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesDeleteSamples.java new file mode 100644 index 000000000000..e4d1c19fe0c2 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for FavoriteProcesses Delete. */ +public final class FavoriteProcessesDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessDelete.json + */ + /** + * Sample code: FavoriteProcessDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .favoriteProcesses() + .deleteWithResponse( + "contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", "testAppProcess", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesGetSamples.java new file mode 100644 index 000000000000..953c6db27037 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for FavoriteProcesses Get. */ +public final class FavoriteProcessesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessGet.json + */ + /** + * Sample code: FavoriteProcessGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .favoriteProcesses() + .getWithResponse( + "contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", "testAppProcess", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesListSamples.java new file mode 100644 index 000000000000..1fd5aa21cdea --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FavoriteProcessesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for FavoriteProcesses List. */ +public final class FavoriteProcessesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FavoriteProcessesList.json + */ + /** + * Sample code: FavoriteProcessesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void favoriteProcessesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.favoriteProcesses().list("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsGetSamples.java new file mode 100644 index 000000000000..789636cfbde3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for FlightingRings Get. */ +public final class FlightingRingsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FlightingRingGet.json + */ + /** + * Sample code: FlightingRingGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void flightingRingGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .flightingRings() + .getWithResponse("contoso-rg", "contoso-testBaseAccount", "Insider-Beta-Channel", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsListSamples.java new file mode 100644 index 000000000000..7c0b9b42508e --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/FlightingRingsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for FlightingRings List. */ +public final class FlightingRingsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/FlightingRingsList.json + */ + /** + * Sample code: FlightingRingsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void flightingRingsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.flightingRings().list("contoso-rg", "contoso-testBaseAccount", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesGetSamples.java new file mode 100644 index 000000000000..cfa216574e2d --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for OSUpdates Get. */ +public final class OSUpdatesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/OSUpdateGet.json + */ + /** + * Sample code: OSUpdateGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void oSUpdateGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .oSUpdates() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-2004-2020-12-B-505", + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesListSamples.java new file mode 100644 index 000000000000..e14d7884ce3d --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OSUpdatesListSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** Samples for OSUpdates List. */ +public final class OSUpdatesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/OSUpdatesList.json + */ + /** + * Sample code: OSUpdatesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void oSUpdatesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .oSUpdates() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + OsUpdateType.SECURITY_UPDATE, + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OperationsListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OperationsListSamples.java new file mode 100644 index 000000000000..ee9d63f0021a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void operationsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesCreateSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesCreateSamples.java new file mode 100644 index 000000000000..b526908d3d9b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesCreateSamples.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.resourcemanager.testbase.models.Action; +import com.azure.resourcemanager.testbase.models.Command; +import com.azure.resourcemanager.testbase.models.ContentType; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.azure.resourcemanager.testbase.models.TestType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Packages Create. */ +public final class PackagesCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageCreate.json + */ + /** + * Sample code: PackageCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .packages() + .define("contoso-package2") + .withRegion("westus") + .withExistingTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1") + .withTags(mapOf()) + .withApplicationName("contoso-package2") + .withVersion("1.0.0") + .withTargetOSList( + Arrays + .asList( + new TargetOSInfo() + .withOsUpdateType("Security updates") + .withTargetOSs(Arrays.asList("Windows 10 2004", "Windows 10 1903")))) + .withFlightingRing("Insider Beta Channel") + .withBlobPath("storageAccountPath/package.zip") + .withTests( + Arrays + .asList( + new Test() + .withTestType(TestType.OUT_OF_BOX_TEST) + .withIsActive(true) + .withCommands( + Arrays + .asList( + new Command() + .withName("Install") + .withAction(Action.INSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/install/job.ps1") + .withRunElevated(true) + .withRestartAfter(true) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false), + new Command() + .withName("Launch") + .withAction(Action.LAUNCH) + .withContentType(ContentType.PATH) + .withContent("app/scripts/launch/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(true), + new Command() + .withName("Close") + .withAction(Action.CLOSE) + .withContentType(ContentType.PATH) + .withContent("app/scripts/close/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(false), + new Command() + .withName("Uninstall") + .withAction(Action.UNINSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/uninstall/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesDeleteSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesDeleteSamples.java new file mode 100644 index 000000000000..d6d5aad5fdea --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Packages Delete. */ +public final class PackagesDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageDelete.json + */ + /** + * Sample code: PackageDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().delete("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetDownloadUrlSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetDownloadUrlSamples.java new file mode 100644 index 000000000000..8fc95ad47788 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetDownloadUrlSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Packages GetDownloadUrl. */ +public final class PackagesGetDownloadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageGetDownloadURL.json + */ + /** + * Sample code: PackageGetDownloadURL. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageGetDownloadURL(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .packages() + .getDownloadUrlWithResponse("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetSamples.java new file mode 100644 index 000000000000..2c6abf073be3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Packages Get. */ +public final class PackagesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageGet.json + */ + /** + * Sample code: PackageGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().getWithResponse("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesHardDeleteSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesHardDeleteSamples.java new file mode 100644 index 000000000000..1b59d77168ee --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesHardDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Packages HardDelete. */ +public final class PackagesHardDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageHardDelete.json + */ + /** + * Sample code: PackageHardDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageHardDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().hardDelete("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesListByTestBaseAccountSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesListByTestBaseAccountSamples.java new file mode 100644 index 000000000000..12c483f8c019 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesListByTestBaseAccountSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Packages ListByTestBaseAccount. */ +public final class PackagesListByTestBaseAccountSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackagesList.json + */ + /** + * Sample code: PackagesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packagesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.packages().listByTestBaseAccount("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesUpdateSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesUpdateSamples.java new file mode 100644 index 000000000000..773e36044b12 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/PackagesUpdateSamples.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.Action; +import com.azure.resourcemanager.testbase.models.Command; +import com.azure.resourcemanager.testbase.models.ContentType; +import com.azure.resourcemanager.testbase.models.PackageResource; +import com.azure.resourcemanager.testbase.models.TargetOSInfo; +import com.azure.resourcemanager.testbase.models.Test; +import com.azure.resourcemanager.testbase.models.TestType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Packages Update. */ +public final class PackagesUpdateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/PackageUpdate.json + */ + /** + * Sample code: PackageUpdate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void packageUpdate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + PackageResource resource = + manager + .packages() + .getWithResponse("contoso-rg1", "contoso-testBaseAccount1", "contoso-package2", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withTargetOSList( + Arrays + .asList( + new TargetOSInfo() + .withOsUpdateType("Security updates") + .withTargetOSs(Arrays.asList("Windows 10 2004", "Windows 10 1903")))) + .withFlightingRing("Insider Beta Channel") + .withIsEnabled(false) + .withBlobPath("storageAccountPath/package.zip") + .withTests( + Arrays + .asList( + new Test() + .withTestType(TestType.OUT_OF_BOX_TEST) + .withIsActive(true) + .withCommands( + Arrays + .asList( + new Command() + .withName("Install") + .withAction(Action.INSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/install/job.ps1") + .withRunElevated(true) + .withRestartAfter(true) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false), + new Command() + .withName("Launch") + .withAction(Action.LAUNCH) + .withContentType(ContentType.PATH) + .withContent("app/scripts/launch/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(true), + new Command() + .withName("Close") + .withAction(Action.CLOSE) + .withContentType(ContentType.PATH) + .withContent("app/scripts/close/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(false) + .withApplyUpdateBefore(false), + new Command() + .withName("Uninstall") + .withAction(Action.UNINSTALL) + .withContentType(ContentType.PATH) + .withContent("app/scripts/uninstall/job.ps1") + .withRunElevated(true) + .withRestartAfter(false) + .withMaxRunTime(1800) + .withRunAsInteractive(true) + .withAlwaysRun(true) + .withApplyUpdateBefore(false))))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/SkusListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/SkusListSamples.java new file mode 100644 index 000000000000..1c732561ed6a --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/SkusListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountSKUsList.json + */ + /** + * Sample code: TestBaseAccountSKUsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountSKUsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.skus().list(Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCheckPackageNameAvailabilitySamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCheckPackageNameAvailabilitySamples.java new file mode 100644 index 000000000000..2a4776e96550 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCheckPackageNameAvailabilitySamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.PackageCheckNameAvailabilityParameters; + +/** Samples for TestBaseAccounts CheckPackageNameAvailability. */ +public final class TestBaseAccountsCheckPackageNameAvailabilitySamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/CheckPackageNameAvailability.json + */ + /** + * Sample code: CheckPackageNameAvailability. + * + * @param manager Entry point to TestBaseManager. + */ + public static void checkPackageNameAvailability(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .checkPackageNameAvailabilityWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + new PackageCheckNameAvailabilityParameters() + .withName("testApp") + .withApplicationName("testApp") + .withVersion("1.0.0") + .withType("Microsoft.TestBase/testBaseAccounts/packages"), + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCreateSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCreateSamples.java new file mode 100644 index 000000000000..f55b26044aae --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.Tier; + +/** Samples for TestBaseAccounts Create. */ +public final class TestBaseAccountsCreateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountCreate.json + */ + /** + * Sample code: TestBaseAccountCreate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountCreate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .define("contoso-testBaseAccount1") + .withRegion("westus") + .withExistingResourceGroup("contoso-rg1") + .withSku(new TestBaseAccountSkuInner().withName("S0").withTier(Tier.STANDARD)) + .create(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsDeleteSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsDeleteSamples.java new file mode 100644 index 000000000000..380bbe7e7172 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts Delete. */ +public final class TestBaseAccountsDeleteSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountDelete.json + */ + /** + * Sample code: TestBaseAccountDelete. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountDelete(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().delete("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetByResourceGroupSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..915a6ce50641 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts GetByResourceGroup. */ +public final class TestBaseAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountGet.json + */ + /** + * Sample code: TestBaseAccountGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .getByResourceGroupWithResponse("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetFileUploadUrlSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetFileUploadUrlSamples.java new file mode 100644 index 000000000000..17df3945e20b --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsGetFileUploadUrlSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.GetFileUploadUrlParameters; + +/** Samples for TestBaseAccounts GetFileUploadUrl. */ +public final class TestBaseAccountsGetFileUploadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountGetFileUploadUrl.json + */ + /** + * Sample code: TestBaseAccountGetFileUploadUrl. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountGetFileUploadUrl(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testBaseAccounts() + .getFileUploadUrlWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + new GetFileUploadUrlParameters().withBlobName("package.zip"), + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListByResourceGroupSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListByResourceGroupSamples.java new file mode 100644 index 000000000000..47794502aef5 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts ListByResourceGroup. */ +public final class TestBaseAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountsList.json + */ + /** + * Sample code: TestBaseAccountsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().listByResourceGroup("contoso-rg1", null, Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListSamples.java new file mode 100644 index 000000000000..b2323b62bd06 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts List. */ +public final class TestBaseAccountsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountsListBySubscription.json + */ + /** + * Sample code: TestBaseAccountsListBySubscription. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountsListBySubscription(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().list(null, Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsOffboardSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsOffboardSamples.java new file mode 100644 index 000000000000..540a920c4953 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsOffboardSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestBaseAccounts Offboard. */ +public final class TestBaseAccountsOffboardSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountOffboard.json + */ + /** + * Sample code: TestBaseAccountOffboard. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountOffboard(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testBaseAccounts().offboard("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsUpdateSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsUpdateSamples.java new file mode 100644 index 000000000000..0a29100d67bd --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestBaseAccountsUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.fluent.models.TestBaseAccountSkuInner; +import com.azure.resourcemanager.testbase.models.TestBaseAccountResource; +import com.azure.resourcemanager.testbase.models.Tier; + +/** Samples for TestBaseAccounts Update. */ +public final class TestBaseAccountsUpdateSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountUpdate.json + */ + /** + * Sample code: TestBaseAccountUpdate. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountUpdate(com.azure.resourcemanager.testbase.TestBaseManager manager) { + TestBaseAccountResource resource = + manager + .testBaseAccounts() + .getByResourceGroupWithResponse("contoso-rg1", "contoso-testBaseAccount1", Context.NONE) + .getValue(); + resource.update().withSku(new TestBaseAccountSkuInner().withName("S0").withTier(Tier.STANDARD)).apply(); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetDownloadUrlSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetDownloadUrlSamples.java new file mode 100644 index 000000000000..b61d245ecf86 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetDownloadUrlSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestResults GetDownloadUrl. */ +public final class TestResultsGetDownloadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultGetDownloadURL.json + */ + /** + * Sample code: TestResultGetDownloadURL. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultGetDownloadURL(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .getDownloadUrlWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetSamples.java new file mode 100644 index 000000000000..d032316443c1 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestResults Get. */ +public final class TestResultsGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultGet.json + */ + /** + * Sample code: TestResultGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetVideoDownloadUrlSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetVideoDownloadUrlSamples.java new file mode 100644 index 000000000000..9916301881d3 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsGetVideoDownloadUrlSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestResults GetVideoDownloadUrl. */ +public final class TestResultsGetVideoDownloadUrlSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultGetVideoDownloadURL.json + */ + /** + * Sample code: TestResultGetVideoDownloadURL. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultGetVideoDownloadURL(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .getVideoDownloadUrlWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + "Windows-10-1909-99b1f80d-03a9-4148-997f-806ba5bac8e0", + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsListSamples.java new file mode 100644 index 000000000000..fca83b84e614 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestResultsListSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.testbase.models.OsUpdateType; + +/** Samples for TestResults List. */ +public final class TestResultsListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestResultsList.json + */ + /** + * Sample code: TestResultsList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testResultsList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testResults() + .list( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2", + OsUpdateType.SECURITY_UPDATE, + "osName eq 'Windows 10 2004' and releaseName eq '2020.11B'", + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesGetSamples.java new file mode 100644 index 000000000000..1fe41fe75f57 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestSummaries Get. */ +public final class TestSummariesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestSummaryGet.json + */ + /** + * Sample code: TestSummaryGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testSummaryGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager + .testSummaries() + .getWithResponse( + "contoso-rg1", + "contoso-testBaseAccount1", + "contoso-package2-096bffb5-5d3d-4305-a66a-953372ed6e88", + Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesListSamples.java new file mode 100644 index 000000000000..1ac432115d77 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestSummariesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestSummaries List. */ +public final class TestSummariesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestSummariesList.json + */ + /** + * Sample code: TestSummariesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testSummariesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testSummaries().list("contoso-rg1", "contoso-testBaseAccount1", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesGetSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesGetSamples.java new file mode 100644 index 000000000000..c46a4600e0fe --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestTypes Get. */ +public final class TestTypesGetSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestTypeGet.json + */ + /** + * Sample code: TestTypeGet. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testTypeGet(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testTypes().getWithResponse("contoso-rg", "contoso-testBaseAccount", "Functional-Test", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesListSamples.java new file mode 100644 index 000000000000..3fa193927d52 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/TestTypesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for TestTypes List. */ +public final class TestTypesListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestTypesList.json + */ + /** + * Sample code: TestTypesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testTypesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.testTypes().list("contoso-rg", "contoso-testBaseAccount", Context.NONE); + } +} diff --git a/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/UsageListSamples.java b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/UsageListSamples.java new file mode 100644 index 000000000000..436dc7eca2d6 --- /dev/null +++ b/sdk/testbase/azure-resourcemanager-testbase/src/samples/java/com/azure/resourcemanager/testbase/generated/UsageListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.testbase.generated; + +import com.azure.core.util.Context; + +/** Samples for Usage List. */ +public final class UsageListSamples { + /* + * x-ms-original-file: specification/testbase/resource-manager/Microsoft.TestBase/preview/2020-12-16-preview/examples/TestBaseAccountUsagesList.json + */ + /** + * Sample code: TestBaseAccountUsagesList. + * + * @param manager Entry point to TestBaseManager. + */ + public static void testBaseAccountUsagesList(com.azure.resourcemanager.testbase.TestBaseManager manager) { + manager.usages().list("contoso-rg1", "contoso-testBaseAccount1", null, Context.NONE); + } +} diff --git a/sdk/testbase/ci.yml b/sdk/testbase/ci.yml new file mode 100644 index 000000000000..2a4d884b40fa --- /dev/null +++ b/sdk/testbase/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/testbase/ci.yml + - sdk/testbase/azure-resourcemanager-testbase/ + exclude: + - sdk/testbase/pom.xml + - sdk/testbase/azure-resourcemanager-testbase/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/testbase/ci.yml + - sdk/testbase/azure-resourcemanager-testbase/ + exclude: + - sdk/testbase/pom.xml + - sdk/testbase/azure-resourcemanager-testbase/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: testbase + Artifacts: + - name: azure-resourcemanager-testbase + groupId: com.azure.resourcemanager + safeName: azureresourcemanagertestbase diff --git a/sdk/testbase/pom.xml b/sdk/testbase/pom.xml new file mode 100644 index 000000000000..a5c53b862012 --- /dev/null +++ b/sdk/testbase/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-testbase-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-testbase + + + +