From de9c93491fe2c09d7f37bb3e1f9c8cd59554af1a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 16 Apr 2025 10:15:21 +0000 Subject: [PATCH] CodeGen from PR 33926 in Azure/azure-rest-api-specs Merge 556320acc7cef905fba865e34ffa118b0ebcc35a into 4f6ba43a83ed4f80863e1fe698ac10b89e8c48a0 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../azure-resourcemanager-migrate/README.md | 102 ++ .../azure-resourcemanager-migrate/SAMPLE.md | 367 ++++++ .../azure-resourcemanager-migrate/pom.xml | 74 ++ .../migrate/MigrateManager.java | 350 +++++ .../AssessedMachinesV2OperationsClient.java | 86 ++ ...neAssessmentV2SummaryOperationsClient.java | 84 ++ .../MachineAssessmentsV2OperationsClient.java | 255 ++++ ...raphAssessmentOptionsOperationsClient.java | 76 ++ .../migrate/fluent/MigrateClient.java | 83 ++ .../migrate/fluent/OperationsClient.java | 40 + .../fluent/models/AssessedMachineV2Inner.java | 155 +++ .../fluent/models/DownloadUrlInner.java | 101 ++ .../models/MachineAssessmentV2Inner.java | 166 +++ .../MachineAssessmentV2SummaryInner.java | 156 +++ .../MachineGraphAssessmentOptionsInner.java | 157 +++ .../migrate/fluent/models/OperationInner.java | 159 +++ .../migrate/fluent/models/package-info.java | 9 + .../migrate/fluent/package-info.java | 9 + .../implementation/AssessedMachineV2Impl.java | 50 + ...ssessedMachinesV2OperationsClientImpl.java | 510 ++++++++ .../AssessedMachinesV2OperationsImpl.java | 76 ++ .../implementation/DownloadUrlImpl.java | 36 + .../MachineAssessmentV2Impl.java | 116 ++ .../MachineAssessmentV2SummaryImpl.java | 50 + ...sessmentV2SummaryOperationsClientImpl.java | 452 +++++++ ...hineAssessmentV2SummaryOperationsImpl.java | 76 ++ ...hineAssessmentsV2OperationsClientImpl.java | 1133 +++++++++++++++++ .../MachineAssessmentsV2OperationsImpl.java | 184 +++ .../MachineGraphAssessmentOptionsImpl.java | 50 + ...AssessmentOptionsOperationsClientImpl.java | 414 ++++++ ...eGraphAssessmentOptionsOperationsImpl.java | 73 ++ .../implementation/MigrateClientBuilder.java | 138 ++ .../implementation/MigrateClientImpl.java | 352 +++++ .../migrate/implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 235 ++++ .../implementation/OperationsImpl.java | 45 + .../implementation/ResourceManagerUtils.java | 195 +++ .../models/AssessedMachineV2ListResult.java | 114 ++ .../models/MachineAssessmentV2ListResult.java | 115 ++ .../MachineAssessmentV2SummaryListResult.java | 116 ++ ...chineGraphAssessmentOptionsListResult.java | 116 ++ .../models/OperationListResult.java | 113 ++ .../migrate/implementation/package-info.java | 9 + .../migrate/models/ActionType.java | 46 + .../migrate/models/AssessedDiskDataV3.java | 185 +++ .../AssessedMachineExtendedDetails.java | 375 ++++++ .../AssessedMachineNetworkAdaptersV3.java | 187 +++ .../migrate/models/AssessedMachineType.java | 61 + .../migrate/models/AssessedMachineV2.java | 55 + .../models/AssessedMachineV2Properties.java | 180 +++ .../models/AssessedMachinesV2Operations.java | 77 ++ .../migrate/models/AssessmentDetails.java | 151 +++ .../models/AssessmentSizingCriterion.java | 51 + .../migrate/models/AssessmentSource.java | 101 ++ .../migrate/models/AssessmentStatus.java | 86 ++ .../migrate/models/AzureCurrency.java | 171 +++ .../migrate/models/AzureDiskType.java | 76 ++ .../migrate/models/AzureHybridUseBenefit.java | 56 + .../migrate/models/AzureLocation.java | 376 ++++++ .../models/AzureManagementOfferingType.java | 66 + .../migrate/models/AzureOffer.java | 96 ++ .../migrate/models/AzurePricingTier.java | 51 + .../models/AzureSecurityOfferingType.java | 51 + .../models/AzureStorageRedundancy.java | 66 + .../migrate/models/AzureTarget.java | 111 ++ .../migrate/models/AzureVmFamily.java | 301 +++++ .../AzureVmSecuritySuitabilityDetail.java | 169 +++ .../migrate/models/AzureVmSecurityType.java | 61 + .../migrate/models/BillingSettings.java | 122 ++ .../models/CloudSuitabilityCommon.java | 71 ++ .../migrate/models/Configuration.java | 98 ++ .../migrate/models/CostDetailsCommon.java | 103 ++ .../migrate/models/CostType.java | 146 +++ .../migrate/models/DownloadUrl.java | 34 + .../migrate/models/DownloadUrlRequest.java | 63 + .../migrate/models/EnvironmentType.java | 56 + .../resourcemanager/migrate/models/Error.java | 282 ++++ .../GuestOperatingSystemArchitecture.java | 56 + .../migrate/models/LicensingProgram.java | 61 + .../migrate/models/LinkageKind.java | 76 ++ .../migrate/models/LinkageType.java | 51 + .../migrate/models/Linkages.java | 129 ++ ...ineAssessmentOptionsOutboundEdgeGroup.java | 319 +++++ .../MachineAssessmentRecommendation.java | 302 +++++ .../models/MachineAssessmentSettings.java | 625 +++++++++ .../migrate/models/MachineAssessmentV2.java | 168 +++ .../models/MachineAssessmentV2Properties.java | 176 +++ .../models/MachineAssessmentV2Summary.java | 55 + .../MachineAssessmentV2SummaryOperations.java | 76 ++ .../MachineAssessmentsV2Operations.java | 186 +++ .../migrate/models/MachineBootType.java | 61 + .../models/MachineGraphAssessmentOptions.java | 55 + ...chineGraphAssessmentOptionsOperations.java | 68 + ...chineGraphAssessmentOptionsProperties.java | 102 ++ .../migrate/models/ManagementDetails.java | 103 ++ .../migrate/models/MigrateWorkloadType.java | 86 ++ .../migrate/models/MigrationDetails.java | 103 ++ .../migrate/models/MigrationIssues.java | 168 +++ .../models/MigrationIssuesCategory.java | 56 + .../migrate/models/MigrationPlatform.java | 61 + .../migrate/models/MigrationSuitability.java | 81 ++ .../migrate/models/MigrationType.java | 66 + .../migrate/models/MoreInformation.java | 98 ++ .../migrate/models/NameValuePair.java | 97 ++ .../NameValuePairCloudSuitabilityCommon.java | 100 ++ .../migrate/models/NameValuePairCostType.java | 97 ++ .../models/NameValuePairSavingsType.java | 97 ++ .../migrate/models/Operation.java | 58 + .../migrate/models/OperationDisplay.java | 136 ++ .../migrate/models/Operations.java | 35 + .../migrate/models/Origin.java | 57 + .../migrate/models/Percentile.java | 66 + .../migrate/models/PerformanceData.java | 192 +++ .../migrate/models/PremiumDiskSupport.java | 51 + .../migrate/models/ProcessorInfo.java | 116 ++ .../migrate/models/ProductSupportStatus.java | 251 ++++ .../migrate/models/ProvisioningState.java | 76 ++ .../migrate/models/RecommendedFor.java | 84 ++ .../migrate/models/SavingsDetailsCommon.java | 103 ++ .../migrate/models/SavingsOptions.java | 71 ++ .../migrate/models/SavingsSettings.java | 123 ++ .../migrate/models/SavingsType.java | 62 + .../resourcemanager/migrate/models/Scope.java | 149 +++ .../migrate/models/ScopeType.java | 51 + .../migrate/models/SecuritySuitability.java | 81 ++ .../migrate/models/SkuDetails.java | 160 +++ .../migrate/models/SkuKind.java | 51 + .../migrate/models/SkuType.java | 71 ++ .../models/SkusMigrationSuitability.java | 186 +++ .../migrate/models/SourceDetails.java | 129 ++ ...rceRecommendationMigrationSuitability.java | 103 ++ .../migrate/models/StrategyType.java | 56 + .../migrate/models/SummaryProperties.java | 201 +++ .../migrate/models/SummaryType.java | 56 + .../migrate/models/TargetDetails.java | 129 ++ .../migrate/models/TargetSourcePair.java | 228 ++++ .../migrate/models/TimeRange.java | 61 + .../migrate/models/UltraDiskSupport.java | 51 + .../migrate/models/VmFamilyCategoryItem.java | 91 ++ .../migrate/models/VmSecuritySuitability.java | 119 ++ .../migrate/models/VmUptime.java | 121 ++ .../migrate/models/package-info.java | 9 + .../resourcemanager/migrate/package-info.java | 9 + .../src/main/java/module-info.java | 16 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + .../azure-resourcemanager-migrate.properties | 1 + ...ssessedMachinesV2OperationsGetSamples.java | 25 + ...chinesV2OperationsListByParentSamples.java | 25 + ...sessmentV2SummaryOperationsGetSamples.java | 25 + ...2SummaryOperationsListByParentSamples.java | 24 + ...eAssessmentsV2OperationsCreateSamples.java | 81 ++ ...eAssessmentsV2OperationsDeleteSamples.java | 25 + ...ssmentsV2OperationsDownloadUrlSamples.java | 26 + ...hineAssessmentsV2OperationsGetSamples.java | 25 + ...smentsV2OperationsListByParentSamples.java | 24 + ...AssessmentOptionsOperationsGetSamples.java | 24 + ...tOptionsOperationsListByParentSamples.java | 24 + .../generated/OperationsListSamples.java | 22 + .../generated/AssessedDiskDataV3Tests.java | 23 + ...AssessedMachineNetworkAdaptersV3Tests.java | 22 + .../AssessedMachineV2ListResultTests.java | 19 + .../generated/AssessmentDetailsTests.java | 23 + .../generated/BillingSettingsTests.java | 29 + .../migrate/generated/ConfigurationTests.java | 17 + .../generated/CostDetailsCommonTests.java | 17 + .../generated/DownloadUrlInnerTests.java | 17 + .../generated/DownloadUrlRequestTests.java | 21 + .../migrate/generated/LinkagesTests.java | 17 + .../MachineAssessmentV2SummaryInnerTests.java | 17 + ...ineAssessmentV2SummaryListResultTests.java | 19 + ...aryOperationsGetWithResponseMockTests.java | 37 + ...ummaryOperationsListByParentMockTests.java | 37 + ...OperationsDeleteWithResponseMockTests.java | 34 + ...mentsV2OperationsDownloadUrlMockTests.java | 36 + .../generated/ManagementDetailsTests.java | 17 + .../generated/MigrationDetailsTests.java | 17 + .../generated/MigrationSuitabilityTests.java | 16 + .../generated/MoreInformationTests.java | 16 + ...eValuePairCloudSuitabilityCommonTests.java | 17 + .../generated/NameValuePairCostTypeTests.java | 17 + .../NameValuePairSavingsTypeTests.java | 17 + .../migrate/generated/NameValuePairTests.java | 16 + .../generated/OperationDisplayTests.java | 17 + .../generated/OperationInnerTests.java | 17 + .../generated/OperationListResultTests.java | 19 + .../generated/OperationsListMockTests.java | 36 + .../generated/PerformanceDataTests.java | 38 + .../migrate/generated/ProcessorInfoTests.java | 22 + .../generated/ProductSupportStatusTests.java | 17 + .../generated/RecommendedForTests.java | 17 + .../generated/SavingsDetailsCommonTests.java | 17 + .../migrate/generated/ScopeTests.java | 33 + .../generated/SecuritySuitabilityTests.java | 16 + .../migrate/generated/SkuDetailsTests.java | 17 + .../SkusMigrationSuitabilityTests.java | 17 + .../migrate/generated/SourceDetailsTests.java | 17 + ...commendationMigrationSuitabilityTests.java | 17 + .../generated/SummaryPropertiesTests.java | 17 + .../migrate/generated/TargetDetailsTests.java | 17 + .../generated/TargetSourcePairTests.java | 17 + .../generated/VmSecuritySuitabilityTests.java | 17 + .../migrate/generated/VmUptimeTests.java | 27 + .../tsp-location.yaml | 5 + sdk/migrate/ci.yml | 46 + sdk/migrate/pom.xml | 15 + 209 files changed, 20175 insertions(+) create mode 100644 sdk/migrate/azure-resourcemanager-migrate/CHANGELOG.md create mode 100644 sdk/migrate/azure-resourcemanager-migrate/README.md create mode 100644 sdk/migrate/azure-resourcemanager-migrate/SAMPLE.md create mode 100644 sdk/migrate/azure-resourcemanager-migrate/pom.xml create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/MigrateManager.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/AssessedMachinesV2OperationsClient.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentV2SummaryOperationsClient.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentsV2OperationsClient.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineGraphAssessmentOptionsOperationsClient.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MigrateClient.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/OperationsClient.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/AssessedMachineV2Inner.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/DownloadUrlInner.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2Inner.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2SummaryInner.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineGraphAssessmentOptionsInner.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/OperationInner.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/package-info.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/package-info.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachineV2Impl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsClientImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/DownloadUrlImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2Impl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsClientImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsClientImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsClientImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientBuilder.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsClientImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsImpl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/ResourceManagerUtils.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/AssessedMachineV2ListResult.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2ListResult.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2SummaryListResult.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineGraphAssessmentOptionsListResult.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/OperationListResult.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/package-info.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ActionType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedDiskDataV3.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineExtendedDetails.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineNetworkAdaptersV3.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2Properties.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachinesV2Operations.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentDetails.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSizingCriterion.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSource.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentStatus.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureCurrency.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureDiskType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureHybridUseBenefit.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureLocation.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureManagementOfferingType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureOffer.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzurePricingTier.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureSecurityOfferingType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureStorageRedundancy.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureTarget.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmFamily.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecuritySuitabilityDetail.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecurityType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/BillingSettings.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CloudSuitabilityCommon.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Configuration.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostDetailsCommon.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrl.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrlRequest.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/EnvironmentType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Error.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/GuestOperatingSystemArchitecture.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LicensingProgram.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageKind.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Linkages.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentOptionsOutboundEdgeGroup.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentRecommendation.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentSettings.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Properties.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Summary.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2SummaryOperations.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentsV2Operations.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineBootType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptions.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsOperations.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsProperties.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ManagementDetails.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrateWorkloadType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationDetails.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssues.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssuesCategory.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationPlatform.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationSuitability.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MoreInformation.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePair.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCloudSuitabilityCommon.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCostType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairSavingsType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operation.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/OperationDisplay.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operations.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Origin.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Percentile.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PerformanceData.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PremiumDiskSupport.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProcessorInfo.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProductSupportStatus.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProvisioningState.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/RecommendedFor.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsDetailsCommon.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsOptions.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsSettings.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Scope.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ScopeType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SecuritySuitability.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuDetails.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuKind.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkusMigrationSuitability.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceDetails.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceRecommendationMigrationSuitability.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/StrategyType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryProperties.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryType.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetDetails.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetSourcePair.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TimeRange.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/UltraDiskSupport.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmFamilyCategoryItem.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmSecuritySuitability.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmUptime.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/package-info.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/package-info.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/java/module-info.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/proxy-config.json create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/reflect-config.json create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/main/resources/azure-resourcemanager-migrate.properties create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsGetSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsListByParentSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsCreateSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsGetSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsListByParentSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsGetSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsListByParentSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/OperationsListSamples.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedDiskDataV3Tests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineNetworkAdaptersV3Tests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineV2ListResultTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessmentDetailsTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/BillingSettingsTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ConfigurationTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/CostDetailsCommonTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlInnerTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlRequestTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/LinkagesTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryInnerTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryListResultTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetWithResponseMockTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentMockTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteWithResponseMockTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlMockTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ManagementDetailsTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationDetailsTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationSuitabilityTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MoreInformationTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCloudSuitabilityCommonTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCostTypeTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairSavingsTypeTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationDisplayTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationInnerTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationListResultTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationsListMockTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/PerformanceDataTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProcessorInfoTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProductSupportStatusTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/RecommendedForTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SavingsDetailsCommonTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ScopeTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SecuritySuitabilityTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkuDetailsTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkusMigrationSuitabilityTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceDetailsTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceRecommendationMigrationSuitabilityTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SummaryPropertiesTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetDetailsTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetSourcePairTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmSecuritySuitabilityTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmUptimeTests.java create mode 100644 sdk/migrate/azure-resourcemanager-migrate/tsp-location.yaml create mode 100644 sdk/migrate/ci.yml create mode 100644 sdk/migrate/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 92dbd2e57617..df692054253d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -473,6 +473,7 @@ com.azure.resourcemanager:azure-resourcemanager-databasewatcher;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-durabletask;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-arizeaiobservabilityeval;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-weightsandbiases;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-migrate;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/pom.xml b/pom.xml index ff71d092c5bb..22d1f86d1099 100644 --- a/pom.xml +++ b/pom.xml @@ -144,6 +144,7 @@ sdk/marketplaceordering sdk/mediaservices sdk/metricsadvisor + sdk/migrate sdk/migration sdk/migrationdiscoverysap sdk/mixedreality diff --git a/sdk/migrate/azure-resourcemanager-migrate/CHANGELOG.md b/sdk/migrate/azure-resourcemanager-migrate/CHANGELOG.md new file mode 100644 index 000000000000..cd53d4d61776 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-04-16) + +- Azure Resource Manager migrate client library for Java. This package contains Microsoft Azure SDK for migrate Management SDK. Azure Migrate Resource Provider management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-migrate Java SDK. diff --git a/sdk/migrate/azure-resourcemanager-migrate/README.md b/sdk/migrate/azure-resourcemanager-migrate/README.md new file mode 100644 index 000000000000..368e170b2524 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager migrate client library for Java + +Azure Resource Manager migrate client library for Java. + +This package contains Microsoft Azure SDK for migrate Management SDK. Azure Migrate Resource Provider management API. 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-migrate;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-migrate + 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +MigrateManager manager = MigrateManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` 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/migrate/azure-resourcemanager-migrate/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/migrate/azure-resourcemanager-migrate/SAMPLE.md b/sdk/migrate/azure-resourcemanager-migrate/SAMPLE.md new file mode 100644 index 000000000000..1e7adf3d1d27 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/SAMPLE.md @@ -0,0 +1,367 @@ +# Code snippets and samples + + +## AssessedMachinesV2Operations + +- [Get](#assessedmachinesv2operations_get) +- [ListByParent](#assessedmachinesv2operations_listbyparent) + +## MachineAssessmentV2SummaryOperations + +- [Get](#machineassessmentv2summaryoperations_get) +- [ListByParent](#machineassessmentv2summaryoperations_listbyparent) + +## MachineAssessmentsV2Operations + +- [Create](#machineassessmentsv2operations_create) +- [Delete](#machineassessmentsv2operations_delete) +- [DownloadUrl](#machineassessmentsv2operations_downloadurl) +- [Get](#machineassessmentsv2operations_get) +- [ListByParent](#machineassessmentsv2operations_listbyparent) + +## MachineGraphAssessmentOptionsOperations + +- [Get](#machinegraphassessmentoptionsoperations_get) +- [ListByParent](#machinegraphassessmentoptionsoperations_listbyparent) + +## Operations + +- [List](#operations_list) +### AssessedMachinesV2Operations_Get + +```java +/** + * Samples for MachineAssessmentsV2Operations ListByParent. + */ +public final class MachineAssessmentsV2OperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsListByParentMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### AssessedMachinesV2Operations_ListByParent + +```java +/** + * Samples for AssessedMachinesV2Operations Get. + */ +public final class AssessedMachinesV2OperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedMachinesV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + assessedMachinesV2OperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.assessedMachinesV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentV2SummaryOperations_Get + +```java +/** + * Samples for AssessedMachinesV2Operations ListByParent. + */ +public final class AssessedMachinesV2OperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/AssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedMachinesV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + assessedMachinesV2OperationsListByParentMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.assessedMachinesV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", "eabpcsewhenpdfcsjck", 13, + "lsuhpxtnundds", 28, com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentV2SummaryOperations_ListByParent + +```java +/** + * Samples for MachineAssessmentV2SummaryOperations Get. + */ +public final class MachineAssessmentV2SummaryOperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentV2SummaryOperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentV2SummaryOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_Create + +```java +/** + * Samples for MachineAssessmentV2SummaryOperations ListByParent. + */ +public final class MachineAssessmentV2SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void machineAssessmentV2SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentV2SummaryOperations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_Delete + +```java +/** + * Samples for MachineAssessmentsV2Operations Delete. + */ +public final class MachineAssessmentsV2OperationsDeleteSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsDeleteMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .deleteWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_DownloadUrl + +```java +/** + * Samples for MachineGraphAssessmentOptionsOperations Get. + */ +public final class MachineGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineGraphAssessmentOptionsOperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_Get + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2024-03-03-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to MigrateManager. + */ + public static void operationsList(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### MachineAssessmentsV2Operations_ListByParent + +```java +import com.azure.resourcemanager.migrate.models.AssessmentDetails; +import com.azure.resourcemanager.migrate.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migrate.models.AzureCurrency; +import com.azure.resourcemanager.migrate.models.AzureDiskType; +import com.azure.resourcemanager.migrate.models.AzureHybridUseBenefit; +import com.azure.resourcemanager.migrate.models.AzureOffer; +import com.azure.resourcemanager.migrate.models.AzurePricingTier; +import com.azure.resourcemanager.migrate.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migrate.models.AzureStorageRedundancy; +import com.azure.resourcemanager.migrate.models.AzureVmFamily; +import com.azure.resourcemanager.migrate.models.AzureVmSecurityType; +import com.azure.resourcemanager.migrate.models.BillingSettings; +import com.azure.resourcemanager.migrate.models.EnvironmentType; +import com.azure.resourcemanager.migrate.models.LicensingProgram; +import com.azure.resourcemanager.migrate.models.MachineAssessmentSettings; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Properties; +import com.azure.resourcemanager.migrate.models.Percentile; +import com.azure.resourcemanager.migrate.models.PerformanceData; +import com.azure.resourcemanager.migrate.models.SavingsOptions; +import com.azure.resourcemanager.migrate.models.SavingsSettings; +import com.azure.resourcemanager.migrate.models.Scope; +import com.azure.resourcemanager.migrate.models.ScopeType; +import com.azure.resourcemanager.migrate.models.TimeRange; +import com.azure.resourcemanager.migrate.models.VmUptime; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for MachineAssessmentsV2Operations Create. + */ +public final class MachineAssessmentsV2OperationsCreateSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsCreateMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgmachineAssessments", "contosoProject") + .withProperties(new MachineAssessmentV2Properties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("f") + .withAzureResourceGraphQuery("hfhwuqalmenpcttboxvo")) + .withSettings(new MachineAssessmentSettings().withAzureLocation("rsequlcso") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(9.0D) + .withDiscountPercentage(5.0D) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T05:47:51.336Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T05:47:51.336Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings( + new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL).withSubscriptionId("lee")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withAzureSecurityOfferingType(AzureSecurityOfferingType.NO) + .withAzureDiskTypes(Arrays.asList(AzureDiskType.UNKNOWN)) + .withAzurePricingTier(AzurePricingTier.STANDARD) + .withAzureStorageRedundancy(AzureStorageRedundancy.UNKNOWN) + .withAzureHybridUseBenefit(AzureHybridUseBenefit.UNKNOWN) + .withLinuxAzureHybridUseBenefit(AzureHybridUseBenefit.UNKNOWN) + .withAzureVmFamilies(Arrays.asList(AzureVmFamily.UNKNOWN)) + .withVmUptime(new VmUptime().withDaysPerMonth(9).withHoursPerDay(10)) + .withAzureVmSecurityOptions(Arrays.asList(AzureVmSecurityType.TVM))) + .withDetails(new AssessmentDetails())) + .create(); + } +} +``` + +### MachineGraphAssessmentOptionsOperations_Get + +```java +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; + +/** + * Samples for MachineAssessmentsV2Operations DownloadUrl. + */ +public final class MachineAssessmentsV2OperationsDownloadUrlSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the assessment report. + * + * @param manager Entry point to MigrateManager. + */ + public static void getDownloadURLForTheAssessmentReport(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .downloadUrl("rgmachineAssessments", "contosoProject", "assessmentName", new DownloadUrlRequest(), + com.azure.core.util.Context.NONE); + } +} +``` + +### MachineGraphAssessmentOptionsOperations_ListByParent + +```java +/** + * Samples for MachineAssessmentsV2Operations Get. + */ +public final class MachineAssessmentsV2OperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for MachineGraphAssessmentOptionsOperations ListByParent. + */ +public final class MachineGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void machineGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/migrate/azure-resourcemanager-migrate/pom.xml b/sdk/migrate/azure-resourcemanager-migrate/pom.xml new file mode 100644 index 000000000000..42b363c46a3b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-migrate + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for migrate Management + This package contains Microsoft Azure SDK for migrate Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Migrate Resource Provider management API. + 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 + 0 + 0 + true + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + com.azure + azure-core-test + 1.27.0-beta.8 + test + + + com.azure + azure-identity + 1.15.4 + test + + + diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/MigrateManager.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/MigrateManager.java new file mode 100644 index 000000000000..f3d97453225c --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/MigrateManager.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate; + +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.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +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.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.migrate.fluent.MigrateClient; +import com.azure.resourcemanager.migrate.implementation.AssessedMachinesV2OperationsImpl; +import com.azure.resourcemanager.migrate.implementation.MachineAssessmentV2SummaryOperationsImpl; +import com.azure.resourcemanager.migrate.implementation.MachineAssessmentsV2OperationsImpl; +import com.azure.resourcemanager.migrate.implementation.MachineGraphAssessmentOptionsOperationsImpl; +import com.azure.resourcemanager.migrate.implementation.MigrateClientBuilder; +import com.azure.resourcemanager.migrate.implementation.OperationsImpl; +import com.azure.resourcemanager.migrate.models.AssessedMachinesV2Operations; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2SummaryOperations; +import com.azure.resourcemanager.migrate.models.MachineAssessmentsV2Operations; +import com.azure.resourcemanager.migrate.models.MachineGraphAssessmentOptionsOperations; +import com.azure.resourcemanager.migrate.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to MigrateManager. + * Azure Migrate Resource Provider management API. + */ +public final class MigrateManager { + private Operations operations; + + private MachineAssessmentsV2Operations machineAssessmentsV2Operations; + + private AssessedMachinesV2Operations assessedMachinesV2Operations; + + private MachineAssessmentV2SummaryOperations machineAssessmentV2SummaryOperations; + + private MachineGraphAssessmentOptionsOperations machineGraphAssessmentOptionsOperations; + + private final MigrateClient clientObject; + + private MigrateManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new MigrateClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of migrate service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the migrate service API instance. + */ + public static MigrateManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of migrate service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the migrate service API instance. + */ + public static MigrateManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new MigrateManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create MigrateManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new MigrateManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-migrate.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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 migrate service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the migrate service API instance. + */ + public MigrateManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.migrate") + .append("/") + .append(clientVersion); + 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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + 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 BearerTokenAuthenticationPolicy(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 MigrateManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of MachineAssessmentsV2Operations. It manages MachineAssessmentV2. + * + * @return Resource collection API of MachineAssessmentsV2Operations. + */ + public MachineAssessmentsV2Operations machineAssessmentsV2Operations() { + if (this.machineAssessmentsV2Operations == null) { + this.machineAssessmentsV2Operations + = new MachineAssessmentsV2OperationsImpl(clientObject.getMachineAssessmentsV2Operations(), this); + } + return machineAssessmentsV2Operations; + } + + /** + * Gets the resource collection API of AssessedMachinesV2Operations. + * + * @return Resource collection API of AssessedMachinesV2Operations. + */ + public AssessedMachinesV2Operations assessedMachinesV2Operations() { + if (this.assessedMachinesV2Operations == null) { + this.assessedMachinesV2Operations + = new AssessedMachinesV2OperationsImpl(clientObject.getAssessedMachinesV2Operations(), this); + } + return assessedMachinesV2Operations; + } + + /** + * Gets the resource collection API of MachineAssessmentV2SummaryOperations. + * + * @return Resource collection API of MachineAssessmentV2SummaryOperations. + */ + public MachineAssessmentV2SummaryOperations machineAssessmentV2SummaryOperations() { + if (this.machineAssessmentV2SummaryOperations == null) { + this.machineAssessmentV2SummaryOperations = new MachineAssessmentV2SummaryOperationsImpl( + clientObject.getMachineAssessmentV2SummaryOperations(), this); + } + return machineAssessmentV2SummaryOperations; + } + + /** + * Gets the resource collection API of MachineGraphAssessmentOptionsOperations. + * + * @return Resource collection API of MachineGraphAssessmentOptionsOperations. + */ + public MachineGraphAssessmentOptionsOperations machineGraphAssessmentOptionsOperations() { + if (this.machineGraphAssessmentOptionsOperations == null) { + this.machineGraphAssessmentOptionsOperations = new MachineGraphAssessmentOptionsOperationsImpl( + clientObject.getMachineGraphAssessmentOptionsOperations(), this); + } + return machineGraphAssessmentOptionsOperations; + } + + /** + * Gets wrapped service client MigrateClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client MigrateClient. + */ + public MigrateClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/AssessedMachinesV2OperationsClient.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/AssessedMachinesV2OperationsClient.java new file mode 100644 index 000000000000..5b39d375b02e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/AssessedMachinesV2OperationsClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.models.AssessedMachineV2Inner; + +/** + * An instance of this class provides access to all the operations defined in AssessedMachinesV2OperationsClient. + */ +public interface AssessedMachinesV2OperationsClient { + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedMachineName, Context context); + + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AssessedMachineV2Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedMachineName); + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 the response of a AssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param filter Filter query. + * @param pageSize Optional parameter for page size. + * @param continuationToken Optional parameter for continuation token. + * @param totalRecordCount Total record count. + * @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 response of a AssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentV2SummaryOperationsClient.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentV2SummaryOperationsClient.java new file mode 100644 index 000000000000..5814ca588b21 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentV2SummaryOperationsClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.models.MachineAssessmentV2SummaryInner; + +/** + * An instance of this class provides access to all the operations defined in + * MachineAssessmentV2SummaryOperationsClient. + */ +public interface MachineAssessmentV2SummaryOperationsClient { + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineAssessmentV2SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 the response of a MachineAssessmentV2Summary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentsV2OperationsClient.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentsV2OperationsClient.java new file mode 100644 index 000000000000..f1b7df3a8d1b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineAssessmentsV2OperationsClient.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2Inner; +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; + +/** + * An instance of this class provides access to all the operations defined in MachineAssessmentsV2OperationsClient. + */ +public interface MachineAssessmentsV2OperationsClient { + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, Context context); + + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineAssessmentV2Inner get(String resourceGroupName, String projectName, String assessmentName); + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 the response of a MachineAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineAssessmentV2Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, MachineAssessmentV2Inner resource); + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MachineAssessmentV2Inner> beginCreate(String resourceGroupName, + String projectName, String assessmentName, MachineAssessmentV2Inner resource, Context context); + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + MachineAssessmentV2Inner resource); + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + MachineAssessmentV2Inner resource, Context context); + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, String assessmentName, + Context context); + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, String assessmentName); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, DownloadUrlRequest body); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, DownloadUrlRequest body, Context context); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body, Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineGraphAssessmentOptionsOperationsClient.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineGraphAssessmentOptionsOperationsClient.java new file mode 100644 index 000000000000..0670bda86b04 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MachineGraphAssessmentOptionsOperationsClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.models.MachineGraphAssessmentOptionsInner; + +/** + * An instance of this class provides access to all the operations defined in + * MachineGraphAssessmentOptionsOperationsClient. + */ +public interface MachineGraphAssessmentOptionsOperationsClient { + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String projectName, + Context context); + + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MachineGraphAssessmentOptionsInner get(String resourceGroupName, String projectName); + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 the response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MigrateClient.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MigrateClient.java new file mode 100644 index 000000000000..529ca045c605 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/MigrateClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for MigrateClient class. + */ +public interface MigrateClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * 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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the MachineAssessmentsV2OperationsClient object to access its operations. + * + * @return the MachineAssessmentsV2OperationsClient object. + */ + MachineAssessmentsV2OperationsClient getMachineAssessmentsV2Operations(); + + /** + * Gets the AssessedMachinesV2OperationsClient object to access its operations. + * + * @return the AssessedMachinesV2OperationsClient object. + */ + AssessedMachinesV2OperationsClient getAssessedMachinesV2Operations(); + + /** + * Gets the MachineAssessmentV2SummaryOperationsClient object to access its operations. + * + * @return the MachineAssessmentV2SummaryOperationsClient object. + */ + MachineAssessmentV2SummaryOperationsClient getMachineAssessmentV2SummaryOperations(); + + /** + * Gets the MachineGraphAssessmentOptionsOperationsClient object to access its operations. + * + * @return the MachineGraphAssessmentOptionsOperationsClient object. + */ + MachineGraphAssessmentOptionsOperationsClient getMachineGraphAssessmentOptionsOperations(); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/OperationsClient.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/OperationsClient.java new file mode 100644 index 000000000000..8b9af5d52240 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/AssessedMachineV2Inner.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/AssessedMachineV2Inner.java new file mode 100644 index 000000000000..8b9f1e5dedcd --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/AssessedMachineV2Inner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.models.AssessedMachineV2Properties; +import java.io.IOException; + +/** + * Machine assessment V2 Assessed Machine resource. + */ +@Immutable +public final class AssessedMachineV2Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AssessedMachineV2Properties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AssessedMachineV2Inner class. + */ + private AssessedMachineV2Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AssessedMachineV2Properties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedMachineV2Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineV2Inner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssessedMachineV2Inner. + */ + public static AssessedMachineV2Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineV2Inner deserializedAssessedMachineV2Inner = new AssessedMachineV2Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAssessedMachineV2Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAssessedMachineV2Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAssessedMachineV2Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAssessedMachineV2Inner.properties = AssessedMachineV2Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAssessedMachineV2Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineV2Inner; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/DownloadUrlInner.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/DownloadUrlInner.java new file mode 100644 index 000000000000..a7d16cccd320 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/DownloadUrlInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Data model of Download URL for assessment report. + */ +@Immutable +public final class DownloadUrlInner implements JsonSerializable { + /* + * Hyperlink to download report. + */ + private String assessmentReportUrl; + + /* + * Expiry date of download url. + */ + private OffsetDateTime expirationTime; + + /** + * Creates an instance of DownloadUrlInner class. + */ + private DownloadUrlInner() { + } + + /** + * Get the assessmentReportUrl property: Hyperlink to download report. + * + * @return the assessmentReportUrl value. + */ + public String assessmentReportUrl() { + return this.assessmentReportUrl; + } + + /** + * Get the expirationTime property: Expiry date of 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DownloadUrlInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DownloadUrlInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DownloadUrlInner. + */ + public static DownloadUrlInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DownloadUrlInner deserializedDownloadUrlInner = new DownloadUrlInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assessmentReportUrl".equals(fieldName)) { + deserializedDownloadUrlInner.assessmentReportUrl = reader.getString(); + } else if ("expirationTime".equals(fieldName)) { + deserializedDownloadUrlInner.expirationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedDownloadUrlInner; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2Inner.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2Inner.java new file mode 100644 index 000000000000..fd4e8df7e123 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2Inner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Properties; +import java.io.IOException; + +/** + * Machine assessment V2 resource. + */ +@Fluent +public final class MachineAssessmentV2Inner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private MachineAssessmentV2Properties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MachineAssessmentV2Inner class. + */ + public MachineAssessmentV2Inner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public MachineAssessmentV2Properties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the MachineAssessmentV2Inner object itself. + */ + public MachineAssessmentV2Inner withProperties(MachineAssessmentV2Properties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentV2Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentV2Inner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineAssessmentV2Inner. + */ + public static MachineAssessmentV2Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentV2Inner deserializedMachineAssessmentV2Inner = new MachineAssessmentV2Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMachineAssessmentV2Inner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMachineAssessmentV2Inner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMachineAssessmentV2Inner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMachineAssessmentV2Inner.properties = MachineAssessmentV2Properties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMachineAssessmentV2Inner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentV2Inner; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2SummaryInner.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2SummaryInner.java new file mode 100644 index 000000000000..fe1a05a82081 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineAssessmentV2SummaryInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.models.SummaryProperties; +import java.io.IOException; + +/** + * Machine Assessment REST resource. + */ +@Immutable +public final class MachineAssessmentV2SummaryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SummaryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MachineAssessmentV2SummaryInner class. + */ + private MachineAssessmentV2SummaryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SummaryProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentV2SummaryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentV2SummaryInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineAssessmentV2SummaryInner. + */ + public static MachineAssessmentV2SummaryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentV2SummaryInner deserializedMachineAssessmentV2SummaryInner + = new MachineAssessmentV2SummaryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMachineAssessmentV2SummaryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMachineAssessmentV2SummaryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMachineAssessmentV2SummaryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMachineAssessmentV2SummaryInner.properties = SummaryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMachineAssessmentV2SummaryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentV2SummaryInner; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineGraphAssessmentOptionsInner.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineGraphAssessmentOptionsInner.java new file mode 100644 index 000000000000..7690d284073f --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/MachineGraphAssessmentOptionsInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.models.MachineGraphAssessmentOptionsProperties; +import java.io.IOException; + +/** + * Machine Assessment REST resource. + */ +@Immutable +public final class MachineGraphAssessmentOptionsInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private MachineGraphAssessmentOptionsProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MachineGraphAssessmentOptionsInner class. + */ + private MachineGraphAssessmentOptionsInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public MachineGraphAssessmentOptionsProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineGraphAssessmentOptionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineGraphAssessmentOptionsInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineGraphAssessmentOptionsInner. + */ + public static MachineGraphAssessmentOptionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineGraphAssessmentOptionsInner deserializedMachineGraphAssessmentOptionsInner + = new MachineGraphAssessmentOptionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMachineGraphAssessmentOptionsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMachineGraphAssessmentOptionsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMachineGraphAssessmentOptionsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMachineGraphAssessmentOptionsInner.properties + = MachineGraphAssessmentOptionsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMachineGraphAssessmentOptionsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineGraphAssessmentOptionsInner; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/OperationInner.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/OperationInner.java new file mode 100644 index 000000000000..1a6e856dd042 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/OperationInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.models.ActionType; +import com.azure.resourcemanager.migrate.models.OperationDisplay; +import com.azure.resourcemanager.migrate.models.Origin; +import java.io.IOException; + +/** + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/package-info.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/package-info.java new file mode 100644 index 000000000000..2e96b34b740e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for Migrate. + * Azure Migrate Resource Provider management API. + */ +package com.azure.resourcemanager.migrate.fluent.models; diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/package-info.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/package-info.java new file mode 100644 index 000000000000..5fe3fd4e2a93 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for Migrate. + * Azure Migrate Resource Provider management API. + */ +package com.azure.resourcemanager.migrate.fluent; diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachineV2Impl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachineV2Impl.java new file mode 100644 index 000000000000..179f63153ac6 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachineV2Impl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migrate.fluent.models.AssessedMachineV2Inner; +import com.azure.resourcemanager.migrate.models.AssessedMachineV2; +import com.azure.resourcemanager.migrate.models.AssessedMachineV2Properties; + +public final class AssessedMachineV2Impl implements AssessedMachineV2 { + private AssessedMachineV2Inner innerObject; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + AssessedMachineV2Impl(AssessedMachineV2Inner innerObject, + com.azure.resourcemanager.migrate.MigrateManager 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 AssessedMachineV2Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AssessedMachineV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsClientImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsClientImpl.java new file mode 100644 index 000000000000..a030d0db05da --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsClientImpl.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.AssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.AssessedMachineV2Inner; +import com.azure.resourcemanager.migrate.implementation.models.AssessedMachineV2ListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AssessedMachinesV2OperationsClient. + */ +public final class AssessedMachinesV2OperationsClientImpl implements AssessedMachinesV2OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AssessedMachinesV2OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrateClientImpl client; + + /** + * Initializes an instance of AssessedMachinesV2OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AssessedMachinesV2OperationsClientImpl(MigrateClientImpl client) { + this.service = RestProxy.create(AssessedMachinesV2OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrateClientAssessedMachinesV2Operations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MigrateClientAssesse") + public interface AssessedMachinesV2OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}/assessedMachines/{assessedMachineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, + @PathParam("assessedMachineName") String assessedMachineName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}/assessedMachines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("pageSize") Integer pageSize, @QueryParam("continuationToken") String continuationToken, + @QueryParam("totalRecordCount") Integer totalRecordCount, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedMachineName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (assessedMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessedMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, assessedMachineName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, String assessedMachineName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (assessedMachineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter assessedMachineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, assessedMachineName, accept, context); + } + + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, String assessmentName, + String assessedMachineName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedMachineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedMachineName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, assessedMachineName, context) + .block(); + } + + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AssessedMachineV2Inner get(String resourceGroupName, String projectName, String assessmentName, + String assessedMachineName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, assessedMachineName, Context.NONE) + .getValue(); + } + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param filter Filter query. + * @param pageSize Optional parameter for page size. + * @param continuationToken Optional parameter for continuation token. + * @param totalRecordCount Total record count. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a AssessedMachineV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String assessmentName, String filter, Integer pageSize, String continuationToken, + Integer totalRecordCount) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, pageSize, continuationToken, + totalRecordCount, projectName, assessmentName, 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())); + } + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param filter Filter query. + * @param pageSize Optional parameter for page size. + * @param continuationToken Optional parameter for continuation token. + * @param totalRecordCount Total record count. + * @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 response of a AssessedMachineV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String assessmentName, String filter, Integer pageSize, String continuationToken, + Integer totalRecordCount, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByParent(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, pageSize, continuationToken, totalRecordCount, projectName, assessmentName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param filter Filter query. + * @param pageSize Optional parameter for page size. + * @param continuationToken Optional parameter for continuation token. + * @param totalRecordCount Total record count. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a AssessedMachineV2 list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String assessmentName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, assessmentName, filter, + pageSize, continuationToken, totalRecordCount), nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a AssessedMachineV2 list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String assessmentName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, assessmentName, filter, + pageSize, continuationToken, totalRecordCount), nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param filter Filter query. + * @param pageSize Optional parameter for page size. + * @param continuationToken Optional parameter for continuation token. + * @param totalRecordCount Total record count. + * @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 response of a AssessedMachineV2 list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String assessmentName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, assessmentName, filter, pageSize, + continuationToken, totalRecordCount, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a AssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + final String filter = null; + final Integer pageSize = null; + final String continuationToken = null; + final Integer totalRecordCount = null; + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, assessmentName, filter, pageSize, + continuationToken, totalRecordCount)); + } + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param filter Filter query. + * @param pageSize Optional parameter for page size. + * @param continuationToken Optional parameter for continuation token. + * @param totalRecordCount Total record count. + * @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 response of a AssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, assessmentName, filter, pageSize, + continuationToken, totalRecordCount, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a AssessedMachineV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a AssessedMachineV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(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/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsImpl.java new file mode 100644 index 000000000000..eaf85ad09a28 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/AssessedMachinesV2OperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.AssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.AssessedMachineV2Inner; +import com.azure.resourcemanager.migrate.models.AssessedMachineV2; +import com.azure.resourcemanager.migrate.models.AssessedMachinesV2Operations; + +public final class AssessedMachinesV2OperationsImpl implements AssessedMachinesV2Operations { + private static final ClientLogger LOGGER = new ClientLogger(AssessedMachinesV2OperationsImpl.class); + + private final AssessedMachinesV2OperationsClient innerClient; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + public AssessedMachinesV2OperationsImpl(AssessedMachinesV2OperationsClient innerClient, + com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String assessedMachineName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, assessedMachineName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AssessedMachineV2Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AssessedMachineV2 get(String resourceGroupName, String projectName, String assessmentName, + String assessedMachineName) { + AssessedMachineV2Inner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, assessedMachineName); + if (inner != null) { + return new AssessedMachineV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedMachineV2Impl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, + Context context) { + PagedIterable inner = this.serviceClient() + .listByParent(resourceGroupName, projectName, assessmentName, filter, pageSize, continuationToken, + totalRecordCount, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AssessedMachineV2Impl(inner1, this.manager())); + } + + private AssessedMachinesV2OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/DownloadUrlImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/DownloadUrlImpl.java new file mode 100644 index 000000000000..e2d60efad493 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/DownloadUrlImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation; + +import com.azure.resourcemanager.migrate.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migrate.models.DownloadUrl; +import java.time.OffsetDateTime; + +public final class DownloadUrlImpl implements DownloadUrl { + private DownloadUrlInner innerObject; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + DownloadUrlImpl(DownloadUrlInner innerObject, com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String assessmentReportUrl() { + return this.innerModel().assessmentReportUrl(); + } + + public OffsetDateTime expirationTime() { + return this.innerModel().expirationTime(); + } + + public DownloadUrlInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2Impl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2Impl.java new file mode 100644 index 000000000000..79428b31af0f --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2Impl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2Inner; +import com.azure.resourcemanager.migrate.models.DownloadUrl; +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Properties; + +public final class MachineAssessmentV2Impl implements MachineAssessmentV2, MachineAssessmentV2.Definition { + private MachineAssessmentV2Inner innerObject; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + MachineAssessmentV2Impl(MachineAssessmentV2Inner innerObject, + com.azure.resourcemanager.migrate.MigrateManager 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 MachineAssessmentV2Properties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MachineAssessmentV2Inner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String projectName; + + private String assessmentName; + + public MachineAssessmentV2Impl withExistingAssessmentProject(String resourceGroupName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.projectName = projectName; + return this; + } + + public MachineAssessmentV2 create() { + this.innerObject = serviceManager.serviceClient() + .getMachineAssessmentsV2Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), Context.NONE); + return this; + } + + public MachineAssessmentV2 create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMachineAssessmentsV2Operations() + .create(resourceGroupName, projectName, assessmentName, this.innerModel(), context); + return this; + } + + MachineAssessmentV2Impl(String name, com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerObject = new MachineAssessmentV2Inner(); + this.serviceManager = serviceManager; + this.assessmentName = name; + } + + public MachineAssessmentV2 refresh() { + this.innerObject = serviceManager.serviceClient() + .getMachineAssessmentsV2Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE) + .getValue(); + return this; + } + + public MachineAssessmentV2 refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getMachineAssessmentsV2Operations() + .getWithResponse(resourceGroupName, projectName, assessmentName, context) + .getValue(); + return this; + } + + public DownloadUrl downloadUrl(DownloadUrlRequest body) { + return serviceManager.machineAssessmentsV2Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body); + } + + public DownloadUrl downloadUrl(DownloadUrlRequest body, Context context) { + return serviceManager.machineAssessmentsV2Operations() + .downloadUrl(resourceGroupName, projectName, assessmentName, body, context); + } + + public MachineAssessmentV2Impl withProperties(MachineAssessmentV2Properties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryImpl.java new file mode 100644 index 000000000000..168315d6fd64 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2SummaryInner; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Summary; +import com.azure.resourcemanager.migrate.models.SummaryProperties; + +public final class MachineAssessmentV2SummaryImpl implements MachineAssessmentV2Summary { + private MachineAssessmentV2SummaryInner innerObject; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + MachineAssessmentV2SummaryImpl(MachineAssessmentV2SummaryInner innerObject, + com.azure.resourcemanager.migrate.MigrateManager 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 SummaryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MachineAssessmentV2SummaryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsClientImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsClientImpl.java new file mode 100644 index 000000000000..73d599691aa7 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsClientImpl.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.MachineAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2SummaryInner; +import com.azure.resourcemanager.migrate.implementation.models.MachineAssessmentV2SummaryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * MachineAssessmentV2SummaryOperationsClient. + */ +public final class MachineAssessmentV2SummaryOperationsClientImpl + implements MachineAssessmentV2SummaryOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MachineAssessmentV2SummaryOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrateClientImpl client; + + /** + * Initializes an instance of MachineAssessmentV2SummaryOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachineAssessmentV2SummaryOperationsClientImpl(MigrateClientImpl client) { + this.service = RestProxy.create(MachineAssessmentV2SummaryOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrateClientMachineAssessmentV2SummaryOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MigrateClientMachine") + public interface MachineAssessmentV2SummaryOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}/summaries/{summaryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @PathParam("summaryName") String summaryName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}/summaries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String summaryName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (summaryName == null) { + return Mono.error(new IllegalArgumentException("Parameter summaryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, summaryName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, String assessmentName, String summaryName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (summaryName == null) { + return Mono.error(new IllegalArgumentException("Parameter summaryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, summaryName, accept, context); + } + + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentName, String summaryName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, summaryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, summaryName, context).block(); + } + + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineAssessmentV2SummaryInner get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, summaryName, Context.NONE).getValue(); + } + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String assessmentName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, 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())); + } + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, String assessmentName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByParent(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String assessmentName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, assessmentName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + String assessmentName, Context context) { + return new PagedFlux<>( + () -> listByParentSinglePageAsync(resourceGroupName, projectName, assessmentName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, assessmentName)); + } + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, assessmentName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a MachineAssessmentV2Summary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a MachineAssessmentV2Summary list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(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/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsImpl.java new file mode 100644 index 000000000000..322c0b16376c --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentV2SummaryOperationsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.MachineAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2SummaryInner; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Summary; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2SummaryOperations; + +public final class MachineAssessmentV2SummaryOperationsImpl implements MachineAssessmentV2SummaryOperations { + private static final ClientLogger LOGGER = new ClientLogger(MachineAssessmentV2SummaryOperationsImpl.class); + + private final MachineAssessmentV2SummaryOperationsClient innerClient; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + public MachineAssessmentV2SummaryOperationsImpl(MachineAssessmentV2SummaryOperationsClient innerClient, + com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, projectName, assessmentName, summaryName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MachineAssessmentV2SummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MachineAssessmentV2Summary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName) { + MachineAssessmentV2SummaryInner inner + = this.serviceClient().get(resourceGroupName, projectName, assessmentName, summaryName); + if (inner != null) { + return new MachineAssessmentV2SummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MachineAssessmentV2SummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, assessmentName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MachineAssessmentV2SummaryImpl(inner1, this.manager())); + } + + private MachineAssessmentV2SummaryOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsClientImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsClientImpl.java new file mode 100644 index 000000000000..d781542d4fff --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsClientImpl.java @@ -0,0 +1,1133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.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.migrate.fluent.MachineAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2Inner; +import com.azure.resourcemanager.migrate.implementation.models.MachineAssessmentV2ListResult; +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; +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 MachineAssessmentsV2OperationsClient. + */ +public final class MachineAssessmentsV2OperationsClientImpl implements MachineAssessmentsV2OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MachineAssessmentsV2OperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrateClientImpl client; + + /** + * Initializes an instance of MachineAssessmentsV2OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachineAssessmentsV2OperationsClientImpl(MigrateClientImpl client) { + this.service = RestProxy.create(MachineAssessmentsV2OperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrateClientMachineAssessmentsV2Operations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MigrateClientMachine") + public interface MachineAssessmentsV2OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MachineAssessmentV2Inner resource, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessments/{assessmentName}/downloadUrl") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUrl(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @PathParam("assessmentName") String assessmentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DownloadUrlRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, accept, context); + } + + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName, + String assessmentName) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, Context context) { + return getWithResponseAsync(resourceGroupName, projectName, assessmentName, context).block(); + } + + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineAssessmentV2Inner get(String resourceGroupName, String projectName, String assessmentName) { + return getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE).getValue(); + } + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, 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())); + } + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentSinglePageAsync(String resourceGroupName, + String projectName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByParent(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, String projectName, + Context context) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); + } + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return machine assessment V2 resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, MachineAssessmentV2Inner resource) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, MachineAssessmentV2Inner resource, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, contentType, accept, resource, context); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineAssessmentV2Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, MachineAssessmentV2Inner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MachineAssessmentV2Inner.class, MachineAssessmentV2Inner.class, + this.client.getContext()); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MachineAssessmentV2Inner> beginCreateAsync( + String resourceGroupName, String projectName, String assessmentName, MachineAssessmentV2Inner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, projectName, assessmentName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MachineAssessmentV2Inner.class, MachineAssessmentV2Inner.class, context); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineAssessmentV2Inner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, MachineAssessmentV2Inner resource) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).getSyncPoller(); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MachineAssessmentV2Inner> beginCreate( + String resourceGroupName, String projectName, String assessmentName, MachineAssessmentV2Inner resource, + Context context) { + return this.beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).getSyncPoller(); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return machine assessment V2 resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String assessmentName, MachineAssessmentV2Inner resource) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String projectName, + String assessmentName, MachineAssessmentV2Inner resource, Context context) { + return beginCreateAsync(resourceGroupName, projectName, assessmentName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + MachineAssessmentV2Inner resource) { + return createAsync(resourceGroupName, projectName, assessmentName, resource).block(); + } + + /** + * Create a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param resource Resource create parameters. + * @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 machine assessment V2 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineAssessmentV2Inner create(String resourceGroupName, String projectName, String assessmentName, + MachineAssessmentV2Inner resource, Context context) { + return createAsync(resourceGroupName, projectName, assessmentName, resource, context).block(); + } + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, + String assessmentName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, + String assessmentName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, assessmentName, accept, context); + } + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, String assessmentName) { + return deleteWithResponseAsync(resourceGroupName, projectName, assessmentName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, String assessmentName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, projectName, assessmentName, context).block(); + } + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, String assessmentName) { + deleteWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, DownloadUrlRequest body) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, contentType, accept, + body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> downloadUrlWithResponseAsync(String resourceGroupName, String projectName, + String assessmentName, DownloadUrlRequest body, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (assessmentName == null) { + return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.downloadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, assessmentName, contentType, accept, body, + context); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String assessmentName, DownloadUrlRequest body) { + Mono>> mono + = downloadUrlWithResponseAsync(resourceGroupName, projectName, assessmentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DownloadUrlInner.class, DownloadUrlInner.class, this.client.getContext()); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DownloadUrlInner> beginDownloadUrlAsync(String resourceGroupName, + String projectName, String assessmentName, DownloadUrlRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = downloadUrlWithResponseAsync(resourceGroupName, projectName, assessmentName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DownloadUrlInner.class, DownloadUrlInner.class, context); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, DownloadUrlRequest body) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body).getSyncPoller(); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DownloadUrlInner> beginDownloadUrl(String resourceGroupName, + String projectName, String assessmentName, DownloadUrlRequest body, Context context) { + return this.beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body, context) + .getSyncPoller(); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body) { + return beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadUrlAsync(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body, Context context) { + return beginDownloadUrlAsync(resourceGroupName, projectName, assessmentName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body) { + return downloadUrlAsync(resourceGroupName, projectName, assessmentName, body).block(); + } + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DownloadUrlInner downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body, Context context) { + return downloadUrlAsync(resourceGroupName, projectName, assessmentName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a MachineAssessmentV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a MachineAssessmentV2 list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(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/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsImpl.java new file mode 100644 index 000000000000..fbd1653d485e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineAssessmentsV2OperationsImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.MachineAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.DownloadUrlInner; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2Inner; +import com.azure.resourcemanager.migrate.models.DownloadUrl; +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2; +import com.azure.resourcemanager.migrate.models.MachineAssessmentsV2Operations; + +public final class MachineAssessmentsV2OperationsImpl implements MachineAssessmentsV2Operations { + private static final ClientLogger LOGGER = new ClientLogger(MachineAssessmentsV2OperationsImpl.class); + + private final MachineAssessmentsV2OperationsClient innerClient; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + public MachineAssessmentsV2OperationsImpl(MachineAssessmentsV2OperationsClient innerClient, + com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, projectName, assessmentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MachineAssessmentV2Impl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MachineAssessmentV2 get(String resourceGroupName, String projectName, String assessmentName) { + MachineAssessmentV2Inner inner = this.serviceClient().get(resourceGroupName, projectName, assessmentName); + if (inner != null) { + return new MachineAssessmentV2Impl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MachineAssessmentV2Impl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MachineAssessmentV2Impl(inner1, this.manager())); + } + + public Response deleteWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + public void delete(String resourceGroupName, String projectName, String assessmentName) { + this.serviceClient().delete(resourceGroupName, projectName, assessmentName); + } + + public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body) { + DownloadUrlInner inner = this.serviceClient().downloadUrl(resourceGroupName, projectName, assessmentName, body); + if (inner != null) { + return new DownloadUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body, Context context) { + DownloadUrlInner inner + = this.serviceClient().downloadUrl(resourceGroupName, projectName, assessmentName, body, context); + if (inner != null) { + return new DownloadUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public MachineAssessmentV2 getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 projectName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentProjects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentProjects'.", id))); + } + String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "assessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 projectName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentProjects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentProjects'.", id))); + } + String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "assessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); + } + return this.getWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 projectName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentProjects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentProjects'.", id))); + } + String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "assessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); + } + this.deleteWithResponse(resourceGroupName, projectName, assessmentName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 projectName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentProjects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentProjects'.", id))); + } + String assessmentName = ResourceManagerUtils.getValueFromIdByName(id, "assessments"); + if (assessmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, projectName, assessmentName, context); + } + + private MachineAssessmentsV2OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } + + public MachineAssessmentV2Impl define(String name) { + return new MachineAssessmentV2Impl(name, this.manager()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsImpl.java new file mode 100644 index 000000000000..1bfc807d9064 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migrate.fluent.models.MachineGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migrate.models.MachineGraphAssessmentOptions; +import com.azure.resourcemanager.migrate.models.MachineGraphAssessmentOptionsProperties; + +public final class MachineGraphAssessmentOptionsImpl implements MachineGraphAssessmentOptions { + private MachineGraphAssessmentOptionsInner innerObject; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + MachineGraphAssessmentOptionsImpl(MachineGraphAssessmentOptionsInner innerObject, + com.azure.resourcemanager.migrate.MigrateManager 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 MachineGraphAssessmentOptionsProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MachineGraphAssessmentOptionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsClientImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsClientImpl.java new file mode 100644 index 000000000000..a5e78814f1fc --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsClientImpl.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.MachineGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.MachineGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migrate.implementation.models.MachineGraphAssessmentOptionsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * MachineGraphAssessmentOptionsOperationsClient. + */ +public final class MachineGraphAssessmentOptionsOperationsClientImpl + implements MachineGraphAssessmentOptionsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MachineGraphAssessmentOptionsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MigrateClientImpl client; + + /** + * Initializes an instance of MachineGraphAssessmentOptionsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MachineGraphAssessmentOptionsOperationsClientImpl(MigrateClientImpl client) { + this.service = RestProxy.create(MachineGraphAssessmentOptionsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrateClientMachineGraphAssessmentOptionsOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MigrateClientMachine") + public interface MachineGraphAssessmentOptionsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/assessmentOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("projectName") String projectName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String projectName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, accept, context); + } + + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String projectName) { + return getWithResponseAsync(resourceGroupName, projectName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String projectName, + Context context) { + return getWithResponseAsync(resourceGroupName, projectName, context).block(); + } + + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MachineGraphAssessmentOptionsInner get(String resourceGroupName, String projectName) { + return getWithResponse(resourceGroupName, projectName, Context.NONE).getValue(); + } + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByParentSinglePageAsync(String resourceGroupName, String projectName) { + 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, projectName, 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())); + } + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByParentSinglePageAsync(String resourceGroupName, String projectName, 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 (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByParent(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, projectName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, + String projectName) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByParentAsync(String resourceGroupName, + String projectName, Context context) { + return new PagedFlux<>(() -> listByParentSinglePageAsync(resourceGroupName, projectName, context), + nextLink -> listByParentNextSinglePageAsync(nextLink, context)); + } + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, + String projectName) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName)); + } + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByParent(String resourceGroupName, String projectName, + Context context) { + return new PagedIterable<>(listByParentAsync(resourceGroupName, projectName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 response of a MachineGraphAssessmentOptions list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a MachineGraphAssessmentOptions list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(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.listByParentNext(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/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsImpl.java new file mode 100644 index 000000000000..c23c68729d93 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MachineGraphAssessmentOptionsOperationsImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.MachineGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.MachineGraphAssessmentOptionsInner; +import com.azure.resourcemanager.migrate.models.MachineGraphAssessmentOptions; +import com.azure.resourcemanager.migrate.models.MachineGraphAssessmentOptionsOperations; + +public final class MachineGraphAssessmentOptionsOperationsImpl implements MachineGraphAssessmentOptionsOperations { + private static final ClientLogger LOGGER = new ClientLogger(MachineGraphAssessmentOptionsOperationsImpl.class); + + private final MachineGraphAssessmentOptionsOperationsClient innerClient; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + public MachineGraphAssessmentOptionsOperationsImpl(MachineGraphAssessmentOptionsOperationsClient innerClient, + com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String projectName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, projectName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MachineGraphAssessmentOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MachineGraphAssessmentOptions get(String resourceGroupName, String projectName) { + MachineGraphAssessmentOptionsInner inner = this.serviceClient().get(resourceGroupName, projectName); + if (inner != null) { + return new MachineGraphAssessmentOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByParent(String resourceGroupName, String projectName) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MachineGraphAssessmentOptionsImpl(inner1, this.manager())); + } + + public PagedIterable listByParent(String resourceGroupName, String projectName, + Context context) { + PagedIterable inner + = this.serviceClient().listByParent(resourceGroupName, projectName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new MachineGraphAssessmentOptionsImpl(inner1, this.manager())); + } + + private MachineGraphAssessmentOptionsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientBuilder.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientBuilder.java new file mode 100644 index 000000000000..f435d263b7ef --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.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 MigrateClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { MigrateClientImpl.class }) +public final class MigrateClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the MigrateClientBuilder. + */ + public MigrateClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the MigrateClientBuilder. + */ + public MigrateClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the MigrateClientBuilder. + */ + public MigrateClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + 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 MigrateClientBuilder. + */ + public MigrateClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + 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 MigrateClientBuilder. + */ + public MigrateClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + 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 MigrateClientBuilder. + */ + public MigrateClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of MigrateClientImpl with the provided parameters. + * + * @return an instance of MigrateClientImpl. + */ + public MigrateClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + MigrateClientImpl client = new MigrateClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientImpl.java new file mode 100644 index 000000000000..6b547d295cab --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/MigrateClientImpl.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +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.CoreUtils; +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.migrate.fluent.AssessedMachinesV2OperationsClient; +import com.azure.resourcemanager.migrate.fluent.MachineAssessmentV2SummaryOperationsClient; +import com.azure.resourcemanager.migrate.fluent.MachineAssessmentsV2OperationsClient; +import com.azure.resourcemanager.migrate.fluent.MachineGraphAssessmentOptionsOperationsClient; +import com.azure.resourcemanager.migrate.fluent.MigrateClient; +import com.azure.resourcemanager.migrate.fluent.OperationsClient; +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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the MigrateClientImpl type. + */ +@ServiceClient(builder = MigrateClientBuilder.class) +public final class MigrateClientImpl implements MigrateClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * 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 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; + } + + /** + * The MachineAssessmentsV2OperationsClient object to access its operations. + */ + private final MachineAssessmentsV2OperationsClient machineAssessmentsV2Operations; + + /** + * Gets the MachineAssessmentsV2OperationsClient object to access its operations. + * + * @return the MachineAssessmentsV2OperationsClient object. + */ + public MachineAssessmentsV2OperationsClient getMachineAssessmentsV2Operations() { + return this.machineAssessmentsV2Operations; + } + + /** + * The AssessedMachinesV2OperationsClient object to access its operations. + */ + private final AssessedMachinesV2OperationsClient assessedMachinesV2Operations; + + /** + * Gets the AssessedMachinesV2OperationsClient object to access its operations. + * + * @return the AssessedMachinesV2OperationsClient object. + */ + public AssessedMachinesV2OperationsClient getAssessedMachinesV2Operations() { + return this.assessedMachinesV2Operations; + } + + /** + * The MachineAssessmentV2SummaryOperationsClient object to access its operations. + */ + private final MachineAssessmentV2SummaryOperationsClient machineAssessmentV2SummaryOperations; + + /** + * Gets the MachineAssessmentV2SummaryOperationsClient object to access its operations. + * + * @return the MachineAssessmentV2SummaryOperationsClient object. + */ + public MachineAssessmentV2SummaryOperationsClient getMachineAssessmentV2SummaryOperations() { + return this.machineAssessmentV2SummaryOperations; + } + + /** + * The MachineGraphAssessmentOptionsOperationsClient object to access its operations. + */ + private final MachineGraphAssessmentOptionsOperationsClient machineGraphAssessmentOptionsOperations; + + /** + * Gets the MachineGraphAssessmentOptionsOperationsClient object to access its operations. + * + * @return the MachineGraphAssessmentOptionsOperationsClient object. + */ + public MachineGraphAssessmentOptionsOperationsClient getMachineGraphAssessmentOptionsOperations() { + return this.machineGraphAssessmentOptionsOperations; + } + + /** + * Initializes an instance of MigrateClient 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 endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + MigrateClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2024-03-03-preview"; + this.operations = new OperationsClientImpl(this); + this.machineAssessmentsV2Operations = new MachineAssessmentsV2OperationsClientImpl(this); + this.assessedMachinesV2Operations = new AssessedMachinesV2OperationsClientImpl(this); + this.machineAssessmentV2SummaryOperations = new MachineAssessmentV2SummaryOperationsClientImpl(this); + this.machineGraphAssessmentOptionsOperations = new MachineGraphAssessmentOptionsOperationsClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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(HttpHeaderName.fromString(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(MigrateClientImpl.class); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationImpl.java new file mode 100644 index 000000000000..1df845e02264 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation; + +import com.azure.resourcemanager.migrate.fluent.models.OperationInner; +import com.azure.resourcemanager.migrate.models.ActionType; +import com.azure.resourcemanager.migrate.models.Operation; +import com.azure.resourcemanager.migrate.models.OperationDisplay; +import com.azure.resourcemanager.migrate.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.migrate.MigrateManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsClientImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..cfcdc07a1d09 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.OperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.OperationInner; +import com.azure.resourcemanager.migrate.implementation.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 MigrateClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(MigrateClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MigrateClientOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MigrateClientOperati") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Migrate/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the 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 REST API operations supported by an Azure 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())); + } + + /** + * List the operations for the 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 REST API operations supported by an Azure 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)); + } + + /** + * List the operations for the 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the 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 REST API operations supported by an Azure 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)); + } + + /** + * List the operations for the 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for the 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 REST API operations supported by an Azure 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 REST API operations supported by an Azure 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 URL to get the next list of items. + * @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 REST API operations supported by an Azure 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/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsImpl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsImpl.java new file mode 100644 index 000000000000..a3a534387ccc --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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.migrate.fluent.OperationsClient; +import com.azure.resourcemanager.migrate.fluent.models.OperationInner; +import com.azure.resourcemanager.migrate.models.Operation; +import com.azure.resourcemanager.migrate.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.migrate.MigrateManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.migrate.MigrateManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.migrate.MigrateManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/ResourceManagerUtils.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..8b440adb7d66 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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 ResourceManagerUtils { + private ResourceManagerUtils() { + } + + 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.isEmpty() && 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<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(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/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/AssessedMachineV2ListResult.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/AssessedMachineV2ListResult.java new file mode 100644 index 000000000000..0dcba2aeefd7 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/AssessedMachineV2ListResult.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.fluent.models.AssessedMachineV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AssessedMachineV2 list operation. + */ +@Immutable +public final class AssessedMachineV2ListResult implements JsonSerializable { + /* + * The AssessedMachineV2 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AssessedMachineV2ListResult class. + */ + private AssessedMachineV2ListResult() { + } + + /** + * Get the value property: The AssessedMachineV2 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model AssessedMachineV2ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AssessedMachineV2ListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedMachineV2ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineV2ListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssessedMachineV2ListResult. + */ + public static AssessedMachineV2ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineV2ListResult deserializedAssessedMachineV2ListResult = new AssessedMachineV2ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AssessedMachineV2Inner.fromJson(reader1)); + deserializedAssessedMachineV2ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAssessedMachineV2ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineV2ListResult; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2ListResult.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2ListResult.java new file mode 100644 index 000000000000..cc9f3ec98277 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2ListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MachineAssessmentV2 list operation. + */ +@Immutable +public final class MachineAssessmentV2ListResult implements JsonSerializable { + /* + * The MachineAssessmentV2 items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MachineAssessmentV2ListResult class. + */ + private MachineAssessmentV2ListResult() { + } + + /** + * Get the value property: The MachineAssessmentV2 items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model MachineAssessmentV2ListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MachineAssessmentV2ListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentV2ListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentV2ListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineAssessmentV2ListResult. + */ + public static MachineAssessmentV2ListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentV2ListResult deserializedMachineAssessmentV2ListResult + = new MachineAssessmentV2ListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MachineAssessmentV2Inner.fromJson(reader1)); + deserializedMachineAssessmentV2ListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMachineAssessmentV2ListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentV2ListResult; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2SummaryListResult.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2SummaryListResult.java new file mode 100644 index 000000000000..165f76b86f5b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineAssessmentV2SummaryListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2SummaryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MachineAssessmentV2Summary list operation. + */ +@Immutable +public final class MachineAssessmentV2SummaryListResult + implements JsonSerializable { + /* + * The MachineAssessmentV2Summary items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MachineAssessmentV2SummaryListResult class. + */ + private MachineAssessmentV2SummaryListResult() { + } + + /** + * Get the value property: The MachineAssessmentV2Summary items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model MachineAssessmentV2SummaryListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MachineAssessmentV2SummaryListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentV2SummaryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentV2SummaryListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineAssessmentV2SummaryListResult. + */ + public static MachineAssessmentV2SummaryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentV2SummaryListResult deserializedMachineAssessmentV2SummaryListResult + = new MachineAssessmentV2SummaryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MachineAssessmentV2SummaryInner.fromJson(reader1)); + deserializedMachineAssessmentV2SummaryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMachineAssessmentV2SummaryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentV2SummaryListResult; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineGraphAssessmentOptionsListResult.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineGraphAssessmentOptionsListResult.java new file mode 100644 index 000000000000..9108afd7fbdf --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/MachineGraphAssessmentOptionsListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.fluent.models.MachineGraphAssessmentOptionsInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MachineGraphAssessmentOptions list operation. + */ +@Immutable +public final class MachineGraphAssessmentOptionsListResult + implements JsonSerializable { + /* + * The MachineGraphAssessmentOptions items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MachineGraphAssessmentOptionsListResult class. + */ + private MachineGraphAssessmentOptionsListResult() { + } + + /** + * Get the value property: The MachineGraphAssessmentOptions items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model MachineGraphAssessmentOptionsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MachineGraphAssessmentOptionsListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineGraphAssessmentOptionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineGraphAssessmentOptionsListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineGraphAssessmentOptionsListResult. + */ + public static MachineGraphAssessmentOptionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineGraphAssessmentOptionsListResult deserializedMachineGraphAssessmentOptionsListResult + = new MachineGraphAssessmentOptionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MachineGraphAssessmentOptionsInner.fromJson(reader1)); + deserializedMachineGraphAssessmentOptionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMachineGraphAssessmentOptionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineGraphAssessmentOptionsListResult; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/OperationListResult.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..516add0218be --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/models/OperationListResult.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.migrate.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/package-info.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/package-info.java new file mode 100644 index 000000000000..e87de4aa145b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for Migrate. + * Azure Migrate Resource Provider management API. + */ +package com.azure.resourcemanager.migrate.implementation; diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ActionType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ActionType.java new file mode 100644 index 000000000000..ae8b8640415a --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedDiskDataV3.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedDiskDataV3.java new file mode 100644 index 000000000000..aa4e34866481 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedDiskDataV3.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Assessed disk data for normalized contract. + */ +@Immutable +public final class AssessedDiskDataV3 implements JsonSerializable { + /* + * The disk name. + */ + private String name; + + /* + * The disk display name. + */ + private String displayName; + + /* + * Gets the gigabytes provisioned. + */ + private Double gigabytesProvisioned; + + /* + * Gets the megabytes per second of read. + */ + private Double megabytesPerSecondOfRead; + + /* + * Gets the megabytes per second of write. + */ + private Double megabytesPerSecondOfWrite; + + /* + * Gets the number of read operations per second. + */ + private Double numberOfReadOperationsPerSecond; + + /* + * Gets the number of write operations per second. + */ + private Double numberOfWriteOperationsPerSecond; + + /** + * Creates an instance of AssessedDiskDataV3 class. + */ + private AssessedDiskDataV3() { + } + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: The disk display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the gigabytesProvisioned property: Gets the gigabytes provisioned. + * + * @return the gigabytesProvisioned value. + */ + public Double gigabytesProvisioned() { + return this.gigabytesProvisioned; + } + + /** + * Get the megabytesPerSecondOfRead property: Gets the megabytes per second of read. + * + * @return the megabytesPerSecondOfRead value. + */ + public Double megabytesPerSecondOfRead() { + return this.megabytesPerSecondOfRead; + } + + /** + * Get the megabytesPerSecondOfWrite property: Gets the megabytes per second of write. + * + * @return the megabytesPerSecondOfWrite value. + */ + public Double megabytesPerSecondOfWrite() { + return this.megabytesPerSecondOfWrite; + } + + /** + * Get the numberOfReadOperationsPerSecond property: Gets the number of read operations per second. + * + * @return the numberOfReadOperationsPerSecond value. + */ + public Double numberOfReadOperationsPerSecond() { + return this.numberOfReadOperationsPerSecond; + } + + /** + * Get the numberOfWriteOperationsPerSecond property: Gets the number of write operations per second. + * + * @return the numberOfWriteOperationsPerSecond value. + */ + public Double numberOfWriteOperationsPerSecond() { + return this.numberOfWriteOperationsPerSecond; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("gigabytesProvisioned", this.gigabytesProvisioned); + jsonWriter.writeNumberField("megabytesPerSecondOfRead", this.megabytesPerSecondOfRead); + jsonWriter.writeNumberField("megabytesPerSecondOfWrite", this.megabytesPerSecondOfWrite); + jsonWriter.writeNumberField("numberOfReadOperationsPerSecond", this.numberOfReadOperationsPerSecond); + jsonWriter.writeNumberField("numberOfWriteOperationsPerSecond", this.numberOfWriteOperationsPerSecond); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedDiskDataV3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedDiskDataV3 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssessedDiskDataV3. + */ + public static AssessedDiskDataV3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedDiskDataV3 deserializedAssessedDiskDataV3 = new AssessedDiskDataV3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAssessedDiskDataV3.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedDiskDataV3.displayName = reader.getString(); + } else if ("gigabytesProvisioned".equals(fieldName)) { + deserializedAssessedDiskDataV3.gigabytesProvisioned = reader.getNullable(JsonReader::getDouble); + } else if ("megabytesPerSecondOfRead".equals(fieldName)) { + deserializedAssessedDiskDataV3.megabytesPerSecondOfRead = reader.getNullable(JsonReader::getDouble); + } else if ("megabytesPerSecondOfWrite".equals(fieldName)) { + deserializedAssessedDiskDataV3.megabytesPerSecondOfWrite + = reader.getNullable(JsonReader::getDouble); + } else if ("numberOfReadOperationsPerSecond".equals(fieldName)) { + deserializedAssessedDiskDataV3.numberOfReadOperationsPerSecond + = reader.getNullable(JsonReader::getDouble); + } else if ("numberOfWriteOperationsPerSecond".equals(fieldName)) { + deserializedAssessedDiskDataV3.numberOfWriteOperationsPerSecond + = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedDiskDataV3; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineExtendedDetails.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineExtendedDetails.java new file mode 100644 index 000000000000..1c8a8905e25b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineExtendedDetails.java @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The assessed machine extended details. + */ +@Immutable +public final class AssessedMachineExtendedDetails implements JsonSerializable { + /* + * Display Name of the Machine. + */ + private String displayName; + + /* + * Gets the product support status related details. + */ + private ProductSupportStatus productSupportStatus; + + /* + * Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + */ + private List disks; + + /* + * Gets or sets the processor details of the host. + */ + private ProcessorInfo hostProcessor; + + /* + * List of Network Adapters that were assessed as part of this machine's + * assessment. + */ + private List networkAdapters; + + /* + * Assessed machine type. + */ + private AssessedMachineType assessedMachineType; + + /* + * Boot type of machine discovered in private data center. + */ + private MachineBootType bootType; + + /* + * Operating system as reported by datacenter management solution. + */ + private String operatingSystemType; + + /* + * Operating system as reported by datacenter management solution. + */ + private String operatingSystemName; + + /* + * Operating system version as reported by datacenter management solution. + */ + private String operatingSystemVersion; + + /* + * Operating system architecture as reported by datacenter management solution. + */ + private GuestOperatingSystemArchitecture operatingSystemArchitecture; + + /* + * Description for the machine. + */ + private String description; + + /* + * Megabytes of memory found allocated for the machine in private data center. + */ + private Double megabytesOfMemory; + + /* + * Number of CPU cores found on the machine. + */ + private Integer numberOfCores; + + /* + * Percentile of Percentage of Cores Utilized noted during time period T. + * Here N and T are settings on Assessment. + */ + private Double percentageCoresUtilization; + + /* + * Percentile of Percentage of Memory Utilized noted during time period T. + * Here N and T are settings on Assessment. + */ + private Double percentageMemoryUtilization; + + /* + * List of errors for this machine. + */ + private List errors; + + /** + * Creates an instance of AssessedMachineExtendedDetails class. + */ + private AssessedMachineExtendedDetails() { + } + + /** + * Get the displayName property: Display Name of the Machine. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the productSupportStatus property: Gets the product support status related details. + * + * @return the productSupportStatus value. + */ + public ProductSupportStatus productSupportStatus() { + return this.productSupportStatus; + } + + /** + * Get the disks property: Dictionary of disks attached to the machine. Key is ID of disk. Value is a disk object. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Get the hostProcessor property: Gets or sets the processor details of the host. + * + * @return the hostProcessor value. + */ + public ProcessorInfo hostProcessor() { + return this.hostProcessor; + } + + /** + * Get the networkAdapters property: List of Network Adapters that were assessed as part of this machine's + * assessment. + * + * @return the networkAdapters value. + */ + public List networkAdapters() { + return this.networkAdapters; + } + + /** + * Get the assessedMachineType property: Assessed machine type. + * + * @return the assessedMachineType value. + */ + public AssessedMachineType assessedMachineType() { + return this.assessedMachineType; + } + + /** + * Get the bootType property: Boot type of machine discovered in private data center. + * + * @return the bootType value. + */ + public MachineBootType bootType() { + return this.bootType; + } + + /** + * Get the operatingSystemType property: Operating system as reported by datacenter management solution. + * + * @return the operatingSystemType value. + */ + public String operatingSystemType() { + return this.operatingSystemType; + } + + /** + * Get the operatingSystemName property: Operating system as reported by datacenter management solution. + * + * @return the operatingSystemName value. + */ + public String operatingSystemName() { + return this.operatingSystemName; + } + + /** + * Get the operatingSystemVersion property: Operating system version as reported by datacenter management solution. + * + * @return the operatingSystemVersion value. + */ + public String operatingSystemVersion() { + return this.operatingSystemVersion; + } + + /** + * Get the operatingSystemArchitecture property: Operating system architecture as reported by datacenter management + * solution. + * + * @return the operatingSystemArchitecture value. + */ + public GuestOperatingSystemArchitecture operatingSystemArchitecture() { + return this.operatingSystemArchitecture; + } + + /** + * Get the description property: Description for the machine. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the megabytesOfMemory property: Megabytes of memory found allocated for the machine in private data center. + * + * @return the megabytesOfMemory value. + */ + public Double megabytesOfMemory() { + return this.megabytesOfMemory; + } + + /** + * Get the numberOfCores property: Number of CPU cores found on the machine. + * + * @return the numberOfCores value. + */ + public Integer numberOfCores() { + return this.numberOfCores; + } + + /** + * Get the percentageCoresUtilization property: Percentile of Percentage of Cores Utilized noted during time period + * T. + * Here N and T are settings on Assessment. + * + * @return the percentageCoresUtilization value. + */ + public Double percentageCoresUtilization() { + return this.percentageCoresUtilization; + } + + /** + * Get the percentageMemoryUtilization property: Percentile of Percentage of Memory Utilized noted during time + * period T. + * Here N and T are settings on Assessment. + * + * @return the percentageMemoryUtilization value. + */ + public Double percentageMemoryUtilization() { + return this.percentageMemoryUtilization; + } + + /** + * Get the errors property: List of errors for this machine. + * + * @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() { + if (productSupportStatus() != null) { + productSupportStatus().validate(); + } + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + if (hostProcessor() != null) { + hostProcessor().validate(); + } + if (networkAdapters() != null) { + networkAdapters().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hostProcessor", this.hostProcessor); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedMachineExtendedDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineExtendedDetails if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AssessedMachineExtendedDetails. + */ + public static AssessedMachineExtendedDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineExtendedDetails deserializedAssessedMachineExtendedDetails + = new AssessedMachineExtendedDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.displayName = reader.getString(); + } else if ("productSupportStatus".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.productSupportStatus + = ProductSupportStatus.fromJson(reader); + } else if ("disks".equals(fieldName)) { + List disks = reader.readArray(reader1 -> AssessedDiskDataV3.fromJson(reader1)); + deserializedAssessedMachineExtendedDetails.disks = disks; + } else if ("hostProcessor".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.hostProcessor = ProcessorInfo.fromJson(reader); + } else if ("networkAdapters".equals(fieldName)) { + List networkAdapters + = reader.readArray(reader1 -> AssessedMachineNetworkAdaptersV3.fromJson(reader1)); + deserializedAssessedMachineExtendedDetails.networkAdapters = networkAdapters; + } else if ("assessedMachineType".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.assessedMachineType + = AssessedMachineType.fromString(reader.getString()); + } else if ("bootType".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.bootType + = MachineBootType.fromString(reader.getString()); + } else if ("operatingSystemType".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.operatingSystemType = reader.getString(); + } else if ("operatingSystemName".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.operatingSystemName = reader.getString(); + } else if ("operatingSystemVersion".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.operatingSystemVersion = reader.getString(); + } else if ("operatingSystemArchitecture".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.operatingSystemArchitecture + = GuestOperatingSystemArchitecture.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.description = reader.getString(); + } else if ("megabytesOfMemory".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.megabytesOfMemory + = reader.getNullable(JsonReader::getDouble); + } else if ("numberOfCores".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.numberOfCores = reader.getNullable(JsonReader::getInt); + } else if ("percentageCoresUtilization".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.percentageCoresUtilization + = reader.getNullable(JsonReader::getDouble); + } else if ("percentageMemoryUtilization".equals(fieldName)) { + deserializedAssessedMachineExtendedDetails.percentageMemoryUtilization + = reader.getNullable(JsonReader::getDouble); + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + deserializedAssessedMachineExtendedDetails.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineExtendedDetails; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineNetworkAdaptersV3.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineNetworkAdaptersV3.java new file mode 100644 index 000000000000..7e4446e85eee --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineNetworkAdaptersV3.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Assessed network adapter data for normalized contract for sql machines. + */ +@Immutable +public final class AssessedMachineNetworkAdaptersV3 implements JsonSerializable { + /* + * The disk name. + */ + private String name; + + /* + * Gets the net gigabytes transmitted per month. + */ + private Double netGigabytesTransmittedPerMonth; + + /* + * Gets the mac address. + */ + private String macAddress; + + /* + * Gets the ip addresses. + */ + private List ipAddresses; + + /* + * Gets the megabytes per second received. + */ + private Double megabytesPerSecondRecieved; + + /* + * Gets the megabytes per second transmitted. + */ + private Double megabytesPerSecondTransmitted; + + /* + * Display Name of the Machine. + */ + private String displayName; + + /** + * Creates an instance of AssessedMachineNetworkAdaptersV3 class. + */ + private AssessedMachineNetworkAdaptersV3() { + } + + /** + * Get the name property: The disk name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the netGigabytesTransmittedPerMonth property: Gets the net gigabytes transmitted per month. + * + * @return the netGigabytesTransmittedPerMonth value. + */ + public Double netGigabytesTransmittedPerMonth() { + return this.netGigabytesTransmittedPerMonth; + } + + /** + * Get the macAddress property: Gets the mac address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the ipAddresses property: Gets the ip addresses. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Get the megabytesPerSecondRecieved property: Gets the megabytes per second received. + * + * @return the megabytesPerSecondRecieved value. + */ + public Double megabytesPerSecondRecieved() { + return this.megabytesPerSecondRecieved; + } + + /** + * Get the megabytesPerSecondTransmitted property: Gets the megabytes per second transmitted. + * + * @return the megabytesPerSecondTransmitted value. + */ + public Double megabytesPerSecondTransmitted() { + return this.megabytesPerSecondTransmitted; + } + + /** + * Get the displayName property: Display Name of the Machine. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("netGigabytesTransmittedPerMonth", this.netGigabytesTransmittedPerMonth); + jsonWriter.writeStringField("macAddress", this.macAddress); + jsonWriter.writeNumberField("megabytesPerSecondRecieved", this.megabytesPerSecondRecieved); + jsonWriter.writeNumberField("megabytesPerSecondTransmitted", this.megabytesPerSecondTransmitted); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedMachineNetworkAdaptersV3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineNetworkAdaptersV3 if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AssessedMachineNetworkAdaptersV3. + */ + public static AssessedMachineNetworkAdaptersV3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineNetworkAdaptersV3 deserializedAssessedMachineNetworkAdaptersV3 + = new AssessedMachineNetworkAdaptersV3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.name = reader.getString(); + } else if ("netGigabytesTransmittedPerMonth".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.netGigabytesTransmittedPerMonth + = reader.getNullable(JsonReader::getDouble); + } else if ("macAddress".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.macAddress = reader.getString(); + } else if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAssessedMachineNetworkAdaptersV3.ipAddresses = ipAddresses; + } else if ("megabytesPerSecondRecieved".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.megabytesPerSecondRecieved + = reader.getNullable(JsonReader::getDouble); + } else if ("megabytesPerSecondTransmitted".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.megabytesPerSecondTransmitted + = reader.getNullable(JsonReader::getDouble); + } else if ("displayName".equals(fieldName)) { + deserializedAssessedMachineNetworkAdaptersV3.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineNetworkAdaptersV3; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineType.java new file mode 100644 index 000000000000..b5a6d25b3571 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Assessed machine type. + */ +public final class AssessedMachineType extends ExpandableStringEnum { + /** + * Unknown - Assessed machine type. + */ + public static final AssessedMachineType UNKNOWN = fromString("Unknown"); + + /** + * AssessedMachine - Assessed machine type. + */ + public static final AssessedMachineType ASSESSED_MACHINE = fromString("AssessedMachine"); + + /** + * AvsAssessedMachine - Assessed machine type. + */ + public static final AssessedMachineType AVS_ASSESSED_MACHINE = fromString("AvsAssessedMachine"); + + /** + * SqlAssessedMachine - Assessed machine type. + */ + public static final AssessedMachineType SQL_ASSESSED_MACHINE = fromString("SqlAssessedMachine"); + + /** + * Creates a new instance of AssessedMachineType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssessedMachineType() { + } + + /** + * Creates or finds a AssessedMachineType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssessedMachineType. + */ + public static AssessedMachineType fromString(String name) { + return fromString(name, AssessedMachineType.class); + } + + /** + * Gets known AssessedMachineType values. + * + * @return known AssessedMachineType values. + */ + public static Collection values() { + return values(AssessedMachineType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2.java new file mode 100644 index 000000000000..000743795081 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migrate.fluent.models.AssessedMachineV2Inner; + +/** + * An immutable client-side representation of AssessedMachineV2. + */ +public interface AssessedMachineV2 { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AssessedMachineV2Properties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.migrate.fluent.models.AssessedMachineV2Inner object. + * + * @return the inner object. + */ + AssessedMachineV2Inner innerModel(); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2Properties.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2Properties.java new file mode 100644 index 000000000000..85f92b6c2f03 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachineV2Properties.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Assessed machine properties class. + */ +@Immutable +public final class AssessedMachineV2Properties implements JsonSerializable { + /* + * The workload type + */ + private MigrateWorkloadType workloadType; + + /* + * The linkages list. + */ + private List linkages; + + /* + * The recommendation list. + */ + private List recommendations; + + /* + * The assessed machine extended details. + */ + private AssessedMachineExtendedDetails extendedDetails; + + /* + * When was machine first created. + */ + private OffsetDateTime createdTimestamp; + + /* + * When was machine last updated. + */ + private OffsetDateTime updatedTimestamp; + + /** + * Creates an instance of AssessedMachineV2Properties class. + */ + private AssessedMachineV2Properties() { + } + + /** + * Get the workloadType property: The workload type. + * + * @return the workloadType value. + */ + public MigrateWorkloadType workloadType() { + return this.workloadType; + } + + /** + * Get the linkages property: The linkages list. + * + * @return the linkages value. + */ + public List linkages() { + return this.linkages; + } + + /** + * Get the recommendations property: The recommendation list. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Get the extendedDetails property: The assessed machine extended details. + * + * @return the extendedDetails value. + */ + public AssessedMachineExtendedDetails extendedDetails() { + return this.extendedDetails; + } + + /** + * Get the createdTimestamp property: When was machine first created. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: When was machine last updated. + * + * @return the updatedTimestamp value. + */ + public OffsetDateTime updatedTimestamp() { + return this.updatedTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linkages() != null) { + linkages().forEach(e -> e.validate()); + } + if (recommendations() != null) { + recommendations().forEach(e -> e.validate()); + } + if (extendedDetails() != null) { + extendedDetails().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessedMachineV2Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessedMachineV2Properties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AssessedMachineV2Properties. + */ + public static AssessedMachineV2Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessedMachineV2Properties deserializedAssessedMachineV2Properties = new AssessedMachineV2Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workloadType".equals(fieldName)) { + deserializedAssessedMachineV2Properties.workloadType + = MigrateWorkloadType.fromString(reader.getString()); + } else if ("linkages".equals(fieldName)) { + List linkages = reader.readArray(reader1 -> Linkages.fromJson(reader1)); + deserializedAssessedMachineV2Properties.linkages = linkages; + } else if ("recommendations".equals(fieldName)) { + List recommendations + = reader.readArray(reader1 -> MachineAssessmentRecommendation.fromJson(reader1)); + deserializedAssessedMachineV2Properties.recommendations = recommendations; + } else if ("extendedDetails".equals(fieldName)) { + deserializedAssessedMachineV2Properties.extendedDetails + = AssessedMachineExtendedDetails.fromJson(reader); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedAssessedMachineV2Properties.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedAssessedMachineV2Properties.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessedMachineV2Properties; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachinesV2Operations.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachinesV2Operations.java new file mode 100644 index 000000000000..935b2664e176 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessedMachinesV2Operations.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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 AssessedMachinesV2Operations. + */ +public interface AssessedMachinesV2Operations { + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + String assessedMachineName, Context context); + + /** + * Get a AssessedMachineV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param assessedMachineName Machine assessment V2 Assessed Machine ARM 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 AssessedMachineV2. + */ + AssessedMachineV2 get(String resourceGroupName, String projectName, String assessmentName, + String assessedMachineName); + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 the response of a AssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName); + + /** + * List AssessedMachineV2 resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param filter Filter query. + * @param pageSize Optional parameter for page size. + * @param continuationToken Optional parameter for continuation token. + * @param totalRecordCount Total record count. + * @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 response of a AssessedMachineV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, String assessmentName, + String filter, Integer pageSize, String continuationToken, Integer totalRecordCount, Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentDetails.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentDetails.java new file mode 100644 index 000000000000..acb736841b9f --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentDetails.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Assessment details class. + */ +@Immutable +public final class AssessmentDetails implements JsonSerializable { + /* + * Confidence Rating in Percentage. + */ + private Double confidenceRatingInPercentage; + + /* + * Last time when rates were queried. + */ + private OffsetDateTime pricesTimestamp; + + /* + * Date and Time when assessment was created. + */ + private OffsetDateTime createdTimestamp; + + /* + * Date and Time when assessment was last updated. + */ + private OffsetDateTime updatedTimestamp; + + /* + * Whether assessment is in valid state and all machines have been assessed. + */ + private AssessmentStatus status; + + /** + * Creates an instance of AssessmentDetails class. + */ + public AssessmentDetails() { + } + + /** + * Get the confidenceRatingInPercentage property: Confidence Rating in Percentage. + * + * @return the confidenceRatingInPercentage value. + */ + public Double confidenceRatingInPercentage() { + return this.confidenceRatingInPercentage; + } + + /** + * Get the pricesTimestamp property: Last time when rates were queried. + * + * @return the pricesTimestamp value. + */ + public OffsetDateTime pricesTimestamp() { + return this.pricesTimestamp; + } + + /** + * Get the createdTimestamp property: Date and Time when assessment was created. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the updatedTimestamp property: Date and Time when assessment was last updated. + * + * @return the updatedTimestamp value. + */ + public OffsetDateTime updatedTimestamp() { + return this.updatedTimestamp; + } + + /** + * Get the status property: Whether assessment is in valid state and all machines have been assessed. + * + * @return the status value. + */ + public AssessmentStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssessmentDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssessmentDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssessmentDetails. + */ + public static AssessmentDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssessmentDetails deserializedAssessmentDetails = new AssessmentDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("confidenceRatingInPercentage".equals(fieldName)) { + deserializedAssessmentDetails.confidenceRatingInPercentage + = reader.getNullable(JsonReader::getDouble); + } else if ("pricesTimestamp".equals(fieldName)) { + deserializedAssessmentDetails.pricesTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdTimestamp".equals(fieldName)) { + deserializedAssessmentDetails.createdTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedTimestamp".equals(fieldName)) { + deserializedAssessmentDetails.updatedTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedAssessmentDetails.status = AssessmentStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAssessmentDetails; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSizingCriterion.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSizingCriterion.java new file mode 100644 index 000000000000..0519bfcf1656 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSizingCriterion.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Assessment Sizing Criteria. + */ +public final class AssessmentSizingCriterion extends ExpandableStringEnum { + /** + * Performance Data based Sizing. + */ + public static final AssessmentSizingCriterion PERFORMANCE_BASED = fromString("PerformanceBased"); + + /** + * As On Premises or Static Data based Sizing. + */ + public static final AssessmentSizingCriterion AS_ON_PREMISES = fromString("AsOnPremises"); + + /** + * Creates a new instance of AssessmentSizingCriterion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssessmentSizingCriterion() { + } + + /** + * Creates or finds a AssessmentSizingCriterion from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssessmentSizingCriterion. + */ + public static AssessmentSizingCriterion fromString(String name) { + return fromString(name, AssessmentSizingCriterion.class); + } + + /** + * Gets known AssessmentSizingCriterion values. + * + * @return known AssessmentSizingCriterion values. + */ + public static Collection values() { + return values(AssessmentSizingCriterion.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSource.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSource.java new file mode 100644 index 000000000000..954020143a1d --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentSource.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Assessment Source. + */ +public final class AssessmentSource extends ExpandableStringEnum { + /** + * Unknown - Assessment Source. + */ + public static final AssessmentSource UNKNOWN = fromString("Unknown"); + + /** + * Machine - Assessment Source. + */ + public static final AssessmentSource MACHINE = fromString("Machine"); + + /** + * IIS - Assessment Source. + */ + public static final AssessmentSource IIS = fromString("IIS"); + + /** + * TomCat - Assessment Source. + */ + public static final AssessmentSource TOM_CAT = fromString("TomCat"); + + /** + * OracleServer - Assessment Source. + */ + public static final AssessmentSource ORACLE_SERVER = fromString("OracleServer"); + + /** + * OracleDatabase - Assessment Source. + */ + public static final AssessmentSource ORACLE_DATABASE = fromString("OracleDatabase"); + + /** + * SAPInstance - Assessment Source. + */ + public static final AssessmentSource SAPINSTANCE = fromString("SAPInstance"); + + /** + * SpringbootApplication - Assessment Source. + */ + public static final AssessmentSource SPRINGBOOT_APPLICATION = fromString("SpringbootApplication"); + + /** + * MySQLServer - Assessment Source. + */ + public static final AssessmentSource MY_SQLSERVER = fromString("MySQLServer"); + + /** + * SqlInstance - Assessment Source. + */ + public static final AssessmentSource SQL_INSTANCE = fromString("SqlInstance"); + + /** + * SqlDatabase - Assessment Source. + */ + public static final AssessmentSource SQL_DATABASE = fromString("SqlDatabase"); + + /** + * WebApps - Assessment Source. + */ + public static final AssessmentSource WEB_APPS = fromString("WebApps"); + + /** + * Creates a new instance of AssessmentSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssessmentSource() { + } + + /** + * Creates or finds a AssessmentSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssessmentSource. + */ + public static AssessmentSource fromString(String name) { + return fromString(name, AssessmentSource.class); + } + + /** + * Gets known AssessmentSource values. + * + * @return known AssessmentSource values. + */ + public static Collection values() { + return values(AssessmentSource.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentStatus.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentStatus.java new file mode 100644 index 000000000000..b2b76b184cdc --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AssessmentStatus.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Assessment Status. + */ +public final class AssessmentStatus extends ExpandableStringEnum { + /** + * Assessment is Created. + */ + public static final AssessmentStatus CREATED = fromString("Created"); + + /** + * Assessment is Updated. + */ + public static final AssessmentStatus UPDATED = fromString("Updated"); + + /** + * Assessment is currently running. + */ + public static final AssessmentStatus RUNNING = fromString("Running"); + + /** + * Assessment is Completed or Ready. + */ + public static final AssessmentStatus COMPLETED = fromString("Completed"); + + /** + * Assessment is Failed i.e. it is now invalid. + */ + public static final AssessmentStatus INVALID = fromString("Invalid"); + + /** + * Assessment is Out of Sync. + */ + public static final AssessmentStatus OUT_OF_SYNC = fromString("OutOfSync"); + + /** + * Assessment is Out Dated. + */ + public static final AssessmentStatus OUT_DATED = fromString("OutDated"); + + /** + * Assessment is Deleted. + */ + public static final AssessmentStatus DELETED = fromString("Deleted"); + + /** + * Assessment has Failed. + */ + public static final AssessmentStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of AssessmentStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssessmentStatus() { + } + + /** + * Creates or finds a AssessmentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssessmentStatus. + */ + public static AssessmentStatus fromString(String name) { + return fromString(name, AssessmentStatus.class); + } + + /** + * Gets known AssessmentStatus values. + * + * @return known AssessmentStatus values. + */ + public static Collection values() { + return values(AssessmentStatus.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureCurrency.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureCurrency.java new file mode 100644 index 000000000000..4ee473935aac --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureCurrency.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Currency for Azure. + */ +public final class AzureCurrency extends ExpandableStringEnum { + /** + * Unknown Currency for Azure. + */ + public static final AzureCurrency UNKNOWN = fromString("Unknown"); + + /** + * USD Currency for Azure. + */ + public static final AzureCurrency USD = fromString("USD"); + + /** + * DKK Currency for Azure. + */ + public static final AzureCurrency DKK = fromString("DKK"); + + /** + * CAD Currency for Azure. + */ + public static final AzureCurrency CAD = fromString("CAD"); + + /** + * IDR Currency for Azure. + */ + public static final AzureCurrency IDR = fromString("IDR"); + + /** + * JPY Currency for Azure. + */ + public static final AzureCurrency JPY = fromString("JPY"); + + /** + * KRW Currency for Azure. + */ + public static final AzureCurrency KRW = fromString("KRW"); + + /** + * NZD Currency for Azure. + */ + public static final AzureCurrency NZD = fromString("NZD"); + + /** + * NOK Currency for Azure. + */ + public static final AzureCurrency NOK = fromString("NOK"); + + /** + * RUB Currency for Azure. + */ + public static final AzureCurrency RUB = fromString("RUB"); + + /** + * SAR Currency for Azure. + */ + public static final AzureCurrency SAR = fromString("SAR"); + + /** + * ZAR Currency for Azure. + */ + public static final AzureCurrency ZAR = fromString("ZAR"); + + /** + * SEK Currency for Azure. + */ + public static final AzureCurrency SEK = fromString("SEK"); + + /** + * TRY Currency for Azure. + */ + public static final AzureCurrency TRY = fromString("TRY"); + + /** + * GBP Currency for Azure. + */ + public static final AzureCurrency GBP = fromString("GBP"); + + /** + * MXN Currency for Azure. + */ + public static final AzureCurrency MXN = fromString("MXN"); + + /** + * MYR Currency for Azure. + */ + public static final AzureCurrency MYR = fromString("MYR"); + + /** + * INR Currency for Azure. + */ + public static final AzureCurrency INR = fromString("INR"); + + /** + * HKD Currency for Azure. + */ + public static final AzureCurrency HKD = fromString("HKD"); + + /** + * BRL Currency for Azure. + */ + public static final AzureCurrency BRL = fromString("BRL"); + + /** + * TWD Currency for Azure. + */ + public static final AzureCurrency TWD = fromString("TWD"); + + /** + * EUR Currency for Azure. + */ + public static final AzureCurrency EUR = fromString("EUR"); + + /** + * CHF Currency for Azure. + */ + public static final AzureCurrency CHF = fromString("CHF"); + + /** + * ARS Currency for Azure. + */ + public static final AzureCurrency ARS = fromString("ARS"); + + /** + * AUD Currency for Azure. + */ + public static final AzureCurrency AUD = fromString("AUD"); + + /** + * CNY Currency for Azure. + */ + public static final AzureCurrency CNY = fromString("CNY"); + + /** + * Creates a new instance of AzureCurrency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureCurrency() { + } + + /** + * Creates or finds a AzureCurrency from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureCurrency. + */ + public static AzureCurrency fromString(String name) { + return fromString(name, AzureCurrency.class); + } + + /** + * Gets known AzureCurrency values. + * + * @return known AzureCurrency values. + */ + public static Collection values() { + return values(AzureCurrency.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureDiskType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureDiskType.java new file mode 100644 index 000000000000..336a55fc8e2b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureDiskType.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Disk Type. + */ +public final class AzureDiskType extends ExpandableStringEnum { + /** + * Unknown Azure Disk Type. + */ + public static final AzureDiskType UNKNOWN = fromString("Unknown"); + + /** + * Standard Azure Disk Type. + */ + public static final AzureDiskType STANDARD = fromString("Standard"); + + /** + * StandardSSD Azure Disk Type. + */ + public static final AzureDiskType STANDARD_SSD = fromString("StandardSSD"); + + /** + * Premium Azure Disk Type. + */ + public static final AzureDiskType PREMIUM = fromString("Premium"); + + /** + * StandardOrPremium Azure Disk Type. + */ + public static final AzureDiskType STANDARD_OR_PREMIUM = fromString("StandardOrPremium"); + + /** + * Ultra Azure Disk Type. + */ + public static final AzureDiskType ULTRA = fromString("Ultra"); + + /** + * PremiumV2 Azure Disk Type. + */ + public static final AzureDiskType PREMIUM_V2 = fromString("PremiumV2"); + + /** + * Creates a new instance of AzureDiskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureDiskType() { + } + + /** + * Creates or finds a AzureDiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureDiskType. + */ + public static AzureDiskType fromString(String name) { + return fromString(name, AzureDiskType.class); + } + + /** + * Gets known AzureDiskType values. + * + * @return known AzureDiskType values. + */ + public static Collection values() { + return values(AzureDiskType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureHybridUseBenefit.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureHybridUseBenefit.java new file mode 100644 index 000000000000..0fe35c2d79ac --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureHybridUseBenefit.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Hybrid Use Benefit. + */ +public final class AzureHybridUseBenefit extends ExpandableStringEnum { + /** + * Unknown Azure Hybrid Use Benefit. + */ + public static final AzureHybridUseBenefit UNKNOWN = fromString("Unknown"); + + /** + * Yes Azure Hybrid Use Benefit. + */ + public static final AzureHybridUseBenefit YES = fromString("Yes"); + + /** + * No Azure Hybrid Use Benefit. + */ + public static final AzureHybridUseBenefit NO = fromString("No"); + + /** + * Creates a new instance of AzureHybridUseBenefit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureHybridUseBenefit() { + } + + /** + * Creates or finds a AzureHybridUseBenefit from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureHybridUseBenefit. + */ + public static AzureHybridUseBenefit fromString(String name) { + return fromString(name, AzureHybridUseBenefit.class); + } + + /** + * Gets known AzureHybridUseBenefit values. + * + * @return known AzureHybridUseBenefit values. + */ + public static Collection values() { + return values(AzureHybridUseBenefit.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureLocation.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureLocation.java new file mode 100644 index 000000000000..653767fd191e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureLocation.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Location for Azure. + */ +public final class AzureLocation extends ExpandableStringEnum { + /** + * Unknown Location for Azure. + */ + public static final AzureLocation UNKNOWN = fromString("Unknown"); + + /** + * EastAsia Location for Azure. + */ + public static final AzureLocation EAST_ASIA = fromString("EastAsia"); + + /** + * SoutheastAsia Location for Azure. + */ + public static final AzureLocation SOUTHEAST_ASIA = fromString("SoutheastAsia"); + + /** + * AustraliaEast Location for Azure. + */ + public static final AzureLocation AUSTRALIA_EAST = fromString("AustraliaEast"); + + /** + * AustraliaSoutheast Location for Azure. + */ + public static final AzureLocation AUSTRALIA_SOUTHEAST = fromString("AustraliaSoutheast"); + + /** + * BrazilSouth Location for Azure. + */ + public static final AzureLocation BRAZIL_SOUTH = fromString("BrazilSouth"); + + /** + * CanadaCentral Location for Azure. + */ + public static final AzureLocation CANADA_CENTRAL = fromString("CanadaCentral"); + + /** + * CanadaEast Location for Azure. + */ + public static final AzureLocation CANADA_EAST = fromString("CanadaEast"); + + /** + * WestEurope Location for Azure. + */ + public static final AzureLocation WEST_EUROPE = fromString("WestEurope"); + + /** + * NorthEurope Location for Azure. + */ + public static final AzureLocation NORTH_EUROPE = fromString("NorthEurope"); + + /** + * CentralIndia Location for Azure. + */ + public static final AzureLocation CENTRAL_INDIA = fromString("CentralIndia"); + + /** + * SouthIndia Location for Azure. + */ + public static final AzureLocation SOUTH_INDIA = fromString("SouthIndia"); + + /** + * WestIndia Location for Azure. + */ + public static final AzureLocation WEST_INDIA = fromString("WestIndia"); + + /** + * JapanEast Location for Azure. + */ + public static final AzureLocation JAPAN_EAST = fromString("JapanEast"); + + /** + * JapanWest Location for Azure. + */ + public static final AzureLocation JAPAN_WEST = fromString("JapanWest"); + + /** + * KoreaCentral Location for Azure. + */ + public static final AzureLocation KOREA_CENTRAL = fromString("KoreaCentral"); + + /** + * KoreaSouth Location for Azure. + */ + public static final AzureLocation KOREA_SOUTH = fromString("KoreaSouth"); + + /** + * UkWest Location for Azure. + */ + public static final AzureLocation UK_WEST = fromString("UkWest"); + + /** + * UkSouth Location for Azure. + */ + public static final AzureLocation UK_SOUTH = fromString("UkSouth"); + + /** + * NorthCentralUs Location for Azure. + */ + public static final AzureLocation NORTH_CENTRAL_US = fromString("NorthCentralUs"); + + /** + * EastUs Location for Azure. + */ + public static final AzureLocation EAST_US = fromString("EastUs"); + + /** + * WestUs2 Location for Azure. + */ + public static final AzureLocation WEST_US2 = fromString("WestUs2"); + + /** + * SouthCentralUs Location for Azure. + */ + public static final AzureLocation SOUTH_CENTRAL_US = fromString("SouthCentralUs"); + + /** + * CentralUs Location for Azure. + */ + public static final AzureLocation CENTRAL_US = fromString("CentralUs"); + + /** + * EastUs2 Location for Azure. + */ + public static final AzureLocation EAST_US2 = fromString("EastUs2"); + + /** + * WestUs Location for Azure. + */ + public static final AzureLocation WEST_US = fromString("WestUs"); + + /** + * WestCentralUs Location for Azure. + */ + public static final AzureLocation WEST_CENTRAL_US = fromString("WestCentralUs"); + + /** + * GermanyCentral Location for Azure. + */ + public static final AzureLocation GERMANY_CENTRAL = fromString("GermanyCentral"); + + /** + * GermanyNortheast Location for Azure. + */ + public static final AzureLocation GERMANY_NORTHEAST = fromString("GermanyNortheast"); + + /** + * ChinaNorth Location for Azure. + */ + public static final AzureLocation CHINA_NORTH = fromString("ChinaNorth"); + + /** + * ChinaEast Location for Azure. + */ + public static final AzureLocation CHINA_EAST = fromString("ChinaEast"); + + /** + * USGovArizona Location for Azure. + */ + public static final AzureLocation USGOV_ARIZONA = fromString("USGovArizona"); + + /** + * USGovTexas Location for Azure. + */ + public static final AzureLocation USGOV_TEXAS = fromString("USGovTexas"); + + /** + * USGovIowa Location for Azure. + */ + public static final AzureLocation USGOV_IOWA = fromString("USGovIowa"); + + /** + * USGovVirginia Location for Azure. + */ + public static final AzureLocation USGOV_VIRGINIA = fromString("USGovVirginia"); + + /** + * USDoDCentral Location for Azure. + */ + public static final AzureLocation USDO_DCENTRAL = fromString("USDoDCentral"); + + /** + * USDoDEast Location for Azure. + */ + public static final AzureLocation USDO_DEAST = fromString("USDoDEast"); + + /** + * FranceCentral Location for Azure. + */ + public static final AzureLocation FRANCE_CENTRAL = fromString("FranceCentral"); + + /** + * AustraliaCentral Location for Azure. + */ + public static final AzureLocation AUSTRALIA_CENTRAL = fromString("AustraliaCentral"); + + /** + * SouthAfricaNorth Location for Azure. + */ + public static final AzureLocation SOUTH_AFRICA_NORTH = fromString("SouthAfricaNorth"); + + /** + * FranceSouth Location for Azure. + */ + public static final AzureLocation FRANCE_SOUTH = fromString("FranceSouth"); + + /** + * AustraliaCentral2 Location for Azure. + */ + public static final AzureLocation AUSTRALIA_CENTRAL2 = fromString("AustraliaCentral2"); + + /** + * SouthAfricaWest Location for Azure. + */ + public static final AzureLocation SOUTH_AFRICA_WEST = fromString("SouthAfricaWest"); + + /** + * GermanyNorth Location for Azure. + */ + public static final AzureLocation GERMANY_NORTH = fromString("GermanyNorth"); + + /** + * GermanyWestCentral Location for Azure. + */ + public static final AzureLocation GERMANY_WEST_CENTRAL = fromString("GermanyWestCentral"); + + /** + * NorwayEast Location for Azure. + */ + public static final AzureLocation NORWAY_EAST = fromString("NorwayEast"); + + /** + * NorwayWest Location for Azure. + */ + public static final AzureLocation NORWAY_WEST = fromString("NorwayWest"); + + /** + * ChinaEast2 Location for Azure. + */ + public static final AzureLocation CHINA_EAST2 = fromString("ChinaEast2"); + + /** + * ChinaNorth2 Location for Azure. + */ + public static final AzureLocation CHINA_NORTH2 = fromString("ChinaNorth2"); + + /** + * SwitzerlandNorth Location for Azure. + */ + public static final AzureLocation SWITZERLAND_NORTH = fromString("SwitzerlandNorth"); + + /** + * SwitzerlandWest Location for Azure. + */ + public static final AzureLocation SWITZERLAND_WEST = fromString("SwitzerlandWest"); + + /** + * UAENorth Location for Azure. + */ + public static final AzureLocation UAENORTH = fromString("UAENorth"); + + /** + * UAECentral Location for Azure. + */ + public static final AzureLocation UAECENTRAL = fromString("UAECentral"); + + /** + * UsNatEast Location for Azure. + */ + public static final AzureLocation US_NAT_EAST = fromString("UsNatEast"); + + /** + * UsNatWest Location for Azure. + */ + public static final AzureLocation US_NAT_WEST = fromString("UsNatWest"); + + /** + * UsSecEast Location for Azure. + */ + public static final AzureLocation US_SEC_EAST = fromString("UsSecEast"); + + /** + * UsSecCentral Location for Azure. + */ + public static final AzureLocation US_SEC_CENTRAL = fromString("UsSecCentral"); + + /** + * UsSecWest Location for Azure. + */ + public static final AzureLocation US_SEC_WEST = fromString("UsSecWest"); + + /** + * SwedenCentral Location for Azure. + */ + public static final AzureLocation SWEDEN_CENTRAL = fromString("SwedenCentral"); + + /** + * QatarCentral Location for Azure. + */ + public static final AzureLocation QATAR_CENTRAL = fromString("QatarCentral"); + + /** + * JioIndiaWest Location for Azure. + */ + public static final AzureLocation JIO_INDIA_WEST = fromString("JioIndiaWest"); + + /** + * ItalyNorth Location for Azure. + */ + public static final AzureLocation ITALY_NORTH = fromString("ItalyNorth"); + + /** + * PolandCentral Location for Azure. + */ + public static final AzureLocation POLAND_CENTRAL = fromString("PolandCentral"); + + /** + * IsraelCentral Location for Azure. + */ + public static final AzureLocation ISRAEL_CENTRAL = fromString("IsraelCentral"); + + /** + * MexicoCentral Location for Azure. + */ + public static final AzureLocation MEXICO_CENTRAL = fromString("MexicoCentral"); + + /** + * NewZealandNorth Location for Azure. + */ + public static final AzureLocation NEW_ZEALAND_NORTH = fromString("NewZealandNorth"); + + /** + * SpainCentral Location for Azure. + */ + public static final AzureLocation SPAIN_CENTRAL = fromString("SpainCentral"); + + /** + * Creates a new instance of AzureLocation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureLocation() { + } + + /** + * Creates or finds a AzureLocation from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureLocation. + */ + public static AzureLocation fromString(String name) { + return fromString(name, AzureLocation.class); + } + + /** + * Gets known AzureLocation values. + * + * @return known AzureLocation values. + */ + public static Collection values() { + return values(AzureLocation.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureManagementOfferingType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureManagementOfferingType.java new file mode 100644 index 000000000000..9d25ef4fbd84 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureManagementOfferingType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure management Offering type. + */ +public final class AzureManagementOfferingType extends ExpandableStringEnum { + /** + * No - Azure management Offering type. + */ + public static final AzureManagementOfferingType NO = fromString("No"); + + /** + * SCOMMI - Azure management Offering type. + */ + public static final AzureManagementOfferingType SCOMMI = fromString("SCOMMI"); + + /** + * AzMon - Azure management Offering type. + */ + public static final AzureManagementOfferingType AZ_MON = fromString("AzMon"); + + /** + * AUM - Azure management Offering type. + */ + public static final AzureManagementOfferingType AUM = fromString("AUM"); + + /** + * AzureBackup - Azure management Offering type. + */ + public static final AzureManagementOfferingType AZURE_BACKUP = fromString("AzureBackup"); + + /** + * Creates a new instance of AzureManagementOfferingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureManagementOfferingType() { + } + + /** + * Creates or finds a AzureManagementOfferingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureManagementOfferingType. + */ + public static AzureManagementOfferingType fromString(String name) { + return fromString(name, AzureManagementOfferingType.class); + } + + /** + * Gets known AzureManagementOfferingType values. + * + * @return known AzureManagementOfferingType values. + */ + public static Collection values() { + return values(AzureManagementOfferingType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureOffer.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureOffer.java new file mode 100644 index 000000000000..f77ffb25b1cc --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureOffer.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Offer. + */ +public final class AzureOffer extends ExpandableStringEnum { + /** + * Unknown - Azure Offer. + */ + public static final AzureOffer UNKNOWN = fromString("Unknown"); + + /** + * MSAZR0003P Azure Offer. + */ + public static final AzureOffer MSAZR0003P = fromString("MSAZR0003P"); + + /** + * MSAZR0023P Azure Offer. + */ + public static final AzureOffer MSAZR0023P = fromString("MSAZR0023P"); + + /** + * MSMCAZR0044P Azure Offer. + */ + public static final AzureOffer MSMCAZR0044P = fromString("MSMCAZR0044P"); + + /** + * MSMCAZR0059P Azure Offer. + */ + public static final AzureOffer MSMCAZR0059P = fromString("MSMCAZR0059P"); + + /** + * MSMCAZR0060P Azure Offer. + */ + public static final AzureOffer MSMCAZR0060P = fromString("MSMCAZR0060P"); + + /** + * MSMCAZR0063P Azure Offer. + */ + public static final AzureOffer MSMCAZR0063P = fromString("MSMCAZR0063P"); + + /** + * MSAZRUSGOV0003P Azure Offer. + */ + public static final AzureOffer MSAZRUSGOV0003P = fromString("MSAZRUSGOV0003P"); + + /** + * EA Azure Offer. + */ + public static final AzureOffer EA = fromString("EA"); + + /** + * SavingsPlan1Year Azure Offer. + */ + public static final AzureOffer SAVINGS_PLAN1YEAR = fromString("SavingsPlan1Year"); + + /** + * SavingsPlan3Year Azure Offer. + */ + public static final AzureOffer SAVINGS_PLAN3YEAR = fromString("SavingsPlan3Year"); + + /** + * Creates a new instance of AzureOffer value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureOffer() { + } + + /** + * Creates or finds a AzureOffer from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureOffer. + */ + public static AzureOffer fromString(String name) { + return fromString(name, AzureOffer.class); + } + + /** + * Gets known AzureOffer values. + * + * @return known AzureOffer values. + */ + public static Collection values() { + return values(AzureOffer.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzurePricingTier.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzurePricingTier.java new file mode 100644 index 000000000000..33b34cc57544 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzurePricingTier.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Pricing Tier. + */ +public final class AzurePricingTier extends ExpandableStringEnum { + /** + * Standard Azure Pricing Tier. + */ + public static final AzurePricingTier STANDARD = fromString("Standard"); + + /** + * Basic Azure Pricing Tier. + */ + public static final AzurePricingTier BASIC = fromString("Basic"); + + /** + * Creates a new instance of AzurePricingTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzurePricingTier() { + } + + /** + * Creates or finds a AzurePricingTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzurePricingTier. + */ + public static AzurePricingTier fromString(String name) { + return fromString(name, AzurePricingTier.class); + } + + /** + * Gets known AzurePricingTier values. + * + * @return known AzurePricingTier values. + */ + public static Collection values() { + return values(AzurePricingTier.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureSecurityOfferingType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureSecurityOfferingType.java new file mode 100644 index 000000000000..69dc5db731fb --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureSecurityOfferingType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Security Offering Type. + */ +public final class AzureSecurityOfferingType extends ExpandableStringEnum { + /** + * NO - Azure Security Offering Type. + */ + public static final AzureSecurityOfferingType NO = fromString("NO"); + + /** + * MDC - Azure Security Offering Type. + */ + public static final AzureSecurityOfferingType MDC = fromString("MDC"); + + /** + * Creates a new instance of AzureSecurityOfferingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureSecurityOfferingType() { + } + + /** + * Creates or finds a AzureSecurityOfferingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureSecurityOfferingType. + */ + public static AzureSecurityOfferingType fromString(String name) { + return fromString(name, AzureSecurityOfferingType.class); + } + + /** + * Gets known AzureSecurityOfferingType values. + * + * @return known AzureSecurityOfferingType values. + */ + public static Collection values() { + return values(AzureSecurityOfferingType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureStorageRedundancy.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureStorageRedundancy.java new file mode 100644 index 000000000000..2b82da63cc50 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureStorageRedundancy.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Storage Redundancy. + */ +public final class AzureStorageRedundancy extends ExpandableStringEnum { + /** + * Unknown Azure Storage Redundancy. + */ + public static final AzureStorageRedundancy UNKNOWN = fromString("Unknown"); + + /** + * LocallyRedundant Azure Storage Redundancy. + */ + public static final AzureStorageRedundancy LOCALLY_REDUNDANT = fromString("LocallyRedundant"); + + /** + * ZoneRedundant Azure Storage Redundancy. + */ + public static final AzureStorageRedundancy ZONE_REDUNDANT = fromString("ZoneRedundant"); + + /** + * GeoRedundant Azure Storage Redundancy. + */ + public static final AzureStorageRedundancy GEO_REDUNDANT = fromString("GeoRedundant"); + + /** + * ReadAccessGeoRedundant Azure Storage Redundancy. + */ + public static final AzureStorageRedundancy READ_ACCESS_GEO_REDUNDANT = fromString("ReadAccessGeoRedundant"); + + /** + * Creates a new instance of AzureStorageRedundancy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureStorageRedundancy() { + } + + /** + * Creates or finds a AzureStorageRedundancy from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureStorageRedundancy. + */ + public static AzureStorageRedundancy fromString(String name) { + return fromString(name, AzureStorageRedundancy.class); + } + + /** + * Gets known AzureStorageRedundancy values. + * + * @return known AzureStorageRedundancy values. + */ + public static Collection values() { + return values(AzureStorageRedundancy.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureTarget.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureTarget.java new file mode 100644 index 000000000000..748c3b18062e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureTarget.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Target. + */ +public final class AzureTarget extends ExpandableStringEnum { + /** + * Unknown - Azure Target. + */ + public static final AzureTarget UNKNOWN = fromString("Unknown"); + + /** + * SqlDatabase - Azure Target. + */ + public static final AzureTarget SQL_DATABASE = fromString("SqlDatabase"); + + /** + * SqlMI - Azure Target. + */ + public static final AzureTarget SQL_MI = fromString("SqlMI"); + + /** + * FlexServerPG - Azure Target. + */ + public static final AzureTarget FLEX_SERVER_PG = fromString("FlexServerPG"); + + /** + * OracleIaasVM - Azure Target. + */ + public static final AzureTarget ORACLE_IAAS_VM = fromString("OracleIaasVM"); + + /** + * AzureSpringApps - Azure Target. + */ + public static final AzureTarget AZURE_SPRING_APPS = fromString("AzureSpringApps"); + + /** + * SAPAzureInstance - Azure Target. + */ + public static final AzureTarget SAPAZURE_INSTANCE = fromString("SAPAzureInstance"); + + /** + * AKS - Azure Target. + */ + public static final AzureTarget AKS = fromString("AKS"); + + /** + * MySQLAzureFlexServer - Azure Target. + */ + public static final AzureTarget MY_SQLAZURE_FLEX_SERVER = fromString("MySQLAzureFlexServer"); + + /** + * AzureSQLVM - Azure Target. + */ + public static final AzureTarget AZURE_SQLVM = fromString("AzureSQLVM"); + + /** + * AzureVM - Azure Target. + */ + public static final AzureTarget AZURE_VM = fromString("AzureVM"); + + /** + * AzureAppService - Azure Target. + */ + public static final AzureTarget AZURE_APP_SERVICE = fromString("AzureAppService"); + + /** + * AzureAppServiceContainer - Azure Target. + */ + public static final AzureTarget AZURE_APP_SERVICE_CONTAINER = fromString("AzureAppServiceContainer"); + + /** + * Avs - Azure Target. + */ + public static final AzureTarget AVS = fromString("Avs"); + + /** + * Creates a new instance of AzureTarget value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureTarget() { + } + + /** + * Creates or finds a AzureTarget from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureTarget. + */ + public static AzureTarget fromString(String name) { + return fromString(name, AzureTarget.class); + } + + /** + * Gets known AzureTarget values. + * + * @return known AzureTarget values. + */ + public static Collection values() { + return values(AzureTarget.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmFamily.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmFamily.java new file mode 100644 index 000000000000..d253fb107c77 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmFamily.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure VM Family. + */ +public final class AzureVmFamily extends ExpandableStringEnum { + /** + * Unknown - Azure VM Family. + */ + public static final AzureVmFamily UNKNOWN = fromString("Unknown"); + + /** + * Basic_A0_A4. + */ + public static final AzureVmFamily BASIC_A0A4 = fromString("Basic_A0_A4"); + + /** + * Standard_A0_A7. + */ + public static final AzureVmFamily STANDARD_A0A7 = fromString("Standard_A0_A7"); + + /** + * Standard_A8_A11. + */ + public static final AzureVmFamily STANDARD_A8A11 = fromString("Standard_A8_A11"); + + /** + * Av2_series. + */ + public static final AzureVmFamily AV2SERIES = fromString("Av2_series"); + + /** + * D_series. + */ + public static final AzureVmFamily DSERIES = fromString("D_series"); + + /** + * Dv2_series. + */ + public static final AzureVmFamily DV2SERIES = fromString("Dv2_series"); + + /** + * DS_series. + */ + public static final AzureVmFamily DSSERIES = fromString("DS_series"); + + /** + * DSv2_series. + */ + public static final AzureVmFamily DSV2SERIES = fromString("DSv2_series"); + + /** + * F_series. + */ + public static final AzureVmFamily FSERIES = fromString("F_series"); + + /** + * Fs_series. + */ + public static final AzureVmFamily FS_SERIES = fromString("Fs_series"); + + /** + * G_series. + */ + public static final AzureVmFamily GSERIES = fromString("G_series"); + + /** + * GS_series. + */ + public static final AzureVmFamily GSSERIES = fromString("GS_series"); + + /** + * H_series. + */ + public static final AzureVmFamily HSERIES = fromString("H_series"); + + /** + * Ls_series. + */ + public static final AzureVmFamily LS_SERIES = fromString("Ls_series"); + + /** + * Dsv3_series. + */ + public static final AzureVmFamily DSV3SERIES = fromString("Dsv3_series"); + + /** + * Dv3_series. + */ + public static final AzureVmFamily DV3SERIES = fromString("Dv3_series"); + + /** + * Fsv2_series. + */ + public static final AzureVmFamily FSV2SERIES = fromString("Fsv2_series"); + + /** + * Ev3_series. + */ + public static final AzureVmFamily EV3SERIES = fromString("Ev3_series"); + + /** + * Esv3_series. + */ + public static final AzureVmFamily ESV3SERIES = fromString("Esv3_series"); + + /** + * M_series. + */ + public static final AzureVmFamily MSERIES = fromString("M_series"); + + /** + * DC_Series. + */ + public static final AzureVmFamily DCSERIES = fromString("DC_Series"); + + /** + * Lsv2_series. + */ + public static final AzureVmFamily LSV2SERIES = fromString("Lsv2_series"); + + /** + * Ev4_series. + */ + public static final AzureVmFamily EV4SERIES = fromString("Ev4_series"); + + /** + * Esv4_series. + */ + public static final AzureVmFamily ESV4SERIES = fromString("Esv4_series"); + + /** + * Edv4_series. + */ + public static final AzureVmFamily EDV4SERIES = fromString("Edv4_series"); + + /** + * Edsv4_series. + */ + public static final AzureVmFamily EDSV4SERIES = fromString("Edsv4_series"); + + /** + * Dv4_series. + */ + public static final AzureVmFamily DV4SERIES = fromString("Dv4_series"); + + /** + * Dsv4_series. + */ + public static final AzureVmFamily DSV4SERIES = fromString("Dsv4_series"); + + /** + * Ddv4_series. + */ + public static final AzureVmFamily DDV4SERIES = fromString("Ddv4_series"); + + /** + * Ddsv4_series. + */ + public static final AzureVmFamily DDSV4SERIES = fromString("Ddsv4_series"); + + /** + * Easv4_series. + */ + public static final AzureVmFamily EASV4SERIES = fromString("Easv4_series"); + + /** + * Dasv4_series. + */ + public static final AzureVmFamily DASV4SERIES = fromString("Dasv4_series"); + + /** + * Mv2_series. + */ + public static final AzureVmFamily MV2SERIES = fromString("Mv2_series"); + + /** + * Eav4_series. + */ + public static final AzureVmFamily EAV4SERIES = fromString("Eav4_series"); + + /** + * Dav4_series. + */ + public static final AzureVmFamily DAV4SERIES = fromString("Dav4_series"); + + /** + * Msv2_series. + */ + public static final AzureVmFamily MSV2SERIES = fromString("Msv2_series"); + + /** + * Mdsv2_series. + */ + public static final AzureVmFamily MDSV2SERIES = fromString("Mdsv2_series"); + + /** + * Dv5_series. + */ + public static final AzureVmFamily DV5SERIES = fromString("Dv5_series"); + + /** + * Dsv5_series. + */ + public static final AzureVmFamily DSV5SERIES = fromString("Dsv5_series"); + + /** + * Ddv5_series. + */ + public static final AzureVmFamily DDV5SERIES = fromString("Ddv5_series"); + + /** + * Ddsv5_series. + */ + public static final AzureVmFamily DDSV5SERIES = fromString("Ddsv5_series"); + + /** + * Dasv5_series. + */ + public static final AzureVmFamily DASV5SERIES = fromString("Dasv5_series"); + + /** + * Dadsv5_series. + */ + public static final AzureVmFamily DADSV5SERIES = fromString("Dadsv5_series"); + + /** + * Ev5_series. + */ + public static final AzureVmFamily EV5SERIES = fromString("Ev5_series"); + + /** + * Esv5_series. + */ + public static final AzureVmFamily ESV5SERIES = fromString("Esv5_series"); + + /** + * Edv5_series. + */ + public static final AzureVmFamily EDV5SERIES = fromString("Edv5_series"); + + /** + * Edsv5_series. + */ + public static final AzureVmFamily EDSV5SERIES = fromString("Edsv5_series"); + + /** + * Easv5_series. + */ + public static final AzureVmFamily EASV5SERIES = fromString("Easv5_series"); + + /** + * Eadsv5_series. + */ + public static final AzureVmFamily EADSV5SERIES = fromString("Eadsv5_series"); + + /** + * Ebsv5_series. + */ + public static final AzureVmFamily EBSV5SERIES = fromString("Ebsv5_series"); + + /** + * Ebdsv5_series. + */ + public static final AzureVmFamily EBDSV5SERIES = fromString("Ebdsv5_series"); + + /** + * Creates a new instance of AzureVmFamily value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureVmFamily() { + } + + /** + * Creates or finds a AzureVmFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureVmFamily. + */ + public static AzureVmFamily fromString(String name) { + return fromString(name, AzureVmFamily.class); + } + + /** + * Gets known AzureVmFamily values. + * + * @return known AzureVmFamily values. + */ + public static Collection values() { + return values(AzureVmFamily.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecuritySuitabilityDetail.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecuritySuitabilityDetail.java new file mode 100644 index 000000000000..61aa8bbb06ee --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecuritySuitabilityDetail.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Vm Security Suitability Detail. + */ +public final class AzureVmSecuritySuitabilityDetail extends ExpandableStringEnum { + /** + * Unknown - Azure Vm Security Suitability Detail. + */ + public static final AzureVmSecuritySuitabilityDetail UNKNOWN = fromString("Unknown"); + + /** + * NotApplicable - Azure Vm Security Suitability Detail. + */ + public static final AzureVmSecuritySuitabilityDetail NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * GuestOperatingSystemNotSupported Azure Vm Security Suitability Detail. + */ + public static final AzureVmSecuritySuitabilityDetail GUEST_OPERATING_SYSTEM_NOT_SUPPORTED + = fromString("GuestOperatingSystemNotSupported"); + + /** + * BootTypeNotSupported Azure Vm Security Suitability Detail. + */ + public static final AzureVmSecuritySuitabilityDetail BOOT_TYPE_NOT_SUPPORTED = fromString("BootTypeNotSupported"); + + /** + * DiskSizeLarge Azure Vm Security Suitability Detail. + */ + public static final AzureVmSecuritySuitabilityDetail DISK_SIZE_LARGE = fromString("DiskSizeLarge"); + + /** + * Azure does not support VM with OS disk size greater than 4TB. + */ + public static final AzureVmSecuritySuitabilityDetail ALL_DISK_SIZE_EXCEEDS4TB = fromString("AllDiskSizeExceeds4TB"); + + /** + * Azure does not support VM with OS disk size greater than 4TB. If OS disk size is less than 4TB, proceed with + * migration. + */ + public static final AzureVmSecuritySuitabilityDetail ANY_DISK_SIZE_EXCEEDS4TB = fromString("AnyDiskSizeExceeds4TB"); + + /** + * Azure does not support VM with any disk size greater than 4TB. Please proceed only if you know the OS disk size + * is less than 4TB. + */ + public static final AzureVmSecuritySuitabilityDetail ANY_DISK_SIZE_EXCEEDS4TBCONDITIONAL + = fromString("AnyDiskSizeExceeds4TBConditional"); + + /** + * The VM is not ready to be migrated to Azure because the OS is not supported. + */ + public static final AzureVmSecuritySuitabilityDetail OSNOT_SUPPORTED = fromString("OSNotSupported"); + + /** + * The VM is ready to be migrated to Azure with standard VM security type. + */ + public static final AzureVmSecuritySuitabilityDetail STANDARD_READY = fromString("StandardReady"); + + /** + * The VM is ready to be migrated to Azure with Trusted launch VM security type. + */ + public static final AzureVmSecuritySuitabilityDetail TVMREADY = fromString("TVMReady"); + + /** + * The VM is not ready to be migrated to Azure with standard VM security type because the OS is not supported. + */ + public static final AzureVmSecuritySuitabilityDetail STANDARD_NOT_READY_OSNOT_SUPPORTED + = fromString("StandardNotReadyOSNotSupported"); + + /** + * The VM is not ready to be migrated to Azure with Trusted launch VM security type because the OS is not supported + * for Trusted launch VM. Get more information [here]. + */ + public static final AzureVmSecuritySuitabilityDetail TVMNOT_READY_OSNOT_SUPPORTED + = fromString("TVMNotReadyOSNotSupported"); + + /** + * The VM is not ready to be migrated to Azure with standard VM security type. Azure does not support OS disk size + * greater than 2TB for VMs with BIOS boot type. + */ + public static final AzureVmSecuritySuitabilityDetail STANDARD_NOT_READY2TBBIOS_BOOT + = fromString("StandardNotReady2TBBiosBoot"); + + /** + * The VM is not ready to be migrated to Azure with Trusted launch VM security type. Azure does not support OS disk + * size greater than 2TB for VMs with BIOS boot type. + */ + public static final AzureVmSecuritySuitabilityDetail ALL_DISK_SIZE_EXCEEDS2TB = fromString("AllDiskSizeExceeds2TB"); + + /** + * The VM readiness is unknown. Azure does not support OS disk size greater than 2TB for VMs with BIOS boot type. + * Please proceed with migration only if OS disk size is less than 2TB. + */ + public static final AzureVmSecuritySuitabilityDetail DISK_SIZE2TBCONDITIONAL_READY_BIOS_BOOT + = fromString("DiskSize2TBConditionalReadyBiosBoot"); + + /** + * The VM cannot be migrated to Trusted launch VM because the OS is not supported. Learn more [here]. + */ + public static final AzureVmSecuritySuitabilityDetail TVMCANNOT_MIGRATE_OSNOT_SUPPORTED + = fromString("TVMCannotMigrateOSNotSupported"); + + /** + * The VM cannot be migrated to Azure because the OS is not supported. + */ + public static final AzureVmSecuritySuitabilityDetail STANDARD_CANNOT_MIGRATE_OSNOT_SUPPORTED + = fromString("StandardCannotMigrateOSNotSupported"); + + /** + * The VM can be migrated to Azure with standard VM security type. + */ + public static final AzureVmSecuritySuitabilityDetail STANDARD_CAN_MIGRATE = fromString("StandardCanMigrate"); + + /** + * The VM can be migrated to Trusted launch VM. Currently, Azure Migrate does not support migration to Trusted + * launch for VM with BIOS boot type. You can convert the VM post-migration to Trusted Launch VM. The steps are + * mentioned in this documentation. + */ + public static final AzureVmSecuritySuitabilityDetail TVMCAN_MIGRATE_CONDITIONAL + = fromString("TVMCanMigrateConditional"); + + /** + * Readiness is marked as unknown because the OS name cannot be read. + */ + public static final AzureVmSecuritySuitabilityDetail OSNAME_CANNOT_BE_READ = fromString("OSNameCannotBeRead"); + + /** + * Migration to Trusted Launch VM is not supported for BIOS boot type VMs at this time. + */ + public static final AzureVmSecuritySuitabilityDetail TVMNOT_SUPPORTED_FOR_BIOS_BOOT + = fromString("TVMNotSupportedForBiosBoot"); + + /** + * Creates a new instance of AzureVmSecuritySuitabilityDetail value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureVmSecuritySuitabilityDetail() { + } + + /** + * Creates or finds a AzureVmSecuritySuitabilityDetail from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureVmSecuritySuitabilityDetail. + */ + public static AzureVmSecuritySuitabilityDetail fromString(String name) { + return fromString(name, AzureVmSecuritySuitabilityDetail.class); + } + + /** + * Gets known AzureVmSecuritySuitabilityDetail values. + * + * @return known AzureVmSecuritySuitabilityDetail values. + */ + public static Collection values() { + return values(AzureVmSecuritySuitabilityDetail.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecurityType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecurityType.java new file mode 100644 index 000000000000..6fb347c10d92 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/AzureVmSecurityType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Azure Vm Security Type. + */ +public final class AzureVmSecurityType extends ExpandableStringEnum { + /** + * Unknown - Azure Vm Security Type. + */ + public static final AzureVmSecurityType UNKNOWN = fromString("Unknown"); + + /** + * Standard Azure Vm Security Type. + */ + public static final AzureVmSecurityType STANDARD = fromString("Standard"); + + /** + * TVM Azure Vm Security Type. + */ + public static final AzureVmSecurityType TVM = fromString("TVM"); + + /** + * CVM Azure Vm Security Type. + */ + public static final AzureVmSecurityType CVM = fromString("CVM"); + + /** + * Creates a new instance of AzureVmSecurityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureVmSecurityType() { + } + + /** + * Creates or finds a AzureVmSecurityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureVmSecurityType. + */ + public static AzureVmSecurityType fromString(String name) { + return fromString(name, AzureVmSecurityType.class); + } + + /** + * Gets known AzureVmSecurityType values. + * + * @return known AzureVmSecurityType values. + */ + public static Collection values() { + return values(AzureVmSecurityType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/BillingSettings.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/BillingSettings.java new file mode 100644 index 000000000000..c9607320ee15 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/BillingSettings.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Billing settings class. + */ +@Fluent +public final class BillingSettings implements JsonSerializable { + /* + * Gets or sets the licensing program. + */ + private LicensingProgram licensingProgram; + + /* + * Gets or sets the subscription ID for licensing program selected. + */ + private String subscriptionId; + + /** + * Creates an instance of BillingSettings class. + */ + public BillingSettings() { + } + + /** + * Get the licensingProgram property: Gets or sets the licensing program. + * + * @return the licensingProgram value. + */ + public LicensingProgram licensingProgram() { + return this.licensingProgram; + } + + /** + * Set the licensingProgram property: Gets or sets the licensing program. + * + * @param licensingProgram the licensingProgram value to set. + * @return the BillingSettings object itself. + */ + public BillingSettings withLicensingProgram(LicensingProgram licensingProgram) { + this.licensingProgram = licensingProgram; + return this; + } + + /** + * Get the subscriptionId property: Gets or sets the subscription ID for licensing program selected. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Gets or sets the subscription ID for licensing program selected. + * + * @param subscriptionId the subscriptionId value to set. + * @return the BillingSettings object itself. + */ + public BillingSettings withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("licensingProgram", + this.licensingProgram == null ? null : this.licensingProgram.toString()); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BillingSettings. + */ + public static BillingSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingSettings deserializedBillingSettings = new BillingSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("licensingProgram".equals(fieldName)) { + deserializedBillingSettings.licensingProgram = LicensingProgram.fromString(reader.getString()); + } else if ("subscriptionId".equals(fieldName)) { + deserializedBillingSettings.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingSettings; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CloudSuitabilityCommon.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CloudSuitabilityCommon.java new file mode 100644 index 000000000000..9d2545fa8f49 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CloudSuitabilityCommon.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cloud Suitability Common. + */ +public final class CloudSuitabilityCommon extends ExpandableStringEnum { + /** + * Unknown - Cloud Suitability Common. + */ + public static final CloudSuitabilityCommon UNKNOWN = fromString("Unknown"); + + /** + * NotSuitable - Cloud Suitability Common. + */ + public static final CloudSuitabilityCommon NOT_SUITABLE = fromString("NotSuitable"); + + /** + * Suitable - Cloud Suitability Common. + */ + public static final CloudSuitabilityCommon SUITABLE = fromString("Suitable"); + + /** + * ConditionallySuitable - Cloud Suitability Common. + */ + public static final CloudSuitabilityCommon CONDITIONALLY_SUITABLE = fromString("ConditionallySuitable"); + + /** + * ReadinessUnknown - Cloud Suitability Common. + */ + public static final CloudSuitabilityCommon READINESS_UNKNOWN = fromString("ReadinessUnknown"); + + /** + * SuitableWithWarnings - Cloud Suitability Common. + */ + public static final CloudSuitabilityCommon SUITABLE_WITH_WARNINGS = fromString("SuitableWithWarnings"); + + /** + * Creates a new instance of CloudSuitabilityCommon value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudSuitabilityCommon() { + } + + /** + * Creates or finds a CloudSuitabilityCommon from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudSuitabilityCommon. + */ + public static CloudSuitabilityCommon fromString(String name) { + return fromString(name, CloudSuitabilityCommon.class); + } + + /** + * Gets known CloudSuitabilityCommon values. + * + * @return known CloudSuitabilityCommon values. + */ + public static Collection values() { + return values(CloudSuitabilityCommon.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Configuration.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Configuration.java new file mode 100644 index 000000000000..9aac042daea8 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Configuration.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration details. + */ +@Immutable +public final class Configuration implements JsonSerializable { + /* + * The azure target. + */ + private AzureTarget azureTarget; + + /* + * The azure target. + */ + private AssessmentSizingCriterion sizingCriterion; + + /** + * Creates an instance of Configuration class. + */ + private Configuration() { + } + + /** + * Get the azureTarget property: The azure target. + * + * @return the azureTarget value. + */ + public AzureTarget azureTarget() { + return this.azureTarget; + } + + /** + * Get the sizingCriterion property: The azure target. + * + * @return the sizingCriterion value. + */ + public AssessmentSizingCriterion sizingCriterion() { + return this.sizingCriterion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Configuration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Configuration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Configuration. + */ + public static Configuration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Configuration deserializedConfiguration = new Configuration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureTarget".equals(fieldName)) { + deserializedConfiguration.azureTarget = AzureTarget.fromString(reader.getString()); + } else if ("sizingCriterion".equals(fieldName)) { + deserializedConfiguration.sizingCriterion + = AssessmentSizingCriterion.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConfiguration; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostDetailsCommon.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostDetailsCommon.java new file mode 100644 index 000000000000..e8a1e2461142 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostDetailsCommon.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The cost details. + */ +@Immutable +public final class CostDetailsCommon implements JsonSerializable { + /* + * The savings options. + */ + private SavingsOptions savingOptions; + + /* + * The sku cost details per azure offer type. + */ + private List costDetail; + + /** + * Creates an instance of CostDetailsCommon class. + */ + private CostDetailsCommon() { + } + + /** + * Get the savingOptions property: The savings options. + * + * @return the savingOptions value. + */ + public SavingsOptions savingOptions() { + return this.savingOptions; + } + + /** + * Get the costDetail property: The sku cost details per azure offer type. + * + * @return the costDetail value. + */ + public List costDetail() { + return this.costDetail; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (costDetail() != null) { + costDetail().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CostDetailsCommon from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CostDetailsCommon if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CostDetailsCommon. + */ + public static CostDetailsCommon fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CostDetailsCommon deserializedCostDetailsCommon = new CostDetailsCommon(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("savingOptions".equals(fieldName)) { + deserializedCostDetailsCommon.savingOptions = SavingsOptions.fromString(reader.getString()); + } else if ("costDetail".equals(fieldName)) { + List costDetail + = reader.readArray(reader1 -> NameValuePairCostType.fromJson(reader1)); + deserializedCostDetailsCommon.costDetail = costDetail; + } else { + reader.skipChildren(); + } + } + + return deserializedCostDetailsCommon; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostType.java new file mode 100644 index 000000000000..58ff63b8b3a5 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/CostType.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cost type. + */ +public final class CostType extends ExpandableStringEnum { + /** + * MonthlyStorageCost - Cost type. + */ + public static final CostType MONTHLY_STORAGE_COST = fromString("MonthlyStorageCost"); + + /** + * MonthlyComputeCost - Cost type. + */ + public static final CostType MONTHLY_COMPUTE_COST = fromString("MonthlyComputeCost"); + + /** + * MonthlyLicensingCost - Cost type. + */ + public static final CostType MONTHLY_LICENSING_COST = fromString("MonthlyLicensingCost"); + + /** + * MonthlySecurityCost - Cost type. + */ + public static final CostType MONTHLY_SECURITY_COST = fromString("MonthlySecurityCost"); + + /** + * MonthlyManagementCost - Cost type. + */ + public static final CostType MONTHLY_MANAGEMENT_COST = fromString("MonthlyManagementCost"); + + /** + * MonitoringService - Cost type. + */ + public static final CostType MONITORING_SERVICE = fromString("MonitoringService"); + + /** + * DataProtectionService - Cost type. + */ + public static final CostType DATA_PROTECTION_SERVICE = fromString("DataProtectionService"); + + /** + * PatchingService - Cost type. + */ + public static final CostType PATCHING_SERVICE = fromString("PatchingService"); + + /** + * MonthlyAzureHybridCost - Cost type. + */ + public static final CostType MONTHLY_AZURE_HYBRID_COST = fromString("MonthlyAzureHybridCost"); + + /** + * MonthlyPremiumV2StorageCost - Cost type. + */ + public static final CostType MONTHLY_PREMIUM_V2STORAGE_COST = fromString("MonthlyPremiumV2StorageCost"); + + /** + * MonthlyLinuxAzureHybridCost - Cost type. + */ + public static final CostType MONTHLY_LINUX_AZURE_HYBRID_COST = fromString("MonthlyLinuxAzureHybridCost"); + + /** + * MonthlyUltraStorageCost - Cost type. + */ + public static final CostType MONTHLY_ULTRA_STORAGE_COST = fromString("MonthlyUltraStorageCost"); + + /** + * MonthlyStandardSsdStorageCost - Cost type. + */ + public static final CostType MONTHLY_STANDARD_SSD_STORAGE_COST = fromString("MonthlyStandardSsdStorageCost"); + + /** + * MonthlyBandwidthCost - Cost type. + */ + public static final CostType MONTHLY_BANDWIDTH_COST = fromString("MonthlyBandwidthCost"); + + /** + * MonthlyPremiumStorageCost - Cost type. + */ + public static final CostType MONTHLY_PREMIUM_STORAGE_COST = fromString("MonthlyPremiumStorageCost"); + + /** + * MonthlyUltraDiskCost - Cost type. + */ + public static final CostType MONTHLY_ULTRA_DISK_COST = fromString("MonthlyUltraDiskCost"); + + /** + * MonthlyStandardHddStorageCost - Cost type. + */ + public static final CostType MONTHLY_STANDARD_HDD_STORAGE_COST = fromString("MonthlyStandardHddStorageCost"); + + /** + * MonthlyAvsExternalStorageCost - Cost type. + */ + public static final CostType MONTHLY_AVS_EXTERNAL_STORAGE_COST = fromString("MonthlyAvsExternalStorageCost"); + + /** + * MonthlyAvsNetworkCost - Cost type. + */ + public static final CostType MONTHLY_AVS_NETWORK_COST = fromString("MonthlyAvsNetworkCost"); + + /** + * MonthlyAvsNodeCost - Cost type. + */ + public static final CostType MONTHLY_AVS_NODE_COST = fromString("MonthlyAvsNodeCost"); + + /** + * TotalMonthlyCost - Cost type. + */ + public static final CostType TOTAL_MONTHLY_COST = fromString("TotalMonthlyCost"); + + /** + * Creates a new instance of CostType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CostType() { + } + + /** + * Creates or finds a CostType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CostType. + */ + public static CostType fromString(String name) { + return fromString(name, CostType.class); + } + + /** + * Gets known CostType values. + * + * @return known CostType values. + */ + public static Collection values() { + return values(CostType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrl.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrl.java new file mode 100644 index 000000000000..488e364e5920 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.resourcemanager.migrate.fluent.models.DownloadUrlInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of DownloadUrl. + */ +public interface DownloadUrl { + /** + * Gets the assessmentReportUrl property: Hyperlink to download report. + * + * @return the assessmentReportUrl value. + */ + String assessmentReportUrl(); + + /** + * Gets the expirationTime property: Expiry date of download url. + * + * @return the expirationTime value. + */ + OffsetDateTime expirationTime(); + + /** + * Gets the inner com.azure.resourcemanager.migrate.fluent.models.DownloadUrlInner object. + * + * @return the inner object. + */ + DownloadUrlInner innerModel(); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrlRequest.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrlRequest.java new file mode 100644 index 000000000000..a3ccdb5ed156 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/DownloadUrlRequest.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The DownloadUrlRequest model. + */ +@Immutable +public final class DownloadUrlRequest implements JsonSerializable { + /** + * Creates an instance of DownloadUrlRequest class. + */ + public DownloadUrlRequest() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DownloadUrlRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DownloadUrlRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DownloadUrlRequest. + */ + public static DownloadUrlRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DownloadUrlRequest deserializedDownloadUrlRequest = new DownloadUrlRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + reader.skipChildren(); + } + + return deserializedDownloadUrlRequest; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/EnvironmentType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/EnvironmentType.java new file mode 100644 index 000000000000..7bd87c4b52ae --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/EnvironmentType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Environment Type. + */ +public final class EnvironmentType extends ExpandableStringEnum { + /** + * Production - Environment Type. + */ + public static final EnvironmentType PRODUCTION = fromString("Production"); + + /** + * Unknown - Environment Type. + */ + public static final EnvironmentType UNKNOWN = fromString("Unknown"); + + /** + * DevTest - Environment Type. + */ + public static final EnvironmentType DEV_TEST = fromString("DevTest"); + + /** + * Creates a new instance of EnvironmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnvironmentType() { + } + + /** + * Creates or finds a EnvironmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnvironmentType. + */ + public static EnvironmentType fromString(String name) { + return fromString(name, EnvironmentType.class); + } + + /** + * Gets known EnvironmentType values. + * + * @return known EnvironmentType values. + */ + public static Collection values() { + return values(EnvironmentType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Error.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Error.java new file mode 100644 index 000000000000..9dcee43c8bb6 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Error.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Error web model class. + */ +@Immutable +public final class Error implements JsonSerializable { + /* + * Gets the error ID. + */ + private Integer id; + + /* + * Gets the error code. + */ + private String code; + + /* + * Gets the Run as account ID. + */ + private String runAsAccountId; + + /* + * Gets the Appliance name. + */ + private String applianceName; + + /* + * Gets the error message. + */ + private String message; + + /* + * Gets the error summary message. + */ + private String summaryMessage; + + /* + * Gets the agent scenario where this error occurred. + */ + private String agentScenario; + + /* + * Gets the error possible causes. + */ + private String possibleCauses; + + /* + * Gets the recommended action for the error. + */ + private String recommendedAction; + + /* + * Gets the error severity. + */ + private String severity; + + /* + * Gets the error message parameters. + */ + private List messageParameters; + + /* + * Gets the time stamp when the error was updated. + */ + private OffsetDateTime updatedTimeStamp; + + /* + * Gets the type of assessment impacted by this error. + */ + private String impactedAssessmentType; + + /** + * Creates an instance of Error class. + */ + private Error() { + } + + /** + * Get the id property: Gets the error ID. + * + * @return the id value. + */ + public Integer id() { + return this.id; + } + + /** + * Get the code property: Gets the error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the runAsAccountId property: Gets the Run as account ID. + * + * @return the runAsAccountId value. + */ + public String runAsAccountId() { + return this.runAsAccountId; + } + + /** + * Get the applianceName property: Gets the Appliance name. + * + * @return the applianceName value. + */ + public String applianceName() { + return this.applianceName; + } + + /** + * Get the message property: Gets the error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the summaryMessage property: Gets the error summary message. + * + * @return the summaryMessage value. + */ + public String summaryMessage() { + return this.summaryMessage; + } + + /** + * Get the agentScenario property: Gets the agent scenario where this error occurred. + * + * @return the agentScenario value. + */ + public String agentScenario() { + return this.agentScenario; + } + + /** + * Get the possibleCauses property: Gets the error possible causes. + * + * @return the possibleCauses value. + */ + public String possibleCauses() { + return this.possibleCauses; + } + + /** + * Get the recommendedAction property: Gets the recommended action for the error. + * + * @return the recommendedAction value. + */ + public String recommendedAction() { + return this.recommendedAction; + } + + /** + * Get the severity property: Gets the error severity. + * + * @return the severity value. + */ + public String severity() { + return this.severity; + } + + /** + * Get the messageParameters property: Gets the error message parameters. + * + * @return the messageParameters value. + */ + public List messageParameters() { + return this.messageParameters; + } + + /** + * Get the updatedTimeStamp property: Gets the time stamp when the error was updated. + * + * @return the updatedTimeStamp value. + */ + public OffsetDateTime updatedTimeStamp() { + return this.updatedTimeStamp; + } + + /** + * Get the impactedAssessmentType property: Gets the type of assessment impacted by this error. + * + * @return the impactedAssessmentType value. + */ + public String impactedAssessmentType() { + return this.impactedAssessmentType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (messageParameters() != null) { + messageParameters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Error from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Error. + */ + public static Error fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Error deserializedError = new Error(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedError.id = reader.getNullable(JsonReader::getInt); + } else if ("code".equals(fieldName)) { + deserializedError.code = reader.getString(); + } else if ("runAsAccountId".equals(fieldName)) { + deserializedError.runAsAccountId = reader.getString(); + } else if ("applianceName".equals(fieldName)) { + deserializedError.applianceName = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedError.message = reader.getString(); + } else if ("summaryMessage".equals(fieldName)) { + deserializedError.summaryMessage = reader.getString(); + } else if ("agentScenario".equals(fieldName)) { + deserializedError.agentScenario = reader.getString(); + } else if ("possibleCauses".equals(fieldName)) { + deserializedError.possibleCauses = reader.getString(); + } else if ("recommendedAction".equals(fieldName)) { + deserializedError.recommendedAction = reader.getString(); + } else if ("severity".equals(fieldName)) { + deserializedError.severity = reader.getString(); + } else if ("messageParameters".equals(fieldName)) { + List messageParameters + = reader.readArray(reader1 -> NameValuePair.fromJson(reader1)); + deserializedError.messageParameters = messageParameters; + } else if ("updatedTimeStamp".equals(fieldName)) { + deserializedError.updatedTimeStamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("impactedAssessmentType".equals(fieldName)) { + deserializedError.impactedAssessmentType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedError; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/GuestOperatingSystemArchitecture.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/GuestOperatingSystemArchitecture.java new file mode 100644 index 000000000000..61c62a860ef7 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/GuestOperatingSystemArchitecture.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Guest operating system architecture. + */ +public final class GuestOperatingSystemArchitecture extends ExpandableStringEnum { + /** + * Unknown - Guest operating system architecture. + */ + public static final GuestOperatingSystemArchitecture UNKNOWN = fromString("Unknown"); + + /** + * X86 - Guest operating system architecture. + */ + public static final GuestOperatingSystemArchitecture X86 = fromString("X86"); + + /** + * X64 - Guest operating system architecture. + */ + public static final GuestOperatingSystemArchitecture X64 = fromString("X64"); + + /** + * Creates a new instance of GuestOperatingSystemArchitecture value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GuestOperatingSystemArchitecture() { + } + + /** + * Creates or finds a GuestOperatingSystemArchitecture from its string representation. + * + * @param name a name to look for. + * @return the corresponding GuestOperatingSystemArchitecture. + */ + public static GuestOperatingSystemArchitecture fromString(String name) { + return fromString(name, GuestOperatingSystemArchitecture.class); + } + + /** + * Gets known GuestOperatingSystemArchitecture values. + * + * @return known GuestOperatingSystemArchitecture values. + */ + public static Collection values() { + return values(GuestOperatingSystemArchitecture.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LicensingProgram.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LicensingProgram.java new file mode 100644 index 000000000000..b4ee86866a69 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LicensingProgram.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The licensing program. + */ +public final class LicensingProgram extends ExpandableStringEnum { + /** + * Retail/Pay as you go. + */ + public static final LicensingProgram RETAIL = fromString("Retail"); + + /** + * Not known. + */ + public static final LicensingProgram UNKNOWN = fromString("Unknown"); + + /** + * Enterprise agreement. + */ + public static final LicensingProgram EA = fromString("EA"); + + /** + * Microsoft customer agreement. + */ + public static final LicensingProgram MCA = fromString("MCA"); + + /** + * Creates a new instance of LicensingProgram value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LicensingProgram() { + } + + /** + * Creates or finds a LicensingProgram from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicensingProgram. + */ + public static LicensingProgram fromString(String name) { + return fromString(name, LicensingProgram.class); + } + + /** + * Gets known LicensingProgram values. + * + * @return known LicensingProgram values. + */ + public static Collection values() { + return values(LicensingProgram.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageKind.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageKind.java new file mode 100644 index 000000000000..39bb94b60fde --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageKind.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Linkage kind. + */ +public final class LinkageKind extends ExpandableStringEnum { + /** + * Unknown - Linkage kind. + */ + public static final LinkageKind UNKNOWN = fromString("Unknown"); + + /** + * Machine - Linkage kind. + */ + public static final LinkageKind MACHINE = fromString("Machine"); + + /** + * Server - Linkage kind. + */ + public static final LinkageKind SERVER = fromString("Server"); + + /** + * Instance - Linkage kind. + */ + public static final LinkageKind INSTANCE = fromString("Instance"); + + /** + * WebServer - Linkage kind. + */ + public static final LinkageKind WEB_SERVER = fromString("WebServer"); + + /** + * WebApplication - Linkage kind. + */ + public static final LinkageKind WEB_APPLICATION = fromString("WebApplication"); + + /** + * Database - Linkage kind. + */ + public static final LinkageKind DATABASE = fromString("Database"); + + /** + * Creates a new instance of LinkageKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinkageKind() { + } + + /** + * Creates or finds a LinkageKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkageKind. + */ + public static LinkageKind fromString(String name) { + return fromString(name, LinkageKind.class); + } + + /** + * Gets known LinkageKind values. + * + * @return known LinkageKind values. + */ + public static Collection values() { + return values(LinkageKind.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageType.java new file mode 100644 index 000000000000..82f882230f13 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/LinkageType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Linkage type. + */ +public final class LinkageType extends ExpandableStringEnum { + /** + * Parent - Linkage type. + */ + public static final LinkageType PARENT = fromString("Parent"); + + /** + * Source - Linkage type. + */ + public static final LinkageType SOURCE = fromString("Source"); + + /** + * Creates a new instance of LinkageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinkageType() { + } + + /** + * Creates or finds a LinkageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkageType. + */ + public static LinkageType fromString(String name) { + return fromString(name, LinkageType.class); + } + + /** + * Gets known LinkageType values. + * + * @return known LinkageType values. + */ + public static Collection values() { + return values(LinkageType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Linkages.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Linkages.java new file mode 100644 index 000000000000..1127583b6b69 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Linkages.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Linkages details. + */ +@Immutable +public final class Linkages implements JsonSerializable { + /* + * The workload name + */ + private String workloadName; + + /* + * The linkage type. + */ + private LinkageType linkageType; + + /* + * The linkage kind. + */ + private LinkageKind kind; + + /* + * The arm id. + */ + private String armId; + + /** + * Creates an instance of Linkages class. + */ + private Linkages() { + } + + /** + * Get the workloadName property: The workload name. + * + * @return the workloadName value. + */ + public String workloadName() { + return this.workloadName; + } + + /** + * Get the linkageType property: The linkage type. + * + * @return the linkageType value. + */ + public LinkageType linkageType() { + return this.linkageType; + } + + /** + * Get the kind property: The linkage kind. + * + * @return the kind value. + */ + public LinkageKind kind() { + return this.kind; + } + + /** + * Get the armId property: The arm id. + * + * @return the armId value. + */ + public String armId() { + return this.armId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Linkages from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Linkages if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Linkages. + */ + public static Linkages fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Linkages deserializedLinkages = new Linkages(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workloadName".equals(fieldName)) { + deserializedLinkages.workloadName = reader.getString(); + } else if ("linkageType".equals(fieldName)) { + deserializedLinkages.linkageType = LinkageType.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedLinkages.kind = LinkageKind.fromString(reader.getString()); + } else if ("armId".equals(fieldName)) { + deserializedLinkages.armId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLinkages; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentOptionsOutboundEdgeGroup.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentOptionsOutboundEdgeGroup.java new file mode 100644 index 000000000000..e1d88e2aa842 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentOptionsOutboundEdgeGroup.java @@ -0,0 +1,319 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A class that represents the outbound edges from a given node. + */ +@Immutable +public final class MachineAssessmentOptionsOutboundEdgeGroup + implements JsonSerializable { + /* + * Gets or sets the Azure Locations. + */ + private List targetLocations; + + /* + * Gets or sets the Azure Currency. + */ + private List currencies; + + /* + * Gets or sets the Assessment Savings Options. + */ + private List savingsOptions; + + /* + * Gets or sets the Licensing Program. + */ + private List licensingProgram; + + /* + * Gets or sets the Azure VM families. + */ + private List azureVmFamilies; + + /* + * Gets or sets the Azure VM family categories. + */ + private List azureVmFamilyCategories; + + /* + * Gets or sets the premium disk support. + */ + private List premiumDiskSupport; + + /* + * Gets or sets the premium disk support. + */ + private List ultraDiskSupport; + + /* + * Gets or sets the Azure Offer Code. + */ + private List azureOfferCode; + + /* + * Gets or sets the Azure VM security options. + */ + private List azureVmSecurityOptions; + + /** + * Creates an instance of MachineAssessmentOptionsOutboundEdgeGroup class. + */ + private MachineAssessmentOptionsOutboundEdgeGroup() { + } + + /** + * Get the targetLocations property: Gets or sets the Azure Locations. + * + * @return the targetLocations value. + */ + public List targetLocations() { + return this.targetLocations; + } + + /** + * Get the currencies property: Gets or sets the Azure Currency. + * + * @return the currencies value. + */ + public List currencies() { + return this.currencies; + } + + /** + * Get the savingsOptions property: Gets or sets the Assessment Savings Options. + * + * @return the savingsOptions value. + */ + public List savingsOptions() { + return this.savingsOptions; + } + + /** + * Get the licensingProgram property: Gets or sets the Licensing Program. + * + * @return the licensingProgram value. + */ + public List licensingProgram() { + return this.licensingProgram; + } + + /** + * Get the azureVmFamilies property: Gets or sets the Azure VM families. + * + * @return the azureVmFamilies value. + */ + public List azureVmFamilies() { + return this.azureVmFamilies; + } + + /** + * Get the azureVmFamilyCategories property: Gets or sets the Azure VM family categories. + * + * @return the azureVmFamilyCategories value. + */ + public List azureVmFamilyCategories() { + return this.azureVmFamilyCategories; + } + + /** + * Get the premiumDiskSupport property: Gets or sets the premium disk support. + * + * @return the premiumDiskSupport value. + */ + public List premiumDiskSupport() { + return this.premiumDiskSupport; + } + + /** + * Get the ultraDiskSupport property: Gets or sets the premium disk support. + * + * @return the ultraDiskSupport value. + */ + public List ultraDiskSupport() { + return this.ultraDiskSupport; + } + + /** + * Get the azureOfferCode property: Gets or sets the Azure Offer Code. + * + * @return the azureOfferCode value. + */ + public List azureOfferCode() { + return this.azureOfferCode; + } + + /** + * Get the azureVmSecurityOptions property: Gets or sets the Azure VM security options. + * + * @return the azureVmSecurityOptions value. + */ + public List azureVmSecurityOptions() { + return this.azureVmSecurityOptions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetLocations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetLocations in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (currencies() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property currencies in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (savingsOptions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property savingsOptions in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (licensingProgram() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property licensingProgram in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (azureVmFamilies() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureVmFamilies in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (azureVmFamilyCategories() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureVmFamilyCategories in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (premiumDiskSupport() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property premiumDiskSupport in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (ultraDiskSupport() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ultraDiskSupport in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + if (azureOfferCode() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureOfferCode in model MachineAssessmentOptionsOutboundEdgeGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MachineAssessmentOptionsOutboundEdgeGroup.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("targetLocations", this.targetLocations, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("currencies", this.currencies, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("savingsOptions", this.savingsOptions, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("licensingProgram", this.licensingProgram, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("azureVmFamilies", this.azureVmFamilies, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("azureVmFamilyCategories", this.azureVmFamilyCategories, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("premiumDiskSupport", this.premiumDiskSupport, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("ultraDiskSupport", this.ultraDiskSupport, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("azureOfferCode", this.azureOfferCode, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("azureVmSecurityOptions", this.azureVmSecurityOptions, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentOptionsOutboundEdgeGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentOptionsOutboundEdgeGroup if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineAssessmentOptionsOutboundEdgeGroup. + */ + public static MachineAssessmentOptionsOutboundEdgeGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentOptionsOutboundEdgeGroup deserializedMachineAssessmentOptionsOutboundEdgeGroup + = new MachineAssessmentOptionsOutboundEdgeGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetLocations".equals(fieldName)) { + List targetLocations + = reader.readArray(reader1 -> AzureLocation.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.targetLocations = targetLocations; + } else if ("currencies".equals(fieldName)) { + List currencies + = reader.readArray(reader1 -> AzureCurrency.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.currencies = currencies; + } else if ("savingsOptions".equals(fieldName)) { + List savingsOptions + = reader.readArray(reader1 -> SavingsOptions.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.savingsOptions = savingsOptions; + } else if ("licensingProgram".equals(fieldName)) { + List licensingProgram + = reader.readArray(reader1 -> LicensingProgram.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.licensingProgram = licensingProgram; + } else if ("azureVmFamilies".equals(fieldName)) { + List azureVmFamilies + = reader.readArray(reader1 -> AzureVmFamily.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.azureVmFamilies = azureVmFamilies; + } else if ("azureVmFamilyCategories".equals(fieldName)) { + List azureVmFamilyCategories + = reader.readArray(reader1 -> VmFamilyCategoryItem.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.azureVmFamilyCategories + = azureVmFamilyCategories; + } else if ("premiumDiskSupport".equals(fieldName)) { + List premiumDiskSupport + = reader.readArray(reader1 -> PremiumDiskSupport.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.premiumDiskSupport = premiumDiskSupport; + } else if ("ultraDiskSupport".equals(fieldName)) { + List ultraDiskSupport + = reader.readArray(reader1 -> UltraDiskSupport.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.ultraDiskSupport = ultraDiskSupport; + } else if ("azureOfferCode".equals(fieldName)) { + List azureOfferCode + = reader.readArray(reader1 -> AzureOffer.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.azureOfferCode = azureOfferCode; + } else if ("azureVmSecurityOptions".equals(fieldName)) { + List azureVmSecurityOptions + = reader.readArray(reader1 -> AzureVmSecurityType.fromString(reader1.getString())); + deserializedMachineAssessmentOptionsOutboundEdgeGroup.azureVmSecurityOptions + = azureVmSecurityOptions; + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentOptionsOutboundEdgeGroup; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentRecommendation.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentRecommendation.java new file mode 100644 index 000000000000..0e6765218c29 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentRecommendation.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Machine Assessment Recommendation with additional properties. + */ +@Immutable +public final class MachineAssessmentRecommendation implements JsonSerializable { + /* + * The configuration data. + */ + private Configuration configuration; + + /* + * The recommended details. + */ + private RecommendedFor recommendedFor; + + /* + * The migration Platform. + */ + private MigrationPlatform migrationPlatform; + + /* + * The confidence score. + */ + private Double confidenceScore; + + /* + * The migration suitability. + */ + private MigrationSuitability migrationSuitability; + + /* + * The security suitability. + */ + private SecuritySuitability securitySuitability; + + /* + * The total cost details. + */ + private List totalCost; + + /* + * The total cost details. + */ + private List totalSavings; + + /* + * The migration issues list. + */ + private List migrationIssues; + + /* + * The Skus list. + */ + private List skus; + + /* + * VM Security Suitability Results. + */ + private List vmSecuritySuitabilityResults; + + /* + * Recommended security type for the VM. + */ + private AzureVmSecurityType recommendedVmSecurityType; + + /** + * Creates an instance of MachineAssessmentRecommendation class. + */ + private MachineAssessmentRecommendation() { + } + + /** + * Get the configuration property: The configuration data. + * + * @return the configuration value. + */ + public Configuration configuration() { + return this.configuration; + } + + /** + * Get the recommendedFor property: The recommended details. + * + * @return the recommendedFor value. + */ + public RecommendedFor recommendedFor() { + return this.recommendedFor; + } + + /** + * Get the migrationPlatform property: The migration Platform. + * + * @return the migrationPlatform value. + */ + public MigrationPlatform migrationPlatform() { + return this.migrationPlatform; + } + + /** + * Get the confidenceScore property: The confidence score. + * + * @return the confidenceScore value. + */ + public Double confidenceScore() { + return this.confidenceScore; + } + + /** + * Get the migrationSuitability property: The migration suitability. + * + * @return the migrationSuitability value. + */ + public MigrationSuitability migrationSuitability() { + return this.migrationSuitability; + } + + /** + * Get the securitySuitability property: The security suitability. + * + * @return the securitySuitability value. + */ + public SecuritySuitability securitySuitability() { + return this.securitySuitability; + } + + /** + * Get the totalCost property: The total cost details. + * + * @return the totalCost value. + */ + public List totalCost() { + return this.totalCost; + } + + /** + * Get the totalSavings property: The total cost details. + * + * @return the totalSavings value. + */ + public List totalSavings() { + return this.totalSavings; + } + + /** + * Get the migrationIssues property: The migration issues list. + * + * @return the migrationIssues value. + */ + public List migrationIssues() { + return this.migrationIssues; + } + + /** + * Get the skus property: The Skus list. + * + * @return the skus value. + */ + public List skus() { + return this.skus; + } + + /** + * Get the vmSecuritySuitabilityResults property: VM Security Suitability Results. + * + * @return the vmSecuritySuitabilityResults value. + */ + public List vmSecuritySuitabilityResults() { + return this.vmSecuritySuitabilityResults; + } + + /** + * Get the recommendedVmSecurityType property: Recommended security type for the VM. + * + * @return the recommendedVmSecurityType value. + */ + public AzureVmSecurityType recommendedVmSecurityType() { + return this.recommendedVmSecurityType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() != null) { + configuration().validate(); + } + if (recommendedFor() != null) { + recommendedFor().validate(); + } + if (migrationSuitability() != null) { + migrationSuitability().validate(); + } + if (securitySuitability() != null) { + securitySuitability().validate(); + } + if (totalCost() != null) { + totalCost().forEach(e -> e.validate()); + } + if (totalSavings() != null) { + totalSavings().forEach(e -> e.validate()); + } + if (migrationIssues() != null) { + migrationIssues().forEach(e -> e.validate()); + } + if (skus() != null) { + skus().forEach(e -> e.validate()); + } + if (vmSecuritySuitabilityResults() != null) { + vmSecuritySuitabilityResults().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentRecommendation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentRecommendation if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MachineAssessmentRecommendation. + */ + public static MachineAssessmentRecommendation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentRecommendation deserializedMachineAssessmentRecommendation + = new MachineAssessmentRecommendation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configuration".equals(fieldName)) { + deserializedMachineAssessmentRecommendation.configuration = Configuration.fromJson(reader); + } else if ("recommendedFor".equals(fieldName)) { + deserializedMachineAssessmentRecommendation.recommendedFor = RecommendedFor.fromJson(reader); + } else if ("migrationPlatform".equals(fieldName)) { + deserializedMachineAssessmentRecommendation.migrationPlatform + = MigrationPlatform.fromString(reader.getString()); + } else if ("confidenceScore".equals(fieldName)) { + deserializedMachineAssessmentRecommendation.confidenceScore + = reader.getNullable(JsonReader::getDouble); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedMachineAssessmentRecommendation.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else if ("securitySuitability".equals(fieldName)) { + deserializedMachineAssessmentRecommendation.securitySuitability + = SecuritySuitability.fromJson(reader); + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedMachineAssessmentRecommendation.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedMachineAssessmentRecommendation.totalSavings = totalSavings; + } else if ("migrationIssues".equals(fieldName)) { + List migrationIssues + = reader.readArray(reader1 -> MigrationIssues.fromJson(reader1)); + deserializedMachineAssessmentRecommendation.migrationIssues = migrationIssues; + } else if ("skus".equals(fieldName)) { + List skus + = reader.readArray(reader1 -> SkusMigrationSuitability.fromJson(reader1)); + deserializedMachineAssessmentRecommendation.skus = skus; + } else if ("vmSecuritySuitabilityResults".equals(fieldName)) { + List vmSecuritySuitabilityResults + = reader.readArray(reader1 -> VmSecuritySuitability.fromJson(reader1)); + deserializedMachineAssessmentRecommendation.vmSecuritySuitabilityResults + = vmSecuritySuitabilityResults; + } else if ("recommendedVmSecurityType".equals(fieldName)) { + deserializedMachineAssessmentRecommendation.recommendedVmSecurityType + = AzureVmSecurityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentRecommendation; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentSettings.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentSettings.java new file mode 100644 index 000000000000..708316ae1b67 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentSettings.java @@ -0,0 +1,625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of an assessment. + */ +@Fluent +public final class MachineAssessmentSettings implements JsonSerializable { + /* + * Azure Location or Azure region where to which the machines will be migrated. + */ + private String azureLocation; + + /* + * Currency in which prices should be reported. + */ + private AzureCurrency currency; + + /* + * Percentage of buffer that user wants on performance metrics when recommending + * Azure sizes. + */ + private Double scalingFactor; + + /* + * Custom discount percentage. + */ + private Double discountPercentage; + + /* + * Assessment sizing criterion. + */ + private AssessmentSizingCriterion sizingCriterion; + + /* + * Gets or sets the performance data. + */ + private PerformanceData performanceData; + + /* + * Gets or sets the savings settings. + */ + private SavingsSettings savingsSettings; + + /* + * Gets or sets the billing settings. + */ + private BillingSettings billingSettings; + + /* + * Gets or sets user configurable setting to display the environment type. + */ + private EnvironmentType environmentType; + + /* + * The azure security offering type. + */ + private AzureSecurityOfferingType azureSecurityOfferingType; + + /* + * The disk type for the assessment. + */ + private List azureDiskTypes; + + /* + * Gets or sets Azure Pricing Tier - Free, Basic, etc. + */ + private AzurePricingTier azurePricingTier; + + /* + * Gets or sets the Azure Storage Redundancy. Example: Locally Redundant Storage. + */ + private AzureStorageRedundancy azureStorageRedundancy; + + /* + * Gets or sets the user configurable setting to display the azure hybrid use + * benefit. + */ + private AzureHybridUseBenefit azureHybridUseBenefit; + + /* + * Gets or sets the user configurable setting to display the linux azure hybrid use + * benefit. + */ + private AzureHybridUseBenefit linuxAzureHybridUseBenefit; + + /* + * Gets or sets the Azure VM families. + */ + private List azureVmFamilies; + + /* + * Gets or sets the duration for which the VMs are up in the on-premises + * environment. + */ + private VmUptime vmUptime; + + /* + * Gets or sets the Azure VM security options. + */ + private List azureVmSecurityOptions; + + /** + * Creates an instance of MachineAssessmentSettings class. + */ + public MachineAssessmentSettings() { + } + + /** + * Get the azureLocation property: Azure Location or Azure region where to which the machines will be migrated. + * + * @return the azureLocation value. + */ + public String azureLocation() { + return this.azureLocation; + } + + /** + * Set the azureLocation property: Azure Location or Azure region where to which the machines will be migrated. + * + * @param azureLocation the azureLocation value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withAzureLocation(String azureLocation) { + this.azureLocation = azureLocation; + return this; + } + + /** + * Get the currency property: Currency in which prices should be reported. + * + * @return the currency value. + */ + public AzureCurrency currency() { + return this.currency; + } + + /** + * Set the currency property: Currency in which prices should be reported. + * + * @param currency the currency value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withCurrency(AzureCurrency currency) { + this.currency = currency; + return this; + } + + /** + * Get the scalingFactor property: Percentage of buffer that user wants on performance metrics when recommending + * Azure sizes. + * + * @return the scalingFactor value. + */ + public Double scalingFactor() { + return this.scalingFactor; + } + + /** + * Set the scalingFactor property: Percentage of buffer that user wants on performance metrics when recommending + * Azure sizes. + * + * @param scalingFactor the scalingFactor value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withScalingFactor(Double scalingFactor) { + this.scalingFactor = scalingFactor; + return this; + } + + /** + * Get the discountPercentage property: Custom discount percentage. + * + * @return the discountPercentage value. + */ + public Double discountPercentage() { + return this.discountPercentage; + } + + /** + * Set the discountPercentage property: Custom discount percentage. + * + * @param discountPercentage the discountPercentage value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withDiscountPercentage(Double discountPercentage) { + this.discountPercentage = discountPercentage; + return this; + } + + /** + * Get the sizingCriterion property: Assessment sizing criterion. + * + * @return the sizingCriterion value. + */ + public AssessmentSizingCriterion sizingCriterion() { + return this.sizingCriterion; + } + + /** + * Set the sizingCriterion property: Assessment sizing criterion. + * + * @param sizingCriterion the sizingCriterion value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withSizingCriterion(AssessmentSizingCriterion sizingCriterion) { + this.sizingCriterion = sizingCriterion; + return this; + } + + /** + * Get the performanceData property: Gets or sets the performance data. + * + * @return the performanceData value. + */ + public PerformanceData performanceData() { + return this.performanceData; + } + + /** + * Set the performanceData property: Gets or sets the performance data. + * + * @param performanceData the performanceData value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withPerformanceData(PerformanceData performanceData) { + this.performanceData = performanceData; + return this; + } + + /** + * Get the savingsSettings property: Gets or sets the savings settings. + * + * @return the savingsSettings value. + */ + public SavingsSettings savingsSettings() { + return this.savingsSettings; + } + + /** + * Set the savingsSettings property: Gets or sets the savings settings. + * + * @param savingsSettings the savingsSettings value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withSavingsSettings(SavingsSettings savingsSettings) { + this.savingsSettings = savingsSettings; + return this; + } + + /** + * Get the billingSettings property: Gets or sets the billing settings. + * + * @return the billingSettings value. + */ + public BillingSettings billingSettings() { + return this.billingSettings; + } + + /** + * Set the billingSettings property: Gets or sets the billing settings. + * + * @param billingSettings the billingSettings value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withBillingSettings(BillingSettings billingSettings) { + this.billingSettings = billingSettings; + return this; + } + + /** + * Get the environmentType property: Gets or sets user configurable setting to display the environment type. + * + * @return the environmentType value. + */ + public EnvironmentType environmentType() { + return this.environmentType; + } + + /** + * Set the environmentType property: Gets or sets user configurable setting to display the environment type. + * + * @param environmentType the environmentType value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withEnvironmentType(EnvironmentType environmentType) { + this.environmentType = environmentType; + return this; + } + + /** + * Get the azureSecurityOfferingType property: The azure security offering type. + * + * @return the azureSecurityOfferingType value. + */ + public AzureSecurityOfferingType azureSecurityOfferingType() { + return this.azureSecurityOfferingType; + } + + /** + * Set the azureSecurityOfferingType property: The azure security offering type. + * + * @param azureSecurityOfferingType the azureSecurityOfferingType value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings + withAzureSecurityOfferingType(AzureSecurityOfferingType azureSecurityOfferingType) { + this.azureSecurityOfferingType = azureSecurityOfferingType; + return this; + } + + /** + * Get the azureDiskTypes property: The disk type for the assessment. + * + * @return the azureDiskTypes value. + */ + public List azureDiskTypes() { + return this.azureDiskTypes; + } + + /** + * Set the azureDiskTypes property: The disk type for the assessment. + * + * @param azureDiskTypes the azureDiskTypes value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withAzureDiskTypes(List azureDiskTypes) { + this.azureDiskTypes = azureDiskTypes; + return this; + } + + /** + * Get the azurePricingTier property: Gets or sets Azure Pricing Tier - Free, Basic, etc. + * + * @return the azurePricingTier value. + */ + public AzurePricingTier azurePricingTier() { + return this.azurePricingTier; + } + + /** + * Set the azurePricingTier property: Gets or sets Azure Pricing Tier - Free, Basic, etc. + * + * @param azurePricingTier the azurePricingTier value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withAzurePricingTier(AzurePricingTier azurePricingTier) { + this.azurePricingTier = azurePricingTier; + return this; + } + + /** + * Get the azureStorageRedundancy property: Gets or sets the Azure Storage Redundancy. Example: Locally Redundant + * Storage. + * + * @return the azureStorageRedundancy value. + */ + public AzureStorageRedundancy azureStorageRedundancy() { + return this.azureStorageRedundancy; + } + + /** + * Set the azureStorageRedundancy property: Gets or sets the Azure Storage Redundancy. Example: Locally Redundant + * Storage. + * + * @param azureStorageRedundancy the azureStorageRedundancy value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withAzureStorageRedundancy(AzureStorageRedundancy azureStorageRedundancy) { + this.azureStorageRedundancy = azureStorageRedundancy; + return this; + } + + /** + * Get the azureHybridUseBenefit property: Gets or sets the user configurable setting to display the azure hybrid + * use + * benefit. + * + * @return the azureHybridUseBenefit value. + */ + public AzureHybridUseBenefit azureHybridUseBenefit() { + return this.azureHybridUseBenefit; + } + + /** + * Set the azureHybridUseBenefit property: Gets or sets the user configurable setting to display the azure hybrid + * use + * benefit. + * + * @param azureHybridUseBenefit the azureHybridUseBenefit value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withAzureHybridUseBenefit(AzureHybridUseBenefit azureHybridUseBenefit) { + this.azureHybridUseBenefit = azureHybridUseBenefit; + return this; + } + + /** + * Get the linuxAzureHybridUseBenefit property: Gets or sets the user configurable setting to display the linux + * azure hybrid use + * benefit. + * + * @return the linuxAzureHybridUseBenefit value. + */ + public AzureHybridUseBenefit linuxAzureHybridUseBenefit() { + return this.linuxAzureHybridUseBenefit; + } + + /** + * Set the linuxAzureHybridUseBenefit property: Gets or sets the user configurable setting to display the linux + * azure hybrid use + * benefit. + * + * @param linuxAzureHybridUseBenefit the linuxAzureHybridUseBenefit value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withLinuxAzureHybridUseBenefit(AzureHybridUseBenefit linuxAzureHybridUseBenefit) { + this.linuxAzureHybridUseBenefit = linuxAzureHybridUseBenefit; + return this; + } + + /** + * Get the azureVmFamilies property: Gets or sets the Azure VM families. + * + * @return the azureVmFamilies value. + */ + public List azureVmFamilies() { + return this.azureVmFamilies; + } + + /** + * Set the azureVmFamilies property: Gets or sets the Azure VM families. + * + * @param azureVmFamilies the azureVmFamilies value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withAzureVmFamilies(List azureVmFamilies) { + this.azureVmFamilies = azureVmFamilies; + return this; + } + + /** + * Get the vmUptime property: Gets or sets the duration for which the VMs are up in the on-premises + * environment. + * + * @return the vmUptime value. + */ + public VmUptime vmUptime() { + return this.vmUptime; + } + + /** + * Set the vmUptime property: Gets or sets the duration for which the VMs are up in the on-premises + * environment. + * + * @param vmUptime the vmUptime value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withVmUptime(VmUptime vmUptime) { + this.vmUptime = vmUptime; + return this; + } + + /** + * Get the azureVmSecurityOptions property: Gets or sets the Azure VM security options. + * + * @return the azureVmSecurityOptions value. + */ + public List azureVmSecurityOptions() { + return this.azureVmSecurityOptions; + } + + /** + * Set the azureVmSecurityOptions property: Gets or sets the Azure VM security options. + * + * @param azureVmSecurityOptions the azureVmSecurityOptions value to set. + * @return the MachineAssessmentSettings object itself. + */ + public MachineAssessmentSettings withAzureVmSecurityOptions(List azureVmSecurityOptions) { + this.azureVmSecurityOptions = azureVmSecurityOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (performanceData() != null) { + performanceData().validate(); + } + if (savingsSettings() != null) { + savingsSettings().validate(); + } + if (billingSettings() != null) { + billingSettings().validate(); + } + if (vmUptime() != null) { + vmUptime().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureLocation", this.azureLocation); + jsonWriter.writeStringField("currency", this.currency == null ? null : this.currency.toString()); + jsonWriter.writeNumberField("scalingFactor", this.scalingFactor); + jsonWriter.writeNumberField("discountPercentage", this.discountPercentage); + jsonWriter.writeStringField("sizingCriterion", + this.sizingCriterion == null ? null : this.sizingCriterion.toString()); + jsonWriter.writeJsonField("performanceData", this.performanceData); + jsonWriter.writeJsonField("savingsSettings", this.savingsSettings); + jsonWriter.writeJsonField("billingSettings", this.billingSettings); + jsonWriter.writeStringField("environmentType", + this.environmentType == null ? null : this.environmentType.toString()); + jsonWriter.writeStringField("azureSecurityOfferingType", + this.azureSecurityOfferingType == null ? null : this.azureSecurityOfferingType.toString()); + jsonWriter.writeArrayField("azureDiskTypes", this.azureDiskTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("azurePricingTier", + this.azurePricingTier == null ? null : this.azurePricingTier.toString()); + jsonWriter.writeStringField("azureStorageRedundancy", + this.azureStorageRedundancy == null ? null : this.azureStorageRedundancy.toString()); + jsonWriter.writeStringField("azureHybridUseBenefit", + this.azureHybridUseBenefit == null ? null : this.azureHybridUseBenefit.toString()); + jsonWriter.writeStringField("linuxAzureHybridUseBenefit", + this.linuxAzureHybridUseBenefit == null ? null : this.linuxAzureHybridUseBenefit.toString()); + jsonWriter.writeArrayField("azureVmFamilies", this.azureVmFamilies, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("vmUptime", this.vmUptime); + jsonWriter.writeArrayField("azureVmSecurityOptions", this.azureVmSecurityOptions, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MachineAssessmentSettings. + */ + public static MachineAssessmentSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentSettings deserializedMachineAssessmentSettings = new MachineAssessmentSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureLocation".equals(fieldName)) { + deserializedMachineAssessmentSettings.azureLocation = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedMachineAssessmentSettings.currency = AzureCurrency.fromString(reader.getString()); + } else if ("scalingFactor".equals(fieldName)) { + deserializedMachineAssessmentSettings.scalingFactor = reader.getNullable(JsonReader::getDouble); + } else if ("discountPercentage".equals(fieldName)) { + deserializedMachineAssessmentSettings.discountPercentage + = reader.getNullable(JsonReader::getDouble); + } else if ("sizingCriterion".equals(fieldName)) { + deserializedMachineAssessmentSettings.sizingCriterion + = AssessmentSizingCriterion.fromString(reader.getString()); + } else if ("performanceData".equals(fieldName)) { + deserializedMachineAssessmentSettings.performanceData = PerformanceData.fromJson(reader); + } else if ("savingsSettings".equals(fieldName)) { + deserializedMachineAssessmentSettings.savingsSettings = SavingsSettings.fromJson(reader); + } else if ("billingSettings".equals(fieldName)) { + deserializedMachineAssessmentSettings.billingSettings = BillingSettings.fromJson(reader); + } else if ("environmentType".equals(fieldName)) { + deserializedMachineAssessmentSettings.environmentType + = EnvironmentType.fromString(reader.getString()); + } else if ("azureSecurityOfferingType".equals(fieldName)) { + deserializedMachineAssessmentSettings.azureSecurityOfferingType + = AzureSecurityOfferingType.fromString(reader.getString()); + } else if ("azureDiskTypes".equals(fieldName)) { + List azureDiskTypes + = reader.readArray(reader1 -> AzureDiskType.fromString(reader1.getString())); + deserializedMachineAssessmentSettings.azureDiskTypes = azureDiskTypes; + } else if ("azurePricingTier".equals(fieldName)) { + deserializedMachineAssessmentSettings.azurePricingTier + = AzurePricingTier.fromString(reader.getString()); + } else if ("azureStorageRedundancy".equals(fieldName)) { + deserializedMachineAssessmentSettings.azureStorageRedundancy + = AzureStorageRedundancy.fromString(reader.getString()); + } else if ("azureHybridUseBenefit".equals(fieldName)) { + deserializedMachineAssessmentSettings.azureHybridUseBenefit + = AzureHybridUseBenefit.fromString(reader.getString()); + } else if ("linuxAzureHybridUseBenefit".equals(fieldName)) { + deserializedMachineAssessmentSettings.linuxAzureHybridUseBenefit + = AzureHybridUseBenefit.fromString(reader.getString()); + } else if ("azureVmFamilies".equals(fieldName)) { + List azureVmFamilies + = reader.readArray(reader1 -> AzureVmFamily.fromString(reader1.getString())); + deserializedMachineAssessmentSettings.azureVmFamilies = azureVmFamilies; + } else if ("vmUptime".equals(fieldName)) { + deserializedMachineAssessmentSettings.vmUptime = VmUptime.fromJson(reader); + } else if ("azureVmSecurityOptions".equals(fieldName)) { + List azureVmSecurityOptions + = reader.readArray(reader1 -> AzureVmSecurityType.fromString(reader1.getString())); + deserializedMachineAssessmentSettings.azureVmSecurityOptions = azureVmSecurityOptions; + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentSettings; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2.java new file mode 100644 index 000000000000..62cd04520662 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2Inner; + +/** + * An immutable client-side representation of MachineAssessmentV2. + */ +public interface MachineAssessmentV2 { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + MachineAssessmentV2Properties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2Inner object. + * + * @return the inner object. + */ + MachineAssessmentV2Inner innerModel(); + + /** + * The entirety of the MachineAssessmentV2 definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The MachineAssessmentV2 definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the MachineAssessmentV2 definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the MachineAssessmentV2 definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, projectName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @return the next definition stage. + */ + WithCreate withExistingAssessmentProject(String resourceGroupName, String projectName); + } + + /** + * The stage of the MachineAssessmentV2 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + MachineAssessmentV2 create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MachineAssessmentV2 create(Context context); + } + + /** + * The stage of the MachineAssessmentV2 definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(MachineAssessmentV2Properties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MachineAssessmentV2 refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MachineAssessmentV2 refresh(Context context); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(DownloadUrlRequest body); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(DownloadUrlRequest body, Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Properties.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Properties.java new file mode 100644 index 000000000000..a227e8c1f765 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Properties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Assessment properties class. + */ +@Fluent +public final class MachineAssessmentV2Properties implements JsonSerializable { + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /* + * Gets or sets the scope of assessment. + */ + private Scope scope; + + /* + * Gets or sets the settings for the assessment. + */ + private MachineAssessmentSettings settings; + + /* + * Gets or sets the details of the assessment. + */ + private AssessmentDetails details; + + /** + * Creates an instance of MachineAssessmentV2Properties class. + */ + public MachineAssessmentV2Properties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the scope property: Gets or sets the scope of assessment. + * + * @return the scope value. + */ + public Scope scope() { + return this.scope; + } + + /** + * Set the scope property: Gets or sets the scope of assessment. + * + * @param scope the scope value to set. + * @return the MachineAssessmentV2Properties object itself. + */ + public MachineAssessmentV2Properties withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get the settings property: Gets or sets the settings for the assessment. + * + * @return the settings value. + */ + public MachineAssessmentSettings settings() { + return this.settings; + } + + /** + * Set the settings property: Gets or sets the settings for the assessment. + * + * @param settings the settings value to set. + * @return the MachineAssessmentV2Properties object itself. + */ + public MachineAssessmentV2Properties withSettings(MachineAssessmentSettings settings) { + this.settings = settings; + return this; + } + + /** + * Get the details property: Gets or sets the details of the assessment. + * + * @return the details value. + */ + public AssessmentDetails details() { + return this.details; + } + + /** + * Set the details property: Gets or sets the details of the assessment. + * + * @param details the details value to set. + * @return the MachineAssessmentV2Properties object itself. + */ + public MachineAssessmentV2Properties withDetails(AssessmentDetails details) { + this.details = details; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scope() != null) { + scope().validate(); + } + if (settings() != null) { + settings().validate(); + } + if (details() != null) { + details().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("scope", this.scope); + jsonWriter.writeJsonField("settings", this.settings); + jsonWriter.writeJsonField("details", this.details); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineAssessmentV2Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineAssessmentV2Properties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MachineAssessmentV2Properties. + */ + public static MachineAssessmentV2Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineAssessmentV2Properties deserializedMachineAssessmentV2Properties + = new MachineAssessmentV2Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedMachineAssessmentV2Properties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedMachineAssessmentV2Properties.scope = Scope.fromJson(reader); + } else if ("settings".equals(fieldName)) { + deserializedMachineAssessmentV2Properties.settings = MachineAssessmentSettings.fromJson(reader); + } else if ("details".equals(fieldName)) { + deserializedMachineAssessmentV2Properties.details = AssessmentDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMachineAssessmentV2Properties; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Summary.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Summary.java new file mode 100644 index 000000000000..903184413130 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2Summary.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2SummaryInner; + +/** + * An immutable client-side representation of MachineAssessmentV2Summary. + */ +public interface MachineAssessmentV2Summary { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SummaryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2SummaryInner object. + * + * @return the inner object. + */ + MachineAssessmentV2SummaryInner innerModel(); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2SummaryOperations.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2SummaryOperations.java new file mode 100644 index 000000000000..4ab44c7450de --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentV2SummaryOperations.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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 MachineAssessmentV2SummaryOperations. + */ +public interface MachineAssessmentV2SummaryOperations { + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + String assessmentName, String summaryName, Context context); + + /** + * Get a MachineAssessmentV2Summary. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param summaryName Gets the Name of the Machine 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 MachineAssessmentV2Summary. + */ + MachineAssessmentV2Summary get(String resourceGroupName, String projectName, String assessmentName, + String summaryName); + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 the response of a MachineAssessmentV2Summary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName); + + /** + * List MachineAssessmentV2Summary resources by MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 response of a MachineAssessmentV2Summary list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + String assessmentName, Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentsV2Operations.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentsV2Operations.java new file mode 100644 index 000000000000..02a3a1ba7f34 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineAssessmentsV2Operations.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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 MachineAssessmentsV2Operations. + */ +public interface MachineAssessmentsV2Operations { + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, String assessmentName, + Context context); + + /** + * Get a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 MachineAssessmentV2. + */ + MachineAssessmentV2 get(String resourceGroupName, String projectName, String assessmentName); + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 the response of a MachineAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List MachineAssessmentV2 resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineAssessmentV2 list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, Context context); + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, String assessmentName, + Context context); + + /** + * Delete a MachineAssessmentV2. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM 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 projectName, String assessmentName); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body); + + /** + * Get download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project Name. + * @param assessmentName Machine Assessment V2 ARM name. + * @param body The content of the action request. + * @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 download URL for the assessment report. + * + * Get the URL for downloading the assessment in a report format. + */ + DownloadUrl downloadUrl(String resourceGroupName, String projectName, String assessmentName, + DownloadUrlRequest body, Context context); + + /** + * Get a MachineAssessmentV2. + * + * @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 MachineAssessmentV2 along with {@link Response}. + */ + MachineAssessmentV2 getById(String id); + + /** + * Get a MachineAssessmentV2. + * + * @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 MachineAssessmentV2 along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a MachineAssessmentV2. + * + * @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); + + /** + * Delete a MachineAssessmentV2. + * + * @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 MachineAssessmentV2 resource. + * + * @param name resource name. + * @return the first stage of the new MachineAssessmentV2 definition. + */ + MachineAssessmentV2.DefinitionStages.Blank define(String name); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineBootType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineBootType.java new file mode 100644 index 000000000000..7fe2888a97ca --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineBootType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Machine Boot Type. + */ +public final class MachineBootType extends ExpandableStringEnum { + /** + * Unknown - Machine Boot Type. + */ + public static final MachineBootType UNKNOWN = fromString("Unknown"); + + /** + * EFI - Machine Boot Type. + */ + public static final MachineBootType EFI = fromString("EFI"); + + /** + * BIOS - Machine Boot Type. + */ + public static final MachineBootType BIOS = fromString("BIOS"); + + /** + * NotSpecified - Machine Boot Type. + */ + public static final MachineBootType NOT_SPECIFIED = fromString("NotSpecified"); + + /** + * Creates a new instance of MachineBootType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MachineBootType() { + } + + /** + * Creates or finds a MachineBootType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MachineBootType. + */ + public static MachineBootType fromString(String name) { + return fromString(name, MachineBootType.class); + } + + /** + * Gets known MachineBootType values. + * + * @return known MachineBootType values. + */ + public static Collection values() { + return values(MachineBootType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptions.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptions.java new file mode 100644 index 000000000000..20dbae863970 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptions.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.migrate.fluent.models.MachineGraphAssessmentOptionsInner; + +/** + * An immutable client-side representation of MachineGraphAssessmentOptions. + */ +public interface MachineGraphAssessmentOptions { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + MachineGraphAssessmentOptionsProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.migrate.fluent.models.MachineGraphAssessmentOptionsInner object. + * + * @return the inner object. + */ + MachineGraphAssessmentOptionsInner innerModel(); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsOperations.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsOperations.java new file mode 100644 index 000000000000..a00838e31e90 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsOperations.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.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 MachineGraphAssessmentOptionsOperations. + */ +public interface MachineGraphAssessmentOptionsOperations { + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String projectName, + Context context); + + /** + * Get a MachineGraphAssessmentOptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 MachineGraphAssessmentOptions. + */ + MachineGraphAssessmentOptions get(String resourceGroupName, String projectName); + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 the response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName); + + /** + * List MachineGraphAssessmentOptions resources by AssessmentProject. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param projectName Assessment Project 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 response of a MachineGraphAssessmentOptions list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByParent(String resourceGroupName, String projectName, + Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsProperties.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsProperties.java new file mode 100644 index 000000000000..6765a67ce728 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MachineGraphAssessmentOptionsProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The properties of the assessment options. + */ +@Immutable +public final class MachineGraphAssessmentOptionsProperties + implements JsonSerializable { + /* + * Gets or sets the edges. + */ + private Map edges; + + /** + * Creates an instance of MachineGraphAssessmentOptionsProperties class. + */ + private MachineGraphAssessmentOptionsProperties() { + } + + /** + * Get the edges property: Gets or sets the edges. + * + * @return the edges value. + */ + public Map edges() { + return this.edges; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (edges() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property edges in model MachineGraphAssessmentOptionsProperties")); + } else { + edges().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MachineGraphAssessmentOptionsProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("edges", this.edges, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MachineGraphAssessmentOptionsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MachineGraphAssessmentOptionsProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MachineGraphAssessmentOptionsProperties. + */ + public static MachineGraphAssessmentOptionsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MachineGraphAssessmentOptionsProperties deserializedMachineGraphAssessmentOptionsProperties + = new MachineGraphAssessmentOptionsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edges".equals(fieldName)) { + Map edges + = reader.readMap(reader1 -> MachineAssessmentOptionsOutboundEdgeGroup.fromJson(reader1)); + deserializedMachineGraphAssessmentOptionsProperties.edges = edges; + } else { + reader.skipChildren(); + } + } + + return deserializedMachineGraphAssessmentOptionsProperties; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ManagementDetails.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ManagementDetails.java new file mode 100644 index 000000000000..6adda471800e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ManagementDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Management details. + */ +@Immutable +public final class ManagementDetails implements JsonSerializable { + /* + * The management summary name. + */ + private AzureManagementOfferingType name; + + /* + * The management suitability summary. + */ + private List readinessSummary; + + /** + * Creates an instance of ManagementDetails class. + */ + private ManagementDetails() { + } + + /** + * Get the name property: The management summary name. + * + * @return the name value. + */ + public AzureManagementOfferingType name() { + return this.name; + } + + /** + * Get the readinessSummary property: The management suitability summary. + * + * @return the readinessSummary value. + */ + public List readinessSummary() { + return this.readinessSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (readinessSummary() != null) { + readinessSummary().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagementDetails. + */ + public static ManagementDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementDetails deserializedManagementDetails = new ManagementDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagementDetails.name = AzureManagementOfferingType.fromString(reader.getString()); + } else if ("readinessSummary".equals(fieldName)) { + List readinessSummary + = reader.readArray(reader1 -> NameValuePairCloudSuitabilityCommon.fromJson(reader1)); + deserializedManagementDetails.readinessSummary = readinessSummary; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementDetails; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrateWorkloadType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrateWorkloadType.java new file mode 100644 index 000000000000..e13364e1e08e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrateWorkloadType.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Workload type. + */ +public final class MigrateWorkloadType extends ExpandableStringEnum { + /** + * Unknown - Migration Workload type. + */ + public static final MigrateWorkloadType UNKNOWN = fromString("Unknown"); + + /** + * Machine - Migration Workload type. + */ + public static final MigrateWorkloadType MACHINE = fromString("Machine"); + + /** + * Server - Migration Workload type. + */ + public static final MigrateWorkloadType SERVER = fromString("Server"); + + /** + * Instance - Migration Workload type. + */ + public static final MigrateWorkloadType INSTANCE = fromString("Instance"); + + /** + * WebServer - Migration Workload type. + */ + public static final MigrateWorkloadType WEB_SERVER = fromString("WebServer"); + + /** + * WebApplication - Migration Workload type. + */ + public static final MigrateWorkloadType WEB_APPLICATION = fromString("WebApplication"); + + /** + * Database - Migration Workload type. + */ + public static final MigrateWorkloadType DATABASE = fromString("Database"); + + /** + * Host - Migration Workload type. + */ + public static final MigrateWorkloadType HOST = fromString("Host"); + + /** + * ManagementServer - Migration Workload type. + */ + public static final MigrateWorkloadType MANAGEMENT_SERVER = fromString("ManagementServer"); + + /** + * Creates a new instance of MigrateWorkloadType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrateWorkloadType() { + } + + /** + * Creates or finds a MigrateWorkloadType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrateWorkloadType. + */ + public static MigrateWorkloadType fromString(String name) { + return fromString(name, MigrateWorkloadType.class); + } + + /** + * Gets known MigrateWorkloadType values. + * + * @return known MigrateWorkloadType values. + */ + public static Collection values() { + return values(MigrateWorkloadType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationDetails.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationDetails.java new file mode 100644 index 000000000000..5cde63afa126 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationDetails.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Migration details. + */ +@Immutable +public final class MigrationDetails implements JsonSerializable { + /* + * The readiness summary. + */ + private List readinessSummary; + + /* + * The migration type + */ + private MigrationType migrationType; + + /** + * Creates an instance of MigrationDetails class. + */ + private MigrationDetails() { + } + + /** + * Get the readinessSummary property: The readiness summary. + * + * @return the readinessSummary value. + */ + public List readinessSummary() { + return this.readinessSummary; + } + + /** + * Get the migrationType property: The migration type. + * + * @return the migrationType value. + */ + public MigrationType migrationType() { + return this.migrationType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (readinessSummary() != null) { + readinessSummary().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationDetails. + */ + public static MigrationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationDetails deserializedMigrationDetails = new MigrationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("readinessSummary".equals(fieldName)) { + List readinessSummary + = reader.readArray(reader1 -> NameValuePairCloudSuitabilityCommon.fromJson(reader1)); + deserializedMigrationDetails.readinessSummary = readinessSummary; + } else if ("migrationType".equals(fieldName)) { + deserializedMigrationDetails.migrationType = MigrationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationDetails; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssues.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssues.java new file mode 100644 index 000000000000..7b3ac13ec3ee --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssues.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Migration issues. + */ +@Immutable +public final class MigrationIssues implements JsonSerializable { + /* + * The issue id. + */ + private String issueCode; + + /* + * The issue category. + */ + private MigrationIssuesCategory issueCategory; + + /* + * The issue description. + */ + private String issueDescription; + + /* + * The possible causes. + */ + private String possibleCause; + + /* + * The recommended action. + */ + private List recommendedActions; + + /* + * The more information list. + */ + private List moreInformation; + + /** + * Creates an instance of MigrationIssues class. + */ + private MigrationIssues() { + } + + /** + * Get the issueCode property: The issue id. + * + * @return the issueCode value. + */ + public String issueCode() { + return this.issueCode; + } + + /** + * Get the issueCategory property: The issue category. + * + * @return the issueCategory value. + */ + public MigrationIssuesCategory issueCategory() { + return this.issueCategory; + } + + /** + * Get the issueDescription property: The issue description. + * + * @return the issueDescription value. + */ + public String issueDescription() { + return this.issueDescription; + } + + /** + * Get the possibleCause property: The possible causes. + * + * @return the possibleCause value. + */ + public String possibleCause() { + return this.possibleCause; + } + + /** + * Get the recommendedActions property: The recommended action. + * + * @return the recommendedActions value. + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * Get the moreInformation property: The more information list. + * + * @return the moreInformation value. + */ + public List moreInformation() { + return this.moreInformation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (moreInformation() != null) { + moreInformation().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationIssues from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationIssues if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationIssues. + */ + public static MigrationIssues fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationIssues deserializedMigrationIssues = new MigrationIssues(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueCode".equals(fieldName)) { + deserializedMigrationIssues.issueCode = reader.getString(); + } else if ("issueCategory".equals(fieldName)) { + deserializedMigrationIssues.issueCategory = MigrationIssuesCategory.fromString(reader.getString()); + } else if ("issueDescription".equals(fieldName)) { + deserializedMigrationIssues.issueDescription = reader.getString(); + } else if ("possibleCause".equals(fieldName)) { + deserializedMigrationIssues.possibleCause = reader.getString(); + } else if ("recommendedActions".equals(fieldName)) { + List recommendedActions = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrationIssues.recommendedActions = recommendedActions; + } else if ("moreInformation".equals(fieldName)) { + List moreInformation + = reader.readArray(reader1 -> MoreInformation.fromJson(reader1)); + deserializedMigrationIssues.moreInformation = moreInformation; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationIssues; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssuesCategory.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssuesCategory.java new file mode 100644 index 000000000000..5f6520249e6b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationIssuesCategory.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Issues Category. + */ +public final class MigrationIssuesCategory extends ExpandableStringEnum { + /** + * Issue - Migration Issues Category. + */ + public static final MigrationIssuesCategory ISSUE = fromString("Issue"); + + /** + * Warning - Migration Issues Category. + */ + public static final MigrationIssuesCategory WARNING = fromString("Warning"); + + /** + * Internal - Migration Issues Category. + */ + public static final MigrationIssuesCategory INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of MigrationIssuesCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationIssuesCategory() { + } + + /** + * Creates or finds a MigrationIssuesCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationIssuesCategory. + */ + public static MigrationIssuesCategory fromString(String name) { + return fromString(name, MigrationIssuesCategory.class); + } + + /** + * Gets known MigrationIssuesCategory values. + * + * @return known MigrationIssuesCategory values. + */ + public static Collection values() { + return values(MigrationIssuesCategory.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationPlatform.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationPlatform.java new file mode 100644 index 000000000000..32cd1ec71561 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationPlatform.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Platform. + */ +public final class MigrationPlatform extends ExpandableStringEnum { + /** + * Unknown - Migration Platform. + */ + public static final MigrationPlatform UNKNOWN = fromString("Unknown"); + + /** + * PaaS - Migration Platform. + */ + public static final MigrationPlatform PAAS = fromString("PaaS"); + + /** + * IaaS - Migration Platform. + */ + public static final MigrationPlatform IAAS = fromString("IaaS"); + + /** + * SaaS - Migration Platform. + */ + public static final MigrationPlatform SAAS = fromString("SaaS"); + + /** + * Creates a new instance of MigrationPlatform value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationPlatform() { + } + + /** + * Creates or finds a MigrationPlatform from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationPlatform. + */ + public static MigrationPlatform fromString(String name) { + return fromString(name, MigrationPlatform.class); + } + + /** + * Gets known MigrationPlatform values. + * + * @return known MigrationPlatform values. + */ + public static Collection values() { + return values(MigrationPlatform.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationSuitability.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationSuitability.java new file mode 100644 index 000000000000..f286ee68bdc2 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationSuitability.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The migration suitability. + */ +@Immutable +public final class MigrationSuitability implements JsonSerializable { + /* + * The migration suitability. + */ + private CloudSuitabilityCommon readiness; + + /** + * Creates an instance of MigrationSuitability class. + */ + private MigrationSuitability() { + } + + /** + * Get the readiness property: The migration suitability. + * + * @return the readiness value. + */ + public CloudSuitabilityCommon readiness() { + return this.readiness; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrationSuitability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrationSuitability if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrationSuitability. + */ + public static MigrationSuitability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrationSuitability deserializedMigrationSuitability = new MigrationSuitability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("readiness".equals(fieldName)) { + deserializedMigrationSuitability.readiness = CloudSuitabilityCommon.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMigrationSuitability; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationType.java new file mode 100644 index 000000000000..224fb148b483 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MigrationType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration Type. + */ +public final class MigrationType extends ExpandableStringEnum { + /** + * Unknown - Migration Type. + */ + public static final MigrationType UNKNOWN = fromString("Unknown"); + + /** + * Replatform - Migration Type. + */ + public static final MigrationType REPLATFORM = fromString("Replatform"); + + /** + * Rehost - Migration Type. + */ + public static final MigrationType REHOST = fromString("Rehost"); + + /** + * Retain - Migration Type. + */ + public static final MigrationType RETAIN = fromString("Retain"); + + /** + * Rearchitect - Migration Type. + */ + public static final MigrationType REARCHITECT = fromString("Rearchitect"); + + /** + * Creates a new instance of MigrationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationType() { + } + + /** + * Creates or finds a MigrationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationType. + */ + public static MigrationType fromString(String name) { + return fromString(name, MigrationType.class); + } + + /** + * Gets known MigrationType values. + * + * @return known MigrationType values. + */ + public static Collection values() { + return values(MigrationType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MoreInformation.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MoreInformation.java new file mode 100644 index 000000000000..fd4878ecb276 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/MoreInformation.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * More information details. + */ +@Immutable +public final class MoreInformation implements JsonSerializable { + /* + * The title of the information. + */ + private String title; + + /* + * The URL of the information. + */ + private String url; + + /** + * Creates an instance of MoreInformation class. + */ + private MoreInformation() { + } + + /** + * Get the title property: The title of the information. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the url property: The URL of the information. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MoreInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MoreInformation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MoreInformation. + */ + public static MoreInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MoreInformation deserializedMoreInformation = new MoreInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedMoreInformation.title = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedMoreInformation.url = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMoreInformation; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePair.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePair.java new file mode 100644 index 000000000000..34bf7171c7d0 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePair.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The generic name value pair. + */ +@Immutable +public final class NameValuePair implements JsonSerializable { + /* + * The name. + */ + private String name; + + /* + * The value. + */ + private String value; + + /** + * Creates an instance of NameValuePair class. + */ + private NameValuePair() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameValuePair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameValuePair if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NameValuePair. + */ + public static NameValuePair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameValuePair deserializedNameValuePair = new NameValuePair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNameValuePair.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedNameValuePair.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameValuePair; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCloudSuitabilityCommon.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCloudSuitabilityCommon.java new file mode 100644 index 000000000000..2d58f7a61607 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCloudSuitabilityCommon.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The generic name value pair. + */ +@Immutable +public final class NameValuePairCloudSuitabilityCommon + implements JsonSerializable { + /* + * The name. + */ + private CloudSuitabilityCommon name; + + /* + * The value. + */ + private Integer value; + + /** + * Creates an instance of NameValuePairCloudSuitabilityCommon class. + */ + private NameValuePairCloudSuitabilityCommon() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public CloudSuitabilityCommon name() { + return this.name; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public Integer value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameValuePairCloudSuitabilityCommon from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameValuePairCloudSuitabilityCommon if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NameValuePairCloudSuitabilityCommon. + */ + public static NameValuePairCloudSuitabilityCommon fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameValuePairCloudSuitabilityCommon deserializedNameValuePairCloudSuitabilityCommon + = new NameValuePairCloudSuitabilityCommon(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNameValuePairCloudSuitabilityCommon.name + = CloudSuitabilityCommon.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedNameValuePairCloudSuitabilityCommon.value = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNameValuePairCloudSuitabilityCommon; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCostType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCostType.java new file mode 100644 index 000000000000..076c1b618916 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairCostType.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The generic name value pair. + */ +@Immutable +public final class NameValuePairCostType implements JsonSerializable { + /* + * The name. + */ + private CostType name; + + /* + * The value. + */ + private Double value; + + /** + * Creates an instance of NameValuePairCostType class. + */ + private NameValuePairCostType() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public CostType name() { + return this.name; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public Double value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameValuePairCostType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameValuePairCostType if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NameValuePairCostType. + */ + public static NameValuePairCostType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameValuePairCostType deserializedNameValuePairCostType = new NameValuePairCostType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNameValuePairCostType.name = CostType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedNameValuePairCostType.value = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedNameValuePairCostType; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairSavingsType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairSavingsType.java new file mode 100644 index 000000000000..8079a262716b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/NameValuePairSavingsType.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The generic name value pair. + */ +@Immutable +public final class NameValuePairSavingsType implements JsonSerializable { + /* + * The name. + */ + private SavingsType name; + + /* + * The value. + */ + private Double value; + + /** + * Creates an instance of NameValuePairSavingsType class. + */ + private NameValuePairSavingsType() { + } + + /** + * Get the name property: The name. + * + * @return the name value. + */ + public SavingsType name() { + return this.name; + } + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public Double value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NameValuePairSavingsType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameValuePairSavingsType if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NameValuePairSavingsType. + */ + public static NameValuePairSavingsType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameValuePairSavingsType deserializedNameValuePairSavingsType = new NameValuePairSavingsType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNameValuePairSavingsType.name = SavingsType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedNameValuePairSavingsType.value = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedNameValuePairSavingsType; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operation.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operation.java new file mode 100644 index 000000000000..c541d46c08f5 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.resourcemanager.migrate.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.migrate.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/OperationDisplay.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/OperationDisplay.java new file mode 100644 index 000000000000..8f4ee02055c1 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for and operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operations.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operations.java new file mode 100644 index 000000000000..55c0aab29b73 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Origin.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Origin.java new file mode 100644 index 000000000000..81f94e362d26 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Percentile.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Percentile.java new file mode 100644 index 000000000000..4a171e014c04 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Percentile.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Percentile for Performance Data. + */ +public final class Percentile extends ExpandableStringEnum { + /** + * Percentile 50. + */ + public static final Percentile PERCENTILE50 = fromString("Percentile50"); + + /** + * Percentile 90. + */ + public static final Percentile PERCENTILE90 = fromString("Percentile90"); + + /** + * Percentile 95. + */ + public static final Percentile PERCENTILE95 = fromString("Percentile95"); + + /** + * Percentile 99. + */ + public static final Percentile PERCENTILE99 = fromString("Percentile99"); + + /** + * Percentile unknown. + */ + public static final Percentile PERCENTILE_UNKNOWN = fromString("PercentileUnknown"); + + /** + * Creates a new instance of Percentile value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Percentile() { + } + + /** + * Creates or finds a Percentile from its string representation. + * + * @param name a name to look for. + * @return the corresponding Percentile. + */ + public static Percentile fromString(String name) { + return fromString(name, Percentile.class); + } + + /** + * Gets known Percentile values. + * + * @return known Percentile values. + */ + public static Collection values() { + return values(Percentile.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PerformanceData.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PerformanceData.java new file mode 100644 index 000000000000..4d0988e1d306 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PerformanceData.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Performance data class. + */ +@Fluent +public final class PerformanceData implements JsonSerializable { + /* + * Percentile of the utilization data values to be considered while assessing + * machines. + */ + private Percentile percentile; + + /* + * Time Range for which the historic utilization data should be considered for + * assessment. + */ + private TimeRange timeRange; + + /* + * Gets or sets the start time to consider performance data for assessment. + */ + private OffsetDateTime perfDataStartTime; + + /* + * Gets or sets the end time to consider performance data for assessment. + */ + private OffsetDateTime perfDataEndTime; + + /** + * Creates an instance of PerformanceData class. + */ + public PerformanceData() { + } + + /** + * Get the percentile property: Percentile of the utilization data values to be considered while assessing + * machines. + * + * @return the percentile value. + */ + public Percentile percentile() { + return this.percentile; + } + + /** + * Set the percentile property: Percentile of the utilization data values to be considered while assessing + * machines. + * + * @param percentile the percentile value to set. + * @return the PerformanceData object itself. + */ + public PerformanceData withPercentile(Percentile percentile) { + this.percentile = percentile; + return this; + } + + /** + * Get the timeRange property: Time Range for which the historic utilization data should be considered for + * assessment. + * + * @return the timeRange value. + */ + public TimeRange timeRange() { + return this.timeRange; + } + + /** + * Set the timeRange property: Time Range for which the historic utilization data should be considered for + * assessment. + * + * @param timeRange the timeRange value to set. + * @return the PerformanceData object itself. + */ + public PerformanceData withTimeRange(TimeRange timeRange) { + this.timeRange = timeRange; + return this; + } + + /** + * Get the perfDataStartTime property: Gets or sets the start time to consider performance data for assessment. + * + * @return the perfDataStartTime value. + */ + public OffsetDateTime perfDataStartTime() { + return this.perfDataStartTime; + } + + /** + * Set the perfDataStartTime property: Gets or sets the start time to consider performance data for assessment. + * + * @param perfDataStartTime the perfDataStartTime value to set. + * @return the PerformanceData object itself. + */ + public PerformanceData withPerfDataStartTime(OffsetDateTime perfDataStartTime) { + this.perfDataStartTime = perfDataStartTime; + return this; + } + + /** + * Get the perfDataEndTime property: Gets or sets the end time to consider performance data for assessment. + * + * @return the perfDataEndTime value. + */ + public OffsetDateTime perfDataEndTime() { + return this.perfDataEndTime; + } + + /** + * Set the perfDataEndTime property: Gets or sets the end time to consider performance data for assessment. + * + * @param perfDataEndTime the perfDataEndTime value to set. + * @return the PerformanceData object itself. + */ + public PerformanceData withPerfDataEndTime(OffsetDateTime perfDataEndTime) { + this.perfDataEndTime = perfDataEndTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("percentile", this.percentile == null ? null : this.percentile.toString()); + jsonWriter.writeStringField("timeRange", this.timeRange == null ? null : this.timeRange.toString()); + jsonWriter.writeStringField("perfDataStartTime", + this.perfDataStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.perfDataStartTime)); + jsonWriter.writeStringField("perfDataEndTime", + this.perfDataEndTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.perfDataEndTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PerformanceData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PerformanceData if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PerformanceData. + */ + public static PerformanceData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PerformanceData deserializedPerformanceData = new PerformanceData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("percentile".equals(fieldName)) { + deserializedPerformanceData.percentile = Percentile.fromString(reader.getString()); + } else if ("timeRange".equals(fieldName)) { + deserializedPerformanceData.timeRange = TimeRange.fromString(reader.getString()); + } else if ("perfDataStartTime".equals(fieldName)) { + deserializedPerformanceData.perfDataStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("perfDataEndTime".equals(fieldName)) { + deserializedPerformanceData.perfDataEndTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPerformanceData; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PremiumDiskSupport.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PremiumDiskSupport.java new file mode 100644 index 000000000000..83ee0d325540 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/PremiumDiskSupport.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Premium Disk Support. + */ +public final class PremiumDiskSupport extends ExpandableStringEnum { + /** + * Premium Disk Supported. + */ + public static final PremiumDiskSupport PREMIUM_DISK_SUPPORTED = fromString("PremiumDiskSupported"); + + /** + * Premium Disk Not Supported. + */ + public static final PremiumDiskSupport PREMIUM_DISK_NOT_SUPPORTED = fromString("PremiumDiskNotSupported"); + + /** + * Creates a new instance of PremiumDiskSupport value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PremiumDiskSupport() { + } + + /** + * Creates or finds a PremiumDiskSupport from its string representation. + * + * @param name a name to look for. + * @return the corresponding PremiumDiskSupport. + */ + public static PremiumDiskSupport fromString(String name) { + return fromString(name, PremiumDiskSupport.class); + } + + /** + * Gets known PremiumDiskSupport values. + * + * @return known PremiumDiskSupport values. + */ + public static Collection values() { + return values(PremiumDiskSupport.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProcessorInfo.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProcessorInfo.java new file mode 100644 index 000000000000..fe403b423699 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProcessorInfo.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a information \ details of a processor. + */ +@Immutable +public final class ProcessorInfo implements JsonSerializable { + /* + * Gets or sets the name \ model of a processor. + */ + private String name; + + /* + * Gets or sets the number of sockets. + */ + private Integer numberOfSockets; + + /* + * Gets or sets the number of cores in a socket. + */ + private Integer numberOfCoresPerSocket; + + /** + * Creates an instance of ProcessorInfo class. + */ + private ProcessorInfo() { + } + + /** + * Get the name property: Gets or sets the name \ model of a processor. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the numberOfSockets property: Gets or sets the number of sockets. + * + * @return the numberOfSockets value. + */ + public Integer numberOfSockets() { + return this.numberOfSockets; + } + + /** + * Get the numberOfCoresPerSocket property: Gets or sets the number of cores in a socket. + * + * @return the numberOfCoresPerSocket value. + */ + public Integer numberOfCoresPerSocket() { + return this.numberOfCoresPerSocket; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("numberOfSockets", this.numberOfSockets); + jsonWriter.writeNumberField("numberOfCoresPerSocket", this.numberOfCoresPerSocket); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProcessorInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProcessorInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProcessorInfo. + */ + public static ProcessorInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProcessorInfo deserializedProcessorInfo = new ProcessorInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProcessorInfo.name = reader.getString(); + } else if ("numberOfSockets".equals(fieldName)) { + deserializedProcessorInfo.numberOfSockets = reader.getNullable(JsonReader::getInt); + } else if ("numberOfCoresPerSocket".equals(fieldName)) { + deserializedProcessorInfo.numberOfCoresPerSocket = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedProcessorInfo; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProductSupportStatus.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProductSupportStatus.java new file mode 100644 index 000000000000..3e7ea8059001 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProductSupportStatus.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Class to represent the Product Support Status. + */ +@Immutable +public final class ProductSupportStatus implements JsonSerializable { + /* + * Gets or sets current version of ServicePack. + */ + private String currentVersion; + + /* + * Gets or sets ServicePack of the product. + */ + private String servicePackStatus; + + /* + * Gets or sets the Extended Security Update ESU status. + */ + private String esuStatus; + + /* + * Gets or sets the support status of the product. + */ + private String supportStatus; + + /* + * Gets or sets the ETA. + */ + private Integer eta; + + /* + * Gets or sets the current ESU support year. + */ + private String currentEsuYear; + + /* + * Gets or sets the main stream end date of the product. + */ + private OffsetDateTime mainstreamEndDate; + + /* + * Gets or sets the extended support end date of the product. + */ + private OffsetDateTime extendedSupportEndDate; + + /* + * Gets or sets the extended security update year 1 end date of the product. + */ + private OffsetDateTime extendedSecurityUpdateYear1EndDate; + + /* + * Gets or sets the extended security update year 2 end date of the product. + */ + private OffsetDateTime extendedSecurityUpdateYear2EndDate; + + /* + * Gets or sets the extended security update year 3 end date of the product. + */ + private OffsetDateTime extendedSecurityUpdateYear3EndDate; + + /** + * Creates an instance of ProductSupportStatus class. + */ + private ProductSupportStatus() { + } + + /** + * Get the currentVersion property: Gets or sets current version of ServicePack. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Get the servicePackStatus property: Gets or sets ServicePack of the product. + * + * @return the servicePackStatus value. + */ + public String servicePackStatus() { + return this.servicePackStatus; + } + + /** + * Get the esuStatus property: Gets or sets the Extended Security Update ESU status. + * + * @return the esuStatus value. + */ + public String esuStatus() { + return this.esuStatus; + } + + /** + * Get the supportStatus property: Gets or sets the support status of the product. + * + * @return the supportStatus value. + */ + public String supportStatus() { + return this.supportStatus; + } + + /** + * Get the eta property: Gets or sets the ETA. + * + * @return the eta value. + */ + public Integer eta() { + return this.eta; + } + + /** + * Get the currentEsuYear property: Gets or sets the current ESU support year. + * + * @return the currentEsuYear value. + */ + public String currentEsuYear() { + return this.currentEsuYear; + } + + /** + * Get the mainstreamEndDate property: Gets or sets the main stream end date of the product. + * + * @return the mainstreamEndDate value. + */ + public OffsetDateTime mainstreamEndDate() { + return this.mainstreamEndDate; + } + + /** + * Get the extendedSupportEndDate property: Gets or sets the extended support end date of the product. + * + * @return the extendedSupportEndDate value. + */ + public OffsetDateTime extendedSupportEndDate() { + return this.extendedSupportEndDate; + } + + /** + * Get the extendedSecurityUpdateYear1EndDate property: Gets or sets the extended security update year 1 end date of + * the product. + * + * @return the extendedSecurityUpdateYear1EndDate value. + */ + public OffsetDateTime extendedSecurityUpdateYear1EndDate() { + return this.extendedSecurityUpdateYear1EndDate; + } + + /** + * Get the extendedSecurityUpdateYear2EndDate property: Gets or sets the extended security update year 2 end date of + * the product. + * + * @return the extendedSecurityUpdateYear2EndDate value. + */ + public OffsetDateTime extendedSecurityUpdateYear2EndDate() { + return this.extendedSecurityUpdateYear2EndDate; + } + + /** + * Get the extendedSecurityUpdateYear3EndDate property: Gets or sets the extended security update year 3 end date of + * the product. + * + * @return the extendedSecurityUpdateYear3EndDate value. + */ + public OffsetDateTime extendedSecurityUpdateYear3EndDate() { + return this.extendedSecurityUpdateYear3EndDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductSupportStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductSupportStatus if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProductSupportStatus. + */ + public static ProductSupportStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductSupportStatus deserializedProductSupportStatus = new ProductSupportStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentVersion".equals(fieldName)) { + deserializedProductSupportStatus.currentVersion = reader.getString(); + } else if ("servicePackStatus".equals(fieldName)) { + deserializedProductSupportStatus.servicePackStatus = reader.getString(); + } else if ("esuStatus".equals(fieldName)) { + deserializedProductSupportStatus.esuStatus = reader.getString(); + } else if ("supportStatus".equals(fieldName)) { + deserializedProductSupportStatus.supportStatus = reader.getString(); + } else if ("eta".equals(fieldName)) { + deserializedProductSupportStatus.eta = reader.getNullable(JsonReader::getInt); + } else if ("currentEsuYear".equals(fieldName)) { + deserializedProductSupportStatus.currentEsuYear = reader.getString(); + } else if ("mainstreamEndDate".equals(fieldName)) { + deserializedProductSupportStatus.mainstreamEndDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("extendedSupportEndDate".equals(fieldName)) { + deserializedProductSupportStatus.extendedSupportEndDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("extendedSecurityUpdateYear1EndDate".equals(fieldName)) { + deserializedProductSupportStatus.extendedSecurityUpdateYear1EndDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("extendedSecurityUpdateYear2EndDate".equals(fieldName)) { + deserializedProductSupportStatus.extendedSecurityUpdateYear2EndDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("extendedSecurityUpdateYear3EndDate".equals(fieldName)) { + deserializedProductSupportStatus.extendedSecurityUpdateYear3EndDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedProductSupportStatus; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProvisioningState.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProvisioningState.java new file mode 100644 index 000000000000..661f6af3216b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ProvisioningState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the current operation. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Resource provisioning Successful. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource provisioning Failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Resource provisioning Canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Resource is being Provisioned. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Resource is being Updated. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Resource is being Deleted. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Resource is being Accepted. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/RecommendedFor.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/RecommendedFor.java new file mode 100644 index 000000000000..3c09bfe7aff5 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/RecommendedFor.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The recommended details. + */ +@Immutable +public final class RecommendedFor implements JsonSerializable { + /* + * The list of strategy type. + */ + private List strategies; + + /** + * Creates an instance of RecommendedFor class. + */ + private RecommendedFor() { + } + + /** + * Get the strategies property: The list of strategy type. + * + * @return the strategies value. + */ + public List strategies() { + return this.strategies; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendedFor from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendedFor if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecommendedFor. + */ + public static RecommendedFor fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendedFor deserializedRecommendedFor = new RecommendedFor(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("strategies".equals(fieldName)) { + List strategies + = reader.readArray(reader1 -> StrategyType.fromString(reader1.getString())); + deserializedRecommendedFor.strategies = strategies; + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendedFor; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsDetailsCommon.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsDetailsCommon.java new file mode 100644 index 000000000000..43211b3465f5 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsDetailsCommon.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The savings details. + */ +@Immutable +public final class SavingsDetailsCommon implements JsonSerializable { + /* + * The savings options. + */ + private SavingsOptions savingOptions; + + /* + * The sku cost details per azure offer type. + */ + private List savingsDetail; + + /** + * Creates an instance of SavingsDetailsCommon class. + */ + private SavingsDetailsCommon() { + } + + /** + * Get the savingOptions property: The savings options. + * + * @return the savingOptions value. + */ + public SavingsOptions savingOptions() { + return this.savingOptions; + } + + /** + * Get the savingsDetail property: The sku cost details per azure offer type. + * + * @return the savingsDetail value. + */ + public List savingsDetail() { + return this.savingsDetail; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (savingsDetail() != null) { + savingsDetail().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SavingsDetailsCommon from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SavingsDetailsCommon if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SavingsDetailsCommon. + */ + public static SavingsDetailsCommon fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SavingsDetailsCommon deserializedSavingsDetailsCommon = new SavingsDetailsCommon(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("savingOptions".equals(fieldName)) { + deserializedSavingsDetailsCommon.savingOptions = SavingsOptions.fromString(reader.getString()); + } else if ("savingsDetail".equals(fieldName)) { + List savingsDetail + = reader.readArray(reader1 -> NameValuePairSavingsType.fromJson(reader1)); + deserializedSavingsDetailsCommon.savingsDetail = savingsDetail; + } else { + reader.skipChildren(); + } + } + + return deserializedSavingsDetailsCommon; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsOptions.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsOptions.java new file mode 100644 index 000000000000..ada7eed70ebf --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsOptions.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The savings options. + */ +public final class SavingsOptions extends ExpandableStringEnum { + /** + * No savings options. + */ + public static final SavingsOptions NONE = fromString("None"); + + /** + * Reserved Instance for 1 year. + */ + public static final SavingsOptions RI1YEAR = fromString("RI1Year"); + + /** + * Reserved Instance for 3 years. + */ + public static final SavingsOptions RI3YEAR = fromString("RI3Year"); + + /** + * The savings plan for 1 year. + */ + public static final SavingsOptions SAVINGS_PLAN1YEAR = fromString("SavingsPlan1Year"); + + /** + * The savings plan for 3 years. + */ + public static final SavingsOptions SAVINGS_PLAN3YEAR = fromString("SavingsPlan3Year"); + + /** + * Custom azure offer code. + */ + public static final SavingsOptions CUSTOM_AZURE_OFFER_CODE = fromString("CustomAzureOfferCode"); + + /** + * Creates a new instance of SavingsOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SavingsOptions() { + } + + /** + * Creates or finds a SavingsOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding SavingsOptions. + */ + public static SavingsOptions fromString(String name) { + return fromString(name, SavingsOptions.class); + } + + /** + * Gets known SavingsOptions values. + * + * @return known SavingsOptions values. + */ + public static Collection values() { + return values(SavingsOptions.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsSettings.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsSettings.java new file mode 100644 index 000000000000..37e9f35d0096 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsSettings.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Savings settings class. + */ +@Fluent +public final class SavingsSettings implements JsonSerializable { + /* + * Gets or sets the savings options. + */ + private SavingsOptions savingsOptions; + + /* + * Gets or sets the Azure offer code. + */ + private AzureOffer azureOfferCode; + + /** + * Creates an instance of SavingsSettings class. + */ + public SavingsSettings() { + } + + /** + * Get the savingsOptions property: Gets or sets the savings options. + * + * @return the savingsOptions value. + */ + public SavingsOptions savingsOptions() { + return this.savingsOptions; + } + + /** + * Set the savingsOptions property: Gets or sets the savings options. + * + * @param savingsOptions the savingsOptions value to set. + * @return the SavingsSettings object itself. + */ + public SavingsSettings withSavingsOptions(SavingsOptions savingsOptions) { + this.savingsOptions = savingsOptions; + return this; + } + + /** + * Get the azureOfferCode property: Gets or sets the Azure offer code. + * + * @return the azureOfferCode value. + */ + public AzureOffer azureOfferCode() { + return this.azureOfferCode; + } + + /** + * Set the azureOfferCode property: Gets or sets the Azure offer code. + * + * @param azureOfferCode the azureOfferCode value to set. + * @return the SavingsSettings object itself. + */ + public SavingsSettings withAzureOfferCode(AzureOffer azureOfferCode) { + this.azureOfferCode = azureOfferCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("savingsOptions", + this.savingsOptions == null ? null : this.savingsOptions.toString()); + jsonWriter.writeStringField("azureOfferCode", + this.azureOfferCode == null ? null : this.azureOfferCode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SavingsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SavingsSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SavingsSettings. + */ + public static SavingsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SavingsSettings deserializedSavingsSettings = new SavingsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("savingsOptions".equals(fieldName)) { + deserializedSavingsSettings.savingsOptions = SavingsOptions.fromString(reader.getString()); + } else if ("azureOfferCode".equals(fieldName)) { + deserializedSavingsSettings.azureOfferCode = AzureOffer.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSavingsSettings; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsType.java new file mode 100644 index 000000000000..b973f9265774 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SavingsType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Savings type. + */ +public final class SavingsType extends ExpandableStringEnum { + /** + * MonthlyAzureHybridCostSavings - Savings type. + */ + public static final SavingsType MONTHLY_AZURE_HYBRID_COST_SAVINGS = fromString("MonthlyAzureHybridCostSavings"); + + /** + * MonthlyLinuxAzureHybridCostSavings - Savings type. + */ + public static final SavingsType MONTHLY_LINUX_AZURE_HYBRID_COST_SAVINGS + = fromString("MonthlyLinuxAzureHybridCostSavings"); + + /** + * MonthlyAhubSqlCostSavings - Savings type. + */ + public static final SavingsType MONTHLY_AHUB_SQL_COST_SAVINGS = fromString("MonthlyAhubSqlCostSavings"); + + /** + * MonthlyVcfByolCostDifference - Savings type. + */ + public static final SavingsType MONTHLY_VCF_BYOL_COST_DIFFERENCE = fromString("MonthlyVcfByolCostDifference"); + + /** + * Creates a new instance of SavingsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SavingsType() { + } + + /** + * Creates or finds a SavingsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SavingsType. + */ + public static SavingsType fromString(String name) { + return fromString(name, SavingsType.class); + } + + /** + * Gets known SavingsType values. + * + * @return known SavingsType values. + */ + public static Collection values() { + return values(SavingsType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Scope.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Scope.java new file mode 100644 index 000000000000..b75114ef71fa --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/Scope.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Scope of the assessment. + */ +@Fluent +public final class Scope implements JsonSerializable { + /* + * The scope type + */ + private ScopeType scopeType; + + /* + * The server group arm id. + */ + private String serverGroupId; + + /* + * The ARG query. + */ + private String azureResourceGraphQuery; + + /** + * Creates an instance of Scope class. + */ + public Scope() { + } + + /** + * Get the scopeType property: The scope type. + * + * @return the scopeType value. + */ + public ScopeType scopeType() { + return this.scopeType; + } + + /** + * Set the scopeType property: The scope type. + * + * @param scopeType the scopeType value to set. + * @return the Scope object itself. + */ + public Scope withScopeType(ScopeType scopeType) { + this.scopeType = scopeType; + return this; + } + + /** + * Get the serverGroupId property: The server group arm id. + * + * @return the serverGroupId value. + */ + public String serverGroupId() { + return this.serverGroupId; + } + + /** + * Set the serverGroupId property: The server group arm id. + * + * @param serverGroupId the serverGroupId value to set. + * @return the Scope object itself. + */ + public Scope withServerGroupId(String serverGroupId) { + this.serverGroupId = serverGroupId; + return this; + } + + /** + * Get the azureResourceGraphQuery property: The ARG query. + * + * @return the azureResourceGraphQuery value. + */ + public String azureResourceGraphQuery() { + return this.azureResourceGraphQuery; + } + + /** + * Set the azureResourceGraphQuery property: The ARG query. + * + * @param azureResourceGraphQuery the azureResourceGraphQuery value to set. + * @return the Scope object itself. + */ + public Scope withAzureResourceGraphQuery(String azureResourceGraphQuery) { + this.azureResourceGraphQuery = azureResourceGraphQuery; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scopeType", this.scopeType == null ? null : this.scopeType.toString()); + jsonWriter.writeStringField("serverGroupId", this.serverGroupId); + jsonWriter.writeStringField("azureResourceGraphQuery", this.azureResourceGraphQuery); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Scope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Scope if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Scope. + */ + public static Scope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Scope deserializedScope = new Scope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scopeType".equals(fieldName)) { + deserializedScope.scopeType = ScopeType.fromString(reader.getString()); + } else if ("serverGroupId".equals(fieldName)) { + deserializedScope.serverGroupId = reader.getString(); + } else if ("azureResourceGraphQuery".equals(fieldName)) { + deserializedScope.azureResourceGraphQuery = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScope; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ScopeType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ScopeType.java new file mode 100644 index 000000000000..959dec746dea --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/ScopeType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Scope type. + */ +public final class ScopeType extends ExpandableStringEnum { + /** + * ServerGroupId - Scope type. + */ + public static final ScopeType SERVER_GROUP_ID = fromString("ServerGroupId"); + + /** + * AzureResourceGraphQuery - Scope type. + */ + public static final ScopeType AZURE_RESOURCE_GRAPH_QUERY = fromString("AzureResourceGraphQuery"); + + /** + * Creates a new instance of ScopeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScopeType() { + } + + /** + * Creates or finds a ScopeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScopeType. + */ + public static ScopeType fromString(String name) { + return fromString(name, ScopeType.class); + } + + /** + * Gets known ScopeType values. + * + * @return known ScopeType values. + */ + public static Collection values() { + return values(ScopeType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SecuritySuitability.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SecuritySuitability.java new file mode 100644 index 000000000000..d1ba381e4988 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SecuritySuitability.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The security suitability. + */ +@Immutable +public final class SecuritySuitability implements JsonSerializable { + /* + * The security suitability. + */ + private CloudSuitabilityCommon readiness; + + /** + * Creates an instance of SecuritySuitability class. + */ + private SecuritySuitability() { + } + + /** + * Get the readiness property: The security suitability. + * + * @return the readiness value. + */ + public CloudSuitabilityCommon readiness() { + return this.readiness; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecuritySuitability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecuritySuitability if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecuritySuitability. + */ + public static SecuritySuitability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecuritySuitability deserializedSecuritySuitability = new SecuritySuitability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("readiness".equals(fieldName)) { + deserializedSecuritySuitability.readiness = CloudSuitabilityCommon.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecuritySuitability; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuDetails.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuDetails.java new file mode 100644 index 000000000000..fe4153c1b793 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuDetails.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Sku details. + */ +@Immutable +public final class SkuDetails implements JsonSerializable { + /* + * The sku type. + */ + private SkuType skuType; + + /* + * The sku name. + */ + private String skuName; + + /* + * The capabilities. + */ + private List capabilities; + + /* + * The sku cost details. + */ + private List totalCost; + + /* + * The sku savings details. + */ + private List totalSavings; + + /** + * Creates an instance of SkuDetails class. + */ + private SkuDetails() { + } + + /** + * Get the skuType property: The sku type. + * + * @return the skuType value. + */ + public SkuType skuType() { + return this.skuType; + } + + /** + * Get the skuName property: The sku name. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Get the capabilities property: The capabilities. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the totalCost property: The sku cost details. + * + * @return the totalCost value. + */ + public List totalCost() { + return this.totalCost; + } + + /** + * Get the totalSavings property: The sku savings details. + * + * @return the totalSavings value. + */ + public List totalSavings() { + return this.totalSavings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (totalCost() != null) { + totalCost().forEach(e -> e.validate()); + } + if (totalSavings() != null) { + totalSavings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuDetails if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SkuDetails. + */ + public static SkuDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuDetails deserializedSkuDetails = new SkuDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skuType".equals(fieldName)) { + deserializedSkuDetails.skuType = SkuType.fromString(reader.getString()); + } else if ("skuName".equals(fieldName)) { + deserializedSkuDetails.skuName = reader.getString(); + } else if ("capabilities".equals(fieldName)) { + List capabilities = reader.readArray(reader1 -> NameValuePair.fromJson(reader1)); + deserializedSkuDetails.capabilities = capabilities; + } else if ("totalCost".equals(fieldName)) { + List totalCost + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedSkuDetails.totalCost = totalCost; + } else if ("totalSavings".equals(fieldName)) { + List totalSavings + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedSkuDetails.totalSavings = totalSavings; + } else { + reader.skipChildren(); + } + } + + return deserializedSkuDetails; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuKind.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuKind.java new file mode 100644 index 000000000000..469d90e50ee8 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Sku Kind. + */ +public final class SkuKind extends ExpandableStringEnum { + /** + * Endpoint - Sku Kind. + */ + public static final SkuKind ENDPOINT = fromString("Endpoint"); + + /** + * Details - Sku Kind. + */ + public static final SkuKind DETAILS = fromString("Details"); + + /** + * Creates a new instance of SkuKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuKind() { + } + + /** + * Creates or finds a SkuKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuKind. + */ + public static SkuKind fromString(String name) { + return fromString(name, SkuKind.class); + } + + /** + * Gets known SkuKind values. + * + * @return known SkuKind values. + */ + public static Collection values() { + return values(SkuKind.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuType.java new file mode 100644 index 000000000000..9287ac8c9761 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkuType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Sku type. + */ +public final class SkuType extends ExpandableStringEnum { + /** + * Unknown - Sku type. + */ + public static final SkuType UNKNOWN = fromString("Unknown"); + + /** + * Compute - Sku type. + */ + public static final SkuType COMPUTE = fromString("Compute"); + + /** + * Storage - Sku type. + */ + public static final SkuType STORAGE = fromString("Storage"); + + /** + * Network - Sku type. + */ + public static final SkuType NETWORK = fromString("Network"); + + /** + * AppServicePlan - Sku type. + */ + public static final SkuType APP_SERVICE_PLAN = fromString("AppServicePlan"); + + /** + * AzureSpringApps - Sku type. + */ + public static final SkuType AZURE_SPRING_APPS = fromString("AzureSpringApps"); + + /** + * Creates a new instance of SkuType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuType() { + } + + /** + * Creates or finds a SkuType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuType. + */ + public static SkuType fromString(String name) { + return fromString(name, SkuType.class); + } + + /** + * Gets known SkuType values. + * + * @return known SkuType values. + */ + public static Collection values() { + return values(SkuType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkusMigrationSuitability.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkusMigrationSuitability.java new file mode 100644 index 000000000000..a38f5e9e9f4a --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SkusMigrationSuitability.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Skus details. + */ +@Immutable +public final class SkusMigrationSuitability implements JsonSerializable { + /* + * The Sku kind. + */ + private SkuKind kind; + + /* + * The resource uri. + */ + private String resourceUri; + + /* + * The sku name. + */ + private String displayName; + + /* + * The sku id. + */ + private String id; + + /* + * The sku type. + */ + private SkuType type; + + /* + * The source name. + */ + private List sources; + + /* + * The sku details. + */ + private SkuDetails details; + + /** + * Creates an instance of SkusMigrationSuitability class. + */ + private SkusMigrationSuitability() { + } + + /** + * Get the kind property: The Sku kind. + * + * @return the kind value. + */ + public SkuKind kind() { + return this.kind; + } + + /** + * Get the resourceUri property: The resource uri. + * + * @return the resourceUri value. + */ + public String resourceUri() { + return this.resourceUri; + } + + /** + * Get the displayName property: The sku name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the id property: The sku id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the type property: The sku type. + * + * @return the type value. + */ + public SkuType type() { + return this.type; + } + + /** + * Get the sources property: The source name. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Get the details property: The sku details. + * + * @return the details value. + */ + public SkuDetails details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sources() != null) { + sources().forEach(e -> e.validate()); + } + if (details() != null) { + details().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkusMigrationSuitability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkusMigrationSuitability if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SkusMigrationSuitability. + */ + public static SkusMigrationSuitability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkusMigrationSuitability deserializedSkusMigrationSuitability = new SkusMigrationSuitability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedSkusMigrationSuitability.kind = SkuKind.fromString(reader.getString()); + } else if ("resourceUri".equals(fieldName)) { + deserializedSkusMigrationSuitability.resourceUri = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedSkusMigrationSuitability.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSkusMigrationSuitability.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSkusMigrationSuitability.type = SkuType.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources + = reader.readArray(reader1 -> SourceRecommendationMigrationSuitability.fromJson(reader1)); + deserializedSkusMigrationSuitability.sources = sources; + } else if ("details".equals(fieldName)) { + deserializedSkusMigrationSuitability.details = SkuDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSkusMigrationSuitability; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceDetails.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceDetails.java new file mode 100644 index 000000000000..e47f60b477f0 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Source details. + */ +@Immutable +public final class SourceDetails implements JsonSerializable { + /* + * The source name. + */ + private AssessmentSource sourceName; + + /* + * The source type. + */ + private MigrateWorkloadType sourceType; + + /* + * The migration platform. + */ + private MigrationPlatform platform; + + /* + * The count of a type of source. + */ + private Integer count; + + /** + * Creates an instance of SourceDetails class. + */ + private SourceDetails() { + } + + /** + * Get the sourceName property: The source name. + * + * @return the sourceName value. + */ + public AssessmentSource sourceName() { + return this.sourceName; + } + + /** + * Get the sourceType property: The source type. + * + * @return the sourceType value. + */ + public MigrateWorkloadType sourceType() { + return this.sourceType; + } + + /** + * Get the platform property: The migration platform. + * + * @return the platform value. + */ + public MigrationPlatform platform() { + return this.platform; + } + + /** + * Get the count property: The count of a type of source. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceDetails. + */ + public static SourceDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceDetails deserializedSourceDetails = new SourceDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceName".equals(fieldName)) { + deserializedSourceDetails.sourceName = AssessmentSource.fromString(reader.getString()); + } else if ("sourceType".equals(fieldName)) { + deserializedSourceDetails.sourceType = MigrateWorkloadType.fromString(reader.getString()); + } else if ("platform".equals(fieldName)) { + deserializedSourceDetails.platform = MigrationPlatform.fromString(reader.getString()); + } else if ("count".equals(fieldName)) { + deserializedSourceDetails.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceDetails; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceRecommendationMigrationSuitability.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceRecommendationMigrationSuitability.java new file mode 100644 index 000000000000..bcb7c43e08fb --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SourceRecommendationMigrationSuitability.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Source recommendation details. + */ +@Immutable +public final class SourceRecommendationMigrationSuitability + implements JsonSerializable { + /* + * The sku name. + */ + private String name; + + /* + * The sku type. + */ + private MigrationSuitability migrationSuitability; + + /** + * Creates an instance of SourceRecommendationMigrationSuitability class. + */ + private SourceRecommendationMigrationSuitability() { + } + + /** + * Get the name property: The sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the migrationSuitability property: The sku type. + * + * @return the migrationSuitability value. + */ + public MigrationSuitability migrationSuitability() { + return this.migrationSuitability; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migrationSuitability() != null) { + migrationSuitability().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceRecommendationMigrationSuitability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceRecommendationMigrationSuitability if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SourceRecommendationMigrationSuitability. + */ + public static SourceRecommendationMigrationSuitability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceRecommendationMigrationSuitability deserializedSourceRecommendationMigrationSuitability + = new SourceRecommendationMigrationSuitability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSourceRecommendationMigrationSuitability.name = reader.getString(); + } else if ("migrationSuitability".equals(fieldName)) { + deserializedSourceRecommendationMigrationSuitability.migrationSuitability + = MigrationSuitability.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceRecommendationMigrationSuitability; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/StrategyType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/StrategyType.java new file mode 100644 index 000000000000..ca5b8c1b97f3 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/StrategyType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Strategy type. + */ +public final class StrategyType extends ExpandableStringEnum { + /** + * PaaSPreferred - Strategy type. + */ + public static final StrategyType PAA_SPREFERRED = fromString("PaaSPreferred"); + + /** + * CostOptimized - Strategy type. + */ + public static final StrategyType COST_OPTIMIZED = fromString("CostOptimized"); + + /** + * EffortOptimized - Strategy type. + */ + public static final StrategyType EFFORT_OPTIMIZED = fromString("EffortOptimized"); + + /** + * Creates a new instance of StrategyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StrategyType() { + } + + /** + * Creates or finds a StrategyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StrategyType. + */ + public static StrategyType fromString(String name) { + return fromString(name, StrategyType.class); + } + + /** + * Gets known StrategyType values. + * + * @return known StrategyType values. + */ + public static Collection values() { + return values(StrategyType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryProperties.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryProperties.java new file mode 100644 index 000000000000..353c40a29854 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryProperties.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Summary properties class. + */ +@Immutable +public final class SummaryProperties implements JsonSerializable { + /* + * The summary type + */ + private SummaryType summaryType; + + /* + * The summary name + */ + private String summaryName; + + /* + * The source details list. + */ + private List sources; + + /* + * The target details list. + */ + private List targets; + + /* + * The target source mapping. + */ + private List targetSourceMapping; + + /* + * The cost components. + */ + private List costComponents; + + /* + * The cost components. + */ + private List savingsComponents; + + /** + * Creates an instance of SummaryProperties class. + */ + private SummaryProperties() { + } + + /** + * Get the summaryType property: The summary type. + * + * @return the summaryType value. + */ + public SummaryType summaryType() { + return this.summaryType; + } + + /** + * Get the summaryName property: The summary name. + * + * @return the summaryName value. + */ + public String summaryName() { + return this.summaryName; + } + + /** + * Get the sources property: The source details list. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Get the targets property: The target details list. + * + * @return the targets value. + */ + public List targets() { + return this.targets; + } + + /** + * Get the targetSourceMapping property: The target source mapping. + * + * @return the targetSourceMapping value. + */ + public List targetSourceMapping() { + return this.targetSourceMapping; + } + + /** + * Get the costComponents property: The cost components. + * + * @return the costComponents value. + */ + public List costComponents() { + return this.costComponents; + } + + /** + * Get the savingsComponents property: The cost components. + * + * @return the savingsComponents value. + */ + public List savingsComponents() { + return this.savingsComponents; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sources() != null) { + sources().forEach(e -> e.validate()); + } + if (targets() != null) { + targets().forEach(e -> e.validate()); + } + if (targetSourceMapping() != null) { + targetSourceMapping().forEach(e -> e.validate()); + } + if (costComponents() != null) { + costComponents().forEach(e -> e.validate()); + } + if (savingsComponents() != null) { + savingsComponents().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SummaryProperties. + */ + public static SummaryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryProperties deserializedSummaryProperties = new SummaryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("summaryType".equals(fieldName)) { + deserializedSummaryProperties.summaryType = SummaryType.fromString(reader.getString()); + } else if ("summaryName".equals(fieldName)) { + deserializedSummaryProperties.summaryName = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> SourceDetails.fromJson(reader1)); + deserializedSummaryProperties.sources = sources; + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> TargetDetails.fromJson(reader1)); + deserializedSummaryProperties.targets = targets; + } else if ("targetSourceMapping".equals(fieldName)) { + List targetSourceMapping + = reader.readArray(reader1 -> TargetSourcePair.fromJson(reader1)); + deserializedSummaryProperties.targetSourceMapping = targetSourceMapping; + } else if ("costComponents".equals(fieldName)) { + List costComponents + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedSummaryProperties.costComponents = costComponents; + } else if ("savingsComponents".equals(fieldName)) { + List savingsComponents + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedSummaryProperties.savingsComponents = savingsComponents; + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryProperties; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryType.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryType.java new file mode 100644 index 000000000000..8c2a32450556 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/SummaryType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Summary Type. + */ +public final class SummaryType extends ExpandableStringEnum { + /** + * Unknown - Summary Type. + */ + public static final SummaryType UNKNOWN = fromString("Unknown"); + + /** + * Strategy - Summary Type. + */ + public static final SummaryType STRATEGY = fromString("Strategy"); + + /** + * Target - Summary Type. + */ + public static final SummaryType TARGET = fromString("Target"); + + /** + * Creates a new instance of SummaryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SummaryType() { + } + + /** + * Creates or finds a SummaryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SummaryType. + */ + public static SummaryType fromString(String name) { + return fromString(name, SummaryType.class); + } + + /** + * Gets known SummaryType values. + * + * @return known SummaryType values. + */ + public static Collection values() { + return values(SummaryType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetDetails.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetDetails.java new file mode 100644 index 000000000000..7c6732598252 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Target details. + */ +@Immutable +public final class TargetDetails implements JsonSerializable { + /* + * The target name. + */ + private AzureTarget targetName; + + /* + * The target type. + */ + private MigrateWorkloadType targetType; + + /* + * The migration platform. + */ + private MigrationPlatform platform; + + /* + * The count of a type of source. + */ + private Integer count; + + /** + * Creates an instance of TargetDetails class. + */ + private TargetDetails() { + } + + /** + * Get the targetName property: The target name. + * + * @return the targetName value. + */ + public AzureTarget targetName() { + return this.targetName; + } + + /** + * Get the targetType property: The target type. + * + * @return the targetType value. + */ + public MigrateWorkloadType targetType() { + return this.targetType; + } + + /** + * Get the platform property: The migration platform. + * + * @return the platform value. + */ + public MigrationPlatform platform() { + return this.platform; + } + + /** + * Get the count property: The count of a type of source. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetDetails. + */ + public static TargetDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetDetails deserializedTargetDetails = new TargetDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetName".equals(fieldName)) { + deserializedTargetDetails.targetName = AzureTarget.fromString(reader.getString()); + } else if ("targetType".equals(fieldName)) { + deserializedTargetDetails.targetType = MigrateWorkloadType.fromString(reader.getString()); + } else if ("platform".equals(fieldName)) { + deserializedTargetDetails.platform = MigrationPlatform.fromString(reader.getString()); + } else if ("count".equals(fieldName)) { + deserializedTargetDetails.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetDetails; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetSourcePair.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetSourcePair.java new file mode 100644 index 000000000000..9caff40246a2 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TargetSourcePair.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Target source pair. + */ +@Immutable +public final class TargetSourcePair implements JsonSerializable { + /* + * The source name. + */ + private AssessmentSource sourceRef; + + /* + * The target name. + */ + private AzureTarget targetRef; + + /* + * The count of a type of source. + */ + private Integer sourceCount; + + /* + * The count of a type of target. + */ + private Integer targetCount; + + /* + * The migration details. + */ + private MigrationDetails migrationDetails; + + /* + * The management details. + */ + private List managementDetails; + + /* + * The cost details. + */ + private List costDetails; + + /* + * The savings details. + */ + private List savingsDetails; + + /* + * The confidence score. + */ + private Double confidenceScore; + + /** + * Creates an instance of TargetSourcePair class. + */ + private TargetSourcePair() { + } + + /** + * Get the sourceRef property: The source name. + * + * @return the sourceRef value. + */ + public AssessmentSource sourceRef() { + return this.sourceRef; + } + + /** + * Get the targetRef property: The target name. + * + * @return the targetRef value. + */ + public AzureTarget targetRef() { + return this.targetRef; + } + + /** + * Get the sourceCount property: The count of a type of source. + * + * @return the sourceCount value. + */ + public Integer sourceCount() { + return this.sourceCount; + } + + /** + * Get the targetCount property: The count of a type of target. + * + * @return the targetCount value. + */ + public Integer targetCount() { + return this.targetCount; + } + + /** + * Get the migrationDetails property: The migration details. + * + * @return the migrationDetails value. + */ + public MigrationDetails migrationDetails() { + return this.migrationDetails; + } + + /** + * Get the managementDetails property: The management details. + * + * @return the managementDetails value. + */ + public List managementDetails() { + return this.managementDetails; + } + + /** + * Get the costDetails property: The cost details. + * + * @return the costDetails value. + */ + public List costDetails() { + return this.costDetails; + } + + /** + * Get the savingsDetails property: The savings details. + * + * @return the savingsDetails value. + */ + public List savingsDetails() { + return this.savingsDetails; + } + + /** + * Get the confidenceScore property: The confidence score. + * + * @return the confidenceScore value. + */ + public Double confidenceScore() { + return this.confidenceScore; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (migrationDetails() != null) { + migrationDetails().validate(); + } + if (managementDetails() != null) { + managementDetails().forEach(e -> e.validate()); + } + if (costDetails() != null) { + costDetails().forEach(e -> e.validate()); + } + if (savingsDetails() != null) { + savingsDetails().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TargetSourcePair from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TargetSourcePair if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TargetSourcePair. + */ + public static TargetSourcePair fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TargetSourcePair deserializedTargetSourcePair = new TargetSourcePair(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceRef".equals(fieldName)) { + deserializedTargetSourcePair.sourceRef = AssessmentSource.fromString(reader.getString()); + } else if ("targetRef".equals(fieldName)) { + deserializedTargetSourcePair.targetRef = AzureTarget.fromString(reader.getString()); + } else if ("sourceCount".equals(fieldName)) { + deserializedTargetSourcePair.sourceCount = reader.getNullable(JsonReader::getInt); + } else if ("targetCount".equals(fieldName)) { + deserializedTargetSourcePair.targetCount = reader.getNullable(JsonReader::getInt); + } else if ("migrationDetails".equals(fieldName)) { + deserializedTargetSourcePair.migrationDetails = MigrationDetails.fromJson(reader); + } else if ("managementDetails".equals(fieldName)) { + List managementDetails + = reader.readArray(reader1 -> ManagementDetails.fromJson(reader1)); + deserializedTargetSourcePair.managementDetails = managementDetails; + } else if ("costDetails".equals(fieldName)) { + List costDetails + = reader.readArray(reader1 -> CostDetailsCommon.fromJson(reader1)); + deserializedTargetSourcePair.costDetails = costDetails; + } else if ("savingsDetails".equals(fieldName)) { + List savingsDetails + = reader.readArray(reader1 -> SavingsDetailsCommon.fromJson(reader1)); + deserializedTargetSourcePair.savingsDetails = savingsDetails; + } else if ("confidenceScore".equals(fieldName)) { + deserializedTargetSourcePair.confidenceScore = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedTargetSourcePair; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TimeRange.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TimeRange.java new file mode 100644 index 000000000000..304eede4d9a7 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/TimeRange.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Time Range for Performance Data. + */ +public final class TimeRange extends ExpandableStringEnum { + /** + * Daily. + */ + public static final TimeRange DAY = fromString("Day"); + + /** + * Weekly. + */ + public static final TimeRange WEEK = fromString("Week"); + + /** + * Monthly. + */ + public static final TimeRange MONTH = fromString("Month"); + + /** + * Custom Time Range. + */ + public static final TimeRange CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of TimeRange value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TimeRange() { + } + + /** + * Creates or finds a TimeRange from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeRange. + */ + public static TimeRange fromString(String name) { + return fromString(name, TimeRange.class); + } + + /** + * Gets known TimeRange values. + * + * @return known TimeRange values. + */ + public static Collection values() { + return values(TimeRange.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/UltraDiskSupport.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/UltraDiskSupport.java new file mode 100644 index 000000000000..16b8e427ea7b --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/UltraDiskSupport.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Ultra Disk Support. + */ +public final class UltraDiskSupport extends ExpandableStringEnum { + /** + * Ultra Disk Supported. + */ + public static final UltraDiskSupport ULTRA_DISK_SUPPORTED = fromString("UltraDiskSupported"); + + /** + * Ultra Disk Not Supported. + */ + public static final UltraDiskSupport ULTRA_DISK_NOT_SUPPORTED = fromString("UltraDiskNotSupported"); + + /** + * Creates a new instance of UltraDiskSupport value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UltraDiskSupport() { + } + + /** + * Creates or finds a UltraDiskSupport from its string representation. + * + * @param name a name to look for. + * @return the corresponding UltraDiskSupport. + */ + public static UltraDiskSupport fromString(String name) { + return fromString(name, UltraDiskSupport.class); + } + + /** + * Gets known UltraDiskSupport values. + * + * @return known UltraDiskSupport values. + */ + public static Collection values() { + return values(UltraDiskSupport.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmFamilyCategoryItem.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmFamilyCategoryItem.java new file mode 100644 index 000000000000..89696c332f8a --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmFamilyCategoryItem.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Vm Family Category Item. + */ +public final class VmFamilyCategoryItem extends ExpandableStringEnum { + /** + * Unknown - Vm Family Category Item. + */ + public static final VmFamilyCategoryItem UNKNOWN = fromString("Unknown"); + + /** + * GeneralPurpose Vm Family Category Item. + */ + public static final VmFamilyCategoryItem GENERAL_PURPOSE = fromString("GeneralPurpose"); + + /** + * ComputeOptimized Vm Family Category Item. + */ + public static final VmFamilyCategoryItem COMPUTE_OPTIMIZED = fromString("ComputeOptimized"); + + /** + * MemoryOptimized Vm Family Category Item. + */ + public static final VmFamilyCategoryItem MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * StorageOptimized Vm Family Category Item. + */ + public static final VmFamilyCategoryItem STORAGE_OPTIMIZED = fromString("StorageOptimized"); + + /** + * GpuOptimized Vm Family Category Item. + */ + public static final VmFamilyCategoryItem GPU_OPTIMIZED = fromString("GpuOptimized"); + + /** + * HighPerformanceCompute Vm Family Category Item. + */ + public static final VmFamilyCategoryItem HIGH_PERFORMANCE_COMPUTE = fromString("HighPerformanceCompute"); + + /** + * SupportsPremiumStorage Vm Family Category Item. + */ + public static final VmFamilyCategoryItem SUPPORTS_PREMIUM_STORAGE = fromString("SupportsPremiumStorage"); + + /** + * Confidential Vm Family Category Item. + */ + public static final VmFamilyCategoryItem CONFIDENTIAL = fromString("Confidential"); + + /** + * SupportsUltraDiskStorage Vm Family Category Item. + */ + public static final VmFamilyCategoryItem SUPPORTS_ULTRA_DISK_STORAGE = fromString("SupportsUltraDiskStorage"); + + /** + * Creates a new instance of VmFamilyCategoryItem value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VmFamilyCategoryItem() { + } + + /** + * Creates or finds a VmFamilyCategoryItem from its string representation. + * + * @param name a name to look for. + * @return the corresponding VmFamilyCategoryItem. + */ + public static VmFamilyCategoryItem fromString(String name) { + return fromString(name, VmFamilyCategoryItem.class); + } + + /** + * Gets known VmFamilyCategoryItem values. + * + * @return known VmFamilyCategoryItem values. + */ + public static Collection values() { + return values(VmFamilyCategoryItem.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmSecuritySuitability.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmSecuritySuitability.java new file mode 100644 index 000000000000..1d5a3d8e8950 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmSecuritySuitability.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VM Security Suitability. + */ +@Immutable +public final class VmSecuritySuitability implements JsonSerializable { + /* + * Gets and sets the security type for this secure VM. + */ + private AzureVmSecurityType vmSecurityType; + + /* + * Gets the suitability for this secure VM. + */ + private CloudSuitabilityCommon securitySuitability; + + /* + * Gets the security suitability details for this VM. + */ + private List securitySuitabilityDetails; + + /** + * Creates an instance of VmSecuritySuitability class. + */ + private VmSecuritySuitability() { + } + + /** + * Get the vmSecurityType property: Gets and sets the security type for this secure VM. + * + * @return the vmSecurityType value. + */ + public AzureVmSecurityType vmSecurityType() { + return this.vmSecurityType; + } + + /** + * Get the securitySuitability property: Gets the suitability for this secure VM. + * + * @return the securitySuitability value. + */ + public CloudSuitabilityCommon securitySuitability() { + return this.securitySuitability; + } + + /** + * Get the securitySuitabilityDetails property: Gets the security suitability details for this VM. + * + * @return the securitySuitabilityDetails value. + */ + public List securitySuitabilityDetails() { + return this.securitySuitabilityDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmSecuritySuitability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmSecuritySuitability if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VmSecuritySuitability. + */ + public static VmSecuritySuitability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmSecuritySuitability deserializedVmSecuritySuitability = new VmSecuritySuitability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmSecurityType".equals(fieldName)) { + deserializedVmSecuritySuitability.vmSecurityType + = AzureVmSecurityType.fromString(reader.getString()); + } else if ("securitySuitability".equals(fieldName)) { + deserializedVmSecuritySuitability.securitySuitability + = CloudSuitabilityCommon.fromString(reader.getString()); + } else if ("securitySuitabilityDetails".equals(fieldName)) { + List securitySuitabilityDetails + = reader.readArray(reader1 -> AzureVmSecuritySuitabilityDetail.fromString(reader1.getString())); + deserializedVmSecuritySuitability.securitySuitabilityDetails = securitySuitabilityDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedVmSecuritySuitability; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmUptime.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmUptime.java new file mode 100644 index 000000000000..8143f957fa6d --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/VmUptime.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details on the total up-time for the VM. + */ +@Fluent +public final class VmUptime implements JsonSerializable { + /* + * Number of days in a month for VM uptime. + */ + private Integer daysPerMonth; + + /* + * Number of hours per day for VM uptime. + */ + private Integer hoursPerDay; + + /** + * Creates an instance of VmUptime class. + */ + public VmUptime() { + } + + /** + * Get the daysPerMonth property: Number of days in a month for VM uptime. + * + * @return the daysPerMonth value. + */ + public Integer daysPerMonth() { + return this.daysPerMonth; + } + + /** + * Set the daysPerMonth property: Number of days in a month for VM uptime. + * + * @param daysPerMonth the daysPerMonth value to set. + * @return the VmUptime object itself. + */ + public VmUptime withDaysPerMonth(Integer daysPerMonth) { + this.daysPerMonth = daysPerMonth; + return this; + } + + /** + * Get the hoursPerDay property: Number of hours per day for VM uptime. + * + * @return the hoursPerDay value. + */ + public Integer hoursPerDay() { + return this.hoursPerDay; + } + + /** + * Set the hoursPerDay property: Number of hours per day for VM uptime. + * + * @param hoursPerDay the hoursPerDay value to set. + * @return the VmUptime object itself. + */ + public VmUptime withHoursPerDay(Integer hoursPerDay) { + this.hoursPerDay = hoursPerDay; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("daysPerMonth", this.daysPerMonth); + jsonWriter.writeNumberField("hoursPerDay", this.hoursPerDay); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VmUptime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VmUptime if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the VmUptime. + */ + public static VmUptime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VmUptime deserializedVmUptime = new VmUptime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysPerMonth".equals(fieldName)) { + deserializedVmUptime.daysPerMonth = reader.getNullable(JsonReader::getInt); + } else if ("hoursPerDay".equals(fieldName)) { + deserializedVmUptime.hoursPerDay = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVmUptime; + }); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/package-info.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/package-info.java new file mode 100644 index 000000000000..a4bdc739698a --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for Migrate. + * Azure Migrate Resource Provider management API. + */ +package com.azure.resourcemanager.migrate.models; diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/package-info.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/package-info.java new file mode 100644 index 000000000000..2bf956d7b26c --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/com/azure/resourcemanager/migrate/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for Migrate. + * Azure Migrate Resource Provider management API. + */ +package com.azure.resourcemanager.migrate; diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/java/module-info.java b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/module-info.java new file mode 100644 index 000000000000..c9cf891f2a5d --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.migrate { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.migrate; + exports com.azure.resourcemanager.migrate.fluent; + exports com.azure.resourcemanager.migrate.fluent.models; + exports com.azure.resourcemanager.migrate.models; + + opens com.azure.resourcemanager.migrate.fluent.models to com.azure.core; + opens com.azure.resourcemanager.migrate.models to com.azure.core; + opens com.azure.resourcemanager.migrate.implementation.models to com.azure.core; +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/proxy-config.json b/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/proxy-config.json new file mode 100644 index 000000000000..1d569d7e44f8 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.migrate.implementation.AssessedMachinesV2OperationsClientImpl$AssessedMachinesV2OperationsService"],["com.azure.resourcemanager.migrate.implementation.MachineAssessmentV2SummaryOperationsClientImpl$MachineAssessmentV2SummaryOperationsService"],["com.azure.resourcemanager.migrate.implementation.MachineAssessmentsV2OperationsClientImpl$MachineAssessmentsV2OperationsService"],["com.azure.resourcemanager.migrate.implementation.MachineGraphAssessmentOptionsOperationsClientImpl$MachineGraphAssessmentOptionsOperationsService"],["com.azure.resourcemanager.migrate.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/reflect-config.json b/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-migrate/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/azure-resourcemanager-migrate.properties b/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/azure-resourcemanager-migrate.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/main/resources/azure-resourcemanager-migrate.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsGetSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsGetSamples.java new file mode 100644 index 000000000000..d5bb3f47c9c2 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for AssessedMachinesV2Operations Get. + */ +public final class AssessedMachinesV2OperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedMachinesV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + assessedMachinesV2OperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.assessedMachinesV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "machine1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsListByParentSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsListByParentSamples.java new file mode 100644 index 000000000000..05f20e51e6e2 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/AssessedMachinesV2OperationsListByParentSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for AssessedMachinesV2Operations ListByParent. + */ +public final class AssessedMachinesV2OperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/AssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: AssessedMachinesV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + assessedMachinesV2OperationsListByParentMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.assessedMachinesV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", "eabpcsewhenpdfcsjck", 13, + "lsuhpxtnundds", 28, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetSamples.java new file mode 100644 index 000000000000..16a8782d690a --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for MachineAssessmentV2SummaryOperations Get. + */ +public final class MachineAssessmentV2SummaryOperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentV2SummaryOperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentV2SummaryOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", "PaaSPreferred", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentSamples.java new file mode 100644 index 000000000000..7dcb33685860 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for MachineAssessmentV2SummaryOperations ListByParent. + */ +public final class MachineAssessmentV2SummaryOperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void machineAssessmentV2SummaryOperationsListByParentMaximumSet( + com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentV2SummaryOperations() + .listByParent("rgmachineAssessments", "contosoProject", "assessmentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsCreateSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsCreateSamples.java new file mode 100644 index 000000000000..a3f2498d0365 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsCreateSamples.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.resourcemanager.migrate.models.AssessmentDetails; +import com.azure.resourcemanager.migrate.models.AssessmentSizingCriterion; +import com.azure.resourcemanager.migrate.models.AzureCurrency; +import com.azure.resourcemanager.migrate.models.AzureDiskType; +import com.azure.resourcemanager.migrate.models.AzureHybridUseBenefit; +import com.azure.resourcemanager.migrate.models.AzureOffer; +import com.azure.resourcemanager.migrate.models.AzurePricingTier; +import com.azure.resourcemanager.migrate.models.AzureSecurityOfferingType; +import com.azure.resourcemanager.migrate.models.AzureStorageRedundancy; +import com.azure.resourcemanager.migrate.models.AzureVmFamily; +import com.azure.resourcemanager.migrate.models.AzureVmSecurityType; +import com.azure.resourcemanager.migrate.models.BillingSettings; +import com.azure.resourcemanager.migrate.models.EnvironmentType; +import com.azure.resourcemanager.migrate.models.LicensingProgram; +import com.azure.resourcemanager.migrate.models.MachineAssessmentSettings; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Properties; +import com.azure.resourcemanager.migrate.models.Percentile; +import com.azure.resourcemanager.migrate.models.PerformanceData; +import com.azure.resourcemanager.migrate.models.SavingsOptions; +import com.azure.resourcemanager.migrate.models.SavingsSettings; +import com.azure.resourcemanager.migrate.models.Scope; +import com.azure.resourcemanager.migrate.models.ScopeType; +import com.azure.resourcemanager.migrate.models.TimeRange; +import com.azure.resourcemanager.migrate.models.VmUptime; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for MachineAssessmentsV2Operations Create. + */ +public final class MachineAssessmentsV2OperationsCreateSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Create_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsCreateMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .define("assessmentName") + .withExistingAssessmentProject("rgmachineAssessments", "contosoProject") + .withProperties(new MachineAssessmentV2Properties() + .withScope(new Scope().withScopeType(ScopeType.SERVER_GROUP_ID) + .withServerGroupId("f") + .withAzureResourceGraphQuery("hfhwuqalmenpcttboxvo")) + .withSettings(new MachineAssessmentSettings().withAzureLocation("rsequlcso") + .withCurrency(AzureCurrency.UNKNOWN) + .withScalingFactor(9.0D) + .withDiscountPercentage(5.0D) + .withSizingCriterion(AssessmentSizingCriterion.PERFORMANCE_BASED) + .withPerformanceData(new PerformanceData().withPercentile(Percentile.fromString("Unknown")) + .withTimeRange(TimeRange.DAY) + .withPerfDataStartTime(OffsetDateTime.parse("2025-02-21T05:47:51.336Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2025-02-21T05:47:51.336Z"))) + .withSavingsSettings(new SavingsSettings().withSavingsOptions(SavingsOptions.NONE) + .withAzureOfferCode(AzureOffer.UNKNOWN)) + .withBillingSettings( + new BillingSettings().withLicensingProgram(LicensingProgram.RETAIL).withSubscriptionId("lee")) + .withEnvironmentType(EnvironmentType.PRODUCTION) + .withAzureSecurityOfferingType(AzureSecurityOfferingType.NO) + .withAzureDiskTypes(Arrays.asList(AzureDiskType.UNKNOWN)) + .withAzurePricingTier(AzurePricingTier.STANDARD) + .withAzureStorageRedundancy(AzureStorageRedundancy.UNKNOWN) + .withAzureHybridUseBenefit(AzureHybridUseBenefit.UNKNOWN) + .withLinuxAzureHybridUseBenefit(AzureHybridUseBenefit.UNKNOWN) + .withAzureVmFamilies(Arrays.asList(AzureVmFamily.UNKNOWN)) + .withVmUptime(new VmUptime().withDaysPerMonth(9).withHoursPerDay(10)) + .withAzureVmSecurityOptions(Arrays.asList(AzureVmSecurityType.TVM))) + .withDetails(new AssessmentDetails())) + .create(); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteSamples.java new file mode 100644 index 000000000000..3a547f5b4cb8 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for MachineAssessmentsV2Operations Delete. + */ +public final class MachineAssessmentsV2OperationsDeleteSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Delete_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsDeleteMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .deleteWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlSamples.java new file mode 100644 index 000000000000..2bf3f7eb5eef --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; + +/** + * Samples for MachineAssessmentsV2Operations DownloadUrl. + */ +public final class MachineAssessmentsV2OperationsDownloadUrlSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + */ + /** + * Sample code: Get download URL for the assessment report. + * + * @param manager Entry point to MigrateManager. + */ + public static void getDownloadURLForTheAssessmentReport(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .downloadUrl("rgmachineAssessments", "contosoProject", "assessmentName", new DownloadUrlRequest(), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsGetSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsGetSamples.java new file mode 100644 index 000000000000..94a9177e48d2 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for MachineAssessmentsV2Operations Get. + */ +public final class MachineAssessmentsV2OperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .getWithResponse("rgmachineAssessments", "contosoProject", "assessmentName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsListByParentSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsListByParentSamples.java new file mode 100644 index 000000000000..0bd42e25795e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsListByParentSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for MachineAssessmentsV2Operations ListByParent. + */ +public final class MachineAssessmentsV2OperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineAssessmentsV2Operations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineAssessmentsV2OperationsListByParentMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineAssessmentsV2Operations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsGetSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsGetSamples.java new file mode 100644 index 000000000000..6459c8a81924 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for MachineGraphAssessmentOptionsOperations Get. + */ +public final class MachineGraphAssessmentOptionsOperationsGetSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_Get_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void + machineGraphAssessmentOptionsOperationsGetMaximumSet(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .getWithResponse("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsListByParentSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsListByParentSamples.java new file mode 100644 index 000000000000..1b6e68c497f1 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/MachineGraphAssessmentOptionsOperationsListByParentSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for MachineGraphAssessmentOptionsOperations ListByParent. + */ +public final class MachineGraphAssessmentOptionsOperationsListByParentSamples { + /* + * x-ms-original-file: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet. + * + * @param manager Entry point to MigrateManager. + */ + public static void machineGraphAssessmentOptionsOperationsListByParentMaximumSet( + com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.machineGraphAssessmentOptionsOperations() + .listByParent("rgmachineAssessments", "contosoProject", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/OperationsListSamples.java b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/OperationsListSamples.java new file mode 100644 index 000000000000..b2cb07af1252 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/samples/java/com/azure/resourcemanager/migrate/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2024-03-03-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to MigrateManager. + */ + public static void operationsList(com.azure.resourcemanager.migrate.MigrateManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedDiskDataV3Tests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedDiskDataV3Tests.java new file mode 100644 index 000000000000..ae236ddba6c8 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedDiskDataV3Tests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.AssessedDiskDataV3; +import org.junit.jupiter.api.Assertions; + +public final class AssessedDiskDataV3Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssessedDiskDataV3 model = BinaryData.fromString( + "{\"name\":\"tqgtzxdpnqbqq\",\"displayName\":\"rjfeallnwsubisnj\",\"gigabytesProvisioned\":24.825661827980916,\"megabytesPerSecondOfRead\":59.54108285604358,\"megabytesPerSecondOfWrite\":25.562655955921976,\"numberOfReadOperationsPerSecond\":14.24281984629977,\"numberOfWriteOperationsPerSecond\":23.731244778708096}") + .toObject(AssessedDiskDataV3.class); + Assertions.assertEquals(24.825661827980916D, model.gigabytesProvisioned()); + Assertions.assertEquals(59.54108285604358D, model.megabytesPerSecondOfRead()); + Assertions.assertEquals(25.562655955921976D, model.megabytesPerSecondOfWrite()); + Assertions.assertEquals(14.24281984629977D, model.numberOfReadOperationsPerSecond()); + Assertions.assertEquals(23.731244778708096D, model.numberOfWriteOperationsPerSecond()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineNetworkAdaptersV3Tests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineNetworkAdaptersV3Tests.java new file mode 100644 index 000000000000..980d10da5df7 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineNetworkAdaptersV3Tests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.AssessedMachineNetworkAdaptersV3; +import org.junit.jupiter.api.Assertions; + +public final class AssessedMachineNetworkAdaptersV3Tests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssessedMachineNetworkAdaptersV3 model = BinaryData.fromString( + "{\"name\":\"eipheoflokeyy\",\"netGigabytesTransmittedPerMonth\":8.258695733393173,\"macAddress\":\"dlwtgrhpdj\",\"ipAddresses\":[\"masxazjpqyegu\",\"lhbxxhejjzzvdud\",\"wdslfhotwmcy\"],\"megabytesPerSecondRecieved\":86.83052048611727,\"megabytesPerSecondTransmitted\":23.095344898075965,\"displayName\":\"gacftadeh\"}") + .toObject(AssessedMachineNetworkAdaptersV3.class); + Assertions.assertEquals(8.258695733393173D, model.netGigabytesTransmittedPerMonth()); + Assertions.assertEquals("dlwtgrhpdj", model.macAddress()); + Assertions.assertEquals(86.83052048611727D, model.megabytesPerSecondRecieved()); + Assertions.assertEquals(23.095344898075965D, model.megabytesPerSecondTransmitted()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineV2ListResultTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineV2ListResultTests.java new file mode 100644 index 000000000000..8e836104fa82 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessedMachineV2ListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.implementation.models.AssessedMachineV2ListResult; +import org.junit.jupiter.api.Assertions; + +public final class AssessedMachineV2ListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssessedMachineV2ListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"workloadType\":\"ManagementServer\",\"linkages\":[{\"workloadName\":\"ej\",\"linkageType\":\"Source\",\"kind\":\"WebApplication\",\"armId\":\"zdmohctbqvu\"}],\"recommendations\":[{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"IaaS\",\"confidenceScore\":99.35971803544761,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{},{},{}],\"totalSavings\":[{},{},{}],\"migrationIssues\":[{},{}],\"skus\":[{},{},{},{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"ConditionallySuitable\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"SuitableWithWarnings\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"Unknown\",\"securitySuitability\":\"NotSuitable\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"ConditionallySuitable\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"CVM\"}],\"extendedDetails\":{\"displayName\":\"jixhbk\",\"productSupportStatus\":{\"currentVersion\":\"qweykhmenev\",\"servicePackStatus\":\"exfwhy\",\"esuStatus\":\"i\",\"supportStatus\":\"yvdcsitynnaa\",\"eta\":1553066482,\"currentEsuYear\":\"tehfiqscjeypvh\",\"mainstreamEndDate\":\"2021-10-04T21:09:43Z\",\"extendedSupportEndDate\":\"2021-04-02T10:03:16Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-02-23T09:11:36Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-10-29T01:56:30Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-06-04T03:18:37Z\"},\"disks\":[{}],\"hostProcessor\":{\"name\":\"mkqsleyyv\",\"numberOfSockets\":1769493620,\"numberOfCoresPerSocket\":704885083},\"networkAdapters\":[{},{},{},{}],\"assessedMachineType\":\"Unknown\",\"bootType\":\"NotSpecified\",\"operatingSystemType\":\"gjcrcczsqpjhvm\",\"operatingSystemName\":\"jvnysounqe\",\"operatingSystemVersion\":\"noae\",\"operatingSystemArchitecture\":\"X64\",\"description\":\"yhltrpmopjmcm\",\"megabytesOfMemory\":1.440689266354489,\"numberOfCores\":1961920372,\"percentageCoresUtilization\":12.270076552530396,\"percentageMemoryUtilization\":52.38565880355986,\"errors\":[{},{},{},{}]},\"createdTimestamp\":\"2021-01-11T08:50:44Z\",\"updatedTimestamp\":\"2021-06-02T06:16:12Z\"},\"id\":\"vxodpu\",\"name\":\"zmyzydagf\",\"type\":\"axbezyiuo\"},{\"properties\":{\"workloadType\":\"WebApplication\",\"linkages\":[{\"workloadName\":\"xw\",\"linkageType\":\"Parent\",\"kind\":\"Instance\",\"armId\":\"bsureximo\"},{\"workloadName\":\"ocfs\",\"linkageType\":\"Parent\",\"kind\":\"Machine\",\"armId\":\"dystkiiuxhqyud\"},{\"workloadName\":\"rrqnbpoczvyifqrv\",\"linkageType\":\"Source\",\"kind\":\"Unknown\",\"armId\":\"lrmv\"}],\"recommendations\":[{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"SaaS\",\"confidenceScore\":4.838999534427835,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{},{}],\"totalSavings\":[{}],\"migrationIssues\":[{},{},{},{}],\"skus\":[{},{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"Unknown\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"TVM\",\"securitySuitability\":\"Unknown\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"CVM\"}],\"extendedDetails\":{\"displayName\":\"sovmyokacspkwl\",\"productSupportStatus\":{\"currentVersion\":\"obpxjmflbvvn\",\"servicePackStatus\":\"rkcciwwzjuqk\",\"esuStatus\":\"sa\",\"supportStatus\":\"wkuofoskghsauu\",\"eta\":1525008184,\"currentEsuYear\":\"vxieduugidyj\",\"mainstreamEndDate\":\"2021-01-22T08:57:19Z\",\"extendedSupportEndDate\":\"2021-04-30T20:35:21Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-09-15T05:38:02Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-06-21T06:23:36Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-01-29T02:12:36Z\"},\"disks\":[{},{},{}],\"hostProcessor\":{\"name\":\"pclhocohslk\",\"numberOfSockets\":1882750055,\"numberOfCoresPerSocket\":1452843037},\"networkAdapters\":[{},{}],\"assessedMachineType\":\"SqlAssessedMachine\",\"bootType\":\"BIOS\",\"operatingSystemType\":\"mvfaxkffeiith\",\"operatingSystemName\":\"m\",\"operatingSystemVersion\":\"yvshxmz\",\"operatingSystemArchitecture\":\"X86\",\"description\":\"oggigrxwburv\",\"megabytesOfMemory\":36.14885863474371,\"numberOfCores\":953955678,\"percentageCoresUtilization\":45.7513774224536,\"percentageMemoryUtilization\":18.545481899382153,\"errors\":[{},{},{}]},\"createdTimestamp\":\"2021-12-01T07:03:23Z\",\"updatedTimestamp\":\"2021-08-24T09:48:52Z\"},\"id\":\"nvudwtiukb\",\"name\":\"dng\",\"type\":\"pocipazyxoegu\"},{\"properties\":{\"workloadType\":\"ManagementServer\",\"linkages\":[{\"workloadName\":\"cgygev\",\"linkageType\":\"Source\",\"kind\":\"Database\",\"armId\":\"mrbpizcdrqj\"},{\"workloadName\":\"pyd\",\"linkageType\":\"Source\",\"kind\":\"Unknown\",\"armId\":\"eoejzic\"},{\"workloadName\":\"fsj\",\"linkageType\":\"Source\",\"kind\":\"Instance\",\"armId\":\"ishc\"}],\"recommendations\":[{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"PaaS\",\"confidenceScore\":28.69422884114701,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{},{},{},{}],\"totalSavings\":[{}],\"migrationIssues\":[{},{},{},{}],\"skus\":[{},{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"TVM\",\"securitySuitability\":\"Suitable\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"TVM\"},{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"PaaS\",\"confidenceScore\":42.700623481202356,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{},{},{}],\"totalSavings\":[{},{},{}],\"migrationIssues\":[{},{},{},{}],\"skus\":[{},{},{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"TVM\",\"securitySuitability\":\"SuitableWithWarnings\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"Suitable\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"TVM\"},{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"PaaS\",\"confidenceScore\":23.259063607351393,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{},{},{}],\"totalSavings\":[{},{}],\"migrationIssues\":[{},{},{},{}],\"skus\":[{},{},{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"Suitable\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"ConditionallySuitable\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"Unknown\"},{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"IaaS\",\"confidenceScore\":65.32181245174368,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{}],\"totalSavings\":[{},{},{},{}],\"migrationIssues\":[{},{},{},{}],\"skus\":[{},{},{},{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"SuitableWithWarnings\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"TVM\",\"securitySuitability\":\"NotSuitable\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"Unknown\",\"securitySuitability\":\"Suitable\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"CVM\"}],\"extendedDetails\":{\"displayName\":\"hgyxzkonoc\",\"productSupportStatus\":{\"currentVersion\":\"klyaxuconu\",\"servicePackStatus\":\"zf\",\"esuStatus\":\"eyp\",\"supportStatus\":\"rmjmwvvjektc\",\"eta\":1803945661,\"currentEsuYear\":\"hwlrsf\",\"mainstreamEndDate\":\"2021-08-26T16:24:45Z\",\"extendedSupportEndDate\":\"2021-08-02T01:11:29Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-07-22T11:31:47Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-01-03T19:26:04Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-04-25T22:26:14Z\"},\"disks\":[{},{},{}],\"hostProcessor\":{\"name\":\"lihkaetcktvfc\",\"numberOfSockets\":533172139,\"numberOfCoresPerSocket\":1960016252},\"networkAdapters\":[{},{},{},{}],\"assessedMachineType\":\"AvsAssessedMachine\",\"bootType\":\"BIOS\",\"operatingSystemType\":\"hjfbebrjcxe\",\"operatingSystemName\":\"uwutttxfvjrbi\",\"operatingSystemVersion\":\"hxepcyvahfnlj\",\"operatingSystemArchitecture\":\"X64\",\"description\":\"j\",\"megabytesOfMemory\":45.9964588316922,\"numberOfCores\":1970519416,\"percentageCoresUtilization\":31.363687102629,\"percentageMemoryUtilization\":60.2726973374229,\"errors\":[{},{},{}]},\"createdTimestamp\":\"2021-09-19T17:18:46Z\",\"updatedTimestamp\":\"2021-06-21T09:19:47Z\"},\"id\":\"cltbgsncghkjesz\",\"name\":\"hbijhtxfvgxb\",\"type\":\"smx\"},{\"properties\":{\"workloadType\":\"Database\",\"linkages\":[{\"workloadName\":\"cxgod\",\"linkageType\":\"Parent\",\"kind\":\"Unknown\",\"armId\":\"rbmpukgri\"},{\"workloadName\":\"lzlfbxzpuz\",\"linkageType\":\"Source\",\"kind\":\"Machine\",\"armId\":\"qzahmgkbrp\"},{\"workloadName\":\"dhibnuq\",\"linkageType\":\"Parent\",\"kind\":\"Database\",\"armId\":\"drgvtqagn\"},{\"workloadName\":\"ynhijggme\",\"linkageType\":\"Source\",\"kind\":\"WebServer\",\"armId\":\"butr\"}],\"recommendations\":[{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"IaaS\",\"confidenceScore\":6.580478742194273,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{},{},{},{}],\"totalSavings\":[{}],\"migrationIssues\":[{},{},{}],\"skus\":[{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"NotSuitable\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"Unknown\",\"securitySuitability\":\"SuitableWithWarnings\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"CVM\",\"securitySuitability\":\"SuitableWithWarnings\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"Standard\",\"securitySuitability\":\"ConditionallySuitable\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"CVM\"},{\"configuration\":{},\"recommendedFor\":{},\"migrationPlatform\":\"SaaS\",\"confidenceScore\":75.0275878940987,\"migrationSuitability\":{},\"securitySuitability\":{},\"totalCost\":[{},{},{},{}],\"totalSavings\":[{}],\"migrationIssues\":[{}],\"skus\":[{}],\"vmSecuritySuitabilityResults\":[{\"vmSecurityType\":\"Unknown\",\"securitySuitability\":\"Unknown\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"Standard\",\"securitySuitability\":\"ConditionallySuitable\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"TVM\",\"securitySuitability\":\"Suitable\",\"securitySuitabilityDetails\":[]},{\"vmSecurityType\":\"Standard\",\"securitySuitability\":\"ReadinessUnknown\",\"securitySuitabilityDetails\":[]}],\"recommendedVmSecurityType\":\"Standard\"}],\"extendedDetails\":{\"displayName\":\"fclhaaxdbabphlwr\",\"productSupportStatus\":{\"currentVersion\":\"ktsthsucocmny\",\"servicePackStatus\":\"zt\",\"esuStatus\":\"twwrqp\",\"supportStatus\":\"dckzywbiexz\",\"eta\":1043765409,\"currentEsuYear\":\"eaxib\",\"mainstreamEndDate\":\"2021-10-23T16:09:08Z\",\"extendedSupportEndDate\":\"2021-09-10T00:08:50Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-09-09T17:36:53Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-10-28T10:03:56Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-05-06T03:18:53Z\"},\"disks\":[{},{},{},{}],\"hostProcessor\":{\"name\":\"xaepdkzjancuxr\",\"numberOfSockets\":714190447,\"numberOfCoresPerSocket\":1879785159},\"networkAdapters\":[{},{}],\"assessedMachineType\":\"AssessedMachine\",\"bootType\":\"Unknown\",\"operatingSystemType\":\"jswztsdbpg\",\"operatingSystemName\":\"ytxhp\",\"operatingSystemVersion\":\"bzpfzab\",\"operatingSystemArchitecture\":\"X86\",\"description\":\"hxw\",\"megabytesOfMemory\":17.869411204038087,\"numberOfCores\":228169976,\"percentageCoresUtilization\":49.88334916972171,\"percentageMemoryUtilization\":28.630321448652463,\"errors\":[{},{},{}]},\"createdTimestamp\":\"2021-10-27T08:32:46Z\",\"updatedTimestamp\":\"2021-01-04T19:51:15Z\"},\"id\":\"gy\",\"name\":\"gu\",\"type\":\"svmkfssxquk\"}],\"nextLink\":\"plgmgsxnk\"}") + .toObject(AssessedMachineV2ListResult.class); + Assertions.assertEquals("plgmgsxnk", model.nextLink()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessmentDetailsTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessmentDetailsTests.java new file mode 100644 index 000000000000..716d9940f6ca --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/AssessmentDetailsTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.AssessmentDetails; + +public final class AssessmentDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssessmentDetails model = BinaryData.fromString( + "{\"confidenceRatingInPercentage\":23.153669923594467,\"pricesTimestamp\":\"2021-09-26T05:06:44Z\",\"createdTimestamp\":\"2021-02-09T04:27:06Z\",\"updatedTimestamp\":\"2021-08-30T14:27:09Z\",\"status\":\"OutDated\"}") + .toObject(AssessmentDetails.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AssessmentDetails model = new AssessmentDetails(); + model = BinaryData.fromObject(model).toObject(AssessmentDetails.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/BillingSettingsTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/BillingSettingsTests.java new file mode 100644 index 000000000000..882081a92ba5 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/BillingSettingsTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.BillingSettings; +import com.azure.resourcemanager.migrate.models.LicensingProgram; +import org.junit.jupiter.api.Assertions; + +public final class BillingSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BillingSettings model = BinaryData.fromString("{\"licensingProgram\":\"EA\",\"subscriptionId\":\"datscmd\"}") + .toObject(BillingSettings.class); + Assertions.assertEquals(LicensingProgram.EA, model.licensingProgram()); + Assertions.assertEquals("datscmd", model.subscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BillingSettings model + = new BillingSettings().withLicensingProgram(LicensingProgram.EA).withSubscriptionId("datscmd"); + model = BinaryData.fromObject(model).toObject(BillingSettings.class); + Assertions.assertEquals(LicensingProgram.EA, model.licensingProgram()); + Assertions.assertEquals("datscmd", model.subscriptionId()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ConfigurationTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ConfigurationTests.java new file mode 100644 index 000000000000..27f3bbc71b08 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ConfigurationTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.Configuration; + +public final class ConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Configuration model + = BinaryData.fromString("{\"azureTarget\":\"AzureAppService\",\"sizingCriterion\":\"PerformanceBased\"}") + .toObject(Configuration.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/CostDetailsCommonTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/CostDetailsCommonTests.java new file mode 100644 index 000000000000..a3b4b735991d --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/CostDetailsCommonTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.CostDetailsCommon; + +public final class CostDetailsCommonTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CostDetailsCommon model = BinaryData.fromString( + "{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{\"name\":\"MonthlyComputeCost\",\"value\":90.06849030549041}]}") + .toObject(CostDetailsCommon.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlInnerTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlInnerTests.java new file mode 100644 index 000000000000..ef37cb378eb9 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.fluent.models.DownloadUrlInner; + +public final class DownloadUrlInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DownloadUrlInner model = BinaryData + .fromString("{\"assessmentReportUrl\":\"hmsbzjhcrzevdp\",\"expirationTime\":\"2021-01-31T22:20:23Z\"}") + .toObject(DownloadUrlInner.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlRequestTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlRequestTests.java new file mode 100644 index 000000000000..83aa48df84d4 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/DownloadUrlRequestTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; + +public final class DownloadUrlRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DownloadUrlRequest model = BinaryData.fromString("{}").toObject(DownloadUrlRequest.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DownloadUrlRequest model = new DownloadUrlRequest(); + model = BinaryData.fromObject(model).toObject(DownloadUrlRequest.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/LinkagesTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/LinkagesTests.java new file mode 100644 index 000000000000..a788887ab780 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/LinkagesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.Linkages; + +public final class LinkagesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Linkages model = BinaryData.fromString( + "{\"workloadName\":\"jczdzevndh\",\"linkageType\":\"Source\",\"kind\":\"Server\",\"armId\":\"ppdsbdkvwrwj\"}") + .toObject(Linkages.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryInnerTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryInnerTests.java new file mode 100644 index 000000000000..9aad9d89bf8f --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.fluent.models.MachineAssessmentV2SummaryInner; + +public final class MachineAssessmentV2SummaryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MachineAssessmentV2SummaryInner model = BinaryData.fromString( + "{\"properties\":{\"summaryType\":\"Target\",\"summaryName\":\"slpvlop\",\"sources\":[{\"sourceName\":\"OracleServer\",\"sourceType\":\"Unknown\",\"platform\":\"SaaS\",\"count\":1713070379},{\"sourceName\":\"WebApps\",\"sourceType\":\"Server\",\"platform\":\"Unknown\",\"count\":1361291806}],\"targets\":[{\"targetName\":\"MySQLAzureFlexServer\",\"targetType\":\"Server\",\"platform\":\"Unknown\",\"count\":865900212},{\"targetName\":\"SAPAzureInstance\",\"targetType\":\"WebServer\",\"platform\":\"IaaS\",\"count\":996509936}],\"targetSourceMapping\":[{\"sourceRef\":\"SqlDatabase\",\"targetRef\":\"AKS\",\"sourceCount\":392832113,\"targetCount\":578889985,\"migrationDetails\":{\"readinessSummary\":[{},{},{},{}],\"migrationType\":\"Retain\"},\"managementDetails\":[{\"name\":\"No\",\"readinessSummary\":[{},{}]},{\"name\":\"AzMon\",\"readinessSummary\":[{},{},{},{}]}],\"costDetails\":[{\"savingOptions\":\"CustomAzureOfferCode\",\"costDetail\":[{},{},{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"costDetail\":[{},{}]}],\"savingsDetails\":[{\"savingOptions\":\"RI1Year\",\"savingsDetail\":[{},{}]},{\"savingOptions\":\"None\",\"savingsDetail\":[{}]},{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{},{},{},{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"savingsDetail\":[{},{},{}]}],\"confidenceScore\":82.90921305628528},{\"sourceRef\":\"SpringbootApplication\",\"targetRef\":\"FlexServerPG\",\"sourceCount\":722380339,\"targetCount\":1278272073,\"migrationDetails\":{\"readinessSummary\":[{},{},{},{}],\"migrationType\":\"Replatform\"},\"managementDetails\":[{\"name\":\"No\",\"readinessSummary\":[{}]},{\"name\":\"AzMon\",\"readinessSummary\":[{}]},{\"name\":\"SCOMMI\",\"readinessSummary\":[{}]},{\"name\":\"No\",\"readinessSummary\":[{}]}],\"costDetails\":[{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{}]},{\"savingOptions\":\"None\",\"costDetail\":[{}]},{\"savingOptions\":\"RI1Year\",\"costDetail\":[{},{},{},{}]}],\"savingsDetails\":[{\"savingOptions\":\"SavingsPlan1Year\",\"savingsDetail\":[{},{},{},{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"savingsDetail\":[{}]}],\"confidenceScore\":88.02672231826142},{\"sourceRef\":\"IIS\",\"targetRef\":\"Unknown\",\"sourceCount\":661305446,\"targetCount\":1227353846,\"migrationDetails\":{\"readinessSummary\":[{},{},{},{}],\"migrationType\":\"Retain\"},\"managementDetails\":[{\"name\":\"SCOMMI\",\"readinessSummary\":[{},{}]},{\"name\":\"SCOMMI\",\"readinessSummary\":[{},{}]}],\"costDetails\":[{\"savingOptions\":\"CustomAzureOfferCode\",\"costDetail\":[{}]},{\"savingOptions\":\"RI3Year\",\"costDetail\":[{},{},{},{}]},{\"savingOptions\":\"RI3Year\",\"costDetail\":[{},{}]},{\"savingOptions\":\"SavingsPlan3Year\",\"costDetail\":[{}]}],\"savingsDetails\":[{\"savingOptions\":\"None\",\"savingsDetail\":[{},{},{}]},{\"savingOptions\":\"None\",\"savingsDetail\":[{}]},{\"savingOptions\":\"SavingsPlan1Year\",\"savingsDetail\":[{},{}]},{\"savingOptions\":\"RI3Year\",\"savingsDetail\":[{},{},{}]}],\"confidenceScore\":63.32801979897209}],\"costComponents\":[{\"savingOptions\":\"SavingsPlan3Year\",\"costDetail\":[{\"name\":\"MonthlyStandardSsdStorageCost\",\"value\":62.299990105668726}]}],\"savingsComponents\":[{\"savingOptions\":\"RI3Year\",\"savingsDetail\":[{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":7.595716132036068},{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":9.387832271008234},{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":36.035795288058004},{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":7.649966513313988}]}]},\"id\":\"qj\",\"name\":\"hckfrlhrx\",\"type\":\"bkyvp\"}") + .toObject(MachineAssessmentV2SummaryInner.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryListResultTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryListResultTests.java new file mode 100644 index 000000000000..b094dfe2ccbd --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.implementation.models.MachineAssessmentV2SummaryListResult; +import org.junit.jupiter.api.Assertions; + +public final class MachineAssessmentV2SummaryListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MachineAssessmentV2SummaryListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"summaryType\":\"Strategy\",\"summaryName\":\"fhzovawjvzunluth\",\"sources\":[{\"sourceName\":\"SqlInstance\",\"sourceType\":\"Database\",\"platform\":\"SaaS\",\"count\":609811636},{\"sourceName\":\"TomCat\",\"sourceType\":\"ManagementServer\",\"platform\":\"Unknown\",\"count\":1140769310},{\"sourceName\":\"Machine\",\"sourceType\":\"Instance\",\"platform\":\"PaaS\",\"count\":478789870}],\"targets\":[{\"targetName\":\"AKS\",\"targetType\":\"Instance\",\"platform\":\"Unknown\",\"count\":1487921664},{\"targetName\":\"SAPAzureInstance\",\"targetType\":\"Server\",\"platform\":\"Unknown\",\"count\":1290652027},{\"targetName\":\"FlexServerPG\",\"targetType\":\"Instance\",\"platform\":\"Unknown\",\"count\":205303620}],\"targetSourceMapping\":[{\"sourceRef\":\"OracleDatabase\",\"targetRef\":\"OracleIaasVM\",\"sourceCount\":1856979158,\"targetCount\":1422945070,\"migrationDetails\":{},\"managementDetails\":[{},{}],\"costDetails\":[{},{}],\"savingsDetails\":[{},{},{},{}],\"confidenceScore\":0.5889681397022062}],\"costComponents\":[{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{},{},{}]}],\"savingsComponents\":[{\"savingOptions\":\"RI3Year\",\"savingsDetail\":[{},{}]},{\"savingOptions\":\"SavingsPlan1Year\",\"savingsDetail\":[{},{},{}]},{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{},{},{}]}]},\"id\":\"jixisxyawjoyaqcs\",\"name\":\"yjpkiidzyexz\",\"type\":\"eli\"},{\"properties\":{\"summaryType\":\"Target\",\"summaryName\":\"tfolhbnx\",\"sources\":[{\"sourceName\":\"SqlInstance\",\"sourceType\":\"ManagementServer\",\"platform\":\"Unknown\",\"count\":809589965},{\"sourceName\":\"SqlInstance\",\"sourceType\":\"Machine\",\"platform\":\"IaaS\",\"count\":1500766151},{\"sourceName\":\"OracleServer\",\"sourceType\":\"Instance\",\"platform\":\"PaaS\",\"count\":2098592267},{\"sourceName\":\"SqlDatabase\",\"sourceType\":\"Machine\",\"platform\":\"Unknown\",\"count\":2050375248}],\"targets\":[{\"targetName\":\"AzureAppService\",\"targetType\":\"Host\",\"platform\":\"Unknown\",\"count\":119641642},{\"targetName\":\"AzureVM\",\"targetType\":\"WebApplication\",\"platform\":\"IaaS\",\"count\":745098113},{\"targetName\":\"AzureVM\",\"targetType\":\"Unknown\",\"platform\":\"Unknown\",\"count\":953152084},{\"targetName\":\"Avs\",\"targetType\":\"Database\",\"platform\":\"IaaS\",\"count\":2053919351}],\"targetSourceMapping\":[{\"sourceRef\":\"TomCat\",\"targetRef\":\"OracleIaasVM\",\"sourceCount\":1761160515,\"targetCount\":429359313,\"migrationDetails\":{},\"managementDetails\":[{}],\"costDetails\":[{},{},{}],\"savingsDetails\":[{},{},{}],\"confidenceScore\":4.426505796193814}],\"costComponents\":[{\"savingOptions\":\"RI3Year\",\"costDetail\":[{}]},{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{},{}]},{\"savingOptions\":\"RI1Year\",\"costDetail\":[{},{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"costDetail\":[{}]}],\"savingsComponents\":[{\"savingOptions\":\"None\",\"savingsDetail\":[{},{},{},{}]}]},\"id\":\"dahzxctobg\",\"name\":\"kdmoi\",\"type\":\"postmgrcfbunrm\"},{\"properties\":{\"summaryType\":\"Target\",\"summaryName\":\"kxbpvj\",\"sources\":[{\"sourceName\":\"SpringbootApplication\",\"sourceType\":\"Database\",\"platform\":\"Unknown\",\"count\":8533369},{\"sourceName\":\"WebApps\",\"sourceType\":\"Machine\",\"platform\":\"Unknown\",\"count\":855265021}],\"targets\":[{\"targetName\":\"Unknown\",\"targetType\":\"Database\",\"platform\":\"IaaS\",\"count\":928593835},{\"targetName\":\"AzureAppServiceContainer\",\"targetType\":\"Machine\",\"platform\":\"PaaS\",\"count\":1924532267},{\"targetName\":\"AKS\",\"targetType\":\"Database\",\"platform\":\"IaaS\",\"count\":393815457}],\"targetSourceMapping\":[{\"sourceRef\":\"TomCat\",\"targetRef\":\"AzureVM\",\"sourceCount\":1242839577,\"targetCount\":1076611714,\"migrationDetails\":{},\"managementDetails\":[{},{}],\"costDetails\":[{}],\"savingsDetails\":[{},{},{}],\"confidenceScore\":65.73562822490665}],\"costComponents\":[{\"savingOptions\":\"RI3Year\",\"costDetail\":[{},{},{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"costDetail\":[{},{},{}]},{\"savingOptions\":\"None\",\"costDetail\":[{},{}]}],\"savingsComponents\":[{\"savingOptions\":\"RI1Year\",\"savingsDetail\":[{},{},{},{}]},{\"savingOptions\":\"SavingsPlan1Year\",\"savingsDetail\":[{},{},{}]},{\"savingOptions\":\"RI1Year\",\"savingsDetail\":[{}]}]},\"id\":\"ohxcrsbfova\",\"name\":\"rruvwbhsq\",\"type\":\"sub\"}],\"nextLink\":\"jbi\"}") + .toObject(MachineAssessmentV2SummaryListResult.class); + Assertions.assertEquals("jbi", model.nextLink()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetWithResponseMockTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..f001e72ace84 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.migrate.MigrateManager; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Summary; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MachineAssessmentV2SummaryOperationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"summaryType\":\"Strategy\",\"summaryName\":\"xdxr\",\"sources\":[{\"sourceName\":\"SqlDatabase\",\"sourceType\":\"Server\",\"platform\":\"PaaS\",\"count\":737609208},{\"sourceName\":\"SqlDatabase\",\"sourceType\":\"Unknown\",\"platform\":\"Unknown\",\"count\":1019657066},{\"sourceName\":\"OracleDatabase\",\"sourceType\":\"Machine\",\"platform\":\"Unknown\",\"count\":1454988388},{\"sourceName\":\"Unknown\",\"sourceType\":\"Server\",\"platform\":\"Unknown\",\"count\":1032331086}],\"targets\":[{\"targetName\":\"OracleIaasVM\",\"targetType\":\"Server\",\"platform\":\"IaaS\",\"count\":1280631673},{\"targetName\":\"FlexServerPG\",\"targetType\":\"Machine\",\"platform\":\"PaaS\",\"count\":1872827948},{\"targetName\":\"AzureSpringApps\",\"targetType\":\"ManagementServer\",\"platform\":\"Unknown\",\"count\":1263192387},{\"targetName\":\"Avs\",\"targetType\":\"ManagementServer\",\"platform\":\"PaaS\",\"count\":980549756}],\"targetSourceMapping\":[{\"sourceRef\":\"Unknown\",\"targetRef\":\"AzureSpringApps\",\"sourceCount\":1316469962,\"targetCount\":297328779,\"migrationDetails\":{\"readinessSummary\":[{},{},{}],\"migrationType\":\"Unknown\"},\"managementDetails\":[{},{},{}],\"costDetails\":[{},{},{},{}],\"savingsDetails\":[{},{}],\"confidenceScore\":25.39340732212677},{\"sourceRef\":\"OracleDatabase\",\"targetRef\":\"AzureAppServiceContainer\",\"sourceCount\":615108235,\"targetCount\":1591182394,\"migrationDetails\":{\"readinessSummary\":[{},{},{}],\"migrationType\":\"Retain\"},\"managementDetails\":[{},{},{},{}],\"costDetails\":[{},{}],\"savingsDetails\":[{},{},{}],\"confidenceScore\":4.0814142253364105},{\"sourceRef\":\"OracleDatabase\",\"targetRef\":\"AzureSpringApps\",\"sourceCount\":625929025,\"targetCount\":1697622666,\"migrationDetails\":{\"readinessSummary\":[{},{}],\"migrationType\":\"Replatform\"},\"managementDetails\":[{}],\"costDetails\":[{},{}],\"savingsDetails\":[{},{},{}],\"confidenceScore\":35.425091747511715},{\"sourceRef\":\"OracleServer\",\"targetRef\":\"SqlMI\",\"sourceCount\":1586298558,\"targetCount\":185421372,\"migrationDetails\":{\"readinessSummary\":[{},{}],\"migrationType\":\"Rehost\"},\"managementDetails\":[{},{},{},{}],\"costDetails\":[{}],\"savingsDetails\":[{},{}],\"confidenceScore\":7.75031898043358}],\"costComponents\":[{\"savingOptions\":\"RI3Year\",\"costDetail\":[{},{},{}]},{\"savingOptions\":\"SavingsPlan3Year\",\"costDetail\":[{},{},{}]},{\"savingOptions\":\"None\",\"costDetail\":[{},{}]}],\"savingsComponents\":[{\"savingOptions\":\"CustomAzureOfferCode\",\"savingsDetail\":[{},{},{}]},{\"savingOptions\":\"None\",\"savingsDetail\":[{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"savingsDetail\":[{}]},{\"savingOptions\":\"None\",\"savingsDetail\":[{},{}]}]},\"id\":\"kif\",\"name\":\"vtpuqujmqlgk\",\"type\":\"btndo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MigrateManager manager = MigrateManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MachineAssessmentV2Summary response = manager.machineAssessmentV2SummaryOperations() + .getWithResponse("tiagx", "dszue", "psbzkfzbeyvpn", "icvi", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentMockTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentMockTests.java new file mode 100644 index 000000000000..3d9df09f5d95 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentV2SummaryOperationsListByParentMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.migrate.MigrateManager; +import com.azure.resourcemanager.migrate.models.MachineAssessmentV2Summary; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MachineAssessmentV2SummaryOperationsListByParentMockTests { + @Test + public void testListByParent() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"summaryType\":\"Strategy\",\"summaryName\":\"xarzgszufoxciq\",\"sources\":[{\"sourceName\":\"Machine\",\"sourceType\":\"Server\",\"platform\":\"SaaS\",\"count\":1263985401},{\"sourceName\":\"Machine\",\"sourceType\":\"Server\",\"platform\":\"SaaS\",\"count\":1699851993},{\"sourceName\":\"OracleDatabase\",\"sourceType\":\"Database\",\"platform\":\"PaaS\",\"count\":959916144},{\"sourceName\":\"TomCat\",\"sourceType\":\"ManagementServer\",\"platform\":\"IaaS\",\"count\":541688375}],\"targets\":[{\"targetName\":\"AzureAppService\",\"targetType\":\"Database\",\"platform\":\"PaaS\",\"count\":2022074677},{\"targetName\":\"SqlDatabase\",\"targetType\":\"Unknown\",\"platform\":\"SaaS\",\"count\":152154395},{\"targetName\":\"MySQLAzureFlexServer\",\"targetType\":\"Host\",\"platform\":\"PaaS\",\"count\":931216317},{\"targetName\":\"Avs\",\"targetType\":\"Machine\",\"platform\":\"PaaS\",\"count\":1422593899}],\"targetSourceMapping\":[{\"sourceRef\":\"IIS\",\"targetRef\":\"AzureVM\",\"sourceCount\":1275486297,\"targetCount\":1506529335,\"migrationDetails\":{\"readinessSummary\":[{},{}],\"migrationType\":\"Replatform\"},\"managementDetails\":[{},{},{},{}],\"costDetails\":[{}],\"savingsDetails\":[{},{}],\"confidenceScore\":12.377960256454223},{\"sourceRef\":\"OracleServer\",\"targetRef\":\"AzureSpringApps\",\"sourceCount\":1711302582,\"targetCount\":1828204425,\"migrationDetails\":{\"readinessSummary\":[{},{},{},{}],\"migrationType\":\"Rehost\"},\"managementDetails\":[{}],\"costDetails\":[{}],\"savingsDetails\":[{}],\"confidenceScore\":88.82868866859093},{\"sourceRef\":\"OracleServer\",\"targetRef\":\"AzureAppService\",\"sourceCount\":2086518628,\"targetCount\":1790091997,\"migrationDetails\":{\"readinessSummary\":[{},{},{}],\"migrationType\":\"Rearchitect\"},\"managementDetails\":[{}],\"costDetails\":[{}],\"savingsDetails\":[{},{},{},{}],\"confidenceScore\":5.73213357740917},{\"sourceRef\":\"Unknown\",\"targetRef\":\"AKS\",\"sourceCount\":1613422288,\"targetCount\":270021296,\"migrationDetails\":{\"readinessSummary\":[{},{},{},{}],\"migrationType\":\"Rehost\"},\"managementDetails\":[{},{},{}],\"costDetails\":[{},{},{},{}],\"savingsDetails\":[{},{},{},{}],\"confidenceScore\":57.17684280566054}],\"costComponents\":[{\"savingOptions\":\"RI3Year\",\"costDetail\":[{},{}]}],\"savingsComponents\":[{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"savingsDetail\":[{},{},{},{}]},{\"savingOptions\":\"None\",\"savingsDetail\":[{}]}]},\"id\":\"enuuzkopbm\",\"name\":\"nrfdw\",\"type\":\"yuhhziu\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MigrateManager manager = MigrateManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.machineAssessmentV2SummaryOperations() + .listByParent("ongbjcnt", "jitcjedftwwaez", "ojvdcpzfoqo", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteWithResponseMockTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..c21415498497 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.migrate.MigrateManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MachineAssessmentsV2OperationsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MigrateManager manager = MigrateManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.machineAssessmentsV2Operations() + .deleteWithResponse("kbebxmubyyntwlrb", "tkoievseotgq", "l", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlMockTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlMockTests.java new file mode 100644 index 000000000000..3040fa59e8bd --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MachineAssessmentsV2OperationsDownloadUrlMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.migrate.MigrateManager; +import com.azure.resourcemanager.migrate.models.DownloadUrl; +import com.azure.resourcemanager.migrate.models.DownloadUrlRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MachineAssessmentsV2OperationsDownloadUrlMockTests { + @Test + public void testDownloadUrl() throws Exception { + String responseStr = "{\"assessmentReportUrl\":\"pbttdum\",\"expirationTime\":\"2021-05-09T00:50:12Z\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MigrateManager manager = MigrateManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DownloadUrl response = manager.machineAssessmentsV2Operations() + .downloadUrl("tmuwlauwzi", "xbmp", "cjefuzmu", new DownloadUrlRequest(), com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ManagementDetailsTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ManagementDetailsTests.java new file mode 100644 index 000000000000..40db14e002c4 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ManagementDetailsTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.ManagementDetails; + +public final class ManagementDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagementDetails model = BinaryData.fromString( + "{\"name\":\"SCOMMI\",\"readinessSummary\":[{\"name\":\"NotSuitable\",\"value\":1600165537},{\"name\":\"Suitable\",\"value\":1630309887},{\"name\":\"NotSuitable\",\"value\":1080384286},{\"name\":\"NotSuitable\",\"value\":1151827085}]}") + .toObject(ManagementDetails.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationDetailsTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationDetailsTests.java new file mode 100644 index 000000000000..0c576b6840bf --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationDetailsTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.MigrationDetails; + +public final class MigrationDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationDetails model = BinaryData.fromString( + "{\"readinessSummary\":[{\"name\":\"Suitable\",\"value\":988905675},{\"name\":\"ConditionallySuitable\",\"value\":841332893},{\"name\":\"ReadinessUnknown\",\"value\":1995543121}],\"migrationType\":\"Replatform\"}") + .toObject(MigrationDetails.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationSuitabilityTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationSuitabilityTests.java new file mode 100644 index 000000000000..c3a990fc9f26 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MigrationSuitabilityTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.MigrationSuitability; + +public final class MigrationSuitabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MigrationSuitability model + = BinaryData.fromString("{\"readiness\":\"Suitable\"}").toObject(MigrationSuitability.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MoreInformationTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MoreInformationTests.java new file mode 100644 index 000000000000..e87b584d1d79 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/MoreInformationTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.MoreInformation; + +public final class MoreInformationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MoreInformation model + = BinaryData.fromString("{\"title\":\"smodmgloug\",\"url\":\"b\"}").toObject(MoreInformation.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCloudSuitabilityCommonTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCloudSuitabilityCommonTests.java new file mode 100644 index 000000000000..4a9da40c4689 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCloudSuitabilityCommonTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.NameValuePairCloudSuitabilityCommon; + +public final class NameValuePairCloudSuitabilityCommonTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NameValuePairCloudSuitabilityCommon model + = BinaryData.fromString("{\"name\":\"NotSuitable\",\"value\":2048055130}") + .toObject(NameValuePairCloudSuitabilityCommon.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCostTypeTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCostTypeTests.java new file mode 100644 index 000000000000..f075f89fbc29 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairCostTypeTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.NameValuePairCostType; + +public final class NameValuePairCostTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NameValuePairCostType model + = BinaryData.fromString("{\"name\":\"MonthlyPremiumStorageCost\",\"value\":8.954052266895395}") + .toObject(NameValuePairCostType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairSavingsTypeTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairSavingsTypeTests.java new file mode 100644 index 000000000000..0ab3c4f87839 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairSavingsTypeTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.NameValuePairSavingsType; + +public final class NameValuePairSavingsTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NameValuePairSavingsType model + = BinaryData.fromString("{\"name\":\"MonthlyAhubSqlCostSavings\",\"value\":80.0666334294689}") + .toObject(NameValuePairSavingsType.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairTests.java new file mode 100644 index 000000000000..3230c7e697d9 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/NameValuePairTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.NameValuePair; + +public final class NameValuePairTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NameValuePair model + = BinaryData.fromString("{\"name\":\"ysh\",\"value\":\"zafb\"}").toObject(NameValuePair.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationDisplayTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..3b74a4b18697 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationInnerTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationInnerTests.java new file mode 100644 index 000000000000..8cca4a21d687 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationListResultTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationListResultTests.java new file mode 100644 index 000000000000..b7df8b3b7cb4 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationsListMockTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..ed1186725530 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.migrate.MigrateManager; +import com.azure.resourcemanager.migrate.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"tgccymvaolpss\",\"isDataAction\":true,\"display\":{\"provider\":\"mdnbbglzpswiy\",\"resource\":\"cwyhzdxssa\",\"operation\":\"zmnvdfznudaod\",\"description\":\"zbn\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MigrateManager manager = MigrateManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/PerformanceDataTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/PerformanceDataTests.java new file mode 100644 index 000000000000..e684ce1aeeb9 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/PerformanceDataTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.Percentile; +import com.azure.resourcemanager.migrate.models.PerformanceData; +import com.azure.resourcemanager.migrate.models.TimeRange; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class PerformanceDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PerformanceData model = BinaryData.fromString( + "{\"percentile\":\"PercentileUnknown\",\"timeRange\":\"Week\",\"perfDataStartTime\":\"2021-01-29T23:00:34Z\",\"perfDataEndTime\":\"2021-04-27T04:38:08Z\"}") + .toObject(PerformanceData.class); + Assertions.assertEquals(Percentile.PERCENTILE_UNKNOWN, model.percentile()); + Assertions.assertEquals(TimeRange.WEEK, model.timeRange()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-29T23:00:34Z"), model.perfDataStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T04:38:08Z"), model.perfDataEndTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PerformanceData model = new PerformanceData().withPercentile(Percentile.PERCENTILE_UNKNOWN) + .withTimeRange(TimeRange.WEEK) + .withPerfDataStartTime(OffsetDateTime.parse("2021-01-29T23:00:34Z")) + .withPerfDataEndTime(OffsetDateTime.parse("2021-04-27T04:38:08Z")); + model = BinaryData.fromObject(model).toObject(PerformanceData.class); + Assertions.assertEquals(Percentile.PERCENTILE_UNKNOWN, model.percentile()); + Assertions.assertEquals(TimeRange.WEEK, model.timeRange()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-29T23:00:34Z"), model.perfDataStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T04:38:08Z"), model.perfDataEndTime()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProcessorInfoTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProcessorInfoTests.java new file mode 100644 index 000000000000..c65a9e29edd7 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProcessorInfoTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.ProcessorInfo; +import org.junit.jupiter.api.Assertions; + +public final class ProcessorInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProcessorInfo model = BinaryData + .fromString( + "{\"name\":\"hcbonqvpkvlr\",\"numberOfSockets\":1098577091,\"numberOfCoresPerSocket\":635672501}") + .toObject(ProcessorInfo.class); + Assertions.assertEquals("hcbonqvpkvlr", model.name()); + Assertions.assertEquals(1098577091, model.numberOfSockets()); + Assertions.assertEquals(635672501, model.numberOfCoresPerSocket()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProductSupportStatusTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProductSupportStatusTests.java new file mode 100644 index 000000000000..0fe81c4a7a5d --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ProductSupportStatusTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.ProductSupportStatus; + +public final class ProductSupportStatusTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProductSupportStatus model = BinaryData.fromString( + "{\"currentVersion\":\"wgndrvynhzgpp\",\"servicePackStatus\":\"cgyncocpecf\",\"esuStatus\":\"mcoo\",\"supportStatus\":\"xlzevgbmqjqabcy\",\"eta\":1896643633,\"currentEsuYear\":\"kwlzuvccfwnfn\",\"mainstreamEndDate\":\"2021-06-18T01:35:08Z\",\"extendedSupportEndDate\":\"2021-02-24T21:18:31Z\",\"extendedSecurityUpdateYear1EndDate\":\"2021-07-19T23:59:40Z\",\"extendedSecurityUpdateYear2EndDate\":\"2021-02-03T17:09:09Z\",\"extendedSecurityUpdateYear3EndDate\":\"2021-02-16T15:30:37Z\"}") + .toObject(ProductSupportStatus.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/RecommendedForTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/RecommendedForTests.java new file mode 100644 index 000000000000..5801e0c0ef9e --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/RecommendedForTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.RecommendedFor; + +public final class RecommendedForTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendedFor model + = BinaryData.fromString("{\"strategies\":[\"CostOptimized\",\"EffortOptimized\",\"EffortOptimized\"]}") + .toObject(RecommendedFor.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SavingsDetailsCommonTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SavingsDetailsCommonTests.java new file mode 100644 index 000000000000..bfd3152ed897 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SavingsDetailsCommonTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.SavingsDetailsCommon; + +public final class SavingsDetailsCommonTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SavingsDetailsCommon model = BinaryData.fromString( + "{\"savingOptions\":\"SavingsPlan1Year\",\"savingsDetail\":[{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":74.25909432049728}]}") + .toObject(SavingsDetailsCommon.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ScopeTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ScopeTests.java new file mode 100644 index 000000000000..32947b6d184a --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/ScopeTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.Scope; +import com.azure.resourcemanager.migrate.models.ScopeType; +import org.junit.jupiter.api.Assertions; + +public final class ScopeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Scope model = BinaryData.fromString( + "{\"scopeType\":\"AzureResourceGraphQuery\",\"serverGroupId\":\"vnipjox\",\"azureResourceGraphQuery\":\"nchgej\"}") + .toObject(Scope.class); + Assertions.assertEquals(ScopeType.AZURE_RESOURCE_GRAPH_QUERY, model.scopeType()); + Assertions.assertEquals("vnipjox", model.serverGroupId()); + Assertions.assertEquals("nchgej", model.azureResourceGraphQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Scope model = new Scope().withScopeType(ScopeType.AZURE_RESOURCE_GRAPH_QUERY) + .withServerGroupId("vnipjox") + .withAzureResourceGraphQuery("nchgej"); + model = BinaryData.fromObject(model).toObject(Scope.class); + Assertions.assertEquals(ScopeType.AZURE_RESOURCE_GRAPH_QUERY, model.scopeType()); + Assertions.assertEquals("vnipjox", model.serverGroupId()); + Assertions.assertEquals("nchgej", model.azureResourceGraphQuery()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SecuritySuitabilityTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SecuritySuitabilityTests.java new file mode 100644 index 000000000000..eb92c6749c38 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SecuritySuitabilityTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.SecuritySuitability; + +public final class SecuritySuitabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SecuritySuitability model + = BinaryData.fromString("{\"readiness\":\"ReadinessUnknown\"}").toObject(SecuritySuitability.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkuDetailsTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkuDetailsTests.java new file mode 100644 index 000000000000..d6123dd3faba --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkuDetailsTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.SkuDetails; + +public final class SkuDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuDetails model = BinaryData.fromString( + "{\"skuType\":\"Unknown\",\"skuName\":\"dwzjeiach\",\"capabilities\":[{\"name\":\"flnrosfqpteehzz\",\"value\":\"pyqr\"},{\"name\":\"z\",\"value\":\"pvswjdkirso\"}],\"totalCost\":[{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{\"name\":\"MonthlyPremiumStorageCost\",\"value\":49.49177285408809},{\"name\":\"PatchingService\",\"value\":65.91078195049245}]},{\"savingOptions\":\"RI1Year\",\"costDetail\":[{\"name\":\"MonthlyStandardSsdStorageCost\",\"value\":1.4454124691317571},{\"name\":\"MonthlyUltraDiskCost\",\"value\":50.39975719979002},{\"name\":\"MonthlySecurityCost\",\"value\":40.629246476095894},{\"name\":\"MonthlyAvsNodeCost\",\"value\":83.16138196857777}]}],\"totalSavings\":[{\"savingOptions\":\"SavingsPlan1Year\",\"savingsDetail\":[{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":73.71081893817491},{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":17.906466616579298}]}]}") + .toObject(SkuDetails.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkusMigrationSuitabilityTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkusMigrationSuitabilityTests.java new file mode 100644 index 000000000000..43d36fe8d0ce --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SkusMigrationSuitabilityTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.SkusMigrationSuitability; + +public final class SkusMigrationSuitabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkusMigrationSuitability model = BinaryData.fromString( + "{\"kind\":\"Endpoint\",\"resourceUri\":\"utduqktapspwgcu\",\"displayName\":\"tumkdosvqwhbm\",\"id\":\"bbjfddgmbmbexp\",\"type\":\"AzureSpringApps\",\"sources\":[{\"name\":\"rolfpfp\",\"migrationSuitability\":{\"readiness\":\"ConditionallySuitable\"}}],\"details\":{\"skuType\":\"Storage\",\"skuName\":\"igjyjg\",\"capabilities\":[{\"name\":\"yfhrtxilnerkujy\",\"value\":\"l\"},{\"name\":\"uvfqawrlyxwj\",\"value\":\"prbnwbxgjvtbv\"},{\"name\":\"sszdnru\",\"value\":\"guhmuouqfpr\"},{\"name\":\"wbnguitnwui\",\"value\":\"a\"}],\"totalCost\":[{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{\"name\":\"MonthlyBandwidthCost\",\"value\":36.9042144067823},{\"name\":\"MonthlyAvsNodeCost\",\"value\":16.047049583758998}]},{\"savingOptions\":\"RI1Year\",\"costDetail\":[{\"name\":\"MonthlyUltraStorageCost\",\"value\":26.788138158909092},{\"name\":\"MonthlyStandardSsdStorageCost\",\"value\":93.00579310542419},{\"name\":\"MonthlyManagementCost\",\"value\":99.89794584243784}]},{\"savingOptions\":\"RI3Year\",\"costDetail\":[{\"name\":\"MonitoringService\",\"value\":85.54340924181797},{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":6.281575357547132},{\"name\":\"PatchingService\",\"value\":33.100777389723376}]}],\"totalSavings\":[{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":98.09041073934307}]}]}}") + .toObject(SkusMigrationSuitability.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceDetailsTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceDetailsTests.java new file mode 100644 index 000000000000..9b631931c3a9 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceDetailsTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.SourceDetails; + +public final class SourceDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SourceDetails model = BinaryData.fromString( + "{\"sourceName\":\"OracleDatabase\",\"sourceType\":\"Machine\",\"platform\":\"PaaS\",\"count\":2070148801}") + .toObject(SourceDetails.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceRecommendationMigrationSuitabilityTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceRecommendationMigrationSuitabilityTests.java new file mode 100644 index 000000000000..32981557dbd3 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SourceRecommendationMigrationSuitabilityTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.SourceRecommendationMigrationSuitability; + +public final class SourceRecommendationMigrationSuitabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SourceRecommendationMigrationSuitability model = BinaryData + .fromString("{\"name\":\"zidnsezcxtbzsgfy\",\"migrationSuitability\":{\"readiness\":\"Unknown\"}}") + .toObject(SourceRecommendationMigrationSuitability.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SummaryPropertiesTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SummaryPropertiesTests.java new file mode 100644 index 000000000000..495dca13c8f2 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/SummaryPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.SummaryProperties; + +public final class SummaryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SummaryProperties model = BinaryData.fromString( + "{\"summaryType\":\"Strategy\",\"summaryName\":\"uzbpzkafku\",\"sources\":[{\"sourceName\":\"OracleDatabase\",\"sourceType\":\"Unknown\",\"platform\":\"SaaS\",\"count\":1688496747},{\"sourceName\":\"MySQLServer\",\"sourceType\":\"WebApplication\",\"platform\":\"Unknown\",\"count\":661393497}],\"targets\":[{\"targetName\":\"Avs\",\"targetType\":\"Server\",\"platform\":\"PaaS\",\"count\":968042540}],\"targetSourceMapping\":[{\"sourceRef\":\"SqlDatabase\",\"targetRef\":\"SqlMI\",\"sourceCount\":1437529213,\"targetCount\":375290729,\"migrationDetails\":{\"readinessSummary\":[{\"name\":\"NotSuitable\",\"value\":543207996},{\"name\":\"ConditionallySuitable\",\"value\":669336905}],\"migrationType\":\"Rehost\"},\"managementDetails\":[{\"name\":\"AzMon\",\"readinessSummary\":[{},{},{}]},{\"name\":\"AzMon\",\"readinessSummary\":[{},{}]},{\"name\":\"AUM\",\"readinessSummary\":[{},{},{},{}]}],\"costDetails\":[{\"savingOptions\":\"RI3Year\",\"costDetail\":[{}]},{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{}]}],\"savingsDetails\":[{\"savingOptions\":\"None\",\"savingsDetail\":[{},{},{}]},{\"savingOptions\":\"SavingsPlan1Year\",\"savingsDetail\":[{},{}]},{\"savingOptions\":\"CustomAzureOfferCode\",\"savingsDetail\":[{},{}]},{\"savingOptions\":\"RI3Year\",\"savingsDetail\":[{},{}]}],\"confidenceScore\":87.85710575340117},{\"sourceRef\":\"Unknown\",\"targetRef\":\"AzureSQLVM\",\"sourceCount\":1990301694,\"targetCount\":2092849341,\"migrationDetails\":{\"readinessSummary\":[{\"name\":\"Unknown\",\"value\":585337534}],\"migrationType\":\"Retain\"},\"managementDetails\":[{\"name\":\"AUM\",\"readinessSummary\":[{},{}]},{\"name\":\"No\",\"readinessSummary\":[{},{},{}]}],\"costDetails\":[{\"savingOptions\":\"CustomAzureOfferCode\",\"costDetail\":[{},{},{}]},{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{},{}]},{\"savingOptions\":\"RI3Year\",\"costDetail\":[{},{},{}]},{\"savingOptions\":\"None\",\"costDetail\":[{},{},{},{}]}],\"savingsDetails\":[{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{}]},{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{},{},{},{}]},{\"savingOptions\":\"None\",\"savingsDetail\":[{},{}]}],\"confidenceScore\":7.923429694200879},{\"sourceRef\":\"Machine\",\"targetRef\":\"SqlDatabase\",\"sourceCount\":2004605521,\"targetCount\":321338352,\"migrationDetails\":{\"readinessSummary\":[{\"name\":\"NotSuitable\",\"value\":360614729}],\"migrationType\":\"Rearchitect\"},\"managementDetails\":[{\"name\":\"No\",\"readinessSummary\":[{},{},{},{}]},{\"name\":\"No\",\"readinessSummary\":[{},{}]},{\"name\":\"AzureBackup\",\"readinessSummary\":[{},{}]},{\"name\":\"AzMon\",\"readinessSummary\":[{},{}]}],\"costDetails\":[{\"savingOptions\":\"SavingsPlan3Year\",\"costDetail\":[{},{},{}]}],\"savingsDetails\":[{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{},{},{}]},{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{},{},{}]}],\"confidenceScore\":15.747079722936764}],\"costComponents\":[{\"savingOptions\":\"RI1Year\",\"costDetail\":[{\"name\":\"MonthlyPremiumV2StorageCost\",\"value\":86.16645809099069}]}],\"savingsComponents\":[{\"savingOptions\":\"RI1Year\",\"savingsDetail\":[{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":33.95123254634036},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":46.350425785763726}]},{\"savingOptions\":\"RI1Year\",\"savingsDetail\":[{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":79.5004423009667}]}]}") + .toObject(SummaryProperties.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetDetailsTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetDetailsTests.java new file mode 100644 index 000000000000..69c6bf48c4eb --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetDetailsTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.TargetDetails; + +public final class TargetDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TargetDetails model = BinaryData.fromString( + "{\"targetName\":\"AzureSpringApps\",\"targetType\":\"Host\",\"platform\":\"IaaS\",\"count\":1484000584}") + .toObject(TargetDetails.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetSourcePairTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetSourcePairTests.java new file mode 100644 index 000000000000..e828a7abaa86 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/TargetSourcePairTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.TargetSourcePair; + +public final class TargetSourcePairTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TargetSourcePair model = BinaryData.fromString( + "{\"sourceRef\":\"SpringbootApplication\",\"targetRef\":\"AzureSQLVM\",\"sourceCount\":1162707208,\"targetCount\":46275154,\"migrationDetails\":{\"readinessSummary\":[{\"name\":\"ConditionallySuitable\",\"value\":1535328040},{\"name\":\"Unknown\",\"value\":1626950587},{\"name\":\"ConditionallySuitable\",\"value\":1482197190}],\"migrationType\":\"Retain\"},\"managementDetails\":[{\"name\":\"No\",\"readinessSummary\":[{\"name\":\"NotSuitable\",\"value\":1043132128}]},{\"name\":\"AzMon\",\"readinessSummary\":[{\"name\":\"NotSuitable\",\"value\":1623747079},{\"name\":\"ConditionallySuitable\",\"value\":2103137599},{\"name\":\"ReadinessUnknown\",\"value\":1432172672}]}],\"costDetails\":[{\"savingOptions\":\"SavingsPlan1Year\",\"costDetail\":[{\"name\":\"MonthlyBandwidthCost\",\"value\":79.3075675694348},{\"name\":\"MonthlyLinuxAzureHybridCost\",\"value\":36.26251943965845},{\"name\":\"MonthlyAvsExternalStorageCost\",\"value\":24.089688483967507},{\"name\":\"TotalMonthlyCost\",\"value\":58.15262064791411}]}],\"savingsDetails\":[{\"savingOptions\":\"SavingsPlan3Year\",\"savingsDetail\":[{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":59.12175027396561},{\"name\":\"MonthlyAzureHybridCostSavings\",\"value\":47.771215176411566},{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":29.432491839309428},{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":51.482814511904685}]},{\"savingOptions\":\"RI3Year\",\"savingsDetail\":[{\"name\":\"MonthlyAhubSqlCostSavings\",\"value\":45.06398122641379},{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":68.02094074522861},{\"name\":\"MonthlyAhubSqlCostSavings\",\"value\":93.86468476983777}]},{\"savingOptions\":\"None\",\"savingsDetail\":[{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":73.58859792650183},{\"name\":\"MonthlyVcfByolCostDifference\",\"value\":40.32626282788239},{\"name\":\"MonthlyLinuxAzureHybridCostSavings\",\"value\":59.27446000177991}]}],\"confidenceScore\":51.7609236137217}") + .toObject(TargetSourcePair.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmSecuritySuitabilityTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmSecuritySuitabilityTests.java new file mode 100644 index 000000000000..a5bed49c9b56 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmSecuritySuitabilityTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.VmSecuritySuitability; + +public final class VmSecuritySuitabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmSecuritySuitability model = BinaryData.fromString( + "{\"vmSecurityType\":\"Standard\",\"securitySuitability\":\"SuitableWithWarnings\",\"securitySuitabilityDetails\":[\"DiskSizeLarge\",\"AnyDiskSizeExceeds4TBConditional\",\"AnyDiskSizeExceeds4TBConditional\"]}") + .toObject(VmSecuritySuitability.class); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmUptimeTests.java b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmUptimeTests.java new file mode 100644 index 000000000000..1403cb0343b4 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/src/test/java/com/azure/resourcemanager/migrate/generated/VmUptimeTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.migrate.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.migrate.models.VmUptime; +import org.junit.jupiter.api.Assertions; + +public final class VmUptimeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VmUptime model + = BinaryData.fromString("{\"daysPerMonth\":902734826,\"hoursPerDay\":153428823}").toObject(VmUptime.class); + Assertions.assertEquals(902734826, model.daysPerMonth()); + Assertions.assertEquals(153428823, model.hoursPerDay()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VmUptime model = new VmUptime().withDaysPerMonth(902734826).withHoursPerDay(153428823); + model = BinaryData.fromObject(model).toObject(VmUptime.class); + Assertions.assertEquals(902734826, model.daysPerMonth()); + Assertions.assertEquals(153428823, model.hoursPerDay()); + } +} diff --git a/sdk/migrate/azure-resourcemanager-migrate/tsp-location.yaml b/sdk/migrate/azure-resourcemanager-migrate/tsp-location.yaml new file mode 100644 index 000000000000..c400663f2528 --- /dev/null +++ b/sdk/migrate/azure-resourcemanager-migrate/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/migrate/AssessmentProjects.Management/MachineAssessments.Management +commit: 1122b7b3d029d302775df331025e6b46c1dc6106 +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/migrate/AssessmentProjects.Management/Common diff --git a/sdk/migrate/ci.yml b/sdk/migrate/ci.yml new file mode 100644 index 000000000000..f486884722e2 --- /dev/null +++ b/sdk/migrate/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/migrate/ci.yml + - sdk/migrate/azure-resourcemanager-migrate/ + exclude: + - sdk/migrate/pom.xml + - sdk/migrate/azure-resourcemanager-migrate/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrate/ci.yml + - sdk/migrate/azure-resourcemanager-migrate/ + exclude: + - sdk/migrate/pom.xml + - sdk/migrate/azure-resourcemanager-migrate/pom.xml + +parameters: + - name: release_azureresourcemanagermigrate + displayName: azure-resourcemanager-migrate + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: migrate + Artifacts: + - name: azure-resourcemanager-migrate + groupId: com.azure.resourcemanager + safeName: azureresourcemanagermigrate + releaseInBatch: ${{ parameters.release_azureresourcemanagermigrate }} diff --git a/sdk/migrate/pom.xml b/sdk/migrate/pom.xml new file mode 100644 index 000000000000..2fb619f945f4 --- /dev/null +++ b/sdk/migrate/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-migrate-service + pom + 1.0.0 + + + azure-resourcemanager-migrate + +